This Flask application utilizes the Pegasus Transformer model by Google for conditional text summarization. It allows users to input large text and receive a concise summary, making it ideal for processing articles, reports, or any long-form text data.
- Text Summarization: Uses the PegasusForConditionalGeneration model to generate a summary for the input text.
- CUDA Optimization: Leverages CUDA if available, allowing for faster summarization on GPU devices.
- Responsive Web Interface: The application provides a user-friendly interface with index.html for input and output.html to display results.
- Input: The user submits text via a form on the home page.
- Text Tokenization: The input text is tokenized and encoded for the Pegasus model.
- Summarization: The model generates a summary with specified minimum and maximum length constraints.
- Output: The summary is decoded and displayed on the output page.
- Python >= 3.10
- Flask
- Transformers
- gunicorn
- sentencepiece
- torch
-
Clone the repository
git clone https://github.com/letsdoitbycode/Text-Summarization-Webapp.git cd Text-Summarization-Webapp -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install flask transformers torch sentencepiece gunicorn pip install requirements.txt #else you can do this directly -
Run the Flask app:
python app.py
Text-Summarization-Webapp/
│
├── templates/
│ └── index.html # HTML file for text input
│ └── output.html # Output file for a output of summarisation
├── venv # Virtual environment
├── README.md # This README file
├── app.py # Main Flask application
└── requirements.txt # requirement file
Contributions are welcome! Please open an issue or submit a pull request for any changes or improvements.

