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.2.0.tar.gz
(15.2 kB
view hashes)