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.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4da3c637d5e2c9f78b0fef123808e485159cc9179370bd12fdc8db164eb6fc7b |
|
MD5 | 0c546ba0fa3717e9d57f7476787dd11c |
|
BLAKE2b-256 | b086367d91dbd1136b104b2175fd9f901f9f91eb747520b59caa509628170ff4 |
Close
Hashes for fast_sentence_tokenize-0.1.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9aeafb480d8f25aa75576dedc7833971c96ede657b0df3e185d23374725385e9 |
|
MD5 | 9a4f9af123f014ef53ec760b6801a10e |
|
BLAKE2b-256 | 19877d1ed29147e6e8a3c2b3bcc51c5bfd5a5d879f8cf1339e06806850d5f871 |