301 lines
11 KiB
Markdown
301 lines
11 KiB
Markdown
# Architecture
|
||
|
||
## MySQL Database
|
||
|
||
**[`example.sql`](https://download.东北大学.com/gitsrc/example.sql) can be an example MySQL database that can be directly used and contains complete movie data.**
|
||
|
||
1. **Table: category_search** (Stores records of category-based searches by users)
|
||
+ **id** : int(11) - Primary key
|
||
+ **user_id** : int(11) - Foreign key referencing the `id` in the `user` table
|
||
+ **category_id** : int(11) - Foreign key referencing the `id` in the `genre` table
|
||
+ **search_times** : int(11) - Tracks the number of times a user has searched in a specific category
|
||
2. **Table: genre**
|
||
+ **id** : int(11) - Primary key
|
||
+ **name** : varchar(50) - Name of the genre
|
||
+ **rating** : decimal(3,1) - Stores the average rating of movies in this genre
|
||
3. **Table: movie**
|
||
+ **id** : int(11) - Primary key
|
||
+ **title** : varchar(255) - Title of the movie
|
||
+ **release_date** : date - Release date of the movie
|
||
+ **imdb_url** : varchar(255) - URL of the movie’s IMDb page
|
||
+ **genres** : varchar(255) - Stores genre IDs as an array (e.g., "2,4,5")
|
||
+ **rating_count** : int(11) - Number of ratings the movie has received
|
||
+ **average_rating** : decimal(3,1) - Average rating of the movie
|
||
+ **actor** : text - Stores a comma-separated string of lead actors (e.g., "AAA, BBB")
|
||
+ **similar_movie** : varchar(255) - Stores IDs of similar movies as an array (e.g., "2,3,4")
|
||
4. **Table: occupation**
|
||
+ **id** : int(11) - Primary key
|
||
+ **name** : varchar(50) - Name of the occupation
|
||
5. **Table: rating** (Stores individual rating records)
|
||
+ **rating_id** : int(11) - Primary key
|
||
+ **user_id** : int(11) - Foreign key referencing `user_id` in the `user_default` table
|
||
+ **item_id** : int(11) - Foreign key referencing `id` in the `movie` table
|
||
+ **rating** : int(11) - User’s rating for a specific movie
|
||
+ **time** : datetime - Timestamp of the rating
|
||
6. **Table: search** (Stores records of keyword-based searches by users)
|
||
+ **id** : int(11) - Primary key
|
||
+ **user_id** : int(11) - Foreign key referencing the `id` in the `user` table
|
||
+ **keyword** : varchar(255) - The keyword used in the search
|
||
+ **search_times** : int(11) - Number of times a user has searched for this keyword
|
||
7. **Table: user**
|
||
|
||
:::danger
|
||
**<font style="color:#E4495B;">Note:</font>**<font style="color:#E4495B;"> The </font>`<font style="color:#E4495B;">user</font>`<font style="color:#E4495B;"> table stores registered users of the website, while </font>`<font style="color:#E4495B;">user_default</font>`<font style="color:#E4495B;"> stores users from the movie rating dataset.</font>
|
||
|
||
:::
|
||
|
||
+ **id** : int(11) - Primary key
|
||
+ **email** : varchar(255) - User’s email address
|
||
+ **nickname** : varchar(100) - User’s nickname
|
||
+ **user_type** : char(1) - Stores either "U" for Normal User or "P" for Producer
|
||
+ **password** : varchar(255) - Hashed password of the user
|
||
8. **Table: user_default**
|
||
+ **user_id** : int(11) - Primary key
|
||
+ **age** : int(11) - User’s age
|
||
+ **gender** : char(1) - Stores "M" for male or "W" for female
|
||
+ **occupation** : int(11) - Foreign key referencing `id` in the `occupation` table
|
||
+ **zip_code** : varchar(10) - User’s zip code
|
||
|
||

|
||
|
||
## Python Project
|
||
|
||
```plain
|
||
filmSystem
|
||
│ actor.py
|
||
│ app.py
|
||
│ extensions.py
|
||
│ helpers.py
|
||
│ models.py
|
||
│ similarity_recommend.py
|
||
│
|
||
├─.idea
|
||
│ │ .gitignore
|
||
│ │ deployment.xml
|
||
│ │ jsLibraryMappings.xml
|
||
│ │ misc.xml
|
||
│ │ modules.xml
|
||
│ │ workspace.xml
|
||
│ │ 电影推荐系统.iml
|
||
│ │
|
||
│ └─inspectionProfiles
|
||
│ profiles_settings.xml
|
||
│
|
||
├─dashboard
|
||
│ │ views.py
|
||
│ │ __init__.py
|
||
│ │
|
||
│ └─__pycache__
|
||
│ views.cpython-312.pyc
|
||
│ __init__.cpython-312.pyc
|
||
│
|
||
├─ml-100k
|
||
│ └─ml-100k
|
||
│ allbut.pl
|
||
│ mku.sh
|
||
│ README.MD
|
||
│ u.data
|
||
│ u.genre
|
||
│ u.info
|
||
│ u.item
|
||
│ u.occupation
|
||
│ u.user
|
||
│ u1.base
|
||
│ u1.test
|
||
│ u2.base
|
||
│ u2.test
|
||
│ u3.base
|
||
│ u3.test
|
||
│ u4.base
|
||
│ u4.test
|
||
│ u5.base
|
||
│ u5.test
|
||
│ ua.base
|
||
│ ua.test
|
||
│ ub.base
|
||
│ ub.test
|
||
│
|
||
├─movies
|
||
│ │ views.py
|
||
│ │ __init__.py
|
||
│ │
|
||
│ └─__pycache__
|
||
│ views.cpython-312.pyc
|
||
│ __init__.cpython-312.pyc
|
||
│
|
||
├─recommendations
|
||
│ │ views.py
|
||
│ │ __init__.py
|
||
│ │
|
||
│ └─__pycache__
|
||
│ views.cpython-312.pyc
|
||
│ __init__.cpython-312.pyc
|
||
│
|
||
├─scripts
|
||
│ │ genre.sql
|
||
│ │ movie.sql
|
||
│ │ occupation.sql
|
||
│ │ rating.sql
|
||
│ │ user_default.sql
|
||
│ │ 生成SQL.ipynb
|
||
│ │
|
||
│ └─src
|
||
│ u.data
|
||
│ u.genre
|
||
│ u.info
|
||
│ u.item
|
||
│ u.occupation
|
||
│ u.user
|
||
│
|
||
├─static
|
||
│ bg.webp
|
||
│ chart.js
|
||
│ favicon.ico
|
||
│ search_bg.png
|
||
│
|
||
├─templates
|
||
│ auth.html
|
||
│ dashboard.html
|
||
│ detail.html
|
||
│ navbar.html
|
||
│ recommendations.html
|
||
│
|
||
└─__pycache__
|
||
app.cpython-312.pyc
|
||
extensions.cpython-312.pyc
|
||
helpers.cpython-312.pyc
|
||
models.cpython-312.pyc
|
||
```
|
||
|
||
# User Guide
|
||
|
||
Welcome to use the movie recommendation system! This user guide will help you fully understand the use of this system.
|
||
|
||
:::danger
|
||
⚠️ <font style="color:#E4495B;">The copyright of this software system exclusively belongs to </font>**<font style="color:#E4495B;">Li Qiaoru</font>**<font style="color:#E4495B;">. Any unauthorized copying, reprinting or other infringement will be subject to legal consequences.</font>
|
||
|
||
:::
|
||
|
||
## Login & Register
|
||
|
||
We first type the website into the browser, which will bring us to the login page.
|
||
|
||

|
||
|
||
As a new user, we click on the "Register" button, which will take us to the registration page.
|
||
|
||

|
||
|
||
For the user role, noraml user and producer have slightly different content in the movie data analysis obtained.
|
||
|
||
:::color1
|
||
<font style="color:#07787E;"></font>ℹ️<font style="color:#07787E;"> Producer can obtain detailed data analysis report for each movie based on the gender, age and occupation of the rated users.</font>
|
||
|
||
:::
|
||
|
||
|
||
|
||

|
||
|
||
## Dashboard page
|
||
|
||
After successful login, we will enter dashboard page.
|
||
|
||

|
||
|
||
### Searching for movie
|
||
|
||
We offer two search modes: Search by category and search by keyword.
|
||
|
||

|
||
|
||

|
||
|
||
For searching by category, you can select multiple categories, and the system will recommend movies that fit both categories for you, sorted from high to low score.
|
||
|
||

|
||
|
||
For a keyword search, you can enter the name of the movie or the name of the actor, and the system will recommend movies that meet your criteria, again in order of high to low scores.
|
||
|
||

|
||
|
||
:::color1
|
||
ℹ️<font style="color:#07787E;"> If you do not select any category or enter any keywords, click the "Search" button and the system will display a list of all the movies.</font>
|
||
|
||
:::
|
||
|
||
When you click on the title of a movie, you are redirected to the movie details page.
|
||
|
||

|
||
|
||
### Personalized recommendation
|
||
|
||
At the bottom of the page is our personalized recommendation feature that recommends content based on your keyword search history and category search history.
|
||
|
||
:::info
|
||
💡 <font style="color:#0C68CA;">Personalized recommendation is also displayed on the </font>[movie detail page](about:blank)<font style="color:#0C68CA;">.</font>
|
||
|
||
:::
|
||
|
||
:::color1
|
||
ℹ️<font style="color:#07787E;"> You should have conducted at least one keyword or category search to use these features.</font>
|
||
|
||
:::
|
||
|
||

|
||
|
||
#### Your Frequent Search
|
||
|
||
When you have a keyword Search history, `Your Frequent Search` area will show you recommended movie cards. Based on your keyword search history and frequency, the system will prioritize the items you search for most often.
|
||
|
||

|
||
|
||
Up to 12 cards will be displayed at a time, click the `Load More` button to get more recommendations.
|
||
|
||

|
||
|
||
#### Genres You Like
|
||
|
||
Similar to `Your Frequent Search`, `Genres You Like` displays recommendations generated from your category search history.
|
||
|
||
Likewise, `Genres You Like` give priority to the categories of movies you search for most often.
|
||
|
||

|
||
|
||
## Movie detail page
|
||
|
||
### Basic information and ratings
|
||
|
||
The movie details page shows the basic information and total score of the movie, as well as the ratio for each rating.
|
||
|
||

|
||
|
||
### Detailed ratings analysis
|
||
|
||
:::danger
|
||
⚠️ <font style="color:#E4495B;">This feature is only available for Producer users.</font>
|
||
|
||
:::
|
||
|
||
If you are a producer user, you will be able to see a detailed rating analysis based on the user's gender, age, and occupation.
|
||
|
||

|
||
|
||

|
||
|
||

|
||
|
||
### Similar movie recommendation
|
||
|
||
`More Like This` displays similar movie recommendations based on the movie information and the user's gender, age and career preferences. We show you the top 8 most similar movie recommendations.
|
||
|
||

|
||
|
||
### Personalized recommendation
|
||
|
||
:::color1
|
||
ℹ️<font style="color:#07787E;"> This feature is exactly the same as in the Dashboard page.</font>
|
||
|
||
:::
|
||
|