How aliahmad552/fake_news_detection_and_summarization_genai_project works
This is a FastAPI news summarization and credibility-analysis app. A user submits a query through the served page to /ask; the handler retrieves articles, turns them into documents, builds a FAISS index, retrieves relevant context, and returns a generated summary plus classifier output. The graph separates these stages and their model integrations. README capabilities are included where documented, but the excerpts do not show the template’s interaction code or details of API errors and response handling.
Main entry points: app.py FastAPI query handler · preprocessor.py Summary and analysis · index.html Query page
Components 15
User interface and API
- Query page
templates/index.html - FastAPI query handler
app.py - Summary and credibility result
app.py
News retrieval and search
- Article retrieval
model/preprocessor.py - Article documents
model/preprocessor.py - Text embeddings
model/preprocessor.py - FAISS index
model/preprocessor.py - Similarity retriever
app.py
Summarization and detection
- Summary and analysis
model/preprocessor.py - Analysis prompt
model/preprocessor.py - Output parser
model/preprocessor.py - Fake-news classifier
model/preprocessor.py
Other components
- News query user
- NewsAPI
- Llama 3 endpoint
Connections 18
- News query user → Query page: opens
README.md - Query page → FastAPI query handler: submits query
- FastAPI query handler → Query page: serves
app.py - FastAPI query handler → Article retrieval: calls
app.py - Article retrieval → NewsAPI: fetches articles
model/preprocessor.py - FastAPI query handler → Article documents: builds
app.py - FastAPI query handler → FAISS index: builds index
app.py - FAISS index → Text embeddings: embeds documents
model/preprocessor.py - FastAPI query handler → Similarity retriever: configures
app.py - FAISS index → Similarity retriever: provides search
app.py - FastAPI query handler → Summary and analysis: calls
app.py - Summary and analysis → Similarity retriever: retrieves context
model/preprocessor.py - Summary and analysis → Analysis prompt: formats prompt
model/preprocessor.py - Summary and analysis → Llama 3 endpoint: invokes model
model/preprocessor.py - Summary and analysis → Output parser: parses output
model/preprocessor.py - Summary and analysis → Fake-news classifier: classifies context
model/preprocessor.py - FastAPI query handler → Summary and credibility result: returns result
app.py - Summary and credibility result → News query user: presents result