tkzs
Installation
pip install tkzs
Use a simple tokenizer
from tkzs.tokenizers import re_tokenizer
txt = "Contrastive Fine-tuning Improves Robustness for Neural Rankers"
re_tokenizer(txt)
Use a spacy word tokenizer
from tkzs.tokenizers import SpacyTokenizer
txt = "Contrastive Fine-tuning Improves Robustness for Neural Rankers"
tokenizer = SpacyTokenizer(name='en_core_web_sm')
tokenizer.tokenize(txt)
Use a word encoder
from tkzs.encoders import WordEncoder
from tkzs.tokenizers import re_tokenizer
docs = [
"Contrastive Fine-tuning Improves Robustness for Neural Rankers",
"Unsupervised Neural Machine Translation for Low-Resource Domains via Meta-Learning",
"Spatial Dependency Parsing for Semi-Structured Document Information Extraction"
]
encoder = WordEncoder(tokenizer=re_tokenizer)
encoder.fit(docs)
encoder.batch_tokenize(docs) # return a list of tokenized sequence
encoder.encode_batch(docs) # return a tensor of size [batch_size, max_length]
Use a byte encoder
from tkzs.encoders import ByteEncoder
from tkzs.tokenizers import re_tokenizer
docs = [
"Contrastive Fine-tuning Improves Robustness for Neural Rankers",
"Unsupervised Neural Machine Translation for Low-Resource Domains via Meta-Learning",
"Spatial Dependency Parsing for Semi-Structured Document Information Extraction"
]
encoder = ByteEncoder()
# return a tensor of shape [Batch, Word, Char]
encoder.encode_batch(docs, char_padding='center', word_length=None, tokenizer=re_tokenizer)
Metadata
Release files for tkzs 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tkzs-0.0.7.tar.gz | 3.8 kB | Without provenance | Details for tkzs-0.0.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tkzs-0.0.7-py3-none-any.whl | Python 3 | none | any | Details for tkzs-0.0.7-py3-none-any.whl |
Total release size: 8.3 kB
Release files / tkzs-0.0.7.tar.gz
| Download URL | tkzs-0.0.7.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
adc675ce823291dd51798b614a635c3abb74b5d1874d1b3762a4ef4066a9351a
|
|
BLAKE2b-256 checksum How to use checksums |
82095b21c022753826f3ad606879957c828487a5bc7ba43824396144614d6979
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/3.10.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
|
Release files / tkzs-0.0.7-py3-none-any.whl
| Download URL | tkzs-0.0.7-py3-none-any.whl |
|---|---|
| Size | 4.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52c9ec2c35dc4102a08789d4682499e9deddf6180707454bcec37523955990b3
|
|
BLAKE2b-256 checksum How to use checksums |
02dd48fb191e9ec83d1f1a8f3e758b6d7c2e385f8f47b5a8d00442bb14b9eba1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/3.10.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9
|
Security for tkzs 0.0.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.