This project implements a movie recommendation system using vector search and cosine similarity. The system takes user input in the form of a movie title or overview and returns the most similar movies based on their embeddings.
- Vectorized search for movie recommendations
- Cosine similarity calculation for finding similar movies
- RESTful API built with Flask
- Docker support for easy deployment
- Python 3.10
- Flask
- txtai
- NumPy
- Gunicorn
- Pickle
-
Clone the repository:
git clone https://github.com/NexusAurora/MovieApp.git cd MovieApp
-
Build the Docker image:
docker build -t MovieApp .
-
Run the Docker container:
docker run -p 8000:8000 MovieApp
Once the application is running, you can make POST requests to the /search
endpoint to get movie recommendations.
- URL:
http://localhost:8000/search
- Method:
POST
- Body (JSON):
{
"query": "Your movie title or overview",
"results": 5
}
The response will be a JSON object containing the recommended movies and their probabilities:
[
{
"Output": {
"title": "Movie Title 1",
"overview": "Overview of Movie 1"
},
"Probability": 0.95
},
{
"Output": {
"title": "Movie Title 2",
"overview": "Overview of Movie 2"
},
"Probability": 0.92
}
]
- Import and parse dataset: Load the dataset containing movie titles and overviews.
- Extract relevant data: Keep only the title and overview, discarding other parameters.
- Calculate vector embeddings: Vectorize each overview and store the embeddings.
- Accept user input: Transform user input into an embedding.
- Find cosine similarities: Calculate the cosine similarities between the user input embedding and the movie embeddings.
- Return top results: Return the top N movies with the highest similarities.
This project is licensed under the MIT License. See the LICENSE file for details.
My Name
My GitHub Profile