đ Question Answering Bot
This project implements an interactive Question Answering Bot using a fine - tuned BERT model. It can take context and questions as input and return answers. The Gradio interface enables user - friendly interaction.
đ Quick Start
To run the Question Answering Bot, you need to have the required libraries installed, including Gradio and Transformers.
Running the Gradio App
You can find the Gradio app code in the file gradio_app.py
. To launch the app, simply run:
$ python gradio_app.py
Using the Notebook
The complete code, including model training and the Gradio app, is available in the Jupyter Notebook QuestionAnsweringBot.ipynb
. You can run it using Jupyter to explore and modify the code as needed.
â ī¸ Important Note
It is recommended to run this notebook on paperspace.com for no errors as when I ran this on Google Colab it was showing some import errors which I was unable to resolve.
⨠Features
- The bot uses a pre - trained BERT model fine - tuned on the SQuAD dataset, enabling it to answer questions based on given context.
- It includes a Gradio interface, allowing users to interact with the model through a user - friendly web application.
- Users can provide the context by either manually entering it or by uploading a text file. The interface also has options to remember the context for subsequent questions and clear it when needed.
đĻ Installation
To run this project, you need to install the required libraries such as Gradio and Transformers. However, specific installation commands are not provided in the original README.
đģ Usage Examples
Basic Usage
The basic usage is to run the Gradio app:
$ python gradio_app.py
Advanced Usage
You can explore and modify the code in the Jupyter Notebook QuestionAnsweringBot.ipynb
to customize the model training and usage.
đ Documentation
Model
The model used in this project is based on BERT (Bidirectional Encoder Representations from Transformers), a state - of - the - art NLP model. Specifically, we use the "Graphcore/bert - large - uncased" variant, optimized for question answering tasks.
Task
The primary task of this bot is to answer questions based on a given context.
Dataset
The model was fine - tuned using the SQuAD dataset, which is a collection of questions and answers based on Wikipedia articles. This dataset provides a rigorous benchmark for evaluating the model's question - answering abilities.
đ§ Technical Details
The major challenge faced during this project was the implementation of IPU as it was pretty complex. The author was unable to run it on either their laptop or on Google Colab and had to take a lot of help from Google and ChatGPT. After finally implementing it, there was a sense of accomplishment.
đ License
No license information is provided in the original README.