This project is a simple chatbot web app built using Python, Flask, and various NLP libraries such as NLTK, SpaCy, and transformers. The chatbot uses the Huggingface transformers
library with the microsoft/DialoGPT-medium
model to generate responses to user inputs. It also uses NLTK and SpaCy for additional text processing.
-
Install the required dependencies:
pip install flask nltk spacy transformers python -m spacy download en_core_web_sm
-
Download NLTK data:
python -c "import nltk; nltk.download('punkt')"
-
Run the Flask application:
py app.py
-
Open your web browser and navigate to:
http://127.0.0.1:5000/
-
Interact with the chatbot by typing messages and clicking 'Send'.
-
Flask Server: The Flask web server renders the HTML template and handles incoming POST requests to generate chatbot responses.
-
NLP Processing:
- NLTK: Used for tokenizing the input message.
- SpaCy: Used for named entity recognition (NER) and part-of-speech (POS) tagging.
- Transformers: The chatbot uses the Huggingface
transformers
library with themicrosoft/DialoGPT-medium
model to generate responses to user inputs.
-
Frontend: The web interface uses HTML and jQuery to handle user interactions and display the conversation.
Here are some example messages you can try with the chatbot:
- "Hello!"
- "What is your name?"
- "Can you tell me a joke?"
- "I like cats."
- "What's the meaning of life?"
This project is licensed under the MIT License.