marukov
a very simple markov-chain related library, mostly used for text generations but can be applied to anything else.
features
Chaincan be re-used in other applications, refer to [here].Textgenerations are done with GPT-like tokenizer, which speds things up significantly.- Made with text generation in mind, and so, it's really good at doing that.
usage
use ;
// load your data from somewhere
// each new line in your data is a new entry.
let lyrics = read_to_string.unwrap;
// create the text model
let text = new;
// start generating stuff
for _ in 0..5
// or if you want to generate starting from a word
for _ in 0..5
outputs example
uma musume fans when your take a visit to uniqlo
ability so specific it sounds so stupid
asriel dreemurr from touhou 93
banished back to middle east
chemistry is applied philosophy
razorback and danger shield is just really bad
completely new sentence btw, you just have to give it a lot of data.
credits
this package is loosely based off the @jsvine/markovify library.