How gaurav-163/news-recommender-system works
Project type and purpose
• This is a lightweight full-stack application with a single Flask/Gradio web front end, a machine-learning pipeline for embeddings, and a FAISS similarity search back end.
• Its purpose: accept a user’s news query, embed it, search for similar articles, and display recommendations.
File structure
• Top-level scripts:
• app.py – orchestrates the web UI and ML pipeline
• Articles.py – likely holds or loads the news article corpus
• Config/manifests:
• requirements.txt / pyproject.toml
• Web assets:
• templates/index.html
• static/styles.css
• No dedicated database directory—FAISS is used as the index store.
README insights
• Core libraries: Flask (or Gradio), sentence-transformers, FAISS, numpy
• Steps: preprocess → build FAISS index → encode query → search → display results
• Future scope: integrate live feeds, deploy via Flask/FastAPI
a. User Interface Layer
• Browser (static + templates served by Flask) or Gradio widget
• Endpoint: HTTP GET/POST or Gradio API call
b. Backend / Application Layer
• Flask application (app.py)
• Request handler: receives query, calls embedding service, queries FAISS, formats response
c. Embedding Service
• Sentence Transformer model: loads pre-trained weights, computes embeddings for articles and queries
d. FAISS Index Store
• FAISS index: stores article embeddings, supports nearest-neighbor search
e. Data Layer
• Articles.py or flat files: initial corpus of news articles
• (Future) Live Feed Ingestor microservice or scheduled loader
f. External Dependencies
• Docker/hosting (if deployed)
• Libraries: sentence-transformers, faiss-cpu, flask, numpy
Architectural patterns & design principles
• Separation of concerns: UI vs. business logic vs. ML vs. storage
• Modular pipeline: data ingestion → embedding → indexing → querying
• Stateless web layer + in-memory (or persisted) FAISS index
Elements
• Component labels: “Browser / Gradio UI”, “Flask App (app.py)”, “Sentence Transformer Model”, “FAISS Index”, “Articles Corpus”
• Optional: a note on future enhancements (live feed ingestor, deployment layer)