Skip to content

A markov chain implemntation for text generation made in python 3

Notifications You must be signed in to change notification settings

VargasDevelopment/Pykov

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Pykov

A markov chain implementation for text generation made in python 3

Use

Enter your source text in the "text" variable. If you wish, you can easily read in text through a file instead.

You will get more "coherent" text generation the higher you make the number associated with the "order" variable. I find that 5 is a good balance for medium sized texts. For larger texts (like books for example), you may have better results with order 10 n-grams.

As well you can edit the constant integer in line 7 to get more or less length in your generated text. That number is the amount of characters the markov() function will output.

Happy chaining!

About

A markov chain implemntation for text generation made in python 3

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages