markovify icon indicating copy to clipboard operation
markovify copied to clipboard

Fallback without building a new model?

Open yorkshirelandscape opened this issue 2 years ago • 1 comments

I'm trying to build a Slack chatbot using bits and pieces of code I've found lying around on the internet. One of them included markovify and it's just about the only thing from it that worked! I was wondering, though, if there's a way to fall back to a smaller state_size without building an entire fallback model. What I've done in the interim is create 2- and 1-word models. If the 2-word init_state key isn't in the model, it tries the 1-word model with the first word of the key. Failing that, it just lets it come up with something without the init_state argument. I'm sure that as my corpus gets larger, this is going to become unwieldy. I hope this is possible without making any changes to the codebase, but hope you'll consider it, either way.

Thanks for writing this!

yorkshirelandscape avatar Nov 16 '21 02:11 yorkshirelandscape