This is a movie recommendation system based on a Neural Collaborative Filtering model, served via a RESTful API using the Flask framework.
- Model Training: Trigger the model training process via an API call.
- Real-time Recommendations: Get instant movie recommendations for a specific user.
- RESTful API: Recommendation functionality is exposed through an easy-to-integrate API.
- Automated Documentation: Interactive API documentation is auto-generated using Flasgger (Swagger).
- Backend: Flask, Flask-CORS
- Machine Learning: PyTorch, Pandas, Scikit-learn
- API Docs: Flasgger
- Dependency Management: Poetry
- Ensure you have Python 3.11+ installed.
- Ensure you have Poetry installed.
# Clone the repository
git clone https://github.com/YOUR_USERNAME/NeuralRec-System.git
cd NeuralRec-System
# Install dependencies using Poetry
poetry installThis project uses the MovieLens (small) dataset.
# Download and extract the dataset
wget https://files.grouplens.org/datasets/movielens/ml-latest-small.zip
unzip ml-latest-small.zip -d ml-latest-small/
# (Optional) Remove the zip file
rm ml-latest-small.zippoetry run python app.pyThe service will be running at http://127.0.0.1:5001.
After starting the service, you can view detailed information about all APIs and test them interactively at:
Triggers the model training process. The latest model is automatically saved upon completion.
- Request Body:
(empty) - Success Response:
{ "status": "success", "message": "Model training completed and saved" }
Gets a list of movie recommendations for a given user ID.
- Request Body:
{ "userId": 1, "movieId": 2 } - Success Response:
{ "status": "success", "data": [10, 25, 150, 300, 550] }
Manually saves the current state of the model.
- Request Body:
(empty) - Success Response:
{ "status": "success", "message": "Model saved successfully" }
This project is licensed under the MIT License.