Skip to main content

Python implementation of a Hidden Markov Machine that generates text.

Project description

Hidden Markov Machine (HMM)

This module provides the function write(prompt, length, bias, training) which adds length words to the end of the prompt. If the bias is set to 0 (the minimum), there will be no bias, and the closer it gets to 1 (the maximum) nouns in the prompt are more likely to be chosen. If a bias is not provided, the default is 0. The training variable is optional, it defaults to a file of writing I've done in the past, but can be set to a different file. If you choose to change the training, change it to a txt file hosted online, e.g. "https://raw.githubusercontent.com/TobyCK/markov-chain/master/Training/dataset2.txt". Below is an example of how to use the module:

from hmm_write import hmm
hmm.write("The quick brown fox jumps over the", 50, 0.3)

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

hmm_write-0.3.4.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hmm_write-0.3.4-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file hmm_write-0.3.4.tar.gz.

File metadata

  • Download URL: hmm_write-0.3.4.tar.gz
  • Upload date:
  • Size: 3.0 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.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for hmm_write-0.3.4.tar.gz
Algorithm Hash digest
SHA256 1814d95e6483c87e7c9aa1204451d4b3838908f6692e731f13cddf11043e8fb7
MD5 eb279a6a281e5f390f4a0ecd34e97607
BLAKE2b-256 20cd85fd3d7dbd80da1dbfc7b3d114b2ee48f68b58fc9f3761939bd335b5df54

See more details on using hashes here.

File details

Details for the file hmm_write-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: hmm_write-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • 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.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for hmm_write-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 49ad3afb8b1815458567b93ee71bcc921a76aba58883c4338bcd6ddbccb2a229
MD5 c2eae9ff75b16582a96d60def62f40bd
BLAKE2b-256 6af8d519e61124989dd0da347e8d5831a497d4f427c6830ad58c928c30bf0599

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