A NLP Text Summarization using Transformers, FastAPI and CI/CD Deployment
Overview:
The Text Summarization project is an end-to-end implementation designed to automatically generate concise summaries from large bodies of text. This project leverages advanced Natural Language Processing (NLP) techniques to create an effective text summarizer using the Transformer architecture. The application is designed for ease of use, offering a FastAPI-based web interface to interact with the model, and includes robust deployment pipelines for real-time usage.
Key Features:
-
End-to-End Pipeline: Complete ML pipeline covering data ingestion, transformation, model training, and evaluation.
-
FastAPI Interface: Provides a simple and efficient REST API to generate summaries on-the-fly.
-
Model Training and Evaluation: Utilizes state-of-the-art Transformer models from Hugging Face's transformers library.
-
AWS CI/CD Deployment: Implements continuous integration and deployment using GitHub Actions, Docker, and AWS EC2 for scalable deployment.
-
ROUGE Score Evaluation: Measures the quality of the summaries using the ROUGE metric, a standard for summarization tasks.
Technical Details:
-
Languages & Libraries: Python, FastAPI, Uvicorn, Transformers, PyTorch, Hugging Face, Pandas, NLTK, and more.
-
Architecture: The project uses a modular architecture with separate components for data ingestion, validation, transformation, model training, and evaluation, making it scalable and maintainable.
-
Deployment: Deployed on AWS EC2 using Docker for containerization. The project supports continuous deployment via GitHub Actions, ensuring that the application is always up-to-date with the latest code changes.
Project Workflow:
-
Data Ingestion: Automatically downloads and extracts datasets required for training.
-
Data Validation: Ensures that all required files are present and correctly formatted before processing.
-
Data Transformation: Tokenizes and processes text data into a format suitable for model training.
-
Model Training: Trains a sequence-to-sequence model (e.g., PEGASUS) on the prepared data.
-
Model Evaluation: Evaluates the model's performance using the ROUGE score.
-
Prediction: The trained model is served via a FastAPI endpoint, allowing for real-time text summarization.
Deployment Strategy:
The project includes detailed instructions and scripts for deployment on AWS:
-
Dockerized Application: The application is containerized using Docker, ensuring consistent behavior across different environments.
-
EC2 Hosting: The Docker container is deployed on an AWS EC2 instance, which serves as the backend for the FastAPI application.
-
GitHub Actions: Automates the deployment process, pushing updates to the EC2 instance whenever the codebase is modified.
Please visit the GitHub page for additional information.