Skip to main content

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


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

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page