An interactive web application that extracts and summarizes articles from URLs. Built with Streamlit, Hugging Face's BART model, and various Python libraries, this tool is designed to efficiently generate concise, meaningful summaries of long articles, making it perfect for students, professionals, and casual readers.
- Article Extraction: Automatically extracts content from an article URL, cleaning up HTML and retaining only the main text.
- Abstractive Summarization: Uses the Hugging Face
BARTmodel to create a summary of the article, ensuring key points are captured in a brief format. - PDF Export: The summarized text is available for download as a formatted PDF with justified text for easy reading.
- Compression Ratio: Displays a compression ratio to help users understand how much shorter the summary is compared to the original article.
- Progress Tracking: Real-time updates on the summarization process, with a progress bar and estimated time remaining.
- Python: The core language of the application.
- Streamlit: For building the web interface.
- Transformers: Hugging Face’s pre-trained BART model for abstractive summarization.
- Requests & BeautifulSoup: For scraping and processing article content.
- ReportLab: For generating and exporting the summary as a PDF.
To run this project locally, you need Python installed on your system. Then, clone this repository and install the required dependencies:
-
Clone the repository:
git clone https://github.com/your-username/your-repo.git cd your-repo -
Create a virtual environment (optional but recommended):
python -m venv venv source venv\Scripts\activate # On Mac use `venv/bin/activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Run the app:
streamlit run app.py
Your app will be available at http://localhost:8501
- Enter the URL of an article you want to summarize in the input field.
- The app will fetch the article, extract its text, and display it.
- After processing, the summary will be shown on the page.
- You can download the summarized text as a PDF using the "Download Summary as PDF" button.
- The app will also display a compression ratio, indicating how much shorter the summary is compared to the original content.
For example, to summarize an article, you would simply paste the article's URL into the input field and click "Summarize." The app will fetch the content, process it, and display a concise summary with a download link for the PDF.
We welcome contributions! To contribute:
- Fork the repository.
- Create a new branch for your feature (
git checkout -b feature-branch). - Make your changes and commit them (
git commit -am 'Add feature'). - Push to the branch (
git push origin feature-branch). - Open a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Hugging Face: For the pre-trained BART model used for abstractive summarization.
- Streamlit: For providing an easy-to-use framework for creating web apps.
- BeautifulSoup: For scraping and processing HTML content.