Skip to content

This project showcases how to fine-tune a HuggingFace model with the SQuAD dataset and create a Gradio interface for interactive question answering, enabling users to input context and questions and receive model-generated answers.

Notifications You must be signed in to change notification settings

NnekaAsuzu/fine-tuning-on-any-question-answering-dataset-from-HuggingFace

Repository files navigation

Question Answering System with Fine-Tuned HuggingFace Model and Gradio Interface

Overview

This project demonstrates how to perform fine-tuning on a question-answering dataset from HuggingFace and save the model. The saved model is then used to build a Gradio interface, which allows users to input a context and a question to receive the model's answer.

Stanford Question Answering Dataset (SQuAD)

The Stanford Question Answering Dataset (SQuAD) is a popular dataset for machine reading comprehension tasks. It consists of questions posed by crowdworkers on a set of Wikipedia articles, where the answer to every question is a segment of text from the corresponding article.

The dataset is divided into two subsets: SQuAD1.1 and SQuAD2.0. SQuAD1.1 contains questions that can be answered based on the provided context, while SQuAD2.0 contains unanswerable questions as well.

In this project, the SQuAD dataset is utilized to fine-tune a HuggingFace model (bert-large-uncased-whole-word-masking-finetuned-squad) for question answering. Subsequently, the fine-tuned model is used to create a Gradio interface, enabling users to interactively input context and questions to receive answers from the model.

App Screenshots

Gradio Interface

Gradio Interface 1 Gradio Interface 1 Gradio Interface 1 Gradio Interface 1 Gradio Interface 1

Installation

To run the notebook, install the required libraries:

!pip install datasets evaluate transformers[sentencepiece]
!pip install accelerate
!apt install git-lfs
!pip install datasets
!pip install transformers datasets torch gradio



About

This project showcases how to fine-tune a HuggingFace model with the SQuAD dataset and create a Gradio interface for interactive question answering, enabling users to input context and questions and receive model-generated answers.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published