Skip to content

witharyank/news-summarizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📰 AI News Summarizer

Python Streamlit HuggingFace PyTorch License: MIT

A modern, AI-powered web application that automatically summarizes long news articles using Hugging Face Transformers and Streamlit. Built with performance optimization and simplicity in mind, the app uses efficient chunk processing and optimized PyTorch inference for fast, real-time summarization.

🔗 Live Demo | 🐙 GitHub Repository


✨ Features

  • 🧠 AI-Powered Summarization: Uses the pretrained sshleifer/distilbart-cnn-12-6 model for high-quality abstractive summarization.
  • 🔗 Intelligent URL Scraping: Automatically fetches the article, extracts the core content (filtering out ads/boilerplates), and parses webpage title/domain metadata.
  • 📝 Direct Text Summarization: Instantly summarize pasted text from blogs, research papers, or documentation.
  • ⚙️ Configurable Settings: Choose between Short, Medium, or Long summaries in Paragraph or Bullet Points format.
  • 🎭 Sentiment Analysis: Enable optional sentiment tone classification powered by a cached DistilBERT model.
  • 🏷️ Topic Keywords: Automatically extracts and displays top keywords as interactive styled badges.
  • 📜 Recent Summaries (History): Sidebar panel remembers the last 5 summarized articles during the session.
  • 📊 Rich Analytics: Custom progress bars showing compression ratios, time saved, word counts, and language check badges.
  • 💾 One-Click Export: Easily download summaries as .txt files or copy them with a single click.
  • 🎨 Glassmorphic Dark UI: Responsive interface with custom CSS styling, linear gradients, card layouts, and subtle transitions.

🛠️ Tech Stack

Component Technology
Frontend Streamlit
Language Python
NLP Framework Hugging Face Transformers
Backend PyTorch
Web Scraping BeautifulSoup4, Requests
Model DistilBART CNN-12-6

🚀 Installation & Setup

  1. Clone the Repository

    git clone https://github.com/witharyank/news-summarizer.git
    cd news-summarizer
  2. Create a Virtual Environment

    Windows:

    python -m venv .venv
    .venv\Scripts\activate

    macOS/Linux:

    python3 -m venv .venv
    source .venv/bin/activate
  3. Install Dependencies

    pip install -r requirements.txt
  4. Run the Application

    streamlit run news_summarizer_app.py

🏗️ Application Workflow

graph TD
    A[User Input: URL or Text] --> B[Article Extraction]
    B --> C[Text Cleaning]
    C --> D[Chunk Processing]
    D --> E[DistilBART Summarization]
    E --> F[Summary Generation]
    F --> G[Analytics + Download Option]
Loading

💡 Example Use Cases

  • 🗞️ News article summarization
  • 📄 Research paper overviews
  • ✍️ Blog summarization
  • 🏢 Corporate news digests
  • 🎓 Student study assistance
  • ⏱️ Quick content understanding

🔮 Future Improvements

  • Multi-language summarization
  • PDF support
  • Bullet-point summaries
  • Light/Dark theme toggle
  • Advanced transformer models
  • Docker deployment
  • Text-to-speech summaries
  • Summary quality scoring

👨‍💻 Author

Kumar Aryan
Computer Science Undergraduate interested in Artificial Intelligence, NLP Applications, Cloud Computing, and Full Stack Development.


🤝 Support the Project

If you like this project, please consider:

  • ⭐ Starring the repository
  • 🍴 Forking the project
  • 🛠️ Contributing improvements
  • 📢 Sharing with others

📝 License

This project is open-source and available under the MIT License.


Built with ❤️ using Python, Streamlit, Hugging Face Transformers, and PyTorch.

About

AI-powered Streamlit app that summarizes news articles using DistilBART. Paste text → choose summary length → get instant summaries.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages