pteichman / cobe

A Markov chain based text generation library and MegaHAL style chatbot
http://teichman.org/blog/
MIT License
239 stars 51 forks source link

brain to json\sql #35

Open assada opened 7 years ago

assada commented 7 years ago

Is it possible to convert the brain into a file to get the original data? I need to transfer all the data from the brain to the database. The order of the data is absolutely not important.

pteichman commented 7 years ago

Unfortunately not–by the time it hits the brain file, each input has been chopped up into trigrams and any additional context has been lost. It would be possible to write a tool to extract the trigrams themselves, but I'm not sure they would be useful on their own.

My recommendation is to retain a log (text file; one input per line) of everything that has been trained, but obviously that doesn't work in hindsight.

The approach I've taken in fate, cobe's successor, is to store no database at all: it trains from scratch on start and keeps everything in memory. That text file becomes the database, in effect. Partly that decision was driven by how inflexible the sqlite-based cobe ended up being.