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.14.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8285a9c7c31d2ec2025578c06f50129e97bd8c11d8792a73927a2fb2b58e003 |
|
MD5 | c3fe017bbfdb885a13a997d00c2fcf8f |
|
BLAKE2b-256 | 497fcdb130b257a384ba1dd5a9917100b9fe7377f174ea309a50f44609366d09 |
Close
Hashes for fast_sentence_tokenize-0.1.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e3c63b42af2d8bda0a593951e56e8df2ba410c7917092a2a5a6cca6a4fd918a |
|
MD5 | 467ad23adffddfc6e5faf579d5c3cd31 |
|
BLAKE2b-256 | 53667c831ffca6048be9141847e75ab4bd5354e3cb4abd55112a3c4277d60210 |