Skip to content

This is a chatbot framework with a conversational model for an Ecommerce Website. The chatbot handles simple questions about hours of operation, reservation options, products in stock and so on. The chatbot also handles contextual responses such as inquiries about same-day deliveries and shipping.

Notifications You must be signed in to change notification settings

octocatblain/PyTorch-AI-chatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤖 PyTorch AI-Chatbot for E-commerce Site 💻

In conversations, Context is king. This is a chatbot framework with a conversational model for an Ecommerce Website. The chatbot handles simple questions about hours of operation, reservation options, products in stock and so on. The chatbot also handles contextual responses such as inquiries about same-day deliveries and shipping.

🔌 What to Expect

  • Training of the chatbot

Training of the chatbot

  • Chatbot running in the CLI

Chatbot running in CLI

💉Installation

🌍Create an environment

  • Whatever you prefer (e.g. conda or venv)
mkdir myproject
$ cd myproject
$ python3 -m venv venv

♨️Activate it

  • For Mac / Linux users:
. venv/bin/activate
  • For Windows Users: Use conda base activate or the code below:
venv\Scripts\activate

🌡️Install PyTorch and it's dependencies

pip install nltk
  • If you get an error during the first run, you also need to install nltk.tokenize.punkt:
  • Run this once in your terminal:
$ python
>>> import nltk
>>> nltk.download('punkt')

🔆Usage

  • Run
python train.py
  • This will dump data into the data.pth file. And then run
python chat.py

⚙️Customize

  • Have a look at intents.json.
  • You can customize it according to your own use case. 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?"
      ]
    },
    ...
  ]
}

✌️Contributing

  • You wanna contribute? Wow amazing. That's great to hear.
  • After cloning & setting up the local project you can push the changes to your github fork and make a pull request.

📈Pushing the changes

git add .
git commit -m "feat: added new stuff"
git push YOUR_REPO_URL BRANCH_NAME

This code was built with ❤️ and alot of Coffee☕

About

This is a chatbot framework with a conversational model for an Ecommerce Website. The chatbot handles simple questions about hours of operation, reservation options, products in stock and so on. The chatbot also handles contextual responses such as inquiries about same-day deliveries and shipping.

Topics

Resources

Stars

Watchers

Forks

Languages