Skip to main content

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>')]

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.

Release history Release notifications | RSS feed

2.0.2

1 file

1.0

2 files

This release

0.0.5 This release

1 file

0.0.4

1 file

0.0.3

2 files

0.0.2

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page