I am working on making a chatbot with the chatterbot library in python and it was sometimes not responding correctly, I turned on logging and found that it was because it was excluding responses that it recently used and then defaulted to the "unknown" response I have set. You can see an excerpt from the logs below: User: hi
INFO:chatterbot.chatterbot:Beginning search for close text match INFO:chatterbot.chatterbot:Processing search results INFO:chatterbot.chatterbot:Similar text found: Hi 1.0 INFO:chatterbot.chatterbot:Using "Hi" as a close match to "hi" with a confidence of 1.0 INFO:chatterbot.chatterbot:0. Excluding recent repeated response of "hi" INFO:chatterbot.chatterbot:1. Excluding recent repeated response of "Hi there, I am Minerva, how can I help you?" INFO:chatterbot.chatterbot:No responses found. Generating alternate response list.
I found out about the recent response filter in the documentation here but there is no explanation of how to turn it off or disable it, it is on by default as I have no filters specified in my chatbot code.
I was wondering if anyone knew how to remove the filter? I don't care if my chatbot repeats itself over and over.
It doesn't seem like there's any configuration to turn off this feature, because it's hardcoded in the BestMatch logic adapter:
And the
filters.get_recent_repeated_responsesfunction doesn't provide a way to turn it off either:I can think of two ways to get around it:
Create a copy of the logic adapter BestMatch without the offending lines and specifying it during setup:
Or, for a very hacky solution, you can monkey-patch the filters package: