Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

must contain a value for "import_path" #969

Closed
maylad31 opened this issue Sep 2, 2017 · 17 comments
Closed

must contain a value for "import_path" #969

maylad31 opened this issue Sep 2, 2017 · 17 comments
Assignees
Labels

Comments

@maylad31
Copy link

maylad31 commented Sep 2, 2017

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'
    }
    ],
@maylad31 maylad31 changed the title must contain a value for "import_path must contain a value for "import_path" Sep 2, 2017
@rodneyhayes
Copy link

rodneyhayes commented Sep 2, 2017

Try:

logic_adapters=[
      {
         "import_path": 'chatterbot.logic.BestMatch',

      }, 
      {

        "import_path": 'chatterbot.logic.LowConfidenceAdapter',
        "threshold": 0.90,
        "default_response": 'OhNo'
      }
], 

@maylad31
Copy link
Author

maylad31 commented Sep 2, 2017

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.

@rodneyhayes
Copy link

What are you using to get responses?

@maylad31
Copy link
Author

maylad31 commented Sep 3, 2017

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'
}

@vkosuri
Copy link
Collaborator

vkosuri commented Sep 4, 2017

which version of chatterbot are you using? To know version python -m chatterbot --version

@maylad31
Copy link
Author

maylad31 commented Sep 4, 2017

0.7.6
I am not getting any problem when i am using flask.

@taiwotman
Copy link

taiwotman commented Sep 4, 2017

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.

@maylad31
Copy link
Author

maylad31 commented Sep 5, 2017

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.

@Super-Fly
Copy link

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

@vkosuri
Copy link
Collaborator

vkosuri commented Sep 19, 2017

Yes, It is reproducing I'll tag it as Bug

@gunthercox gunthercox added the bug label Sep 24, 2017
@gunthercox gunthercox self-assigned this Oct 1, 2017
@susmit
Copy link

susmit commented Nov 6, 2017

yes ,i am too facing same problems :(

@susmit
Copy link

susmit commented Nov 6, 2017

does anyone has work around this problem,i want to set threshold value in my django app.

@taiwotman
Copy link

taiwotman commented Nov 6, 2017

@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.

@susmit
Copy link

susmit commented Nov 6, 2017

@taiwotman thx man!!! it worked!!

@vhr121
Copy link

vhr121 commented Nov 10, 2017

@taiwotman Thanks for the workaround

@gunthercox
Copy link
Owner

This issue has been fixed as a part of #969

@ghost
Copy link

ghost commented Feb 25, 2018

screenshot 2018-02-25 17 27 03

screenshot 2018-02-25 17 27 22

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants