How nexus69420/movie-recommender-streamlit works
Purpose and Runtime
This is a Python/Streamlit hybrid movie recommendation application. It combines TMDB-derived movie metadata with MovieLens user ratings to return five recommendations for a selected movie and user ID. The runnable application entry point is app.py; main.ipynb is likely the exploratory/training workflow.
Application Entry Point
app.py hosts the Streamlit web interface and recommendation orchestration. It accepts user-facing inputs—movie selection and user ID—and renders the recommended titles and fetched poster imagery.
Grounding:
• app.py
• README.md
Content-Based Recommendation Stage
The content model derives movie similarity from textual and categorical attributes: overview, genres, cast, keywords, and director. These signals form the movie-content representation used to find movies similar to the input title.
The training/preprocessing implementation is not visible in the supplied tree; main.ipynb is the likely location for dataset preparation and model experimentation.
Grounding:
• main.ipynb
• README.md
Collaborative Recommendation Stage
Collaborative filtering uses MovieLens user ratings and an SVD model from the Surprise library. Given a user ID, this component estimates that user’s affinity for candidate movies based on rating patterns shared with similar users.
Grounding:
• app.py
• README.md
Hybrid Ranking Boundary
The core system boundary is the hybrid combiner: content similarity generates relevance from the selected movie, while SVD-derived predictions personalize those candidates for the supplied user. The result is ranked and truncated to five movies before presentation.
Control flow: Streamlit input → content candidate/relevance scoring → collaborative prediction for user/candidates → combined ranking → five recommendations.
Grounding:
• app.py
• README.md
External Data and Services
TMDB supplies movie metadata used by the content-based side of the system. MovieLens supplies user-rating data for collaborative filtering. OMDb is called to retrieve poster images for displayed recommendations; this is an external API boundary and may require network access/API credentials.
Grounding:
• app.py
• README.md
Delivery Surface
The only declared delivery surface is a Streamlit web UI rather than a separate API or service layer. The notebook should be treated as an offline development/training environment, while app.py is the interactive inference and display runtime.
Grounding:
• app.py
• main.ipynb
Main entry points: main.ipynb Training workflow · app.py Content candidate scoring
Components 12
Offline development
- Training workflow · Prepares data and experiments with recommendation models.
main.ipynb - Content similarity model · Represents overview, genres, cast, keywords, and director.
- Surprise SVD model · Predicts user affinity from rating patterns.
Streamlit runtime
- Streamlit application · Interactive inference and presentation runtime.
app.py - Movie and user input
app.py - Content candidate scoring · Finds movies relevant to the selected title.
app.py - Collaborative prediction · Scores candidates for the supplied user ID.
app.py - Hybrid ranking · Combines relevance and personalized predictions, then keeps five.
app.py - Recommendation display · Renders five titles and their posters.
app.py
External data & APIs
- TMDB metadata · Provides attributes used for content similarity.
- MovieLens ratings · Provides user-rating patterns for collaborative filtering.
- OMDb poster API · Fetches poster imagery for displayed movies.
Connections 13
- TMDB metadata → Training workflow: metadata
- MovieLens ratings → Training workflow: ratings
- Training workflow → Content similarity model: builds
- Training workflow → Surprise SVD model: trains
- Streamlit application → Movie and user input: collects
- Movie and user input → Content candidate scoring: selected movie
- Content similarity model → Content candidate scoring: similarity
- Content candidate scoring → Collaborative prediction: candidates
- Surprise SVD model → Collaborative prediction: predictions
- Collaborative prediction → Hybrid ranking: user scores
- Content candidate scoring → Hybrid ranking: relevance
- Hybrid ranking → Recommendation display: five movies
- OMDb poster API → Recommendation display: posters