Karan-Malik / Chatbot

A Deep-Learning multi-purpose chatbot made using Python3
https://ted-the-deep-learning-bot.herokuapp.com/
MIT License
115 stars 57 forks source link

chat not working. #3

Open abhinavkumar17 opened 3 years ago

abhinavkumar17 commented 3 years ago

Its not working. It opens UI but bot doesn't respond back.

Karan-Malik commented 3 years ago

Is this issue with the cloned version or the online heroku app?

abhinavkumar17 commented 3 years ago

Cloned version. i am able to run it localhost but somehow its only one way communication. Just wondering if some step is missing?

Karan-Malik commented 3 years ago

When you run it on localhost and text the bot, some error would be appearing in the command line where you have run it from. Could you share the error you are getting?

abhisingh007224 commented 3 years ago

there is no app.py file

absonix commented 2 years ago

I can run this app on my local but not working on server. Can you ping me on +91-8602128023 whatsapp

cnrakesh1999 commented 2 years ago

When you run it on localhost and text the bot, some error would be appearing in the command line where you have run it from. Could you share the error you are getting?

hello sir iam getting a internal server 500 error while running on localhost

celikmustafa89 commented 1 year ago

hello, the server is running.
when I type a message, it won't respond.
and throws the following error in the server side: What should I do, any suggestion would be great. thanks.

[2022-09-14 14:34:58,198] ERROR in app: Exception on /get [GET]
Traceback (most recent call last):
  File "/home/ubuntu/projects/chatbot/Chatbot/venv38/lib/python3.8/site-packages/nltk/corpus/util.py", line 86, in __load
    root = nltk.data.find('{}/{}'.format(self.subdir, zip_name))
  File "/home/ubuntu/projects/chatbot/Chatbot/venv38/lib/python3.8/site-packages/nltk/data.py", line 701, in find
    raise LookupError(resource_not_found)
LookupError:
**********************************************************************
  Resource wordnet not found.
  Please use the NLTK Downloader to obtain the resource:

  >>> import nltk
  >>> nltk.download('wordnet')

  For more information see: https://www.nltk.org/data.html

  Attempted to load corpora/wordnet.zip/wordnet/

  Searched in:
    - '/home/ubuntu/nltk_data'
    - '/home/ubuntu/projects/chatbot/Chatbot/venv38/nltk_data'
    - '/home/ubuntu/projects/chatbot/Chatbot/venv38/share/nltk_data'
    - '/home/ubuntu/projects/chatbot/Chatbot/venv38/lib/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'
**********************************************************************

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/projects/chatbot/Chatbot/venv38/lib/python3.8/site-packages/flask/app.py", line 2077, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/ubuntu/projects/chatbot/Chatbot/venv38/lib/python3.8/site-packages/flask/app.py", line 1525, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/ubuntu/projects/chatbot/Chatbot/venv38/lib/python3.8/site-packages/flask/app.py", line 1523, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/ubuntu/projects/chatbot/Chatbot/venv38/lib/python3.8/site-packages/flask/app.py", line 1509, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**req.view_args)
  File "/home/ubuntu/projects/chatbot/Chatbot/chatbot/routes.py", line 181, in chatbot
    resp=response(userText)
  File "/home/ubuntu/projects/chatbot/Chatbot/chatbot/routes.py", line 162, in response
    return_list=predict_class(text,model)
  File "/home/ubuntu/projects/chatbot/Chatbot/chatbot/routes.py", line 42, in predict_class
    p=create_bow(sentence,words)
  File "/home/ubuntu/projects/chatbot/Chatbot/chatbot/routes.py", line 32, in create_bow
    sentence_words=clean_up(sentence)
  File "/home/ubuntu/projects/chatbot/Chatbot/chatbot/routes.py", line 28, in clean_up
    sentence_words=[ lemmatizer.lemmatize(word.lower()) for word in sentence_words]
  File "/home/ubuntu/projects/chatbot/Chatbot/chatbot/routes.py", line 28, in <listcomp>
    sentence_words=[ lemmatizer.lemmatize(word.lower()) for word in sentence_words]
  File "/home/ubuntu/projects/chatbot/Chatbot/venv38/lib/python3.8/site-packages/nltk/stem/wordnet.py", line 41, in lemmatize
    lemmas = wordnet._morphy(word, pos)
  File "/home/ubuntu/projects/chatbot/Chatbot/venv38/lib/python3.8/site-packages/nltk/corpus/util.py", line 123, in __getattr__
    self.__load()
  File "/home/ubuntu/projects/chatbot/Chatbot/venv38/lib/python3.8/site-packages/nltk/corpus/util.py", line 88, in __load
    raise e
  File "/home/ubuntu/projects/chatbot/Chatbot/venv38/lib/python3.8/site-packages/nltk/corpus/util.py", line 83, in __load
    root = nltk.data.find('{}/{}'.format(self.subdir, self.__name))
  File "/home/ubuntu/projects/chatbot/Chatbot/venv38/lib/python3.8/site-packages/nltk/data.py", line 701, in find
    raise LookupError(resource_not_found)
LookupError:
**********************************************************************
  Resource wordnet not found.
  Please use the NLTK Downloader to obtain the resource:

  >>> import nltk
  >>> nltk.download('wordnet')

  For more information see: https://www.nltk.org/data.html

  Attempted to load corpora/wordnet

  Searched in:
    - '/home/ubuntu/nltk_data'
    - '/home/ubuntu/projects/chatbot/Chatbot/venv38/nltk_data'
    - '/home/ubuntu/projects/chatbot/Chatbot/venv38/share/nltk_data'
    - '/home/ubuntu/projects/chatbot/Chatbot/venv38/lib/nltk_data'
    - '/usr/share/nltk_data'
    - '/usr/local/share/nltk_data'
    - '/usr/lib/nltk_data'
    - '/usr/local/lib/nltk_data'
*********************************************
Dev-Gaju commented 1 year ago

Just do the simple thing mentioned in your error. nltk.download('wordnet')

Qoshawa commented 1 year ago

I'm new to github and there's a project/Chatbot I'm working on to use python to fetch a particular information from a .csv file. Eg. Prompt: What is the price of a plate of noodles? Chatbot: A plate of noodles is $5 in US and $3 in China...I would really appreciate ideas??

ByteWiizard commented 1 year ago

i was also getting same error did as it says got another error

error:

127.0.0.1 - - [12/Aug/2023 08:20:32] "GET /get?msg=help HTTP/1.1" 500 - [2023-08-12 08:20:56,420] ERROR in app: Exception on /get [GET] Traceback (most recent call last): File "/home/stinson/miniconda3/envs/chatbot/lib/python3.6/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/home/stinson/miniconda3/envs/chatbot/lib/python3.6/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/stinson/miniconda3/envs/chatbot/lib/python3.6/site-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/stinson/miniconda3/envs/chatbot/lib/python3.6/site-packages/flask/_compat.py", line 39, in reraise raise value File "/home/stinson/miniconda3/envs/chatbot/lib/python3.6/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/home/stinson/miniconda3/envs/chatbot/lib/python3.6/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functionsrule.endpoint File "/home/stinson/Desktop/TedBot/chatbot/routes.py", line 181, in chatbot resp=response(userText) File "/home/stinson/Desktop/TedBot/chatbot/routes.py", line 162, in response return_list=predict_class(text,model) File "/home/stinson/Desktop/TedBot/chatbot/routes.py", line 43, in predict_class res=model.predict(np.array([p]))[0] File "/home/stinson/miniconda3/envs/chatbot/lib/python3.6/site-packages/keras/engine/training.py", line 1452, in predict if self._uses_dynamic_learning_phase(): File "/home/stinson/miniconda3/envs/chatbot/lib/python3.6/site-packages/keras/engine/training.py", line 382, in _uses_dynamic_learning_phase not isinstance(K.learning_phase(), int)) File "/home/stinson/miniconda3/envs/chatbot/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 73, in symbolic_fn_wrapper if _SYMBOLIC_SCOPE.value: AttributeError: '_thread._local' object has no attribute 'value' 127.0.0.1 - - [12/Aug/2023 08:20:56] "GET /get?msg=hello HTTP/1.1" 500 -

can anyone help with this

nixsy9 commented 1 year ago

I added

nltk.download('punkt')
nltk.download('wordnet')

to chatgui.py and ran it via python chatgui

I also had to install tensorflow and nltk

pip install tensorflow and pip install nltk

its a nice script and very well made