Skip to content

Markov chain text generator using Python front-end and Rust

Notifications You must be signed in to change notification settings

ilya-ssh/Markov-GUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Text generation using Markov chains. Small project mainly focused on how to implement Rust code in Python. Front-end is build with Python using NiceGUI library, text generation is Rust as Rust proves to be fastest and easiest to implement languages in Python. If you want to see non-GUI versions of markov text generation in Rust, Go and Python, please refer to https://github.com/ilya-ssh/NLP-in-Python-GO-and-Rust/tree/main/markov

Rust compiler required, as well as nicegui and rustimport libs in Python 3.x

markov

Markov text generation is a method to create new text based on an input text/corprus. It uses a concept called Markov chains, which predict the next word in a sequence based on the previous words. The algorithm looks at pairs or groups of words and learns how often certain words follow others. For example, in the phrase "the cat in the hat," it learns that "cat" often follows "the," and "in" follows "cat." Text Generation: The algorithm picks a starting word and then uses the learned probabilities to choose each next word until the desired length of text is reached. The text generated by Markov chains can be quite believable, especially if the input text is large and varied, the chain considers more words at a time (higher order) and the text is quite short. However, for longer texts or complex language, Markov chains may create repetitive or nonsensical output because they don't understand the overall meaning.

About

Markov chain text generator using Python front-end and Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published