chamkank / flask-chatterbot

Simple boilerplate for ChatterBot using Flask
377 stars 263 forks source link

Slow? #3

Closed peterel closed 7 years ago

peterel commented 7 years ago

Hi,

Im seeing around 10-15 sec responsetime when using this as-is. Even with "simple" single-words, e.g. "Hi". Any idea why that is? Due to chatterbot simply being this slow or is it because its not trained...something else?

Thanks.

chamkank commented 7 years ago

Just tried it again, it does seem a lot slower than before. I think it's due to using a JSON adapter for storage (see this issue).

Using MongoDB is a recommended fix, I'll try to implement it soon - in the meantime, you can try using the Django example.

peterel commented 7 years ago

Thanks for quick response. The Django was indeed a lot quicker! Seems to be using sqlite. But you think mongoDB is the way to go here? Do you know of any example on how to use that on Heroku?

chamkank commented 7 years ago

If you're happy with the speed SQLite is giving you, I'd say stick with it. I believe MongoDB scales better for larger queries, and would be a better choice if you're planning to deploy your app.

I personally use PythonAnywhere instead of Heroku, but they don't have MongoDB support yet. Heroku seems to offer a MongoDB add-on, but I haven't used it before.

Hope that helped!

peterel commented 7 years ago

Alright, thanks for the help!

Ive never used PythonAnywhere, seems to be python specific platform as a service. So, I guess, not that different from heroku (if you program python :) ). Did you have to train your bot directly on PythonAnywhere or could you do that locally and then just push it to your "dynos"/machine on PythonAnywhere?

chamkank commented 7 years ago

Yeah, you could do it locally then upload it since the database is just a file. When I hosted the demo, I trained it directly on PythonAnywhere and I had no issues with it. Unless you have to manually train it with a lot of responses, I would recommend just training it on the platform.

peterel commented 7 years ago

Thanks for the info. Ive spent almost 15 hours traning the bot but now getting error "too big" (reported https://github.com/gunthercox/ChatterBot/issues/757). Not sure how to progress now. Would be great to be able to train the bot "properly" but I may not be able to do that with chatterbot. Anyway, Ill close this issue now as its no longer related to original question. Thanks again.

chamkank commented 7 years ago

Just an update - switched the bot to use SQLAlchemy storage adapter and it's way faster now. 8d25c51777c20764088957fb5727c2f181e2b20c