A scenic spot recommendation method enhanced by fusing user emotion and knowledge graph

By constructing a knowledge graph of tourist attractions and analyzing user sentiment, combined with graph neural networks and loss function optimization, the problem of inaccurate tourist attraction recommendations in existing technologies has been solved, achieving more accurate personalized recommendations.

CN115730138BActive Publication Date: 2026-01-16YANSHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211368217.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-03
Publication Date
2026-01-16
Estimated Expiration
2042-11-03

AI Technical Summary

Technical Problem

Existing attraction recommendation algorithms fail to adequately consider users' emotional feedback after visiting and how emotions change over time, resulting in inaccurate recommendation results. Furthermore, knowledge graph-based methods struggle to capture high-order relationships, leading to data sparsity issues.

Method used

A knowledge graph of tourist attractions is constructed, and a translation model is used to learn low-dimensional representations of entities and relationships. A multi-head attention mechanism and a graph neural network are introduced to aggregate neighbor information. A loss function optimization model is designed based on the time-varying function of user sentiment to calculate the similarity between user and attraction embeddings.

Benefits of technology

It improves the accuracy of personalized attraction recommendations, alleviates data sparsity, and enhances the authenticity and accuracy of attraction and user feature representations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115730138B_ABST
    Figure CN115730138B_ABST
Patent Text Reader

Abstract

The application discloses a kind of fusion user sentiment and knowledge graph enhanced scenic spot recommendation method, belong to scenic spot personalized recommendation field, including according to scenic spot attribute information, constructs scenic spot knowledge graph AKG;Using translation model TransR learns the low-dimensional representation vector of entity and relation in AKG as the initial input of model;Introduce multi-head attention mechanism to learn scenic spot attribute weight, adopt graph neural network to learn scenic spot embedding;According to historical interaction information, user visit scenic spot sequence is constructed in time sequence;From comment, the sentiment of user is analyzed, user sentiment change function is designed, and user interest embedding is learned;Loss function is designed to train model, user and scenic spot embedding are learned according to the model after training, similarity calculation is carried out, and scenic spot is recommended to user according to the result.The application makes full use of scenic spot attribute information, alleviates the sparsity of data, considers the change of real emotion of user, and improves the recommendation precision of personalized scenic spot.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of personalized attraction recommendation, and in particular to an attraction recommendation method enhanced by fusing user emotion and knowledge graph. BACKGROUND

[0002] With the continuous improvement of people's economic level, people begin to pursue a higher quality of life. Tourism can not only release work pressure and relieve mood, but also broaden horizons. With the improvement of the national economy, consumer demand tends to be more diversified and personalized. At present, the tourism attraction recommendation brings convenience to the user's travel. Although with the help of tourism websites, users can learn about tourism information in various places at any time and anywhere, select favorite tourism products, and develop travel plans that meet their needs.

[0003] However, in the environment of rapid development of mobile Internet and exponential growth of data volume, how tourism consumers choose more suitable tourism products from numerous tourism consumption data has an important and positive role in improving user experience and driving economic development. Therefore, how to solve the "information overload" problem from massive tourism data is worth studying.

[0004] The generation of tourism behavior is different from purchasing goods, watching videos, listening to music, browsing news, etc., which requires more time cost and economic cost. Therefore, the interaction matrix between users and attractions is more sparse. To solve the problem of data sparsity, additional information can be introduced, such as user / item attributes, social networks, and context information. As auxiliary information, the knowledge graph applied to the recommendation system can effectively alleviate the data sparsity, improve the accuracy of the recommendation result, and the recommendation result has interpretability. However, the current recommendation method based on knowledge graph mainly faces the following problems: the embedding-based method uses the semantic relationship in the knowledge graph to enrich the node representation of users and items, but it is difficult to capture the high-order relationship between entities; the path-based method uses the connection information in the graph to assist recommendation, but the complex user-item connection mode is decomposed into separate linear paths, which inevitably causes information loss. From the user's point of view, the user's subjective evaluation is an important manifestation of his preference. However, the existing attraction recommendation algorithm does not consider the emotional feedback (comments) of the user after visiting the attraction and the change of the emotion over time. Therefore, simply considering the interaction information between users and attractions cannot obtain the true feature representation of attractions or items, resulting in inaccurate recommendation results. SUMMARY

[0005] The technical problem to be solved by the present application is to provide an attraction recommendation method enhanced by fusing user emotion and knowledge graph, which fully considers the correlation information between attractions and the dynamic change of user emotion, forms a more real and accurate attraction and user feature representation, establishes a more accurate attraction recommendation model, and effectively improves the recommendation accuracy of personalized attractions.

[0006] To solve the above technical problems, the technical scheme adopted by the present application is:

[0007] A scenic spot recommendation method fusing user emotion and knowledge graph enhancement, comprising the following steps:

[0008] S1, according to the attribute information of the scenic spot, a scenic spot knowledge graph AKG is constructed;

[0009] S2, a translation model TransR is used to learn the low-dimensional representation vector of the entity and the relationship in the scenic spot knowledge graph AKG as the initial input of the model;

[0010] S3, in order to fully aggregate the high-order neighbor information of the scenic spot, a multi-head attention mechanism is introduced to learn the attribute weight of the scenic spot, and a graph neural network is used to learn the scenic spot embedding;

[0011] S4, according to the historical interaction information, a user access scenic spot sequence is constructed in chronological order;

[0012] S5, the emotional tendency of the user is analyzed from the comments, a user emotion change function is designed, and the user interest embedding is learned;

[0013] S6, a loss function is designed to train the model, the user and scenic spot embedding are learned according to the trained model, the similarity is calculated, and the scenic spot is recommended to the user according to the result.

[0014] The further improvement of the technical scheme of the present application is that in S1, the constructed scenic spot knowledge graph AKG is generated according to the attribute information of the scenic spot, a series of triples are generated, and the form is (scenic spot name, attribute, attribute value); wherein, the scenic spot name and the attribute value are entities in the scenic spot knowledge graph AKG, and the attribute is a relationship in the scenic spot knowledge graph AKG.

[0015] The further improvement of the technical scheme of the present application is that the specific steps of S2 are as follows:

[0016] 2.1, since the scenic spot contains multiple features and has multiple different relationships, in order to fully represent the entity features, the head and tail entities are mapped from the entity space to the corresponding relationship space, and the formula is:

[0017]

[0018] In the formula, e h , is the head and tail entity embedding in the entity space, is the head and tail entity and relationship embedding in the relationship space, d≠k, and the space transformation matrix

[0019] 2.2, according to the triangle rule of vector addition and subtraction, a score function is defined, and the formula is:

[0020]

[0021] 2.3, the random replacement of the head or tail entity in the triple generates a set of non-fact triples as negative samples, and the model is trained, and the loss function is:

[0022]

[0023] In the formula, And (h, r, t') is a non-fact triple constructed by randomly replacing the tail entity in the fact triple, sigma (·) is an activation function, and Sigmoid function is selected here; f r (h, t) is smaller, the loss is smaller, and f r (h, t') is larger, the loss is smaller; the layer models the entity and the relationship at the triple granularity, and the representation ability of the model is improved.

[0024] The further improvement of the technical scheme of the application is that the specific steps of S3 are as follows:

[0025] 3.1, the influence of the neighbor nodes on the scenic spots is different on different relationships, that is, different relationships r have different contributions to the representation of the entity h; in the case of the same complexity, in order to improve the calculation efficiency of the model, the inner product is used to calculate the attention score, and the formula is:

[0026] π (h, r, t) = (M r e t ) T (M r e h +e r ) (4)

[0027] In the formula, π (h, r, t) is the attenuation factor on the relationship r, which represents the amount of information propagation from the head entity h to the tail entity t controlled by the relationship r; M r is a spatial transformation matrix, e h , and represent the embedding of the head entity, the tail entity and the relationship respectively;

[0028] 3.2, the formula (4) is normalized by using the Softmax function, and the formula is:

[0029]

[0030] 3.3, let the triple set with the entity h as the head entity be That is, the entity t is a first-order neighbor of the entity h; in order to represent the first-order connection structure of the entity h, the first-order neighbor information of h is aggregated, and the formula is:

[0031]

[0032] 3.4, The information aggregation layer aggregates the features of the neighbor nodes by means of the graph neural network, and takes it as the feature vector of the head entity h, which is formally:

[0033]

[0034] In the formula, indicates the feature representation aggregated by the first-order neighbor entity, and the high-order neighbor entity representation is obtained in the same way, and the formula is:

[0035]

[0036]

[0037] 3.5, For the aggregation function f(·), three aggregation operations are performed: f: Respectively:

[0038] ①GCN aggregator, which uses a nonlinear activation function to add the features, and the formula is:

[0039]

[0040] In the formula, W ∈ R d′×d is the training parameter in the information iteration process, and b is the bias;

[0041] ②GraphSage aggregator, which concatenates two vectors and performs a nonlinear activation operation, and the formula is:

[0042]

[0043] In the formula, || represents the concatenation operation;

[0044] ③Bi-Interaction aggregator, which considers two feature interactions between e h and The formula is:

[0045]

[0046] In the formula, W1, is a trainable weight parameter, and is a Hadamard product;

[0047] 3.6, After L-layer propagation and aggregation, the multi-layer representation of the scenic spot is obtained, that is In order to fully guarantee the integrity of the feature information, the following method is used to represent the final feature of the scenic spot:

[0048]

[0049] In the formula, || represents splicing operation.

[0050] Further improvement of the technical scheme of the present application is that in S4, according to the historical record of the user visiting the scenic spot, the scenic spot is sorted according to the time of the comment to obtain the scenic spot visiting sequence of each user.

[0051] Further improvement of the technical scheme of the present application is that the specific steps of S5 are as follows:

[0052] 5.1, analyze the emotional tendency of the user from the comments of the user on the scenic spot, if the user u i has a positive comment emotion on the scenic spot s p , the emotional score of the user u i on the scenic spot s p is set as aff ip =1, otherwise aff ip =0;

[0053] 5.2, design a user emotion change function over time;

[0054] 5.3, calculate the feature vector of the user.

[0055] Further improvement of the technical scheme of the present application is that in 5.2, the specific steps of designing the user emotion change function over time are as follows:

[0056] 5.2.1, inspired by Newton's cooling law, the temperature of an object gradually cools over time, and the time decay formula is:

[0057] T(t)=α+βe (-kt) (14)

[0058] In the formula, α and β are constants, k is a time decay factor, and t is time;

[0059] 5.2.2, in the analysis of the user feature stage, the scenic spots recently visited by the user can better reflect the interests and hobbies of the user, and a greater weight is given to the features of the recently visited scenic spots, and the weight formula of the change over time is:

[0060]

[0061] In the formula, t us is the comment time of the user u on the scenic spot s, min(t us ) and max(t us ) respectively represent the time of visiting the first scenic spot and the last scenic spot in the scenic spot visiting sequence of the user u, and Δt us =max(t us )-t uldenotes the time interval between the first and the last visited POI of user u. us denotes the time interval between the first and the last visited POI of user u. us denotes the time interval between the first and the last visited POI of user u.

[0062] 5.2.3, the weight formula after normalization is:

[0063]

[0064] In the formula, S(u) is the POI visiting sequence of user u.

[0065] Further improvement of the technical scheme of the present application is that in 5.3, the user's emotional tendency reflected in the comprehensive comment and the change of the user's emotion over time are comprehensively considered, and the final feature representation formula of the user is:

[0066]

[0067] In the formula, eff ul is the emotional value of user u to POI l, is the feature representation of POI l calculated in 3.6.

[0068] Further improvement of the technical scheme of the present application is that the specific steps of S6 are as follows:

[0069] 6.1, the inner product operation is performed on the feature vectors of user u and POI s to predict the matching score of the two, and the formula is:

[0070]

[0071] 6.2, the BPR loss optimization model is used, and the algorithm considers that compared with the items that have not been interacted, the user prefers the items that have been interacted, that is, the predicted value of the former is higher, and the formula is:

[0072]

[0073] In the formula, (u, i, j) is the training set, i is the interest point that user u has interacted, which is recorded as a positive sample, j is the interest point that user u has no interaction behavior, which is recorded as a negative sample, is the inner product operation, and the result represents the probability that user u may interact with the interest point i, and sigma is a Sigmoid function.

[0074] 6.3, the POI knowledge graph representation learning loss function is combined, and the final optimization function is:

[0075]

[0076] In the formula, Θ is a model parameter, L2 regularization is used to prevent overfitting of the model, and λ is a regularization coefficient.

[0077] Thanks to the above technical solutions, the present application has achieved the following technical progress:

[0078] 1. The present application constructs a scenic spot knowledge graph according to scenic spot attribute information, enhances the connection between similar scenic spots, calculates the weight score according to the different contributions of different attributes to the scenic spots, and uses the graph neural network to propagate and aggregate layer by layer, thereby generating a low-dimensional dense vector representation of the scenic spots by aggregating the neighbor node information.

[0079] 2. The present application analyzes the user's subjective emotional tendency from the scenic spot comments: negative and positive, and designs a time decay function to simulate the feature that the user's interest decays over time, that is, the user will prefer to choose the scenic spot preferred in the recent period, and obtain an embedding representation that better reflects the user's preference.

[0080] 3. The present application learns the embedding representation of the scenic spots and users that integrates rich information, and improves the accuracy of personalized recommendation.

[0081] 4. The present application makes full use of the scenic spot attribute information, effectively alleviates the sparsity of the data, and fully considers the change of the user's real emotion, thereby improving the accuracy of personalized scenic spot recommendation. BRIEF DESCRIPTION OF DRAWINGS

[0082] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0083] Figure 1 is a knowledge graph scenic spot recommendation diagram of the present application;

[0084] Figure 2 is a scenic spot knowledge graph diagram constructed according to the attribute information of the scenic spots in the embodiment of the present application;

[0085] Figure 3 is a spatial transformation diagram in the embodiment of the present application;

[0086] Figure 4 is a user feature representation diagram in the embodiment of the present application. DETAILED DESCRIPTION

[0087] It is to be understood that the terms "including", "comprising", "having" and "with" used in the specification and the aforementioned appended claims, as well as the variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product or apparatus that comprises a list of steps or units is not necessarily limited to those steps or units which are expressly listed, but can include additional steps or units that are not expressly listed or inherent to such process, method, product or apparatus.

[0088] The embodiment of the present application provides a scenic spot recommendation method fusing user emotion and knowledge graph enhancement, solves the problem of "difficulty in obtaining real feature representation of scenic spots or projects by only considering the interaction information between users and scenic spots, and inaccuracy of recommendation results" in the prior art, and basically thinks as follows: dynamic change of user emotion and association information between scenic spots are fully considered, more real and accurate scenic spot and user feature representation is formed, a more accurate scenic spot recommendation model is established, user and scenic spot embedding is learned according to the trained model, similarity calculation is performed, and scenic spots are recommended to users according to the result.

[0089] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0090] The concepts and problems involved in the present application will be explained as follows:

[0091] User interaction matrix Y: the user u visits the scenic spot i and makes a comment, that is, it is considered that the two exist interaction, and y ui = 1, and y ui = 0 in other cases.

[0092] Scenic spot knowledge graph : The scenic spot knowledge graph is constructed according to the attribute information of the scenic spot and is composed of triples (scenic spot, attribute, attribute value). Formally, the scenic spot knowledge graph is represented as a triple set where h and t are entities in , representing the scenic spot name and the attribute value respectively, and r is the relationship in , representing the attribute relationship between entities. For example, the triple (Forbidden City, scenic spot level, 5A) represents the fact that the Forbidden City is a 5A-level scenic spot in China.

[0093] User visit sequence: according to the scenic spots visited by the user, the sequence is sorted according to time where i = 1, 2,..., M, corresponding to the scenic spot in the interaction matrix

[0094] The present application will be further described in detail in combination with the drawings and embodiments:

[0095] The subjective evaluation of the user on the project is an important embodiment of the preference of the user, such asFigure 1 As shown in the table, the user commented "climbing the mountain is tiring" after visiting Yaji Mountain, and the scenic spot is of "mountain" type, which is a negative emotional expression of the user, and the probability of selecting "mountain" type scenic spot will be smaller; on the contrary, the user's review after visiting the Temple of Heaven in spring shows a positive emotion, and the user is likely to continue to visit similar scenic spots such as the Summer Palace.

[0096] A scenic spot recommendation method combining user emotion and knowledge graph enhancement, comprising the following steps:

[0097] For scenic feature representation:

[0098] S1, according to the attribute information of the scenic spot, a scenic knowledge graph AKG (Attractive Knowledge Graph) is constructed;

[0099] As shown in the table, the user commented "climbing the mountain is tiring" after visiting Yaji Mountain, and the scenic spot is of "mountain" type, which is a negative emotional expression of the user, and the probability of selecting "mountain" type scenic spot will be smaller; on the contrary, the user's review after visiting the Temple of Heaven in spring shows a positive emotion, and the user is likely to continue to visit similar scenic spots such as the Summer Palace. Figure 2 As shown in the table, the user commented "climbing the mountain is tiring" after visiting Yaji Mountain, and the scenic spot is of "mountain" type, which is a negative emotional expression of the user, and the probability of selecting "mountain" type scenic spot will be smaller; on the contrary, the user's review after visiting the Temple of Heaven in spring shows a positive emotion, and the user is likely to continue to visit similar scenic spots such as the Summer Palace.

[0100] S2, a translation model TransR is used to learn the low-dimensional representation vector of the entity and relationship in the scenic knowledge graph AKG as the initial input of the model; first, the entity space is mapped to the relationship space, as shown in the table. Figure 3

[0101] 2.1, the scenic spot contains multiple features and multiple different relationships, in order to fully represent the entity features, the head and tail entities are mapped from the entity space to the corresponding relationship space, and the mapping is l: The corresponding relationship space vector is:

[0102]

[0103] In the formula, e h , is the embedding of the head and tail entities in the entity space, is the embedding of the head and tail entities and the relationship in the relationship space, d≠k, and the space transformation matrix

[0104] 2.2, in the relationship space, a distance-based scoring function is defined according to the triangle rule of vector addition and subtraction, and the formula is:

[0105]

[0106] ​2.3, training model, randomly replacing the head or tail entity in the fact triple, generating a non-fact triple as a negative sample, and its loss function is:

[0107]

[0108] In the formula, And (h, r, t') is a non-fact triple constructed by randomly replacing the tail entity in the fact triple, σ(·) is the activation function, and Sigmoid function is selected here. The f r (h, t) is smaller, the loss is smaller, and the f r (h, t') is larger, the loss is smaller. This layer models entities and relationships at the triple granularity, improving the representation ability of the model.

[0109] S3, to fully aggregate the high-order neighbor information of the scenic spot, introduce multi-head attention mechanism to learn the weight of scenic spot attribute, use graph neural network to learn scenic spot embedding, the specific steps are as follows:

[0110] 3.1, calculate the influence score of neighbor nodes on scenic spot features under different relationships, that is, different relationships r have different contributions to the representation of entity h. In the case of the same complexity, in order to improve the calculation efficiency of the model, the inner product is used to calculate the attention score, and the formula is:

[0111] π(h, r, t) = (M r e t ) T (M r e h +e r ) (4)

[0112] In the formula, π(h, r, t) is the decay factor on the relationship r, which represents the amount of information propagation from the head entity to the entity t controlled by the relationship r; W r is a spatial transformation matrix, e t , and represent the embedding of the head entity, the tail entity and the relationship respectively;

[0113] 3.2, normalize formula (4) using Softmax function, formula is:

[0114]

[0115] 3.3, let the triple set with entity h as the head entity be That is, entity t is the first-order neighbor of entity h. To represent the first-order connection structure of entity h, aggregate the first-order neighbor information of h, the formula is:

[0116]

[0117] 3.4, the information aggregation layer aggregates the neighbor node features by means of a graph neural network, and takes the feature vector of the head entity h, which is formally:

[0118]

[0119] In the formula, represents the feature representation aggregated by the first-order neighbor entity, and similarly, the high-order neighbor entity representation can be obtained, and the formula is:

[0120]

[0121]

[0122] 3.5, for the aggregation function f(·), the present application performs three aggregation operations: f: respectively:

[0123] ① GCN aggregator, which adopts a nonlinear activation function to add the features, and the formula is:

[0124]

[0125] In the formula, W ∈ R d′×d is the training parameter in the information iteration process, and b is the bias.

[0126] ② GraphSage aggregator, which splices two vectors and performs a nonlinear activation operation, and the formula is:

[0127]

[0128] In the formula, || represents the splicing operation.

[0129] ③ Bi-Interaction aggregator, which considers two feature interactions between e h and , and the formula is:

[0130]

[0131] In the formula, W1, is a trainable weight parameter, and is a Hadamard product. The aggregation function considers the interaction features between e h and , and can aggregate features from more similar entities.

[0132] 3.6, after L-layer propagation and aggregation, the multi-layer representation of the scenic spot is obtained, i.e. In order to fully guarantee the integrity of the feature information, the following method is used to represent the final feature of the scenic spot,

[0133]

[0134] In the formula, || represents the splicing operation.

[0135] For the user feature vector:

[0136] The scenic spot comment is a subjective self-impression of the user on the visited scenic spot. Extracting the emotion in the comment helps to analyze the information interested by the user, and the emotion model is used to obtain the emotional tendency of the user and the preference for the scenic spot attribute from the comment, so as to further improve the recommendation accuracy of the model. As shown in Figure 4 , it is a schematic diagram of user feature representation, which specifically includes the following steps:

[0137] S4, according to the historical interaction information, the user access scenic spot sequence is constructed in chronological order, specifically:

[0138] The user comments and scores on the scenic spot after visiting the scenic spot, that is, it is considered that there is an interaction between the user and the scenic spot, and the order of visiting the scenic spot is based on the comment time. According to this, the scenic spot access sequence of each user is established in chronological order Filter out the users whose sequence length is less than 2.

[0139] S5, analyze the emotional tendency of the user from the comment, design the user emotion change function with time, and learn the user interest embedding, the specific steps are as follows:

[0140] 5.1, the support vector machine is used to analyze the positive and negative emotions of the scenic spot comment, if the user u i has a positive comment emotion on the scenic spot s p , then the user u i has a positive emotion score aff p on the scenic spot s p , otherwise aff ip =0. ip

[0141] 5.2, which involves the user emotion change function with time, the steps are as follows:

[0142] 5.2.1, inspired by Newton's cooling law, the temperature of an object gradually cools down with time, and the time decay formula is:

[0143] T(t)=α+βe (-kt) (14)

[0144] In the formula, α and β are constants, k is the time decay factor, and t is the time.

[0145] 5.2.2, in the analysis of the user feature stage, the scenic spots recently visited by the user can better reflect the user's interest and hobby, and a greater weight is given to the features of the recently visited scenic spots, and the weight formula of the change with time is:

[0146]

[0147] where t us is the time of the comment of the user u on the attraction s, min(t us ) and max(t us ) represent the time of visiting the first attraction and the last attraction in the sequence of attractions visited by the user u, respectively, Δt us = max(t us )-t ul represents the time interval between the lth attraction and the last attraction visited by the user u, and Δt = max(t us )-min(t us ) represents the time interval between the first attraction and the last attraction visited by the user u.

[0148] 5.2.3, the weight formula after normalization is:

[0149]

[0150] where S(u i ) is the sequence of attractions visited by the user u i .

[0151] 5.2.4, the user's emotional tendency reflected in the comprehensive comment and the change of the user's emotion over time, the final feature representation formula of the user is:

[0152]

[0153] where eff ul is the emotional value of the user u on the attraction l, is the feature representation of the attraction l calculated by S36.

[0154] Generation of recommendation mechanism:

[0155] S6, design a loss function to train the model, and perform similarity calculation according to the user and attraction embedding learned during the model training process, and recommend attractions to the user according to the results; the specific steps are as follows:

[0156] 6.1, perform inner product operation on the feature vectors of the tourist u and the attraction s to predict the matching score of the two, the formula is:

[0157]

[0158] 6.2, use BPR loss optimization model, which believes that compared with the items that have not interacted, the user prefers the items that have interacted, that is, the predicted value of the former is higher, the formula is:

[0159]

[0160] where (u, i, j) is the training set, i is the interest point that user u has interacted with, denoted as positive sample, j is the interest point that user u has not interacted with, denoted as negative sample, is the inner product operation, and its result represents the probability of user u interacting with interest point i, and σ is the Sigmoid function.

[0161] 6.3, combined with the representation learning loss function of the scenic spot knowledge graph, the final optimization function is:

[0162]

[0163] where Θ is the model parameter, L2 regularization is used to prevent overfitting of the model, and λ is the regularization coefficient.

[0164] The Adam optimizer is used to optimize the model parameters according to the defined loss function.

[0165] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method of scenic spot recommendation enhanced by fusing user emotion and knowledge graph, characterized in that: The method comprises the following steps: S1, constructing an attraction knowledge graph AKG according to attraction attribute information; S2, learning low-dimensional representation vectors of entities and relationships in the attraction knowledge graph AKG by using a translation model TransR as initial input of the model; S3, introducing a multi-head attention mechanism to learn attraction attribute weights, and learning attraction embedding by using a graph neural network; The specific steps are as follows: 3.1, the influence of neighbor nodes on attractions is different on different relationships, that is, different relationships r have different contributions to the representation of entity h; in the case of the same complexity, in order to improve the calculation efficiency of the model, the inner product is used to calculate the attention score, and the formula is: (4) wherein, is a decay factor on the relation r, representing the amount of information propagation from the head entity to the tail entity controlled by the relation r; is a spatial transformation matrix, and are the embeddings of the head entity, tail entity and relation, respectively. 3.2, normalize formula (4) by using a Softmax function, and the formula is: (5) 3.3, Set of triples with entity h as head entity is That is, entity t is a first-order neighbor of entity h; to represent the first-order connection structure of entity h, aggregate the first-order neighbor information of h, the formula is: (6) 3.4, the information aggregation layer aggregates neighbor node features by using a graph neural network, and takes the features as the feature vector of the head entity h, which is formally: (7) wherein denotes the feature representation aggregated by the first-order neighbor entities, and similarly, the higher-order neighbor entity representation is obtained as (8) (9) 3.5, for aggregate functions Three aggregate operations are performed: respectively: ①GCN aggregator, using a nonlinear activation function to add the features, the formula is: (10) wherein is the training parameter in the information iteration process, is the bias; ②GraphSage aggregator, splicing the two vectors and performing nonlinear activation operation, the formula is: (11) In the formula, || represents splicing operation; 3. Bi-Interaction Aggregator, considering two feature interactions between and with the formula: Bi-Interaction = Bi-Interaction + Bi-Interaction (12) wherein are trainable weight parameters, is a Hadamard product; 3.6, after the propagation and aggregation of L layers, the multi-layer representation of the scenic spot is obtained, that is In order to fully guarantee the integrity of the feature information, the following method is used to represent the final features of the scenic spot: (13) S4, constructing a user attraction sequence according to the time sequence of historical interaction information; S5, analyzing the emotional tendency of the user from the comments, designing a user emotion change function over time, and learning the user interest embedding; S6, designing a loss function to train the model, learning user and attraction embedding according to the trained model, calculating the similarity, and recommending attractions to the user according to the result.

2. The method of claim 1, wherein the method is characterized by: In S1, the attraction knowledge graph AKG constructed is generated according to the attribute information of the attraction, and a series of triples are generated, which are in the form of (attraction name, attribute, attribute value); wherein the attraction name and the attribute value are entities in the attraction knowledge graph AKG, and the attribute is a relationship in the attraction knowledge graph AKG.

3. The method of claim 1, wherein: The specific steps of S2 are as follows: 2.1, since the attraction contains multiple features and has multiple different relationships, in order to fully represent the entity features, the head and tail entities are mapped from the entity space to the corresponding relationship space, and the formula is: (1) wherein are head, tail entity embeddings in the entity space, are head, tail entity and relation embeddings in the relation space, d≠k, the space transformation matrix ; 2.2, according to the triangle rule of vector addition and subtraction, the score function is defined, and the formula is: (2) 2.3, randomly replacing the head or tail entity in the triple to generate a set of non-factual triples as negative samples to train the model, and the loss function is: (3) In the formula, and Non-fact triples constructed by randomly replacing the tail entity in the fact triples, The activation function is Sigmoid function here; the The smaller, the smaller the loss, the The larger, the smaller the loss; This layer models entities and relations at the triple granularity, improving the representation ability of the model.

4. The method of claim 1, wherein: In S4, according to the historical records of user attraction, the attractions are sorted according to the time of the comments to obtain the attraction sequence of each user.

5. The method of claim 1, wherein: The specific steps of S5 are as follows: 5.1, analyze the user's sentiment tendency from the user's comment on the attraction, if the user's comment sentiment on the attraction is positive, set the user's sentiment score on the attraction as 1, otherwise set the user's sentiment score on the attraction as -1; ;​​​​​ 5.2, designing a user emotion change function over time; 5.3, calculating the feature vector of the user.

6. The method of claim 5, wherein the method further comprises: The specific steps of designing a user emotion change function over time in 5.2 are as follows: 5.2.1, inspired by Newton's cooling law, the temperature of an object gradually cools down over time, and the time decay formula is: (14) wherein and is a constant, k is a time decay factor, and t is time. 5.2.2, in the analysis of user features, the features of the recently visited attractions can better reflect the interests and hobbies of the user, so a larger weight is given to the features of the recently visited attractions, and the weight formula over time is: (15) wherein, is the time of the comment of the user u on the attraction s, and denote the time of visiting the first attraction and the last attraction in the attraction visiting sequence of the user u, respectively, denotes the time interval between the lth attraction and the last attraction visited by the user u, denotes the time interval between the first attraction and the last attraction visited by the user u. 5.2.3, the normalized weight formula is: (16) In the formula, is a sequence of point of interest visits by user u.

7. The method of claim 5, wherein the method further comprises: 5.3 In this step, the user's sentiment tendency reflected in the comprehensive review and the change of the user's sentiment over time are combined, and the final feature representation of the user is as follows: (17) wherein is the sentiment value of the user u for the point of interest l, is the point of interest l feature representation computed in 3.

6.

8. The method of claim 1, wherein: The specific steps of S6 are as follows: 6.1 Perform the inner product operation on the feature vectors of the user u and the scenic spot s to predict the matching score of the two, and the formula is as follows: (18) 6.2 Use the BPR loss optimization model, which believes that compared with the items that have not been interacted, the user prefers the items that have been interacted, that is, the predicted value of the former is higher, and the formula is as follows: (19) wherein, is the training set, i is the interest point that user u has interacted with, denoted as positive sample, j is the interest point that user u has not interacted with, denoted as negative sample, is the inner product operation, and the result thereof represents the probability that user u is likely to interact with interest point i, is a Sigmoid function; 6.3 Combine the scenic spot knowledge graph representation learning loss function, and the final optimization function is as follows: (20) In the formula, are model parameters, and L2 regularization is used to prevent overfitting of the model, is a regularization coefficient.

Citation Information

Patent Citations

  • Tourism route recommendation method and system based on tourism knowledge graph

    CN112749339A

  • Recommendation method for aggregating knowledge graph neural network and adaptive attention

    CN112989064A