DEV Community

Freddy Adiv
Freddy Adiv

Posted on

Simple ChatBot with tests

Hi all,
The NLP field is pretty amazing, specially with ChatGPT4 around, so as part of my MSc studies I tried to learn a bit about the techniques used to build such AI systems.
I looked around in Github and found several repositories implementing chatbots, so I used some of them to build this Encoder/ Decoder based chat model.
It uses an intents.json file which is contains several input patterns and optional responses.
The readme file relates to some of the sources I used.

Using the chatbot:

  1. Clone the repository to your local computer:
    git clone https://github.com/FredAdiv/Chatbot

  2. (Optional) I suggest you use a docker container for the project. This is a sample command line for creating such a container:
    docker run -it --name chatbot -w /opt -v c:\users<username>\chatbot:/opt python:3.11 bash

  3. If the container was created but didn't open then
    use the following command:
    docker container start -i chatbot

  4. Install dependencies from the requirements file:
    pip install requirements.txt

  5. (Optional) Use pytest to make sure that everything works:
    pytest

  6. Run the bot:
    python chat.py

Happy Chatting.

Top comments (0)