eli64s / python_markov_sentence_generator

A script that creates a sentence for a given vocabulary word using a Markov chain model.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Markov Model Sentence Generator

This notebook generates random sentences using a Markov chain stochastic model. This model takes one user-defined vocabulary word input and then generates its synonyms using the Natural Language Toolkit module. The training data for this model is a collection of example sentences (sentences are composed of the synonyms or user-defined word) obtained from a vocabulary API.

This notebook can be divided into four sections:

  • One user-defined vocabulary word input, used to generate synonyms via the Natural Language Toolkit module
  • The training data is created, collecting sentences composed of the input word's synonyms from a vocabulary API
  • The training data is fed to the Markov chain model function
  • Random sentences are generated

I hope to improve this model over time by refining the data inputs for the model, and eventually look to include this script as a module in my Vocabulary Flashcard Web-Application. Feel free to ask questions and suggest areas of improvement!

About

A script that creates a sentence for a given vocabulary word using a Markov chain model.


Languages

Language:Jupyter Notebook 100.0%