Article recommendation method and device, computer equipment and storage medium
By using the content and timing feature fusion technology of entity relationship paths in the item recommendation system, the problem of insufficient accuracy in determining the relationship between users and items is solved, and the accuracy of item recommendation is improved.
Patent Information
- Application Number
- CN202411512925.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, when determining the potential relationship between a user and an item, there is a problem of inaccurate relationship determination, which affects the accuracy of item recommendations.
By determining the entity relationship path of the target entity based on the user needs and historical behavior data of the user to be recommended, the content feature data and timing feature data in the entity relationship path are extracted; these feature data are fused to obtain the fused feature data; and then according to Fusion feature data to select candidate recommended items and recommend them.
The accuracy of item recommendation results is improved, and the richness and diversity of features are enhanced by integrating content and timing characteristics, fully considering the information and heterogeneity in the entity relationship path.
Smart Images

Figure CN119494701A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an item recommendation method, device, computer equipment and storage medium. Background Art
[0002] With the development of data processing technology, graph convolutional networks (GCN) have emerged. Graph convolutional networks can determine the potential relationship between users and items by aggregating the features of each node, and then recommend items to users based on the potential relationship. Therefore, how to accurately determine the potential relationship is crucial.
[0003] In the prior art, graph convolutional networks usually use fixed convolution kernels to aggregate node features, so as to capture the potential relationship between users and items. Although this method can determine the potential relationship, it has the problem of inaccurate determination of the potential relationship, which in turn affects the accuracy of recommending items to users. Summary of the invention
[0004] Based on this, it is necessary to provide an item recommendation method, device, computer equipment and storage medium that can accurately recommend items to users in response to the above technical problems.
[0005] In a first aspect, the present application provides an item recommendation method, comprising:
[0006] Determine an entity relationship path corresponding to at least one target entity according to the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommendation item;
[0007] For each target entity, extract content feature data and time series feature data in the entity relationship path corresponding to the target entity;
[0008] Perform feature fusion on the content feature data and the time series feature data to obtain fused feature data of the target entity;
[0009] A target recommended item is selected from at least one candidate recommended item to be recommended to the user to be recommended according to the fused feature data of the user to be recommended and the fused feature data of each candidate recommended item.
[0010] In one of the embodiments, content feature data in an entity relationship path corresponding to a target entity is extracted, including: for each entity node in the entity relationship path, determining an initial content feature corresponding to the entity node based on content feature data of a predecessor entity node corresponding to the entity node and a node level feature of the entity node; performing feature fusion on the initial content feature corresponding to the entity node and the content feature data of a predecessor entity node corresponding to the entity node to obtain a node content feature of the entity node; using the node content feature of the tail entity node in the entity relationship path as the content feature data of the entity relationship path; wherein, the predecessor entity node corresponding to the entity node is other entity nodes adjacent to the entity node in the entity relationship path corresponding to the entity node in the opposite direction of the node transmission direction; the predecessor entity node corresponding to the entity node is other entity nodes located before the entity node in the entity relationship path corresponding to the entity node in the opposite direction of the node transmission direction; and the content feature data of the first entity node is the node level feature of the entity node.
[0011] In one of the embodiments, the initial content feature corresponding to the entity node is determined based on the content feature data of the predecessor entity node corresponding to the entity node and the node level feature of the entity node, including: concatenating and fusing the node level corresponding to the entity node and the content feature data of the predecessor entity node corresponding to the entity node to obtain the first content feature of the entity node; and extracting the first content feature of the entity node based on the convolution kernel weight corresponding to the entity relationship path to obtain the initial content feature; wherein the convolution kernel weight corresponding to the entity relationship path is determined based on the node level features of each entity node included in the entity relationship path.
[0012] In one of the embodiments, extracting the temporal feature data in the entity relationship path corresponding to the target entity includes: extracting the hidden state features of the nodes at different time steps in the entity relationship path corresponding to the target entity based on the long short-term memory network LSTM; the entity nodes in the entity relationship path corresponding to the time step; for each time step, determining the level weight of the time step according to the node level features of the entity nodes corresponding to the time step; and performing feature fusion on the hidden state features at the corresponding time steps according to the level weights of different time steps to obtain the temporal feature data of the entity relationship path.
[0013] In one of the embodiments, the hierarchical weight of the time step is determined according to the node hierarchical features of the entity node corresponding to the time step, including: determining the hierarchical score of the entity node corresponding to the time step according to the node hierarchical features of the entity node corresponding to the time step; determining the hierarchical weight of the time step according to the proportion of the hierarchical score of the entity node corresponding to the time step in the hierarchical scores of each entity node in the entity relationship path.
[0014] In one of the embodiments, if the number of entity relationship paths corresponding to the target entity is at least two, the content feature data and the timing feature data are feature fused to obtain the fused feature data of the target entity, including: for each entity relationship path corresponding to the target entity, the content feature data and the corresponding timing feature data of the entity relationship path are spliced and fused to obtain the path fusion feature of the entity relationship path; the path fusion features of each entity relationship path corresponding to the target entity are fused again to obtain the fused feature data of the target entity.
[0015] In one of the embodiments, the path fusion features of each entity relationship path corresponding to the target entity are fused again to obtain the fusion feature data of the target entity, including: for each entity relationship path corresponding to the target entity, according to the path length of the entity relationship path, determining the path category of the entity relationship path; according to the path fusion features of each entity relationship path under the same path category corresponding to the target entity, determining the path score of each entity relationship path under the corresponding path category; according to the path score of the entity relationship path and the proportion of the path scores of each entity relationship path under the corresponding path category, determining the intra-class path weight of the entity relationship path; according to the intra-class path weight of each entity relationship path under the same path category, weightedly fusion the path fusion features of each entity relationship path under the corresponding path category to obtain the target fusion feature of the corresponding path category; and again fusing the target fusion features of different path categories to obtain the fusion feature data of the target entity.
[0016] In a second aspect, the present application also provides an item recommendation device, comprising:
[0017] A path determination module, used to determine an entity relationship path corresponding to at least one target entity according to the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommendation item;
[0018] A feature extraction module, for extracting, for each target entity, content feature data and time series feature data in the entity relationship path corresponding to the target entity;
[0019] A feature fusion module is used to fuse the content feature data and the time series feature data to obtain fused feature data of the target entity;
[0020] The item selection module is used to select a target recommended item from at least one candidate recommended item according to the fused feature data of the user to be recommended and the fused feature data of each candidate recommended item.
[0021] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0022] Determine an entity relationship path corresponding to at least one target entity according to the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommendation item;
[0023] For each target entity, extract content feature data and time series feature data in the entity relationship path corresponding to the target entity;
[0024] Perform feature fusion on the content feature data and the time series feature data to obtain fused feature data of the target entity;
[0025] A target recommended item is selected from at least one candidate recommended item to be recommended to the user to be recommended according to the fused feature data of the user to be recommended and the fused feature data of each candidate recommended item.
[0026] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0027] Determine an entity relationship path corresponding to at least one target entity according to the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommendation item;
[0028] For each target entity, extract content feature data and time series feature data in the entity relationship path corresponding to the target entity;
[0029] Perform feature fusion on the content feature data and the time series feature data to obtain fused feature data of the target entity;
[0030] A target recommended item is selected from at least one candidate recommended item to be recommended to the user to be recommended according to the fused feature data of the user to be recommended and the fused feature data of each candidate recommended item.
[0031] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0032] Determine an entity relationship path corresponding to at least one target entity according to the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommendation item;
[0033] For each target entity, extract content feature data and time series feature data in the entity relationship path corresponding to the target entity;
[0034] Perform feature fusion on the content feature data and the time series feature data to obtain fused feature data of the target entity;
[0035] A target recommended item is selected from at least one candidate recommended item to be recommended to the user to be recommended according to the fused feature data of the user to be recommended and the fused feature data of each candidate recommended item.
[0036] The above-mentioned item recommendation method, device, computer equipment and storage medium determine the entity relationship path corresponding to at least one target entity based on the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommended item; for each target entity, extract the content feature data and time series feature data in the entity relationship path corresponding to the target entity; perform feature fusion on the content feature data and the time series feature data to obtain the fused feature data of the target entity; based on the fused feature data of the user to be recommended and the fused feature data of each candidate recommended item, select the target recommended item to be recommended to the user to be recommended from at least one candidate recommended item. In the above technical scheme, by introducing the entity relationship path corresponding to the target entity, content feature data and time series feature data are extracted, and the extracted content feature data and time series feature data are feature fused, so that the obtained fused feature data can fully consider the information carried in the entity relationship path where the target entity is located, as well as the heterogeneity between the entity nodes in the entity relationship path from the content dimension and the time series dimension, thereby improving the richness and diversity of the extracted features, and thus comprehensively recommending items to the user to be recommended based on the fused feature data of the user to be recommended and the fused feature data of the candidate recommended items, thereby improving the accuracy of the item recommendation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0038] FIG1 is a schematic diagram of a flow chart of an item recommendation method in one embodiment;
[0039] FIG2 is a flow chart of a content feature data extraction step in one embodiment;
[0040] FIG3 is a schematic flow chart of a step of extracting time series feature data in one embodiment;
[0041] FIG4 is a schematic flow chart of a step of determining fusion feature data in one embodiment;
[0042] FIG5 is a structural block diagram of an item recommendation device in one embodiment;
[0043] FIG. 6 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0045] In an exemplary embodiment, as shown in FIG1 , a method for recommending items is provided. This embodiment uses the method applied to a terminal as an example for illustration. It is understandable that the method can also be applied to a server, or to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. This application does not impose any limitation on this. In this embodiment, the method includes the following steps:
[0046] S110, determining an entity relationship path corresponding to at least one target entity according to the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommendation item.
[0047] Among them, the users to be recommended can be understood as users who have item recommendation needs; user needs can be understood as item needs based on the input of the users to be recommended; historical behavior data can be understood as behavior data of the users to be recommended performing specific operations (such as purchase and browsing, etc.) on items in a historical period; candidate recommended items can be understood as items that match the user needs and / or historical behaviors of the users to be recommended.
[0048] The entity relationship path may be a path containing the association relationship between target entities. Optionally, the entity relationship path may contain at least one triple; for example, the entity relationship path "user Items" contains a triple (e 用户 , r 购买 , e 物品 ), where e 用户 is the target entity corresponding to the user, e 物品 is the target entity corresponding to the item, r 购买 The association relationship between the target entity corresponding to the user and the target entity corresponding to the item can be represented by a relationship vector.
[0049] In an optional embodiment, based on the historical behavior data of the user to be recommended, at least one entity relationship path of the user to be recommended is selected from a pre-constructed knowledge graph between users and items; and based on the user needs of the user to be recommended, at least one candidate recommended item is determined; for each candidate recommended item, at least one entity relationship path of the candidate recommended item is selected from the knowledge graph.
[0050] Exemplarily, selecting at least one entity relationship path of the user to be recommended from the knowledge graph based on the historical behavior data of the user to be recommended may include: searching the knowledge graph for the entity relationship path containing the user to be recommended using the historical behavior data of the user to be recommended. For example, assuming that the historical behavior data of the user to be recommended is "the user has purchased item A" and "the user has purchased item B", searching the knowledge graph for entity relationship paths related to the user's purchase behavior may include, for example, "the user has purchased item A". Item A Electronics Item C" and "User Item B Home Appliances Item D” etc.
[0051] Exemplarily, selecting at least one entity relationship path of a candidate recommended item from the knowledge graph includes: searching for an entity relationship path related to each candidate recommended item from the knowledge graph. For example, assuming that the candidate recommended item is "item C", the entity relationship path containing "item C" in the knowledge graph is used as the entity relationship path of the candidate recommended item, for example, "item C" may be included. Home Appliances Item F" and "Item C Item G Item H” etc.
[0052] S120 , for each target entity, extracting content feature data and time series feature data in the entity relationship path corresponding to the target entity.
[0053] Among them, the content feature data in the entity relationship path can carry content information of entities at different levels in the entity relationship path, for example, it can be feature data that integrates the content features of nodes corresponding to all entity nodes in the entity relationship path; the time series feature data in the entity relationship path can carry hierarchical order information between entities at different levels in the entity relationship path, for example, it can be feature data that integrates the hidden state features of relationships at different levels in the entity relationship path.
[0054] In one of the optional embodiments, the content feature data in the entity relationship path corresponding to the target entity can be extracted in the following manner: select each entity node in turn as the current entity node in the node transmission direction; perform feature fusion on the node level feature of the current entity node and the node content feature of the previous entity node corresponding to the current entity node to obtain the node content feature of the current entity node; perform feature fusion on the node content features of all entity nodes in the entity relationship path to obtain the content feature data in the entity relationship path corresponding to the target entity. It should be noted that the node content feature of the first entity node is the node level feature of the first entity node.
[0055] In one of the optional embodiments, the temporal feature data in the entity relationship path corresponding to the target entity can be extracted in the following manner: through a long short-term memory network, the hidden state features at each time step in the entity relationship path are extracted; the hidden state features at each time step are feature fused to obtain the temporal feature data in the entity relationship path.
[0056] It should be noted that the feature fusion in this embodiment includes but is not limited to feature splicing fusion, feature weighted fusion, feature linear fusion or other feature synthesis methods.
[0057] S130, performing feature fusion on the content feature data and the time series feature data to obtain fused feature data of the target entity.
[0058] Among them, the fused feature data of the target entity can be understood as feature data that at least fuses the content feature data and timing feature data of all entity relationship paths corresponding to the target entity, so that the fused feature data carries the content information and hierarchical order information in the entity relationship paths corresponding to the target entity.
[0059] In an optional embodiment, the content feature data and the timing feature data may be feature fused to obtain fused feature data of the target entity in the following manner: for each entity relationship path corresponding to the target entity, determine the content feature data and the corresponding timing feature data corresponding to the entity relationship path; perform feature fusion on the content feature data and the corresponding timing feature data to obtain path feature data of the entity relationship path; perform feature fusion again on all path feature data corresponding to the target entity to obtain fused feature data of the target entity.
[0060] S140, selecting a target recommended item to be recommended to the user to be recommended from at least one candidate recommended item according to the fused feature data of the user to be recommended and the fused feature data of each candidate recommended item.
[0061] The target recommended item may be understood as the item that has a higher degree of matching with the user demand of the to-be-recommended user among all the candidate recommended items, such as the highest candidate recommended item.
[0062] In an optional embodiment, for each candidate recommended item, a matching score between the fused feature data of the candidate recommended item and the fused feature data of the user to be recommended is determined; and from at least one candidate recommended item, a candidate recommended item with a higher matching score, such as the highest, is selected as the target recommended item to be recommended to the user to be recommended.
[0063] Exemplarily, the matching score between the fused feature data of the candidate recommended item and the fused feature data of the user to be recommended can be determined in the following manner: by performing a dot product process on the fused feature data of the candidate recommended item and the fused feature data of the user to be recommended using the following formula (1-1), obtaining a dot product result, and using the dot product result as the matching score.
[0064] (1-1)
[0065] Among them, score represents the matching score, U represents the fused feature data of the user to be recommended, and V represents the fused feature data of the candidate recommended items.
[0066] The embodiment of the present application determines the entity relationship path corresponding to at least one target entity according to the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommended item; for each target entity, extract the content feature data and the time series feature data in the entity relationship path corresponding to the target entity; perform feature fusion on the content feature data and the time series feature data to obtain the fused feature data of the target entity; select the target recommended item to be recommended to the user to be recommended from at least one candidate recommended item according to the fused feature data of the user to be recommended and the fused feature data of each candidate recommended item. In the above technical scheme, by introducing the entity relationship path corresponding to the target entity, extracting the content feature data and the time series feature data, and fusion of the extracted content feature data and the time series feature data, the obtained fused feature data can fully consider the information carried in the entity relationship path where the target entity is located from the content dimension and the time series dimension, as well as the heterogeneity between the entity nodes in the entity relationship path, thereby improving the richness and diversity of the extracted features, thereby comprehensively recommending items to the user to be recommended according to the fused feature data of the user to be recommended and the fused feature data of the candidate recommended items, thereby improving the accuracy of the item recommendation results.
[0067] Based on the technical solutions of the above embodiments, the present application also provides an optional embodiment. In this optional embodiment, the content feature data extraction step in S130 is refined.
[0068] Referring to the content feature data extraction steps shown in FIG2 , the steps include:
[0069] S210 , for each entity node in the entity relationship path, determining an initial content feature corresponding to the entity node according to content feature data of a predecessor entity node corresponding to the entity node and a node level feature of the entity node.
[0070] The predecessor entity node corresponding to the entity node is another entity node adjacent to the entity node in the opposite direction of the node transfer direction in the entity relationship path corresponding to the entity node. The node level feature can be a triple vector at the level corresponding to the entity node.
[0071] In an optional embodiment, the following method can be used to determine the initial content features corresponding to the entity node based on the content feature data of the predecessor entity node corresponding to the entity node and the node level features of the entity node: determine the content feature data of the predecessor node corresponding to the entity node; use the triple vector under the level to which the entity node belongs as the node level feature of the entity node; perform feature fusion on the content feature data of the predecessor entity node and the node level features of the entity node to obtain the initial content features corresponding to the entity node.
[0072] In an optional embodiment, determining the initial content feature corresponding to the entity node based on the content feature data of the predecessor entity node corresponding to the entity node and the node level feature of the entity node can include: concatenating and fusing the node level corresponding to the entity node and the content feature data of the predecessor entity node corresponding to the entity node to obtain the first content feature of the entity node; extracting the first content feature of the entity node based on the convolution kernel weight corresponding to the entity relationship path to obtain the initial content feature; wherein the convolution kernel weight corresponding to the entity relationship path is determined based on the node level features of each entity node included in the entity relationship path.
[0073] Exemplarily, the following method is used to extract the first content feature of the entity node according to the convolution kernel weight corresponding to the entity relationship path to obtain the initial content feature: determine the convolution kernel weight corresponding to the entity relationship path according to the node level feature of the entity node; perform fusion processing (such as dot product or weighted summation, etc.) on the convolution kernel weight corresponding to the entity relationship path and the first content feature of the entity node to obtain the initial content feature. The advantage of this setting is that the convolution kernel is dynamically adjusted through the convolution kernel weight, so that the convolution kernel can adapt to the node level feature in the corresponding entity relationship path, thereby capturing the complex relationship information in the entity relationship path, and improving the accuracy of the content feature data of the subsequent determination of the entity relationship path.
[0074] In a specific implementation, the convolution kernel weight corresponding to the entity relationship path can be determined by the following formula (1-2):
[0075] (1-2)
[0076] Among them, o represents the convolution kernel weight, v l Represents the entity node vector of layer l, r l Represents the relationship vector between two adjacent entity nodes in the lth layer, v l+1 represents the entity node vector of the l+1th layer, σ represents the activation function, W1 represents the first weight matrix, W2 represents the second weight matrix, b1 represents the first bias vector, and b2 represents the second bias vector. Among them, the first weight matrix W1, the second weight matrix W2, the first bias vector b1 and the second bias vector b2 are all trainable parameters. Among them, MLP ( ) is a multi-layer perceptron function used for feature extraction; ReLU ( ) is an activation function that introduces nonlinear features.
[0077] S220 , performing feature fusion on the initial content feature corresponding to the entity node and the content feature data of the previous entity node corresponding to the entity node to obtain the node content feature of the entity node.
[0078] Among them, the preceding entity node corresponding to the entity node is other entity nodes that are located before the entity node in the opposite direction of the node transmission direction in the entity relationship path corresponding to the entity node; the content feature data of the first entity node is the node level feature of the entity node.
[0079] In an optional embodiment, the following method can be used to perform feature fusion on the initial content features corresponding to the entity node and the content feature data of the preceding entity node corresponding to the entity node to obtain the node content features of the entity node: determine at least one preceding entity node corresponding to the entity node, perform feature weighted fusion on the content feature data of all preceding entity nodes to obtain preceding fused feature data; perform feature weighted fusion on the initial content features of the entity node and the preceding fused feature data to obtain the node content features of the entity node.
[0080] Exemplarily, the node content feature of the entity node may be determined by the following formula (1-3):
[0081] (1-3)
[0082] Among them, h (l) Characterizes the node content features of the entity nodes under the lth layer, h (l-1) Characterizes the content feature data of the entity node (predecessor entity node) under the l-1th layer, h (i) Characterizes the content feature data of the previous entity node i, v l Represents the entity node vector of layer l, r l Represents the relationship vector between two adjacent entity nodes in the lth layer, v l+1represents the entity node vector of the l+1th layer, σ represents the activation function, α1 represents the importance of the entity nodes in the lth and l-1th layers (i.e., the first weight), α2 represents the importance of the previous entity nodes (i.e., the second weight), β i Represents the node weight of the i-th preceding entity node, f(h (l -1) ,v l ,r l ,v l+1 ) represents the first content feature of the entity node, (o·f(h (l-1) ,v l ,r l ,v l+1 ))Characterizes the initial content characteristics of the entity node.
[0083] S230: Using the node content feature of the tail entity node in the entity relationship path as content feature data of the entity relationship path.
[0084] The tail entity node may be understood as the last entity node included in the entity relationship path.
[0085] Exemplarily, a tail entity node in the entity relationship path is determined, and the node content feature of the tail entity node is used as content feature data of the entity relationship path.
[0086] In an embodiment of the present application, for each entity node, the content feature data of the predecessor entity node and the node level features of the entity node are used to determine the initial content features of the entity node, and then the initial content features and the content feature data of the predecessor entity node are feature fused to obtain the node content features of the entity node. The node content features of the tail entity node are used as the content feature data of the entity relationship path. By continuously performing convolution operations on the node level features corresponding to each entity node in the entity relationship path, the complex relationship information in the entity relationship path is captured, thereby improving the accuracy of the content feature data of the entity relationship path.
[0087] Based on the technical solutions of the above embodiments, the present application also provides an optional embodiment. In this optional embodiment, based on LSTM (Long Short-Term Memory), the temporal feature data extraction step in S130 is refined.
[0088] Referring to FIG. 3 , the steps of extracting time series feature data include:
[0089] S310, based on LSTM, extract the hidden state features of the nodes at each level in the entity relationship path corresponding to the target entity at different time steps; the time step corresponds to the entity node in the entity relationship path.
[0090] In an optional embodiment, the entity relationship path corresponding to the target entity is input into the LSTM to extract the hidden state features of the nodes at different levels in the entity relationship path at different time steps. It is worth noting that the time steps here correspond to the entity nodes at different levels in the entity relationship path to characterize the transmission level of the corresponding entity nodes.
[0091] For example, the entity relationship path is "User Item A Item D", input the entity relationship path into LSTM to extract time step 1 corresponding to the entity node "user", time step 2 corresponding to the entity node "item A" and time step 3 corresponding to the entity node "item D". For time step 1, extract the hidden state feature 1 of the entity node "user" at time step 1; for time step 2, extract the hidden state feature 2 of the entity node "item A" at time step 2, where the hidden state feature 2 includes both the time series features of time step 1 and the time series features of time step 2; for time step 3, extract the hidden state feature 3 of the entity node "item D" at time step 3, where the hidden state feature 3 includes both the time series features of time step 1, the time series features of time step 2 and the time series features of time step 3.
[0092] S320 , for each time step, determining a level weight of the time step according to a node level feature of an entity node corresponding to the time step.
[0093] In one of the optional embodiments, the hierarchical weight of the time step is determined according to the node hierarchical features of the entity node corresponding to the time step in the following manner: the node hierarchical features of the entity node corresponding to the time step are input into the conditional random field to obtain the hierarchical score of the entity node corresponding to the time step, and the hierarchical score is used as the hierarchical weight of the time step.
[0094] In another optional embodiment, the hierarchical weight of the time step is determined according to the node hierarchical features of the entity node corresponding to the time step, including: determining the hierarchical score of the entity node corresponding to the time step according to the node hierarchical features of the entity node corresponding to the time step; determining the hierarchical weight of the time step according to the proportion of the hierarchical score of the entity node corresponding to the time step in the hierarchical scores of each entity node in the entity relationship path.
[0095] Exemplarily, the hierarchical score of the entity node corresponding to the time step is determined according to the node hierarchical features of the entity node corresponding to the time step in the following manner: the node hierarchical features of the entity node corresponding to the time step are scored to obtain the hierarchical score of the entity node corresponding to the time step.
[0096] Optionally, the method of scoring the node-level features of the entity nodes corresponding to the time step may include: scoring the node-level features according to the head entity node, the relationship vector between the entity nodes, and the distance between the tail entity nodes in the node-level features; or setting a scoring function according to preset rules, and scoring the node-level features through the preset scoring function, etc. This application does not impose any limitations on this.
[0097] Exemplarily, the hierarchical weight of the time step is determined according to the proportion of the hierarchical score of the entity node corresponding to the time step in the hierarchical scores of each entity node in the entity relationship path in the following manner: determine the score and value of the hierarchical score corresponding to each entity node in the entity relationship path, and use the proportion of the hierarchical score of the entity node corresponding to the time step in the score and value as the hierarchical weight of the time step.
[0098] In a specific implementation, the hierarchical weight of the time step can be determined by the following formula (1-4):
[0099] (1-4)
[0100] Among them, α i,j The layer weights representing the time steps, e i Representing entity nodes i, e j Representing entity node j, r ij Represents the relationship vector between entity node i and entity node j, score(e i ,r ij ,e j ) represents the hierarchical score of the entity node corresponding to the i-th time step, e k Representing entity nodes k, r ik Represents the relationship vector between entity node i and entity node k, and K represents the node set of entity nodes included in the entity relationship path.
[0101] S330, according to the hierarchical weights of different time steps, feature fusion is performed on the hidden state features at the corresponding time steps to obtain the temporal feature data of the entity relationship path.
[0102] In an optional embodiment, the following method is used to perform feature fusion on the hidden state features at the corresponding time steps according to the hierarchical weights of different time steps to obtain the temporal feature data of the entity relationship path: for each time step, the hidden state features at the corresponding time step are weightedly fused according to the hierarchical weights of the time step to obtain the hierarchical temporal features of the time step; the sum of the hierarchical temporal features corresponding to all time steps is used as the temporal feature data of the entity relationship path.
[0103] In a specific implementation, the time series feature data of the entity relationship path can be determined by the following formula (1-5):
[0104] (1-5)
[0105] Among them, h agg Temporal feature data representing entity relationship paths, α i,j The layer weight representing the time step, h k Represents the hidden state features of the entity node at time step k, and K represents the node set of entity nodes included in the entity relationship path.
[0106] In the embodiment of the present application, the importance of the hidden state features at the corresponding time steps is adjusted through the hierarchical weights of the time steps, and the time steps that have a greater impact on the target recommended items are highlighted, so that the temporal feature data of the determined entity relationship path is more accurate, further improving the accuracy of subsequent target recommended items.
[0107] Based on the technical solutions of the above embodiments, the present application also provides an optional embodiment. In this optional embodiment, when the number of entity relationship paths corresponding to the target entity is at least two, the step of determining the fused feature data in S140 is refined.
[0108] Referring to the fusion feature data determination step shown in FIG4 , the steps include:
[0109] S410, for each entity relationship path corresponding to the target entity, concatenate and fuse the content feature data of the entity relationship path and the corresponding temporal feature data to obtain a path fusion feature of the entity relationship path.
[0110] In an optional embodiment, the content feature data and the corresponding timing feature data of the entity relationship path can be spliced and fused in the following manner to obtain the path fusion feature of the entity relationship path: vector splicing and fusion are performed on the content feature data and the corresponding timing feature data of the entity relationship path to obtain a splicing and fusion result; and the splicing and fusion result is used as the path fusion feature of the entity relationship path.
[0111] It should be noted that, in this embodiment, vector addition and fusion are performed on the content feature data and the corresponding time series feature data of the entity relationship path to obtain an addition and fusion result; and the addition and fusion result is used as the path fusion feature of the entity relationship path.
[0112] Exemplarily, this embodiment can determine the path fusion feature of the entity relationship path through the following formula (1-6):
[0113] (1-6)
[0114] Among them, p represents the path fusion feature of the entity relationship path, h cnnThe content feature data representing the entity relationship path, h agg Temporal feature data that characterizes entity relationship paths,
[0115] S420, the path fusion features of each entity relationship path corresponding to the target entity are fused again to obtain fusion feature data of the target entity.
[0116] In one of the optional embodiments, feature weighted fusion is performed on the path fusion features of all entity relationship paths corresponding to the target entity to obtain a feature fusion result; and the feature fusion result is used as fusion feature data of the target entity.
[0117] In another optional embodiment, the path fusion features of each entity relationship path corresponding to the target entity are fused again to obtain fusion feature data of the target entity, including: for each entity relationship path corresponding to the target entity, according to the path length of the entity relationship path, determining the path category of the entity relationship path; according to the path fusion features of each entity relationship path under the same path category corresponding to the target entity, determining the path score of each entity relationship path under the corresponding path category; according to the path score of the entity relationship path, the proportion of the path scores of each entity relationship path under the corresponding path category determines the intra-class path weight of the entity relationship path; according to the intra-class path weight of each entity relationship path under the same path category, weighted fusion is performed on the path fusion features of each entity relationship path under the corresponding path category to obtain the target fusion feature of the corresponding path category; the target fusion features of different path categories are fused again to obtain the fusion feature data of the target entity. The advantage of this setting is that the entity relationship paths are classified, the target fusion features corresponding to the entity relationship paths of different path categories are determined, the path information in the entity relationship paths of the same path category is unified, and then the target fusion features of the entity relationship paths of different path categories are fused again, and the path information of different path categories is further unified, so that the fusion feature data of the determined target entity is more accurate.
[0118] Exemplarily, the path type of the entity relationship path is determined according to the path length of the entity relationship path in the following manner:
[0119] For each entity relationship path corresponding to the target entity, the path category of the entity relationship path is determined according to the path length of the entity relationship path. Optionally, the path length of the entity relationship path can be determined by the number of triples contained in the entity relationship path. For example, if the number of triples in the entity relationship path is one, the path category of the entity relationship path is determined to be a short relationship path, such as "user Item A"; if the number of triples in the entity relationship path is two or three, the path category of the entity relationship path is determined to be a medium relationship path, such as "User Item A Home Appliances Item B"; if the number of triples in the entity relationship path is greater than three, the path category of the entity relationship path is determined to be a long relationship path, such as "User Item A Home Appliances Item B Item C".
[0120] Exemplarily, the following method is used to determine the path score of each entity relationship path under the corresponding path category based on the path fusion characteristics of each entity relationship path under the same path category corresponding to the target entity: for each path category corresponding to the target entity, the path fusion characteristics of each entity relationship path under the path category are scored by a preset scoring function to determine the path score of each entity relationship path under the corresponding path category.
[0121] Exemplarily, the intra-class path weight of the entity relationship path is determined according to the path score of the entity relationship path and the proportion of the path scores of each entity relationship path under the corresponding path category in the following manner: for each path category corresponding to the target entity, the path score and value between the path scores of all entity relationship paths under the path category are determined; for each entity relationship path under the path category, the proportion of the path score of the entity relationship path in the path score and value is used as the intra-class path weight of the entity relationship path.
[0122] In a specific implementation, the intra-class path weight of the entity relationship path can be determined by the following formula (1-7):
[0123] (1-7)
[0124] Among them, α i Characterize the intra-class path weight of entity relationship path i, p i The path fusion feature representing the entity relationship path i, score(p i ) represents the path score of entity relationship path i, p j The path fusion feature representing the entity relationship path j, score(p j ) represents the path score of entity relationship path j, and class represents the path set containing all entity relationship paths under the same path category.
[0125] Exemplarily, the following method is used to weightedly fuse the path fusion features of each entity relationship path under the corresponding path category according to the intra-class path weight of each entity relationship path under the same path category to obtain the target fusion feature of the corresponding path category: for each entity relationship path under the same path category, the intra-class path weight of the entity relationship path and the path fusion feature of the entity relationship path are weightedly fused to obtain the weighted path feature; the sum of the weighted path features of all entity relationship paths under the same path category is used as the target fusion feature of the corresponding path category.
[0126] In a specific implementation, the target fusion feature of a certain path category can be determined by the following formula (1-8):
[0127] (1-8)
[0128] Among them, P represents the target fusion feature of a certain path category, α j Represents the intra-class path weight of entity relationship path j under this path category, p j The path fusion feature represents the entity relationship path j, and class represents the path set containing all entity relationship paths under the path category.
[0129] Exemplarily, the target fusion features of different path categories are fused again in the following manner to obtain the fusion feature data of the target entity: determine the target fusion features of different path categories; perform feature weighted fusion on the target fusion features of each path category to obtain the fusion feature data of the target entity.
[0130] In a specific implementation, the fusion feature data of the target entity can be determined by the following formula (1-9):
[0131] (1-9)
[0132] Among them, P final The fused feature data representing the target entity, P long The target fusion feature representing the path category as a long relationship path, P medium Characterizing the path category is the target fusion feature corresponding to the relational path in the middle, P short The target fusion feature corresponding to the path category of the short relationship path is represented. Characterizes the first path weight, that is, the path weight of the long relationship path. Characterizes the second path weight, that is, the path weight corresponding to the middle relationship path. Characterize the third path weight, that is, the path weight corresponding to the short relationship path. It should be noted that the first path weight is less than the second path weight, and the second path weight is less than the third path weight. The weight values of the first path weight, the second path weight, and the third path weight can be set according to the actual scenario (such as attention weight or preset fixed weight).
[0133] The embodiment of the present application performs feature fusion on the path fusion feature of the entity relationship path by fusing content feature data and corresponding time series feature data of the entity relationship path into the path fusion feature of the entity relationship path, thereby improving the accuracy of determining the fusion feature data of the target entity and further improving the accuracy of subsequent selection of target recommended items based on the fusion feature data of the target entity.
[0134] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0135] Based on the same inventive concept, the embodiment of the present application also provides an item recommendation device for implementing the item recommendation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more item recommendation device embodiments provided below can refer to the limitations on the item recommendation method above, and will not be repeated here.
[0136] In an exemplary embodiment, as shown in FIG5 , an item recommendation device is provided, comprising: a path determination module 510, a feature extraction module 520, a feature fusion module 530 and an item selection module 540, wherein:
[0137] A path determination module 510 is used to determine an entity relationship path corresponding to at least one target entity according to the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommendation item;
[0138] A feature extraction module 520 is used to extract content feature data and time series feature data in the entity relationship path corresponding to each target entity;
[0139] A feature fusion module 530 is used to fuse the content feature data and the time series feature data to obtain fused feature data of the target entity;
[0140] The item selection module 540 is used to select a target recommended item from at least one candidate recommended item according to the fused feature data of the user to be recommended and the fused feature data of each candidate recommended item.
[0141] In one embodiment, the feature extraction module 520 includes: an initial content determination unit, which is used to determine, for each entity node in the entity relationship path, the initial content feature corresponding to the entity node according to the content feature data of the predecessor entity node corresponding to the entity node and the node level feature of the entity node; a node content determination unit, which is used to perform feature fusion on the initial content feature corresponding to the entity node and the content feature data of the predecessor entity node corresponding to the entity node to obtain the node content feature of the entity node; a content feature determination unit, which is used to use the node content feature of the tail entity node in the entity relationship path as the content feature data of the entity relationship path; wherein, the predecessor entity node corresponding to the entity node is other entity nodes adjacent to the entity node in the opposite direction of the node transmission direction in the entity relationship path corresponding to the entity node; the predecessor entity node corresponding to the entity node is other entity nodes located before the entity node in the opposite direction of the node transmission direction in the entity relationship path corresponding to the entity node; the content feature data of the first entity node is the node level feature of the entity node.
[0142] In one of the embodiments, the node content determination unit is further used to concatenate and fuse the node level data corresponding to the entity node and the content feature data of the predecessor entity node corresponding to the entity node to obtain a first content feature of the entity node; and extract the first content feature of the entity node according to the convolution kernel weight corresponding to the entity relationship path to obtain an initial content feature; wherein the convolution kernel weight corresponding to the entity relationship path is determined based on the node level features of each entity node included in the entity relationship path.
[0143] In one embodiment, the feature extraction module 520 includes: a feature determination unit, which is used to extract the hidden state features of each level node in the entity relationship path corresponding to the target entity at different time steps based on the long short-term memory network LSTM; the entity node in the entity relationship path corresponding to the time step; a weight determination unit, which is used to determine the level weight of the time step for each time step according to the node level features of the entity node corresponding to the time step; and a feature fusion unit, which is used to fuse the hidden state features at the corresponding time steps according to the level weights of different time steps to obtain the time series feature data of the entity relationship path.
[0144] In one of the embodiments, the weight determination unit is further used to determine the hierarchical score of the entity node corresponding to the time step according to the node hierarchical features of the entity node corresponding to the time step; and determine the hierarchical weight of the time step according to the proportion of the hierarchical score of the entity node corresponding to the time step in the hierarchical scores of each entity node in the entity relationship path.
[0145] In one embodiment, the feature fusion module 530 includes: a path feature determination unit, which is used to splice and fuse the content feature data and the corresponding time series feature data of each entity relationship path corresponding to the target entity to obtain the path fusion feature of the entity relationship path; and a fusion feature determination unit, which is used to fuse the path fusion features of each entity relationship path corresponding to the target entity again to obtain the fusion feature data of the target entity.
[0146] In one of the embodiments, the fusion feature determination unit is further used to determine, for each entity relationship path corresponding to the target entity, the path category of the entity relationship path according to the path length of the entity relationship path; determine the path score of each entity relationship path under the corresponding path category according to the path fusion features of each entity relationship path under the same path category corresponding to the target entity; determine the intra-class path weight of the entity relationship path according to the proportion of the path score of the entity relationship path under the corresponding path category; perform weighted fusion on the path fusion features of each entity relationship path under the corresponding path category according to the intra-class path weight of each entity relationship path under the same path category to obtain the target fusion feature of the corresponding path category; and fuse the target fusion features of different path categories again to obtain the fusion feature data of the target entity.
[0147] Each module in the above-mentioned item recommendation device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0148] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG6. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface is connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for recommending items is implemented.
[0149] Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0150] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0151] Determine an entity relationship path corresponding to at least one target entity according to the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommendation item;
[0152] For each target entity, extract content feature data and time series feature data in the entity relationship path corresponding to the target entity;
[0153] Perform feature fusion on the content feature data and the time series feature data to obtain fused feature data of the target entity;
[0154] A target recommended item is selected from at least one candidate recommended item to be recommended to the user to be recommended according to the fused feature data of the user to be recommended and the fused feature data of each candidate recommended item.
[0155] In one embodiment, the processor further implements the following steps when executing the computer program: for each entity node in the entity relationship path, determining the initial content feature corresponding to the entity node based on the content feature data of the predecessor entity node corresponding to the entity node and the node level feature of the entity node; performing feature fusion on the initial content feature corresponding to the entity node and the content feature data of the predecessor entity node corresponding to the entity node to obtain the node content feature of the entity node; using the node content feature of the tail entity node in the entity relationship path as the content feature data of the entity relationship path; wherein, the predecessor entity node corresponding to the entity node is other entity nodes adjacent to the entity node in the opposite direction of the node transmission direction in the entity relationship path corresponding to the entity node; the predecessor entity node corresponding to the entity node is other entity nodes located before the entity node in the opposite direction of the node transmission direction in the entity relationship path corresponding to the entity node; the content feature data of the first entity node is the node level feature of the entity node.
[0156] In one embodiment, when the processor executes the computer program, the following steps are also implemented: the node level corresponding to the entity node and the content feature data of the predecessor entity node corresponding to the entity node are spliced and merged to obtain the first content feature of the entity node; according to the convolution kernel weight corresponding to the entity relationship path, the first content feature of the entity node is feature extracted to obtain the initial content feature; wherein the convolution kernel weight corresponding to the entity relationship path is determined based on the node level features of each entity node contained in the entity relationship path.
[0157] In one embodiment, when the processor executes the computer program, the following steps are also implemented: based on the long short-term memory network LSTM, the hidden state features of the nodes at different time steps in the entity relationship path corresponding to the target entity are extracted; the time step corresponds to the entity node in the entity relationship path; for each time step, the level weight of the time step is determined according to the node level features of the entity node corresponding to the time step; according to the level weights of different time steps, the hidden state features at the corresponding time steps are feature fused to obtain the time series feature data of the entity relationship path.
[0158] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining the hierarchical score of the entity node corresponding to the time step according to the node hierarchical features of the entity node corresponding to the time step; determining the hierarchical weight of the time step according to the proportion of the hierarchical score of the entity node corresponding to the time step in the hierarchical scores of each entity node in the entity relationship path.
[0159] In one embodiment, when the processor executes the computer program, the following steps are also implemented: for each entity relationship path corresponding to the target entity, the content feature data and the corresponding time series feature data of the entity relationship path are spliced and fused to obtain the path fusion feature of the entity relationship path; the path fusion features of each entity relationship path corresponding to the target entity are fused again to obtain the fusion feature data of the target entity.
[0160] In one embodiment, the processor further implements the following steps when executing the computer program: for each entity relationship path corresponding to the target entity, determining the path category of the entity relationship path according to the path length of the entity relationship path; determining the path score of each entity relationship path under the corresponding path category according to the path fusion features of each entity relationship path under the same path category corresponding to the target entity; determining the intra-class path weight of the entity relationship path according to the path score of the entity relationship path and the proportion of the path scores of each entity relationship path under the corresponding path category; performing weighted fusion on the path fusion features of each entity relationship path under the corresponding path category according to the intra-class path weight of each entity relationship path under the same path category to obtain the target fusion feature of the corresponding path category; and fusing the target fusion features of different path categories again to obtain the fusion feature data of the target entity.
[0161] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0162] Determine an entity relationship path corresponding to at least one target entity according to the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommendation item;
[0163] For each target entity, extract content feature data and time series feature data in the entity relationship path corresponding to the target entity;
[0164] Perform feature fusion on the content feature data and the time series feature data to obtain fused feature data of the target entity;
[0165] A target recommended item is selected from at least one candidate recommended item to be recommended to the user to be recommended according to the fused feature data of the user to be recommended and the fused feature data of each candidate recommended item.
[0166] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for each entity node in the entity relationship path, the initial content feature corresponding to the entity node is determined according to the content feature data of the predecessor entity node corresponding to the entity node and the node level feature of the entity node; the initial content feature corresponding to the entity node and the content feature data of the predecessor entity node corresponding to the entity node are feature fused to obtain the node content feature of the entity node; the node content feature of the tail entity node in the entity relationship path is used as the content feature data of the entity relationship path; wherein, the predecessor entity node corresponding to the entity node is other entity nodes adjacent to the entity node in the opposite direction of the node transmission direction in the entity relationship path corresponding to the entity node; the predecessor entity node corresponding to the entity node is other entity nodes located before the entity node in the opposite direction of the node transmission direction in the entity relationship path corresponding to the entity node; the content feature data of the first entity node is the node level feature of the entity node.
[0167] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the node level corresponding to the entity node and the content feature data of the predecessor entity node corresponding to the entity node are spliced and merged to obtain the first content feature of the entity node; according to the convolution kernel weight corresponding to the entity relationship path, the first content feature of the entity node is feature extracted to obtain the initial content feature; wherein the convolution kernel weight corresponding to the entity relationship path is determined based on the node level features of each entity node contained in the entity relationship path.
[0168] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the long short-term memory network LSTM, the hidden state features of the nodes at different time steps in the entity relationship path corresponding to the target entity are extracted; the time step corresponds to the entity node in the entity relationship path; for each time step, the level weight of the time step is determined according to the node level features of the entity node corresponding to the time step; according to the level weights of different time steps, the hidden state features at the corresponding time steps are feature fused to obtain the time series feature data of the entity relationship path.
[0169] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the hierarchical score of the entity node corresponding to the time step according to the node hierarchical features of the entity node corresponding to the time step; determining the hierarchical weight of the time step according to the proportion of the hierarchical score of the entity node corresponding to the time step in the hierarchical scores of each entity node in the entity relationship path.
[0170] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for each entity relationship path corresponding to the target entity, the content feature data and the corresponding time series feature data of the entity relationship path are spliced and fused to obtain the path fusion feature of the entity relationship path; the path fusion features of each entity relationship path corresponding to the target entity are fused again to obtain the fusion feature data of the target entity.
[0171] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for each entity relationship path corresponding to the target entity, the path category of the entity relationship path is determined according to the path length of the entity relationship path; the path score of each entity relationship path under the corresponding path category is determined according to the path fusion features of each entity relationship path under the same path category corresponding to the target entity; the intra-class path weight of the entity relationship path is determined according to the path score of the entity relationship path and the proportion of the path scores of each entity relationship path under the corresponding path category; according to the intra-class path weight of each entity relationship path under the same path category, the path fusion features of each entity relationship path under the corresponding path category are weightedly fused to obtain the target fusion feature of the corresponding path category; the target fusion features of different path categories are fused again to obtain the fusion feature data of the target entity.
[0172] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0173] Determine an entity relationship path corresponding to at least one target entity according to the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommendation item;
[0174] For each target entity, extract content feature data and time series feature data in the entity relationship path corresponding to the target entity;
[0175] Perform feature fusion on the content feature data and the time series feature data to obtain fused feature data of the target entity;
[0176] A target recommended item is selected from at least one candidate recommended item to be recommended to the user to be recommended according to the fused feature data of the user to be recommended and the fused feature data of each candidate recommended item.
[0177] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for each entity node in the entity relationship path, the initial content feature corresponding to the entity node is determined according to the content feature data of the predecessor entity node corresponding to the entity node and the node level feature of the entity node; the initial content feature corresponding to the entity node and the content feature data of the predecessor entity node corresponding to the entity node are feature fused to obtain the node content feature of the entity node; the node content feature of the tail entity node in the entity relationship path is used as the content feature data of the entity relationship path; wherein, the predecessor entity node corresponding to the entity node is other entity nodes adjacent to the entity node in the opposite direction of the node transmission direction in the entity relationship path corresponding to the entity node; the predecessor entity node corresponding to the entity node is other entity nodes located before the entity node in the opposite direction of the node transmission direction in the entity relationship path corresponding to the entity node; the content feature data of the first entity node is the node level feature of the entity node.
[0178] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: the node level corresponding to the entity node and the content feature data of the predecessor entity node corresponding to the entity node are spliced and merged to obtain the first content feature of the entity node; according to the convolution kernel weight corresponding to the entity relationship path, the first content feature of the entity node is feature extracted to obtain the initial content feature; wherein the convolution kernel weight corresponding to the entity relationship path is determined based on the node level features of each entity node contained in the entity relationship path.
[0179] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: based on the long short-term memory network LSTM, the hidden state features of the nodes at different time steps in the entity relationship path corresponding to the target entity are extracted; the time step corresponds to the entity node in the entity relationship path; for each time step, the level weight of the time step is determined according to the node level features of the entity node corresponding to the time step; according to the level weights of different time steps, the hidden state features at the corresponding time steps are feature fused to obtain the time series feature data of the entity relationship path.
[0180] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the hierarchical score of the entity node corresponding to the time step according to the node hierarchical features of the entity node corresponding to the time step; determining the hierarchical weight of the time step according to the proportion of the hierarchical score of the entity node corresponding to the time step in the hierarchical scores of each entity node in the entity relationship path.
[0181] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for each entity relationship path corresponding to the target entity, the content feature data and the corresponding time series feature data of the entity relationship path are spliced and fused to obtain the path fusion feature of the entity relationship path; the path fusion features of each entity relationship path corresponding to the target entity are fused again to obtain the fusion feature data of the target entity.
[0182] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: for each entity relationship path corresponding to the target entity, the path category of the entity relationship path is determined according to the path length of the entity relationship path; the path score of each entity relationship path under the corresponding path category is determined according to the path fusion features of each entity relationship path under the same path category corresponding to the target entity; the intra-class path weight of the entity relationship path is determined according to the path score of the entity relationship path and the proportion of the path scores of each entity relationship path under the corresponding path category; according to the intra-class path weight of each entity relationship path under the same path category, the path fusion features of each entity relationship path under the corresponding path category are weightedly fused to obtain the target fusion feature of the corresponding path category; the target fusion features of different path categories are fused again to obtain the fusion feature data of the target entity.
[0183] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0184] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0185] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0186] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. An item recommendation method, characterized in that: include: Determine an entity relationship path corresponding to at least one target entity according to the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommendation item; For each target entity, extract content feature data and time series feature data in the entity relationship path corresponding to the target entity; Performing feature fusion on the content feature data and the time series feature data to obtain fused feature data of the target entity; A target recommended item is selected from the at least one candidate recommended item to be recommended to the user to be recommended according to the fused feature data of the user to be recommended and the fused feature data of each of the candidate recommended items.
2. The method according to claim 1, characterized in that Extracting content feature data in the entity relationship path corresponding to the target entity includes: For each entity node in the entity relationship path, determining the initial content feature corresponding to the entity node according to the content feature data of the predecessor entity node corresponding to the entity node and the node level feature of the entity node; Performing feature fusion on the initial content feature corresponding to the entity node and the content feature data of the preceding entity node corresponding to the entity node to obtain the node content feature of the entity node; Using the node content feature of the tail entity node in the entity relationship path as the content feature data of the entity relationship path; Among them, the predecessor entity node corresponding to the entity node is the other entity node adjacent to the entity node in the opposite direction of the node transmission direction in the entity relationship path corresponding to the entity node; the preceding entity node corresponding to the entity node is the other entity node located before the entity node in the opposite direction of the node transmission direction in the entity relationship path corresponding to the entity node; the content feature data of the first entity node is the node level feature of the entity node.
3. The method according to claim 2, characterized in that The determining, based on content feature data of a predecessor entity node corresponding to the entity node and a node level feature of the entity node, an initial content feature corresponding to the entity node comprises: Concatenate and fuse the node level corresponding to the entity node and the content feature data of the predecessor entity node corresponding to the entity node to obtain a first content feature of the entity node; According to the convolution kernel weight corresponding to the entity relationship path, feature extraction is performed on the first content feature of the entity node to obtain an initial content feature; wherein the convolution kernel weight corresponding to the entity relationship path is determined based on the node level features of each entity node included in the entity relationship path.
4. The method according to claim 1, characterized in that: Extracting temporal feature data in the entity relationship path corresponding to the target entity includes: Based on the long short-term memory network LSTM, extract the hidden state features of the nodes at different time steps in the entity relationship path corresponding to the target entity; the time step corresponds to the entity node in the entity relationship path; For each time step, determining the level weight of the time step according to the node level characteristics of the entity node corresponding to the time step; According to the hierarchical weights of different time steps, feature fusion is performed on the hidden state features at the corresponding time steps to obtain the temporal feature data of the entity relationship path.
5. The method according to claim 4, characterized in that The step of determining the level weight of the time step according to the node level feature of the entity node corresponding to the time step includes: Determining a level score of the entity node corresponding to the time step according to a node level feature of the entity node corresponding to the time step; The hierarchical weight of the time step is determined according to the proportion of the hierarchical score of the entity node corresponding to the time step to the hierarchical score of each entity node in the entity relationship path.
6. The method according to any one of claims 1 to 5, characterized in that: If the number of entity relationship paths corresponding to the target entity is at least two, the step of fusing the content feature data and the temporal feature data to obtain fused feature data of the target entity includes: For each entity relationship path corresponding to the target entity, concatenate and fuse the content feature data and the corresponding time series feature data of the entity relationship path to obtain a path fusion feature of the entity relationship path; The path fusion features of each entity relationship path corresponding to the target entity are fused again to obtain fusion feature data of the target entity.
7. The method according to claim 6, characterized in that The step of fusing the path fusion features of each entity relationship path corresponding to the target entity again to obtain fusion feature data of the target entity includes: For each entity relationship path corresponding to the target entity, determining a path category of the entity relationship path according to a path length of the entity relationship path; Determine the path score of each entity relationship path under the corresponding path category according to the path fusion characteristics of each entity relationship path under the same path category corresponding to the target entity; Determining the intra-class path weight of the entity relationship path according to the path score of the entity relationship path and the proportion of the path scores of each entity relationship path under the corresponding path category; According to the intra-class path weights of each entity relationship path under the same path category, the path fusion features of each entity relationship path under the corresponding path category are weightedly fused to obtain the target fusion features of the corresponding path category; The target fusion features of different path categories are fused again to obtain the fusion feature data of the target entity.
8. An item recommendation device, characterized in that: include: A path determination module, used to determine an entity relationship path corresponding to at least one target entity according to the user needs and historical behavior data of the user to be recommended; wherein the target entity includes the user to be recommended and at least one candidate recommendation item; A feature extraction module, used to extract content feature data and time series feature data in the entity relationship path corresponding to each target entity; A feature fusion module, used to perform feature fusion on the content feature data and the time series feature data to obtain fused feature data of the target entity; The item selection module is used to select a target recommended item from the at least one candidate recommended item according to the fused feature data of the user to be recommended and the fused feature data of each candidate recommended item.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.