Giter VIP home page Giter VIP logo

nirdesh17 / chat-bot Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 192 KB

This chatbot project demonstrates the application of AI and ML techniques for natural language processing tasks. By training on a dataset of intents and responses, the chatbot is able to understand user queries and provide appropriate responses, making it a useful tool for various applications, including customer support, and more

Python 100.00%
ai artificial-intelligence chatbot chatbots deep-learning intents json-data machine-learning ml neural-network

chat-bot's Introduction

Chat Bot AI/ML Project

This project involves the development of a chatbot using Artificial Intelligence (AI) and Machine Learning (ML) techniques. The chatbot is trained to understand user queries and respond appropriately based on predefined intents.

File Structure

  • training.py: This file contains the code for training the chatbot model.
  • chatbot.py: This file contains the code for running the chatbot.

Data Preparation

  • The training data is stored in a JSON file named intent.json, which contains intents along with corresponding patterns and responses.
  • The NLTK library is used for text processing tasks such as tokenization, lemmatization, and bag-of-words creation.

Model Training (training.py)

  1. Data Loading: The training data is loaded from the intent.json file.
  2. Data Preprocessing: Patterns and responses from the intents are extracted and tokenized using NLTK.
  3. Word Lemmatization: Words are lemmatized to reduce them to their base forms.
  4. Word Vectorization: The bag-of-words technique is applied to convert words into numerical vectors.
  5. Model Architecture: A Sequential neural network model is built using Keras. The model consists of dense layers with ReLU activation and dropout for regularization.
  6. Model Compilation: The model is compiled using the Stochastic Gradient Descent (SGD) optimizer and categorical cross-entropy loss function.
  7. Model Training: The model is trained on the preprocessed data for a specified number of epochs.

Chatbot Implementation (chatbot.py)

  1. Model Loading: The pre-trained chatbot model is loaded from the chatbotmodel.h5 file.
  2. Data Loading: The words and classes used during training are loaded from the pickle files.
  3. Input Processing: User input is cleaned, tokenized, and converted into a bag-of-words representation.
  4. Intent Prediction: The model predicts the intent of the user input based on the bag-of-words representation.
  5. Response Generation: Based on the predicted intent, a response is selected randomly from the predefined responses associated with that intent.
  6. User Interaction: The chatbot continuously interacts with the user, predicting intents and generating responses based on user input.

Technologies Used

  • Python
  • Libraries: NLTK, TensorFlow, Keras, NumPy
  • File Serialization: Pickle (for storing words and classes)

Setup and Installation

  1. Install the required Python libraries (NLTK, TensorFlow, Keras).
  2. Download the training data (intent.json) and place it in the project directory.
  3. Run training.py to train the chatbot model and generate necessary pickle files and the trained model file.
  4. Run chatbot.py to start the chatbot interaction. Enter messages in the console to chat with the bot.

For any improvements or feedback, please feel free to contribute or reach out.

Connect me:

Linkedin

chat-bot's People

Contributors

nirdesh17 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.