Fast and Efficient Sentence Tokenization
Project description
Fast Sentence Tokenizer (fast-sentence-tokenize)
Best in class tokenizer
Usage
Import
from fast_sentence_tokenize import fast_sentence_tokenize
Call Tokenizer
results = fast_sentence_tokenize("isn't a test great!!?")
Results
[
"isn't",
"a",
"test",
"great",
"!",
"!",
"?"
]
Note that whitespace is not preserved in the output by default.
This generally results in a more accurate parse from downstream components, but may make the reassembly of the original sentence more challenging.
Preserve Whitespace
results = fast_sentence_tokenize("isn't a test great!!?", eliminate_whitespace=False)
Results
[
"isn't ",
"a ",
"test ",
"great",
"!",
"!",
"?"
]
This option preserves whitespace.
This is useful if you want to re-assemble the tokens using the pre-existing spacing
assert ''.join(tokens) == input_text
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
Built Distribution
Close
Hashes for fast-sentence-tokenize-0.1.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | af52c17eae35b0f8a8fc86411eec325bd78362d125681ba0548944eb9cc3cf8e |
|
MD5 | d1955bf2ccefb0567a30c75fb41965fd |
|
BLAKE2b-256 | d256a8d8215c8063fb111182628740412b289e39b701a78c501992d7fae802e5 |
Close
Hashes for fast_sentence_tokenize-0.1.10-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3919fe9de876528a3c5d3292f3bf7f82b59a39f2b64e03057a28f333f41c8241 |
|
MD5 | 27157e1dfbfb154e115c1ad44d33db94 |
|
BLAKE2b-256 | 1571e7315511b4f0db05b2aa161a7809407aac518df3fce4cc6a6eca50b36e57 |