A hybrid movie recommendation system combining Neural Collaborative Filtering with semantic search, featuring cross-attention mechanisms and temporal modeling.
This system implements a sophisticated movie recommendation engine that combines:
- Neural Collaborative Filtering with cross-attention for personalized ratings
- FAISS-powered semantic search for content discovery
- Temporal feature modeling using cyclic encodings
- Rich metadata integration for both users and items
- Cross-attention mechanism for user-item interaction modeling
- Temporal feature integration with cyclic encodings
- Metadata-aware embeddings for cold-start handling
- Diversity-aware recommendation generation
- BERT-based text embeddings (all-mpnet-base-v2)
- FAISS similarity search for efficient retrieval
- Genre-aware diversity scoring
- Cross-validation based evaluation
- Interactive command-line interface
- Personalized movie recommendations
- Semantic movie search
- Similar movie discovery
- User similarity analysis
- Setup Environment
git clone https://github.com/yourusername/RecSys.git
cd RecSys
python -m venv venv
source venv/bin/activate # or 'venv\Scripts\activate' on Windows
pip install -r requirements.txt- Run the System
python run.pyfrom src.controller import MovieRecommenderSystem
recommender = MovieRecommenderSystem()
results = recommender.search_movies("action movies with dragons")recommendations = recommender.get_recommendations(user_id=42, n_rec=5)similar_movies = recommender.similar_items(movie_id=123, k=5)predicted_rating = recommender.predict(user_id=42, movie_id=123)RecSys/
├── src/
│ ├── model/
│ │ └── Retrieval.py # Neural CF implementation
│ ├── search/
│ │ └── semantic_search.py # Semantic search engine
│ ├── controller/
│ │ └── controller.py # System coordination
│ ├── view/
│ │ └── view.py # CLI interface
│ └── utils/
│ └── logger.py # Logging utilities
Input → Embeddings → Cross-Attention → MLP → Rating Prediction
↑ ↑ ↑
└─────────User/Item Features
└───────────Temporal Features
Query → BERT Embedding → FAISS Index → Reranking → Results
↑
Precomputed Movie
Embeddings
- Rating Prediction: RMSE ≈ 0.85
- Ranking: NDCG@10 ≈ 0.72
- Search: MAP ≈ 0.68
- Response Time: < 100ms
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.
Precious - @nwaimo
Project Link: https://github.com/nwaimo/RecSys