how to use low confidence adapter in django chatbot ,the given example in documentation show the use in terminal chatbot, i try the code in django setting but it doesnt work ,please help...
'logic_adapters': [
'chatterbot.logic.LowConfidenceAdapter'
],
and how i can specify threshold and make default response
I think this example will help you
CHATTERBOT = {
'name': 'Chatter Bot',
'logic_adapters': [
{
'import_path': 'chatterbot.logic.BestMatch',
'statement_comparison_function': 'chatterbot.comparisons.jaccard_similarity',
'response_selection_method': 'chatterbot.response_selection.get_first_response'
},
{
'import_path': 'chatterbot.logic.LowConfidenceAdapter',
'threshold': 0.65,
'default_response': 'I am sorry, but I do not understand.'
}
],
'filters': [
'chatterbot.filters.RepetitiveResponseFilter'
],
'storage_adapter': 'chatterbot.storage.DjangoStorageAdapter',
'django_app_name': 'django_chatterbot',
'use_django_models': True
}
@vkosuri the above code does not work properly. if I include the logic adapters it gives random errors even for trained questions in chat corpus.
what type error you were facing?
@vkosuri
I am geting the query as the response. is there any other way to set default response in django chatterbot
@vkosuri It is giving random response from the corpus for unknown queries. How to fix that?Help
Try to use low confidence adapter http://chatterbot.readthedocs.io/en/stable/logic/index.html#low-confidence-response-adapter
And also enable logging that will show how response working etc.
@vkosuri im getting
{"conversation": [], "detail": "You should make a POST request to this endpoint.", "name": "ChatterBot"},
my logic details :
CHATTERBOT = {
'logic_adapters' : [
{
'import_path': "chatterbot.logic.BestMatch"
},
{
'import_path': 'chatterbot.logic.LowConfidenceAdapter',
'threshold': 0.5,
'default_response': 'You can ask other question'
}
How to fix this ???
@gunthercox latest chatterbot version seems to have some issue with lowconfidence adapter,
im getting below error while implementing in django
{"conversation": [], "detail": "You should make a POST request to this endpoint.", "name": "ChatterBot"},
my logic details :
CHATTERBOT = {
'logic_adapters' : [
{
'import_path': "chatterbot.logic.BestMatch"
},
{
'import_path': 'chatterbot.logic.LowConfidenceAdapter',
'threshold': 0.5,
'default_response': 'You can ask other question'
}
]
}
I think this expected result, if no response confidence is greater than 0.5 then you will get above error message.
Can you try check the confidence values for each response?
yes the confidence is less than .5, but im expecting a default response 'default_response': 'You can ask other question' not an error message
I have created a separate issue https://github.com/gunthercox/ChatterBot/issues/1257
Thanks
@vkosuri even this is not working im not getting the default response...and im not getting any response for unknown queries...
@vkosuri
how to enable logging??
@vkosuri in which file django app we have to include that logging code?
@vkosuri sir i couldnt use any logic adapters in my django applications . even time and mathematical adapters wont work. Is just adding the import_path in the django settinngs is enough or we have to do anything?
If you haven't configured then the default adapter will be used your bot
Here a typical settings example http://chatterbot.readthedocs.io/en/stable/django/settings.html#chatterbot-django-settings
Chatterbot uses Django storage adapter http://chatterbot.readthedocs.io/en/stable/django/index.html#mongodb-and-django
I am not sure what you are trying to logging on to console, this information might help you https://stackoverflow.com/a/1598979
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
I think this example will help you