We are excited to announce the release of Chatbot Version 1.0! This release includes the implementation of a simple yet effective chatbot using natural language processing techniques. Below are the key features and improvements in this version:
Features:
- Natural Language Processing (NLP) Integration:
Utilizes the Natural Language Toolkit (NLTK) for tokenization and lemmatization of text data.
Implements WordNet lemmatizer to process and understand the context of words in user input. - Training Data Generation:
Reads intent patterns from a JSON file (data/intents.json) to dynamically generate training data.
Tokenizes and preprocesses patterns, creating a bag of words representation. - Neural Network Model:
Implements a simple neural network model using Keras with a Sequential architecture.
Three layers: 128 neurons in the input layer, 64 neurons in the hidden layer, and an output layer with softmax activation for intent prediction.
Incorporates dropout layers to enhance generalization. - Model Training and Saving:
Trains the model with 500 epochs using stochastic gradient descent (SGD) optimization.
Saves the trained model in Keras format for later use (data/trained_models/chatbot_model.keras). - Improved File Structure:
Organizes code into distinct directories (data, models, src, utils) for better readability and maintainability. - Dependencies and Downloadable Models:
Downloads NLTK models ("punkt" and "wordnet") during runtime for efficient tokenization and lemmatization.
Usage:
To train and use the chatbot:
Ensure dependencies are installed (nltk, numpy, keras).
Execute the script train_chatbot.py located in the src directory.
How to Get Started:
Clone the repository: git clone https://github.com/ProgrammingInBlood/NeuralChat
Install dependencies: pip install -r requirements.txt
Train the model: python src/train_chatbot.py
Run the server: python main.py
We hope you find this release helpful and look forward to your feedback! If you encounter any issues or have suggestions for improvement, please open an issue on our GitHub repository.
Happy chatting!