When running the example program:
from chatterbot import ChatBot
chatbot = ChatBot(
'Ron Obvious',
trainer='chatterbot.trainers.ChatterBotCorpusTrainer'
)
# Train based on the english corpus
chatbot.train("chatterbot.corpus.english")
# Get a response to an input statement
print(chatbot.get_response("Hello, how are you today?"))
I get two warnings, Although the program continues to run as normal.
C:\Python35\lib\site-packages\nltk\decorators.py:59: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() instead
regargs, varargs, varkwargs, defaults = inspect.getargspec(func)
and
C:\Python35\lib\site-packages\chatterbot\adapters\storage\jsonfile.py:18: UnsuitableForProductionWarning: The JsonFileStorageAdapter is not recommended for production application environments.
self.UnsuitableForProductionWarning
I'm running with Python3.5 AMD64 on Windows 10.
Hi @Jackojc,
The DeprecationWarning is being triggered in the codebase of NLTK, which is another library that ChatterBot uses internally to handle various text analysis tasks. You can see where this code is being used around line 59 in https://github.com/nltk/nltk/blob/develop/nltk/decorators.py
The UnsuitableForProductionWarning warning is being triggered by ChatterBot. Keep in mind that it is just a warning, not an error. The warning is being displayed because the default storage adapter stores conversation information that the bot learns in a json file. Doing this works great for testing and debugging and even small projects. However, if someone tries to train the bot with something like ~10,000 statements, then the performance of the chat bot will be extremely slow because of the disk io and memory constraints (making it unsuitable for production).
Hi @Jackojc,
The latest release of ChatterBot (0.4.10) now allows a parameter to be passed in that will suppress the JSON File Database performance warning. To use it, you must set it when constructing your chat bot:
chatbot = ChatBot(
# ...
silence_performance_warning=True
)
Thanks @gunthercox!
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.
Most helpful comment
Hi @Jackojc,
The latest release of ChatterBot (0.4.10) now allows a parameter to be passed in that will suppress the JSON File Database performance warning. To use it, you must set it when constructing your chat bot: