Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
@@ -1,63 +1,74 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
##
|
36 |
-
Uses
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
-
|
60 |
-
|
61 |
-
|
62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
- `feedparser` for RSS feeds.
|
|
|
1 |
+
---
|
2 |
+
title: "News Summarizer"
|
3 |
+
emoji: "📰"
|
4 |
+
colorFrom: "blue"
|
5 |
+
colorTo: "green"
|
6 |
+
sdk: "gradio"
|
7 |
+
sdk_version: "3.50.2" # Update if needed
|
8 |
+
app_file: "app.py"
|
9 |
+
pinned: false
|
10 |
+
---
|
11 |
+
|
12 |
+
# Live Company News Analyzer
|
13 |
+
**A project by Sara Nimje - [Visit Portfolio Website](https://saranimje.github.io/)**
|
14 |
+
This application fetches live news articles for a company, analyzes sentiment, summarizes content, and converts it into Hindi audio.
|
15 |
+
## Objective:
|
16 |
+
I have developed a web-based application that extracts key details from multiple news articles related to a given company. The application performs sentiment analysis, conducts a comparative analysis, and generates a text-to-speech (TTS) output in Hindi. Users can input a company name and receive a structured sentiment report along with an audio summary, making the information more accessible and insightful.
|
17 |
+
# Project Setup
|
18 |
+
## Installation:
|
19 |
+
|
20 |
+
- Clone this repository -
|
21 |
+
`git clone https://github.com/saranimje/news-summarizer.git `
|
22 |
+
- Navigate to directory -
|
23 |
+
`cd news-summarizer`
|
24 |
+
|
25 |
+
- Install Dependencies -
|
26 |
+
`pip install -r requirements.txt`
|
27 |
+
|
28 |
+
- Run Gradio App -
|
29 |
+
`python app.py`
|
30 |
+
|
31 |
+
- Run API (Optional) -
|
32 |
+
`uvicorn api:app --reload`
|
33 |
+
|
34 |
+
# Model Details
|
35 |
+
## Summarization Model
|
36 |
+
- Uses transformers from Hugging Face.
|
37 |
+
- Model: `google/long-t5-tglobal-base`
|
38 |
+
|
39 |
+
## Sentiment Analysis
|
40 |
+
Uses default sentiment-analysis pipeline from Hugging Face.
|
41 |
+
|
42 |
+
## Topic Modelling
|
43 |
+
- Uses TF-IDF vectorization with NMF (Non-Negative Matrix Factorization) to extract key topics from news articles.
|
44 |
+
- Utilizes cosine similarity to measure relationships between articles.
|
45 |
+
|
46 |
+
## Text-to-Speech
|
47 |
+
Uses `gTTS (Google Text-to-Speech)`
|
48 |
+
## Translation
|
49 |
+
Uses `GoogleTranslator` (source: English, target: Hindi).
|
50 |
+
|
51 |
+
|
52 |
+
# API Development
|
53 |
+
This project includes a **FastAPI-based API** to fetch news articles and analyze them.
|
54 |
+
## **Endpoints:**
|
55 |
+
**1. Home**
|
56 |
+
- `GET /`
|
57 |
+
- Returns: `{"message": "News Summarization API is running!"}`
|
58 |
+
**2. Fetch News**
|
59 |
+
- `GET /news/?company_name=Tesla&article_number=5`
|
60 |
+
- Returns JSON output containing news articles and analysis.
|
61 |
+
# API Development
|
62 |
+
## Using Postman or Curl:
|
63 |
+
1. Open **Postman** or any API testing tool.
|
64 |
+
2. Send a `GET` request to:
|
65 |
+
` http://127.0.0.1:8000/news/?company_name=Tesla&article_number=5`
|
66 |
+
3. View JSON response with news articles and summaries.
|
67 |
+
|
68 |
+
## Third-Party API Usage
|
69 |
+
- **News Sources**: Google Search (`googlesearch` Python module).
|
70 |
+
- **Libraries Used**:
|
71 |
+
- `requests` for API calls
|
72 |
+
- `gensim`, `deep_translator`, `nltk` for text processing.
|
73 |
+
- `googlesearch` to fetch news links.
|
74 |
- `feedparser` for RSS feeds.
|