Skip to main content

This is a simple nlp project providing a ngram model package.

Project description

Ngram Model

This is a basic python module that creates and then pads bigrams from a given sentence.

Python Requirements

Any Python version 3.6 and above is supported.

Install

Install this pip package by typing the following into the command prompt:

pip install nmodels

Nmodels

To import the module function, proceed as follows:

>>> import ngrams
>>> from nmodels.gram import simple_bigram
>>> string = "Hello world, how are you" 
>>> [('<START>', 'Hello'), ('Hello', 'world,'), ('world,', 'how'),
 ('how', 'are'), ('are', 'you'), ('you', '<END>')]

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

nmodels-0.0.5.tar.gz (2.5 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