This repository contains the coursework for INM706, focused on the design and development of an intelligent chatbot using modern Natural Language Processing (NLP) techniques.
The project employs Seq2Seq and Transformer architectures, enhanced with attention mechanisms to enable the chatbot to conduct coherent and contextually relevant conversations. Applications of this chatbot span various sectors, including customer service, healthcare, and education.
seq2seq/
ortransformer/
: Contains all source code for the project.data/
: Directory for datasets used, including links to external sources.model_name/train.py
: To train the model.
To set up the project environment to run the code, follow these steps:
git clone https://github.com/rafipatel/transformer-pytorch-chatbot.git
cd transformer-pytorch-chatbot
pip install -r requirements.txt
- Change the directory to desired model (either Seq2Seq or Transformer) To train the chatbot model, run:
python train.py
To interact with the trained chatbot, run:
python conversations.py
The chatbot is trained on the Cornell Movie-Dialogs Corpus. The dataset can be accessed through the following link:
The project includes two main types of models:
- Seq2Seq Model: A sequence-to-sequence model with optional attention mechanisms.
- Transformer Model: Utilizes multi-head attention to improve the understanding of context.
- Checkpoints - Checkpoints for both models can be found here
Contributions to this project are welcome. Please fork the repository and submit a pull request with your enhancements.
This project is licensed under the MIT License - see the LICENSE file for details.
- Code and architecture insights were adapted from the following repositories:
Thank you to the instructors and peers for their guidance and feedback throughout this coursework.