TakeSentenceTokenizer
TakeSentenceTokenizer is a tool for pre processing and tokenizing sentences. The package is used to: - convert the first word of the sentence to lowercase - convert from uppercase to lowercase - convert word to lowercase after punctuation - replace words for placeholders: laugh, date, time, ddd, measures (10kg, 20m, 5gb, etc), code, phone number, cnpj, cpf, email, money, url, number (ordinal and cardinal) - replace abbreviations - replace common typos - split punctuations - remove emoji - remove characters that are not letters or punctuation - add missing accentuation - tokenize the sentence
Installation
Use the package manager pip to install TakeSentenceTokenizer
pip install TakeSentenceTokenizer
Usage
Example 1: full processing not keeping registry of removed punctuation
Code:
from SentenceTokenizer import SentenceTokenizer
sentence = 'P/ saber disso eh c/ vc ou consigo ver pelo site www.dúvidas.com.br/minha-dúvida ??'
tokenizer = SentenceTokenizer()
processed_sentence = tokenizer.process_message(sentence)
print(processed_sentence)
Output:
'para saber disso é com você ou consigo ver pelo site URL ? ?'
Example 2: full processing keeping registry of removed punctuation
from SentenceTokenizer import SentenceTokenizer
sentence = 'como assim $@???'
tokenizer = SentenceTokenizer(keep_registry_punctuation = True)
processed_sentence = tokenizer.process_message(sentence)
print(processed_sentence)
print(tokenizer.removal_registry_lst)
Output:
como assim ? ? ?
[['como assim $@ ? ? ?', {'punctuation': '$', 'position': 11}, {'punctuation': '@', 'position': 12}, {'punctuation': ' ', 'position': 13}]]
Author
Take Data&Analytics Research
License
Metadata
Release files for TakeSentenceTokenizer 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| TakeSentenceTokenizer-1.0.2.tar.gz | 7.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| TakeSentenceTokenizer-1.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 415.7 kB
Release files / TakeSentenceTokenizer-1.0.2.tar.gz
| Download URL | TakeSentenceTokenizer-1.0.2.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fd6be085c4ce022fa5ab9620f85a85ac3c10ba7b14a3302f44a08e7c0dbf947
|
|
BLAKE2b-256 checksum How to use checksums |
c04aca551bbff747a4c414382a1a390eb4b429dbc9ad587009e2b25fdaa7da95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13
|
Release files / TakeSentenceTokenizer-1.0.2-py3-none-any.whl
| Download URL | TakeSentenceTokenizer-1.0.2-py3-none-any.whl |
|---|---|
| Size | 408.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f9f533ef3a880c1ac01859f19bf0de44105e96a4615a8f8d67f5fb4a50465532
|
|
BLAKE2b-256 checksum How to use checksums |
ec0294d828621011be09aee4736151dd1e6a1f5e819ffe5a045de1618f481027
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.13
|
Security for TakeSentenceTokenizer 1.0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.