textpipe: clean and extract metadata from text
Project description
textpipe: clean and extract metadata from text
textpipe
is a Python package for converting raw text in to clean, readable text and
extracting metadata from that text. Its functionalities include transforming
raw text into readable text by removing HTML tags and extracting
metadata such as the number of words and named entities from the text.
Vision: the zen of textpipe
- Designed for use in production pipelines without adult supervision.
- Rechargeable batteries included: provide sane defaults and clear examples to adapt.
- A uniform interface with thin wrappers around state-of-the-art NLP packages.
- As language-agnostic as possible.
- Bring your own models.
Features
- Clean raw text by removing
HTML
and other unreadable constructs - Identify the language of text
- Extract the number of words, number of sentences, named entities from a text
- Calculate the complexity of a text
- Obtain text metadata by specifying a pipeline containing all desired elements
Usage example
>>> from textpipe import doc, pipeline
>>> sample_text = 'Sample text! <!DOCTYPE>'
>>> document = doc.Doc(sample_text)
>>> print(document.clean)
'Sample text!'
>>> print(document.language)
'en'
>>> print(document.nwords)
2
>>> pipe = pipeline.Pipeline(['CleanText', 'NWords'])
>>> print(pipe(sample_text))
{'CleanText': 'Sample text!', 'NWords': 2}
Contributing
See CONTRIBUTING for guidelines for contributors.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
textpipe-0.3.1.tar.gz
(5.7 kB
view details)
File details
Details for the file textpipe-0.3.1.tar.gz
.
File metadata
- Download URL: textpipe-0.3.1.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.6.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91e8c309f35a9befdbda1a1e5100e183ff468186bd0129d338812bfe21b0ba52 |
|
MD5 | 08146a58dab71fab5ec9ff759f17ce48 |
|
BLAKE2b-256 | 45030a2f5e2a46b457947c603a64dd081ad67013caa9191a6b99028718ead94e |