Skip to content

A script that will generate a word to follow any input word, based on a Markov transition matrix computed from a corpus text.

Notifications You must be signed in to change notification settings

lopeetall/markov-next-word

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

markov-next-word

A script that will generate a word to follow any input word, based on a Markov transition matrix computed from a corpus text.

For example, if using Lincoln's Gettysburg Address as a corpus, entering the word "four" will cause the script to output "score". Entering the word "and" will cause the script to output either "seven", "that", dedicated", "proper", "so", or "dead" with equal probability.

I used this script as a tool for college-level math students to explore a simple Markov Chain on their devices.

About

A script that will generate a word to follow any input word, based on a Markov transition matrix computed from a corpus text.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published