ahmadfaizalbh / Chatbot

Python ChatBot 💬
https://chatbot.obbne.com
MIT License
774 stars 320 forks source link

Get confidence score for selected answer #36

Closed padmalcom closed 3 years ago

padmalcom commented 3 years ago

Hi, I'm running chatbotai in combination with snips-nlu whereas chatbotai is the first choice and whenever an answer cannot be parsed, snips-nlu should be used and try to parse the user input. The problem is that I do not know when no pattern from chatbot ai matches. Is there a way to get such a score/boolean? Otherwise, I'd like to open a feature request.

ahmadfaizalbh commented 3 years ago

Please add feature request I will add that feature. Mean while as temporary fix you can add below code to end of your template file and handle in python which would pass entire message to default_snips_nlu_handler function

{% block %}
    {% client %}.*{% endclient %}
    {% response %}{% call default_snips_nlu_handler: %0 %}{% endresponse %}
{% endblock %}
padmalcom commented 3 years ago

Thanks for the quick reply. How would that relate to the default template? Would this block been choosen first? Or the blocks from the default template?

ahmadfaizalbh commented 3 years ago

this block would get chosen before block from default template and hence default template would be skipped/ignored

padmalcom commented 3 years ago

Alright, I'll do some tests to see how the chatbot behaves when configured like that.