spion / triplie-ng

Chatbot with Markov chains BFS and Hebbian learning
MIT License
57 stars 16 forks source link

Markov "afterRight" does not properly detect the ENDING #31

Open Kermalis opened 3 years ago

Kermalis commented 3 years ago

You have a typo here: https://github.com/spion/triplie-ng/blob/master/lib/pipeline/markov.js#L64

else if (path[path.length] != ENDING) {

It should be path.length - 1. So the ENDING is never detected. I'm not sure what exactly changes once it's fixed

spion commented 3 years ago

IIRC ENDING is a constant that denotes a natural chat message ending i.e. end-of-message. Fixing this will likely result with a lot more shorter candidate sentences being generated

Kermalis commented 3 years ago

I haven't noticed that kind of result when I fixed it. For example, with minWords of 3 and minKeys of 1, they are on average generating sentences with 5-7 words. But my databases are about 190MB each. In fact I might be crazy enough to say the replies are 1-2 words longer on average. I'm not sure, there are lots of variables going on. Thanks for the replies by the way :)