Log In  

Cart #34327 | 2016-12-28 | Code ▽ | Embed ▽ | No License
2

press z to generate text using a markov chain

this is almost done. almost. I'll keep working on this until it works. or until someone else makes it work.

usage:
place the markov function in your code

markov(input text,n-gram length,[output length]
input text - string, required
  this is the string you want to use to teach the neural network with. it's used to populate a table of n-grams, then later to build the output string

n-gram length - integer, required
  the length of each n-gram. an n-gram is a string of characters with a length of n. these are pulled out of the input text by stepping through it character by character

output length - integer, default 32
  how long the outputted string should be

known issues:

  • lookit that wacky output
  • it sometimes hangs if the input text is too short (this shouldn't be a problem with a good paragraph. a standard lorem ipsum or navy seal pasta works fine)
  • it's probably poorly optimized and messy

based on this

with help from Sean, justinj, and TheTomster in discord

P#34329 2016-12-27 20:35 ( Edited 2016-12-28 01:35)


[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 11:06:28 | 0.008s | Q:10