My code for logic adapter in django gives me the above mentioned error. Please help.
code:
'logic_adapters' : [
{
"import_path": 'chatterbot.logic.BestMatch',
},
{
"import_path": 'chatterbot.logic.LowConfidenceAdapter',
"threshold": 0.90,
"default_response": 'OhNo'
}
],
Try:
logic_adapters=[
{
"import_path": 'chatterbot.logic.BestMatch',
},
{
"import_path": 'chatterbot.logic.LowConfidenceAdapter',
"threshold": 0.90,
"default_response": 'OhNo'
}
],
hi thanks one more issue i am facing in django is that i am getting the previous sentence in the list as a response when i was running in flask it was alright. Please help me.
What are you using to get responses?
this is my code that i have in settings.py file
CHATTERBOT = {
'name': 'Django ChatterBot Example',
'trainer': 'chatterbot.trainers.ListTrainer',
'training_data': [
#here i have my data
],
'django_app_name': 'django_chatterbot'
}
which version of chatterbot are you using? To know version python -m chatterbot --version
0.7.6
I am not getting any problem when i am using flask.
Did you have this problem while running python manage.py train?
If yes, comment out(#) the whole logic_adapters in your settings.py and uncomment after your training is done.
okay i will try as you say. yes please close this issue as i have shifted my app on flask. However i will still try with django and if the problem persists i will reopen. Thanks.
I have the same issue with Django -> python manage.py train
CHATTERBOT = {
'name': 'My Bot',
'logic_adapters': [
'chatterbot.logic.MathematicalEvaluation',
{
"import_path": "chatterbot.logic.BestMatch",
"statement_comparison_function": "chatterbot.comparisons.levenshtein_distance",
"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.'
},
{
'import_path': 'chatterbot.logic.SpecificResponseAdapter',
'input_text': 'owl',
'output_text': 'you have correct owl emoji, come visit this URL'
}
],
'preprocessors': [
'chatterbot.preprocessors.clean_whitespace'
],
'django_app_name': 'My Bot'
}
The error is in chatterbot/utils.py file on line 54, trying to get import_path but the structure is not like this
Yes, It is reproducing I'll tag it as Bug
yes ,i am too facing same problems :(
does anyone has work around this problem,i want to set threshold value in my django app.
@phunsukwangdu, It is a bug as @vkosuri and @gunthercox pointed. Hope the fix will be out soon. At the moment, the workaround for me as provided in my earlier comment was to do the training while commenting out logic adapters with/out the threshold and after training uncomment it back.
@taiwotman thx man!!! it worked!!
@taiwotman Thanks for the workaround
This issue has been fixed as a part of #969


Hi, I am using your DJANGO-CHATTERBOT example and trained it, there is no error on the training. But it seems like the SpecificResponseAdapter does not work, the LowconfidenceAdapter does not work either.
Any thought?
Most helpful comment
Yes, It is reproducing I'll tag it as Bug