How kaustubhvaidya404/news-summary-ai works
Main Components
• Client Layer
• Web Browser (end user interacting with Streamlit UI)
• HTTP Client (cURL or other tools calling FastAPI)
• Presentation Layer
• Streamlit App (app.py) running on port 8501
• FastAPI Server (api.py) running on port 8000
• Business Logic Layer (modules/)
• extract_articles.py (scrapes Times of India)
• analysis.py (frequency-based summarizer + VADER sentiment analyser)
• text_to_speech.py (translate + gTTS TTS engine)
• Utility Layer
• utils.py (shared helper functions)
• Development/Extension Layer (Jupyter config & pydeck extension under etc/ and share/)
• External Services & Libraries
• Times of India (news source via HTTP requests)
• NLTK (tokenization, VADER)
• translate library (text translation)
• gTTS (Google TTS engine)
Relationships & Data Flows
• Streamlit → calls modules directly for:
a) Article extraction → summarization → sentiment → optional TTS
b) Displays summary, sentiment charts, audio player
• FastAPI → exposes endpoints under /v1/company and /v1/company/audio
• On GET request: orchestrates the same module workflow, returns JSON or audio stream
• Modules interact in sequence:
User query → extract_articles → analysis (summarize + sentiment) → if requested, text_to_speech → return results
Architectural Patterns
• Layered (Presentation → Business → Utility)
• Separation of concerns:
• Frontend (Streamlit UI) vs. API (FastAPI) vs. Core Logic (modules)
• Stateless micro-service style (no persistent DB, each request re-runs the pipeline)
Technologies & Frameworks
• Python 3, Streamlit, FastAPI
• NLTK (sent_tokenize, word_tokenize, VADER)
• gTTS and translate library
• PyDeck Jupyter extension (development/visualization)