Skip to content

A simple AI Chatbot implementation using Pytorch and NPL

Notifications You must be signed in to change notification settings

mindninjaX/AI-Chatbot

Repository files navigation


AI Chatbot

A simple chatbot powered by Pytorch & NPL.
Report Bug · Request Feature


Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Customize
  5. Roadmap
  6. Contributing
  7. Contact
  8. Resources

About The Project

carbon

  • The implementation should be easy to follow for beginners and provide a basic understanding of chatbots.
  • The implementation is straightforward with a Feed Forward Neural net with 2 hidden layers. Customization for your own use case is super easy. Just modify intents.json with possible patterns and responses and re-run the training.

Built With

This section should list any major frameworks that you built your project using. Leave any add-ons/plugins for the acknowledgements section. Here are a few examples.

Getting Started

To get started with this project, follow the instructions below:

Prerequisites

To run and work with this project you need to have the latest version of Python installed in your system.

Along with Python, we would also need some python modules to work with this project. Check Installation for instructions on same.

Installation

  1. Clone the repo
    git clone https://github.com/mindninjaX/AI-Chatbot
  2. Install required packages using pip install
    pip install torch
    pip install numpy
    pip install nltk
  3. Uncomment nltk.download() & run nltk_utlis.py to install Punkt Tokenzier model
    import nltk
    nltk.download()

Usage

Run train.py to train the chatbot

python train.py

This is create a new file data.pth which contains the trained data for our chatbot.

Initiate the chatbot! Run chat.py

python chat.py

Customize

Raw data is present in intents.json. Customize this file as per your needs. Just define a new tag, possible patterns, and possible responses for the chat bot. You have to re-run the training whenever this file is modified.

{
"intents": [
  {
    "tag": "greeting",
    "patterns": [
      "Hi",
      "Hey",
      "How are you",
      "Is anyone there?",
      "Hello",
      "Good day"
    ],
    "responses": [
      "Hey :-)",
      "Hello, thanks for visiting",
      "Hi there, what can I do for you?",
      "Hi there, how can I help?"
    ]
  },
  ...
]
}

Roadmap

See the open issues for a list of proposed features (and known issues).

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Contact

Rishabh Singh

Project Link: https://github.com/mindninjaX/AI-Chatbot

Resources & Acknowledgements

Releases

No releases published

Packages

No packages published

Languages