Amruthayenikonda/News-Summarization-Hindi-TTS
๐ฐ News Sentiment Analysis with Hindi TTS ๐๏ธ

๐ Project Overview
This project is a news sentiment analysis tool that scrapes recent news articles for a given company, summarizes them, performs sentiment analysis, and generates a Hindi TTS (Text-to-Speech) summary. The analysis helps users understand media coverage trends and sentiment distribution.
๐ฅ Features
- Scrape news articles from selected sources.
- Summarize articles using the BART model.
- Perform sentiment analysis using TextBlob.
- Generate Hindi speech with gTTS.
- Provide a comparative analysis of different articles.
- FastAPI backend with endpoints for data access.
- Deployed on Hugging Face Spaces for easy access.
๐ Tech Stack
- Python (FastAPI, BeautifulSoup, Requests, Pandas, NLTK)
- YAKE (Keyword extraction)
- TextBlob (Sentiment analysis)
- Facebook BART Model (Summarization)
- gTTS (Hindi Text-to-Speech)
- FastAPI (Backend API development)
- Streamlit (User interface)
- Hugging Face Spaces (Deployment)
๐ฅ Installation & Setup
๐ ๏ธ 1. Clone the Repository
๐ฆ 2. Install Dependencies
โถ๏ธ 3. Run the FastAPI Server
API will be available at: http://127.0.0.1:8000/docs
๐ญ 4. Run the Streamlit UI (Optional)
run.py is there to serve as the entry point for running the application, handling initialization, and managing API or UI execution. ๐
๐ How to Use
1๏ธโฃ Access the API
Visit Your Hugging Face Space to test it directly.
2๏ธโฃ API Endpoints
Method
Endpoint
Description
GET
/scrape_news/{company}
Scrape news articles for a company
GET
/get_news/{company}
Get sentiment analysis report
GET
/get_tts/{company}
Get Hindi speech summary
3๏ธโฃ Example Request
๐ Model Details
๐น Summarization Model
- Uses Facebook BART (facebook/bart-large-cnn) for text summarization.
- Extracts key information from scraped news articles.
๐น Sentiment Analysis
- Uses TextBlob for polarity-based sentiment scoring.
- Classifies articles as Positive, Negative, or Neutral.
๐น Hindi TTS (Text-to-Speech)
- Uses gTTS (Google Text-to-Speech) to generate Hindi audio.
- Creates a spoken summary of sentiment analysis.
โ ๏ธ Assumptions & Limitations
- Scraped articles depend on website structure and may fail if changes occur.
- Sentiment analysis is based on text polarity and may not always capture nuances.
- Only supports English text input but generates Hindi speech.
๐ Deployment
๐ Live Demo You can try the application live on Hugging Face Spaces: ๐ฅ๏ธ News Summarization Hindi TTS
No account needed to access API docs and test endpoints!
๐ก Feel free to contribute or report issues! ๐ฏ
