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.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bef1c6afab40b98987c10a1a6ccdf9c2467ca745400699b7727f3a65e3266be |
|
MD5 | e44c8b8a69b103b4e0720abab1c4c61b |
|
BLAKE2b-256 | ac72b15c1343dadb560f1c0f124f73a9b18609e723b37c14aaea220e2dcdc7be |
Close
Hashes for fast_sentence_tokenize-0.1.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44bf4dd9413fdad7bfda9b40126173e8ec426ff96cd5e822012968a78fdcf12b |
|
MD5 | 650080bf40de0da8c63fc1f656572062 |
|
BLAKE2b-256 | cb1b03c04e4703791f47e2463c48357cb8e625602cd6fdb428edf09a53c3317a |