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 details)

Uploaded Source

File details

Details for the file nmodels-0.0.5.tar.gz.

File metadata

  • Download URL: nmodels-0.0.5.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.1

File hashes

Hashes for nmodels-0.0.5.tar.gz
Algorithm Hash digest
SHA256 c0d500eb7c5fa8a3cbc006475f912d95b39068f96fb9d931ca5646b90216f86b
MD5 a46d009d635bfacc16eb32c54660618a
BLAKE2b-256 6e338e1901749ad1c40b11bf48e1e63b5b08209ad38f775059616c85483cd527

See more details on using hashes here.

Supported by

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