gunthercox / ChatterBot

ChatterBot is a machine learning, conversational dialog engine for creating chat bots
https://chatterbot.readthedocs.io
BSD 3-Clause "New" or "Revised" License
14.08k stars 4.44k forks source link

How export chatterbot to a exe project or similar #1750

Closed AndrasPataki closed 5 years ago

AndrasPataki commented 5 years ago

Hello good day. I have a problem. I can not export my chatterbot in any application. I tried the Pyinstaller but it has problems with the nltk library, cx_freeze is not exporting, it has problems in certain modules. I do not know what to do to make chatterbot an accessible application. I would like directions or help. I have seen that it is possible to do an integration with django or flask, however I would have to reprogram all of my chatbot for integration.

MohamedA95 commented 5 years ago

would it be possible to make it as a web application? using Django or Flask. This would solve all these problems and also there are already examples out there :)

brightening-eyes commented 5 years ago

install the latest PyInstaller, I have wrote a hook for nltk for it. or instead, you can add nltk.chunk.named_entity to hiddenimports in your spec file. also, chatterbot is going to use SpaCy, which you can write a hook for it as well or add it's modules in the hiddenimports

AndrasPataki commented 5 years ago

Hello guys. I solved the problems with the pyinstaller nltk hook. After much research, I decided to go it alone in the code structure. I solved my problem by commenting on the lines: datas=[]

'''for p in nltk.data.path: datas.append((p, "nltk_data"))'''

hiddenimports = ["nltk.chunk.named_entity"]

What's more, you need to rename the file: pyi_rth__nltk.cpython-36.pyc to pyi_rth_nltk.cpython-36.pyc . This file have 1 more underline. Warning with the python version.

gunthercox commented 5 years ago

Hey @AndrasPataki, I'm glad you were able to get an executable created. Thank you for describing the changes you had to make. Hopefully this will help anyone in the future who is looking to do something similar.

lock[bot] commented 4 years ago

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.