-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
slow to get result when use Mongo Database Adapter #747
Comments
An improvement PR is here #738 |
Please checkout latest changes and experiment let me know your inputs how best we can speedup. |
@vkosuri PR #738 is not work for me. [I 170518 01:10:18 input_adapter:22] Recieved input statement: abc |
Thanks for your inputs. |
I debug the program and find out that it takes a long time in function get_response_statements in mongodb.py.
response_query is a huge list contains 50000+ elements. Is there a way to cache the data in memory? |
issue is with, response_query = self.statements.distinct('in_response_to.text'); |
@telkomops I'm working on a solution that involves caching and additional filtering. The solution to this issue likely wont be available until the next major release of ChatterBot. |
@gunthercox I have cached the result in memory so i don't need to get from MongoDB every time. |
@dyf6372 Database-level caching is a good start. When I mentioned caching I was referring to the various search and comparison algorithms that the chat bot uses to analyse statements and select responses. These often calculate values and these calculations can be costly when it comes to time. |
Closing this as a duplicate of #697 |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
mybot = ChatBot('Terminal',
storage_adapter='chatterbot.storage.MongoDatabaseAdapter',
database='db'
)
2017-05-18,00:17:08.864 INFO {input_adapter} [process_input_statement] Recieved input statement: abc
2017-05-18,00:17:08.866 INFO {input_adapter} [process_input_statement] "abc" is not a known statement
2017-05-18,00:17:16.571 INFO {best_match} [process] Using "abc" as a close match to "abcd"
it takes a long time go get best match
The text was updated successfully, but these errors were encountered: