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.8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a12e31a9b812699ae955330e2b21c69cf31c08de272f2faefad2e2f4d8588d5b |
|
MD5 | 1393567d42078b6e1bab3d3b1cbc7eb0 |
|
BLAKE2b-256 | 66d45b02d4869d0a666a9287c1886fb0798e63df13741960c74dd275dbca42a9 |
Close
Hashes for fast_sentence_tokenize-0.1.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 760df583c6edfdcbde20040ac6e9ddf26eac6f593a10336db1386c46fd132a65 |
|
MD5 | 91e4a18ece1e5e69ea7ab1f01775d082 |
|
BLAKE2b-256 | 906676292484ea8dbfe2b20e5049d590b43df6e7256d687eb891d412220b4c79 |