Skip to content

SrTorGonz/Grammar-Correction-System-using-T5-Transformers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Grammar Correction System using T5 Transformers

This repository contains a complete Natural Language Processing (NLP) pipeline for grammatical error correction (GEC) using a Transformer-based architecture.

The project is divided into two stages:

  1. Model Training – Fine-tuning a T5-small model using the JFLEG dataset.
  2. Model Deployment – Interactive grammar correction application built with Gradio.

Project Structure

├── Modelo_final_H7_Deep_Learning.ipynb │ └── Training, fine-tuning, and evaluation of the T5 model

├── Corrector_ortográfico.ipynb │ └── Interactive application for testing the trained model

└── README.md


Overview

The objective of this project is to automatically correct grammatical, spelling, and fluency errors in English sentences while preserving their original meaning.

The system was trained using the JFLEG (JHU Fluency-Extended GUG Corpus) dataset and implemented with the Hugging Face Transformers framework.


Features

  • Grammar correction
  • Spelling correction
  • Sentence fluency improvement
  • Fine-tuned T5 Transformer
  • Hugging Face integration
  • Interactive Gradio interface
  • End-to-end NLP pipeline

Technologies Used

  • Python
  • PyTorch
  • Hugging Face Transformers
  • Hugging Face Datasets
  • Gradio
  • SentencePiece
  • Jupyter Notebook

Dataset

This project uses the JFLEG dataset, a benchmark dataset designed for grammatical error correction and sentence fluency enhancement.

Dataset: https://huggingface.co/datasets/jhu-clsp/jfleg


Training Pipeline

The notebook Modelo_final_H7_Deep_Learning.ipynb includes:

  • Dataset loading
  • Data preprocessing
  • Reference expansion
  • Tokenization
  • Fine-tuning T5-small
  • Model evaluation
  • Model export

Application Demo

The notebook Corrector_ortográfico.ipynb demonstrates how to:

  • Load the trained model
  • Perform inference
  • Correct user-entered text
  • Deploy a simple web interface using Gradio

Download Trained Model

The trained model can be downloaded from:

Download Model

Example

Input:

She go to school every day.

Output:

She goes to school every day.


Author

Daniel Torres

Multimedia Engineer / Deep Learning Project

About

Fine-tuning and deployment of a T5 transformer model for grammatical error correction using the JFLEG dataset. Includes model training, evaluation, and an interactive Gradio application for real-time text correction.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors