when i use it in Chineseļ¼it don't work in python2ļ¼
` chatbot.set_trainer(ChatterBotCorpusTrainer)
chatbot.train(
"chatterbot.corpus.chinese"
)`
when i run the code, the error is:
conversations.yml Training: [####################] 100%
greetings.yml Training: [####################] 100%
trivia.yml Training: [####################] 100%
ä½ å„½
Traceback (most recent call last):
File "chat.py", line 40, in
print(chatbot.get_response(input(">")))
File "", line 1
ä½ å„½
SyntaxError: invalid syntax
i use the latest chatterbot 's version
@zhouzebiao Could you please provide fallowing details to resolve issue very quickly
python -m catterbot chatterbot.__version__Read this documentation to fix python encoding issues http://chatterbot.readthedocs.io/en/stable/encoding.html#how-do-i-fix-python-encoding-errors
This Chinese article may solve your problem, http://blog.just4fun.site/create-a-smart-chat-bot.html, please read the section of "å", it mention that might be a encoding problem in python2.
Without further ado, you may want to upgrade to python3
I get an error like this when I train Chinese
_sqlalchemy.exc.ProgrammingError: (sqlite3.ProgrammingError) You must not use 8-bit bytestrings unless you use a text_factory that can interpret 8-bit bytestrings (like text_factory = str).
It is highly recommended that you instead just switch your application to Unicode strings.
[SQL: u'SELECT "StatementTable".id AS "StatementTable_id", "StatementTable".text AS "StatementTable_text", "StatementTable".extra_data AS "StatementTable_extra_data" \nFROM "StatementTable" \nWHERE "StatementTable".text = ?\n LIMIT ? OFFSET ?'] [parameters: ('\xe5\x97\xb3\xef\xbc\x8c\xe6\xb8\xa1\xe8\xbe\xb9\xe5\x90\x9b\xef\xbc\x8c\xe7\x9c\x9f\xe5\x96\x9c\xe6\xac\xa2\xe6\x88\x91?', 1, 0)]_
Finally, I install the mongodb and set storage_adapter="chatterbot.storage.MongoDatabaseAdapter", then it works.
I'm closing this off because I _believe_ this was answered? @zhouzebiao feel free to reopen this if you have any further questions on this issue.
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.