This script demonstrates how to train a movie genre classification model using TensorFlow. The model classifies movies into three genres: Western, History, and Musical. Uses the sample_mflix movies collection in Atlas
-
Install Python (version 3.6 or above) if you haven't already.
-
Install TensorFlow using pip:
pip3 install tensorflow
- Install the required additional modules:
pip3 install pymongo
-
Make sure you have a MongoDB Atlas account set up. If not, sign up for free at https://www.mongodb.com/cloud/atlas.
-
Clone this repository to your local machine or download the files.
-
Open the
movies.py
script in a text editor. -
Replace
<your_connection_string>
with your actual MongoDB Atlas connection string in theclient = pymongo.MongoClient('<your_connection_string>')
line. -
Open a terminal or command prompt and navigate to the project directory.
-
Run the script using the following command:
python3 movies.py
This will start the training process and display the progress and accuracy.
- Once the model is trained, it will be saved as
movie_genre_model.keras
in the current directory.
If you'd like to contribute to this project, feel free to fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE
file for more information.
For more information, you can refer to the following documentation: