Intelligent movie recommendation system based on TensorFlow + CNN + collaborative filtering algorithm - deep learning algorithm application (including WeChat applet, ipynb engineering source code) + MovieLens data set (7)


Insert image description here

Preface

This project focuses on the MovieLens dataset and uses the 2D text convolutional network model in TensorFlow. It combines the collaborative filtering algorithm to calculate the cosine similarity between movies and provides two different movie recommendation methods through user interaction by clicking on the movie.

First, the project uses the MovieLens dataset, which contains a large number of user ratings and comments on movies. This data is used to train collaborative filtering algorithms to recommend movies that are similar to the user's preferences.

Secondly, the project uses the 2D text convolutional network model in TensorFlow, which can process the text description information of movies. By learning the text features of the movie, the model can better understand the content and style of the movie.

When users interact with the mini program, there are two different ways to recommend movies:

  1. Collaborative filtering recommendation : Based on the user's historical ratings and collaborative filtering algorithm, the system will recommend movies that are similar to the user's preferences. This is a traditional recommendation method that recommends movies by analyzing the behavior of users and other users.

  2. Text convolutional network recommendation : Users can start the text convolutional network model by clicking on a movie or entering a text description. The model analyzes the text information of the movie and recommends other movies that match the input movie or description. This method pays more attention to the content and plot similarity of the movie.

Taken together, this project combines collaborative filtering and deep learning technology to provide users with two different but effective ways to recommend movies. This improves user experience and makes it easier for them to find movies that suit their tastes.

overall design

This part includes the overall system structure diagram and system flow chart.

Overall system structure diagram

The overall structure of the system is shown in the figure.
Insert image description here

System flow chart

The system flow is shown in the figure.

Insert image description here

The model training process is shown in the figure.

Insert image description here

The server operation process is shown in the figure.

Insert image description here

Operating environment

This part includes the Python environment, TensorFlow environment, back-end server, Django and WeChat applet environments .

Module implementation

This project includes 3 modules: model training, back-end Django, and front-end WeChat applet module. The function introduction and related code of each module are given below.

1. Model training

./ml-1mDownload the data set and extract it to a folder in the project directory . The data set is divided into user data users.dat, movie data movies.dat and rating data ratings.dat.

1) Data set analysis

The website address of the data set is http://files.grouplens.org/datasets/movielens/ml-1m-README.txt . Description of the data.

Related blogs: https://blog.csdn.net/qq_31136513/article/details/133124641#1_44

2) Data preprocessing

By studying the field types in the data set, we found that some are category fields and converted them into one-hot encoding. However, the fields of UserID and MovieID will become sparse, and the dimensions of the input data will expand sharply. Therefore, these fields will be converted when preprocessing the data. into numbers.

Related blogs: https://blog.csdn.net/qq_31136513/article/details/133124641#2_123

3) Model creation

Related blogs: https://blog.csdn.net/qq_31136513/article/details/133125845#3_50

4) Model training

Related blogs: https://blog.csdn.net/qq_31136513/article/details/133130704#4_57

5) Get the feature matrix

This part includes defining function tensors, generating movie feature matrices, and generating user feature matrices.

Related blogs: https://blog.csdn.net/qq_31136513/article/details/133130704#5_240

2. Backend Django

This module implements the encapsulation of recommendation algorithms and front-end data interaction functions.

Related blogs: https://blog.csdn.net/qq_31136513/article/details/133131103#2_Django_67

3. Front-end WeChat applet

This module implements user interaction and back-end data transmission functions, and performs front-end development through the WeChat developer platform.

1) Mini program global configuration file

The global configuration file usually starts with APP and includes app.js, app.json, app.wxssetc. These files are automatically generated by the WeChat developer platform when creating a new mini program.

Related blogs: https://blog.csdn.net/qq_31136513/article/details/133146411#1_75

2) Recommended movie page

Recommended movie page movies, including movies.js, movies.json, movies.wxml, movies.wxss. What is movies.jsrecorded is the logic layer; movies.wxmlwhat is recorded is the view layer; what is movies.wxssrecorded is the style sheet of the page elements; movies.jsonsimilarly app.json, what is recorded is the relevant configuration information of this page.

Related blogs: https://blog.csdn.net/qq_31136513/article/details/133146411#2_177

3) Personal information interface and user login record page

These two pages are automatically generated by the system when creating a new mini program and do not need to be changed. The following personal information page consists of files such as index.js, index.html, index.json, index.wxssand so on.

Related blogs: https://blog.csdn.net/qq_31136513/article/details/133146411#3_383

System test

This section includes model loss curves and test results.

1. Model loss curve

The model uses the MSE of the real score and the predicted score as the loss function. As the number of iterations increases, the loss on the training data and test data gradually decreases, and finally stabilizes. After 5 iterations, the loss stabilizes at 1.

The training loss is shown in the figure.

Insert image description here

The test loss is shown in the figure.

Insert image description here

2. Test effect

After the development of the front-end applet is completed, preview it in the WeChat developer platform. The operation interface is as shown in the figure.

Insert image description here

There are two recommendation method selection buttons on the Movies page, and there are 5 randomly displayed movie information below. Choose one of the methods for movie recommendation, that is, “同类型电影”the recommendation method, and then select one of the movies. For example, if you select the first movie on the current screen, Last Night, you can see that many movies of the same type are recommended, as shown in the figure. Show.
Insert image description here

Choose another method, that is “看过这个的还喜欢看”, the recommendation method, continue to select the first movie, and other movies will appear, as shown in the figure.
Insert image description here

Related other blogs

Intelligent movie recommendation system based on TensorFlow + CNN + collaborative filtering algorithm - deep learning algorithm application (including WeChat applet, ipynb engineering source code) + MovieLens data set (1)

Intelligent movie recommendation system based on TensorFlow+CNN+collaborative filtering algorithm - deep learning algorithm application (including WeChat applet, ipynb engineering source code)+MovieLens data set (2)

Intelligent movie recommendation system based on TensorFlow+CNN+collaborative filtering algorithm - deep learning algorithm application (including WeChat applet, ipynb engineering source code)+MovieLens data set (3)

Intelligent movie recommendation system based on TensorFlow + CNN + collaborative filtering algorithm - deep learning algorithm application (including WeChat applet, ipynb engineering source code) + MovieLens data set (4)

Intelligent movie recommendation system based on TensorFlow + CNN + collaborative filtering algorithm - deep learning algorithm application (including WeChat applet, ipynb engineering source code) + MovieLens data set (5)

Intelligent movie recommendation system based on TensorFlow + CNN + collaborative filtering algorithm - deep learning algorithm application (including WeChat applet, ipynb engineering source code) + MovieLens data set (6)

Project source code download

For details, please see my blog resource download page


Download other information

If you want to continue to understand the learning routes and knowledge systems related to artificial intelligence, you are welcome to read my other blog " Heavyweight | Complete Artificial Intelligence AI Learning - Basic Knowledge Learning Route, all information can be downloaded directly from the network disk without following any routines.
This blog refers to Github’s well-known open source platform, AI technology platform and experts in related fields: Datawhale, ApacheCN, AI Youdao and Dr. Huang Haiguang, etc., which has nearly 100G of related information. I hope it can help all my friends.

Guess you like

Origin blog.csdn.net/qq_31136513/article/details/133146987