Alexmhack/Django-Rasa-Bot

Incomplete html file

SujanBal opened this issue · 12 comments

I think the index file is not complete. After opening the URL, it only shows Django-Rasa-BotUI. Can you put the complete index.html file?

No the index.html file in templates folder is complete and working. It shows Django-Rasa-BotUI because there are only two urls configured for django, one is for admin and other is the root url which points to home_view in chatsite/views.py file which is rendering templates/index.html.

What exactly is the problem that occurred in your index.html file ?

There can be few reasons why chat interface isn't showing up.

  • Computer not having an active internet connection.
  • errors appearing in any of the javascript files (Checkout console)

I will get back to you after checking the project on my computer.

I cannot see the screenshots, where are they ?

Capture

Capture1

Sorry, here they are.

@SujanBal also run the bot.py file in another terminal. After running that file only you'll see the chatbot icon on the right side bottom of the screen.
To run the bot.py file you will have to train your own model and place it into the models folder. Because the version present into the repo is older than the current version.

Hope this helps.

@SujanBal sorry for being too late in replying and @Zorro30 thanks for answering, I will update the models folder very soon.

@Alexmhack Can you please let me know why the bot is taking so much time to respond to a msg, and 3 out of 5 times it doesn't reply.

Screenshot 2019-04-18 at 11 31 41 PM

I have just uploaded the updated models for Rasa Core & Nlu in the rasachat/models folder.

And as far as I have tested on my computer, it works fine with very good response time. It does not reply for most of our messages because the bot is trained on very very less data so it won't understand every message that we send to it, you need to add more data in rasachat/nlu.md & rasachat/stories.md files you can refer the original docs for further instructions

You can also refer to starter-pack-rasa-nlu and build upon and extend the existing data present in the repo at data/nlu.md file for a more advanced bot.

Since we are using the most efficient and fastest way "Sockets" the response time of bot should not be an issue.

Try testing out again, if you think bot replies are slow then send me screenshots of the terminal running bot.py file.

@Alexmhack

  1. I guess you haven't committed the models folder into the repo.

Also when I try to add my own models and run.
It gives this in the log of bot.py file.

(rasa) Gaurangs-MacBook-Air:rasachat gaurang$ python3 bot.py 
2019-04-20 19:01:32.030808: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
127.0.0.1 - - [2019-04-20 19:02:36] "GET /socket.io/?EIO=3&transport=polling&t=Mewyk1J HTTP/1.1" 200 365 0.003284
127.0.0.1 - - [2019-04-20 19:02:36] "POST /socket.io/?EIO=3&transport=polling&t=Mewyk2x&sid=19f85ae069864becaa45314e32d2a75b HTTP/1.1" 200 195 0.001026
127.0.0.1 - - [2019-04-20 19:02:36] "GET /socket.io/?EIO=3&transport=polling&t=Mewyk2y&sid=19f85ae069864becaa45314e32d2a75b HTTP/1.1" 200 268 0.000646
message handler error
Traceback (most recent call last):
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/engineio/server.py", line 505, in _trigger_event
    return self.handlers[event](*args)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/socketio/server.py", line 590, in _handle_eio_message
    self._handle_event(sid, pkt.namespace, pkt.id, pkt.data)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/socketio/server.py", line 526, in _handle_event
    self._handle_event_internal(self, sid, data, namespace, id)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/socketio/server.py", line 529, in _handle_event_internal
    r = server._trigger_event(data[0], namespace, sid, *data[1:])
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/socketio/server.py", line 558, in _trigger_event
    return self.handlers[namespace][event](*args)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/rasa_core/channels/socketio.py", line 169, in handle_message
    on_new_message(message)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/rasa_core/agent.py", line 303, in handle_message
    return processor.handle_message(message)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/rasa_core/processor.py", line 76, in handle_message
    tracker = self.log_message(message)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/rasa_core/processor.py", line 122, in log_message
    self._handle_message_with_tracker(message, tracker)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/rasa_core/processor.py", line 263, in _handle_message_with_tracker
    parse_data = self._parse_message(message)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/rasa_core/processor.py", line 248, in _parse_message
    parse_data = self.interpreter.parse(message.text)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/rasa_core/interpreter.py", line 242, in parse
    return self.interpreter.parse(text)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/rasa_nlu/model.py", line 357, in parse
    component.process(message, **self.context)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/rasa_nlu/classifiers/sklearn_intent_classifier.py", line 180, in process
    intent_ids, probabilities = self.predict(X)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/rasa_nlu/classifiers/sklearn_intent_classifier.py", line 222, in predict
    pred_result = self.predict_prob(X)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/rasa_nlu/classifiers/sklearn_intent_classifier.py", line 210, in predict_prob
    return self.clf.predict_proba(X)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/sklearn/utils/metaestimators.py", line 118, in <lambda>
    out = lambda *args, **kwargs: self.fn(obj, *args, **kwargs)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/sklearn/model_selection/_search.py", line 508, in predict_proba
    return self.best_estimator_.predict_proba(X)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/sklearn/svm/base.py", line 622, in _predict_proba
    X = self._validate_for_predict(X)
  File "/Users/gaurang/WebSocket/20April/rasa/lib/python3.6/site-packages/sklearn/svm/base.py", line 478, in _validate_for_predict
    (n_features, self.shape_fit_[1]))
ValueError: X.shape[1] = 96 should be equal to 384, the number of features at training time

Pushed the changes now. And I guess this issue is resolved so closing it, open it anytime.