Skip to content

samanta-sc/QuickSum

Repository files navigation

🌍 Multilingual Summarizer (Bengali + English)

A multilingual text summarizer built with Hugging Face Transformers that supports both Bengali and English.
This project demonstrates state-of-the-art abstractive summarization using mT5-small, optimized with ONNX runtime and 8-bit quantization for faster inference.


✨ Model Highlights

  • ✅ Supports two languages: Bengali + English
  • ✅ Transformer-based summarization using MT5ForConditionalGeneration
  • ✅ Evaluated with ROUGE metrics (best ROUGE-L = 0.0654)
  • ✅ Optimized with ONNX runtime + 8-bit quantization
  • ✅ Post-processing filters for cleaner summaries
  • Inference Speedup – Reduced runtime from 71s → 21s

📊 Datasets

Data columns:

  • description → Input text
  • summary → Target summary

⚙️ Model & Training

  • Tokenizer: MT5Tokenizer
  • Base Model: MT5ForConditionalGeneration (google/mt5-small)
  • Training Args:
    • learning_rate = 2e-5
    • num_train_epochs = 6
    • per_device_train_batch_size = 8
    • evaluation_strategy = "epoch"
  • Best Validation Loss: 0.8312 (after 6 epochs)

📈 Results

Metric Value
Validation Loss 0.8312
ROUGE-L 0.0654

⚡ Optimization

  • ✅ ONNX Runtime – reduced from 71.4s → 58.5s
  • ✅ 8-bit Quantization – reduced further to 21.4s

🛠️ Post-Processing

  • filter_short_sentences() → Removes sentences with < 3 words
  • Beam search decoding parameters:
    max_length = 500
    num_beams = 4
    early_stopping = True

📂 Repository Structure

QuickSum/
├── training/
│   └── training.ipynb           # Model training experiments, Evaluation & ROUGE scoring
│   
├── optimization/
│   ├── onnx_optimize.ipynb         # ONNX conversion + quantization
│   └── postprocess.ipynb           # Post-processing filters
│
├── static/
│   ├── css/                   # cascaded style file
│   └── js/                    # javascript file
│
├── templates/
│   └── index.html             # front end skeleton
│
├── .gitignore
├── LICENSE
├── README.md
└── requirements.txt

Setup Instructions

  1. Install Dependencies: Make sure you have Python installed on your system. Install the required Python libraries by running the following command:
pip install -r requirements.txt
  1. Run the FastAPI Server: To start the server, use the following command:
uvicorn server:app --reload

Once the server is running, you can access the API at:

📸 Demo

Summarizer API Bengali Text English Text

🧑‍💻 Tech Stack

  • Python
  • Hugging Face Transformers
  • PyTorch
  • ONNX Runtime
  • FastAPI

🎯 Key Takeaways

This project highlights:

  • Using Transformer-based architectures
  • Handling multilingual NLP tasks
  • Model training + evaluation + optimization
  • Applying quantization for production-ready inference

📬 Contact

If you'd like to discuss NLP, transformers, or optimization techniques, feel free to connect! 🚀

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages