Skip to content

MJAHMADEE/Extractive_Question_Answering

Repository files navigation

Extractive Question Answering with BERT 📖🔍

Python PyTorch NLP

This repository demonstrates an Extractive Question Answering system implemented using BERT (Bidirectional Encoder Representations from Transformers). It fine-tunes a pre-trained BERT model on the PQuAD (Persian Question Answering Dataset) to predict the answer to a question based on the content of a given passage.

Features 🌟

  • Utilizes the bert-base-parsbert-uncased model from Hugging Face's Transformers library.
  • Supports processing and analysis of Persian language datasets for question answering.
  • Implements training, validation, and testing phases with comprehensive data preprocessing.
  • Provides visualizations for answer distribution and performance metrics.

Setup and Installation 🛠️

  1. Clone the repository.
  2. Install the required dependencies: transformers, torch, pandas, numpy, tqdm.
  3. Download and prepare the PQuAD dataset.

Data 📁

The project uses the PQuAD (Persian Question Answering Dataset), which consists of questions, passages, and answers. The dataset is structured to train and evaluate extractive question answering models.

Training and Evaluation 🚀

  • Fine-tune the BERT model on the PQuAD dataset.
  • Utilize a custom training loop to manage the training process and metrics calculation.
  • Evaluate the model's performance using precision, recall, and F1-score on the test dataset.

Results 📊

  • The model's performance is showcased through metrics such as exact match (EM) and F1-score.
  • Training and evaluation processes are detailed, with results showing the effectiveness of the model in understanding and answering questions based on given passages.

Contributing 🤝

We welcome contributions to enhance the functionality and performance of the question answering system. Feel free to fork the repository, make changes, and submit a pull request.

License 📜

The project is licensed under the MIT License. See the LICENSE file for more details.

Acknowledgements 🙌

  • Hugging Face's Transformers library for providing the powerful and efficient pre-trained models.
  • Authors of the PQuAD dataset for creating and distributing a quality dataset for Persian question answering research.

For more details, please visit the GitHub repository.