# Personalized Chinese Tourism Recommendation Algorithm Based on Knowledge Graph
## 3 Methodology
### Personalized Travel Recommendation Algorithm Based on Knowledge Graph
#### 3.3.1 Modeling User Interests  
Personalized recommendation is based on the user's preferences, from the vast amount of information to find out the information that meets the user's interests, and recommend it to the user. Because of the different interests of each user, the recommended objects are also different. Therefore, prior to a personalized recommendation, constructing a user interest model and applying it to the recommendation process can improve the quality of the recommendation system [27]. In the recommendation based on the Knowledge Graph, the entities corresponding to the items to be recommended in the Knowledge Graph are usually integrated into the recommendation system. These recommendation methods only describe the user's interest from the entity level, and do not make use of the attribute information of the item, and cannot deeply dig into the user's preference for the attribute of the item [28; 29]. In the Knowledge Graph of tourist attractions, there are many attributes of tourist attractions besides tourist attractions' entity. If making full use of these attributes' information, they can express the user's interest in a more fine-grained manner.  
Aiming at the problem that entity attributes are not considered in the recommendation based on the Knowledge Graph, this paper proposes a new method of user interest modeling based on the entity attributes in the Knowledge Graph. By using the Knowledge Graph of tourist attractions, we are mining users' interest in the attributes of tourist attractions from the attribute level, constructing a user interest model, expressing user interest in a more granular manner, and integrating it into the recommendation system to further improve the recommendation performance. The user's attention to the tourist attractions is usually focused on the attribute of the tourist attractions, and the interest degree of the user is calculated, that is, the vector representation of the user under the attribute of the tourist attractions is calculated. According to the B-TransD model, the user interest vector is calculated. First define a set of triples for user attributes:  
\[T_{u}=\left\{(h,r,t|h\in V_{u}^{+})\right\} \tag{6}\]  
Among them, \(t_{a}\) is the set of historically visited tourist attractions of the user and is the corresponding entity of tourist attractions in the Knowledge Graph.  
In order to obtain more fine-grained user interest, it is necessary to understand the user's preference for the attributes of tourist attractions. Preference indicates that users have different degrees of attention to different attributes. To obtain user preference, firstly, it is necessary to calculate the attention degree of users to attributes, that is, to calculate the weight of each attribute in the historically visited tourist attractions. Given the vector of the tourist attractions, attributes, and attribute values, the weight of the attribute \(r_{a}\) in tourist attractions \(v\) is as follows:  
\[wr_{a}=\frac{exp((hM_{r_{a}})^{T}r_{a})}{\sum_{(h,r,t)\in T_{u}^{exp((hM_{r}) \mid T_{r})}}} \tag{7}\]Among them, \(h\) and \(r_{a}\) are the vector forms of the tourist attractions and attributes obtained by B-TransD training, and \(M_{r_{a}}\) is the mapping matrix in B-TransD. Calculating the weight of each attribute of the user separately, the weighted sum of all attribute values in the set of historically visited attractions can represent the user interest vector. The expression is as follows:  
\[c_{u}=\sum_{(h_{a},r_{a},t_{a})\in T_{i}}w_{r_{a}}t_{a} \tag{8}\]  
Among them, \(t_{a}\)is the amount of attribute values obtained by the B-TransD training. User interest is represented by vectors of related items, rather than independent feature words, and the fixed vector dimensions reduce the size of the parameters.