CoolFace
Apppublic

Amruthayenikonda/News-Summarization-Hindi-TTS

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
App README

๐Ÿ“ฐ News Sentiment Analysis with Hindi TTS ๐ŸŽ™๏ธ

Alt

๐Ÿ“Œ 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! ๐ŸŽฏ