/RailwayLLM

Primary LanguageJupyter Notebook

Fine-Tuned BART Model for Text Summarization

Overview

This repository contains the script finetuned_bart.py, designed for fine-tuning, evaluating, and using the BART (Bidirectional and Auto-Regressive Transformers) model for text summarization. BART, developed by Facebook AI, excels in natural language understanding and generation tasks.

Features

  • Fine-Tuning: Adapt the BART model to specific characteristics of a custom dataset for improved summarization.
  • Summarization: Demonstrate the use of the fine-tuned model to generate summaries for new texts.

Requirements

  • Python 3.9
  • PyTorch
  • Transformers Library (Hugging Face)
  • NLTK

Dataset

https://uscode.house.gov/download/download.shtml

Usage

  1. Fine-Tuning the Model:

    • Fine-tune the BART model on your dataset by running the script. Ensure your dataset is compatible with the script's data processing functions.
    • Adjust hyperparameters like batch size, learning rate, and epochs as needed.
  2. Generating Summaries:

    • Generate summaries for new text inputs using the fine-tuned model.
    • The generate_summary function in the script takes a text input and outputs its summary.

Customization

Modify the script to meet specific requirements, such as changing the dataset, adjusting preprocessing steps, tweaking model parameters, or using different evaluation metrics.

RailwayLLM