Skip to content

houssemlachtar/ChatBot-FST

Repository files navigation

ChatBot-FST

A machine learning chatbot with Flask Python and Javascript in the front-end.

Initial Setup in Windows

Make sure you have Node JS installed.
Make sure Python 2.7 is installed and is among your environment variables first.
Open the whole project in VS Code
Open app.py and run in a new terminal

Create a virtual environment

chatbot-FST\Scripts\activate

Now install the dependencies

python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org --upgrade pip
python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org pip Flask
python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org pip torch
python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org pip torchvision
python -m pip install --trusted-host pypi.python.org --trusted-host files.pythonhosted.org --trusted-host pypi.org pip nltk

Running the app

python
>>> import ntlk
>>> nltk.download('punkt')
>>> quit() 
python train.py
python chat.py

At this level your chatbot should be running and appearing in the command line.

Linking in the chatbot to the front-end

All you have to do now is to: Press F5 to start debugging
Or
Just go to RUN in the menu bar and click start debugging

The app should be running on http://127.0.0.1:5000/

You can edit chatbot responses in the "intents.json" file freely according to your needs

Used Tools

Used Libraries
  1. Flask
  2. PyTorch
  3. Nltk

Follow me on

Instagram, Linkedin , Codepen, GitHub