A tool set for NLP.
Project description
Usage Sample ''''''''''''
.. code:: python
from nlpx.text_token import Tokenizer
if __name__ == '__main__':
corpus = ...
tokenizer = Tokenizer(corpus)
sent = 'I love you'
tokens = tokenizer.encode(sent, max_length=6, pad_begin_end=True)
# [101, 66, 88, 99, 102, 0]
sent = tokenizer.decode(sent)
# ['<bos>', 'I', 'love', 'you', '<eos>', '<pad>']
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
nlpx-1.3.5.tar.gz
(16.7 kB
view details)
File details
Details for the file nlpx-1.3.5.tar.gz
.
File metadata
- Download URL: nlpx-1.3.5.tar.gz
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34fe0b49dd053c2c0a0f8873700e119c5322c78bf8108135109a6e631395a8b0 |
|
MD5 | 0a8b81747210b37142af4bfda295baeb |
|
BLAKE2b-256 | db8d6691d2391ab60328a463853a7e73b085a84b74b1efd8a1fca82b1205efa4 |