Information recommendation method and device based on time sequence knowledge graph

By using a time-series knowledge graph-based information recommendation method, and leveraging multi-head attention and importance scores to dynamically capture user interest features, this approach solves the problem of static recommendation results in existing recommendation systems and achieves more accurate personalized recommendations.

CN120821837BActive Publication Date: 2025-11-21北京观微科技有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511333959.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-18
Publication Date
2025-11-21
Estimated Expiration
2045-09-18

AI Technical Summary

Technical Problem

Existing recommendation systems struggle to effectively capture and process the dynamic evolution of user behavior and item characteristics over time, resulting in relatively static recommendation results, poor accuracy, and an inability to achieve personalized recommendations.

Method used

This paper proposes an information recommendation method based on temporal knowledge graphs. By obtaining the feature representations of candidate entities in the temporal knowledge graph, and using a multi-head attention mechanism to combine importance scores and attention scores, the target entities are determined, thereby realizing dynamic capture of user interests and personalized recommendations.

Benefits of technology

It significantly improves the accuracy of recommendation results, making them more aligned with users' immediate interests and enhancing the effectiveness of personalized recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120821837B_ABST
    Figure CN120821837B_ABST
Patent Text Reader

Abstract

The application provides a time sequence knowledge graph-based information recommendation method and device, and relates to the field of information processing. The method comprises: receiving an information query request sent by a user terminal and comprising a to-be-queried entity; obtaining candidate entities related to the to-be-queried entity in a time sequence knowledge graph representing user interest characteristics according to the information query request, wherein the time sequence knowledge graph comprises a plurality of different entities and inter-entity relationships carrying timestamps; obtaining feature representations of each candidate entity in the time sequence knowledge graph, wherein the feature representation of each entity in the time sequence knowledge graph is determined according to the importance scores of all neighbor entities in different time scales and the attention scores assigned to the neighbor entities, and the importance scores in different time scales are determined according to the inter-entity relationships carrying timestamps between the neighbor entities and the entities pointing to the neighbor entities; then, a target entity is determined from the candidate entities and sent to the user terminal. The application can improve the personalized recommendation effect.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of information processing, in particular to a method and device for information recommendation based on a time sequence knowledge graph. BACKGROUND

[0002] Time sequence knowledge graph representation learning is an important research direction in the field of knowledge graph, and its core goal is to effectively express and efficiently reason the relationship evolving over time in the knowledge graph. This learning method has shown specific application potential in recommendation systems, event prediction and other fields.

[0003] The current mainstream recommendation system construction methods include content-based recommendation, collaborative filtering recommendation, association rule-based recommendation, knowledge-based recommendation and hybrid recommendation and other modes. However, these traditional methods have obvious technical bottlenecks in dealing with dynamic time information, that is, it is difficult to effectively capture and process the dynamic evolution process of user behavior and item characteristics over time. This limitation directly leads to the fact that the generated recommendation results are often static, the accuracy of the recommendation results is poor (not consistent with the user's immediate interest), personalized recommendation for users cannot be achieved, and the recommendation effect is poor. SUMMARY

[0004] The present application provides a method and device for information recommendation based on a time sequence knowledge graph to solve the defect that the accuracy of the recommendation results is poor in the prior art, which can significantly improve the personalized recommendation effect.

[0005] The present application provides a method for information recommendation based on a time sequence knowledge graph, comprising:

[0006] receiving an information query request sent by a user terminal, the information query request including a to-be-queried entity;

[0007] According to the information query request, a candidate entity related to the to-be-queried entity is obtained in a time sequence knowledge graph representing user interest characteristics, the time sequence knowledge graph including a plurality of different entities and inter-entity relationships carrying timestamps;

[0008] The feature representation of each candidate entity is obtained in the time sequence knowledge graph, wherein the feature representation of each entity in the time sequence knowledge graph is determined according to the importance score of its neighbor entity at different time scales and the attention score assigned to the neighbor entity by the current entity, the importance score of the neighbor entity at different time scales being determined according to the neighbor entity and the inter-entity relationship carrying a timestamp between the entity pointing to the neighbor entity, the neighbor entity being all entities in the time sequence knowledge graph that have the inter-entity relationship with the current entity;

[0009] determine a target entity from the candidate entities according to the information query request and respective feature representations of the candidate entities;

[0010] send the target entity to the user terminal in response to the information query request.

[0011] According to the information recommendation method provided in the present application, the entities in the time sequence knowledge graph include a first entity, the first entity is any one entity in the time sequence knowledge graph, and the feature representation of the first entity is determined through the following steps:

[0012] According to the neighbor entities of the first entity and the inter-entity relationship between the entities pointing to the neighbor entities, first importance scores of the neighbor entities on a historical time scale and second importance scores of the neighbor entities on a future time scale are determined.

[0013] According to the first importance scores and the second importance scores, a comprehensive importance score of the neighbor entities is determined.

[0014] An attention score assigned to the neighbor entities by the first entity is obtained.

[0015] According to the comprehensive importance score and the attention score, a feature representation of the first entity is determined based on a multi-head attention mechanism.

[0016] According to the information recommendation method provided in the present application, the inter-entity relationship is described by an event, and the determination of the first importance scores of the neighbor entities on the historical time scale and the second importance scores of the neighbor entities on the future time scale according to the neighbor entities of the first entity and the inter-entity relationship between the entities pointing to the neighbor entities includes:

[0017] For the neighbor entity, a second entity and a third entity are determined according to the inter-entity relationship, the second entity is an entity pointing to the neighbor entity, and the third entity is an entity pointed to by the second entity.

[0018] According to the time stamp carried by the inter-entity relationship between the neighbor entity and the second entity, first decay weights of an event corresponding to the inter-entity relationship between the neighbor entity and the second entity on a historical time scale and second decay weights of the event on a future time scale are determined.

[0019] According to the time stamp carried by the inter-entity relationship between the second entity and the third entity, third decay weights of an event corresponding to the inter-entity relationship between the second entity and the third entity on a historical time scale and fourth decay weights of the event on a future time scale are determined.

[0020] The first importance score of the neighboring entity is determined based on the first attenuation weight and the third attenuation weight;

[0021] The second importance score of the neighboring entity is determined based on the second attenuation weight and the fourth attenuation weight.

[0022] According to the information recommendation method provided in this application, the first attenuation weight is determined by the following formula (1), and the second attenuation weight is determined by the following formula (2);

[0023]

[0024]

[0025] in, This refers to the timestamps of events that occurred corresponding to the relationships between entities. The decay weight of the event over a historical timescale. As the decay weight of the event over future time scales, For the start timestamp, This is the end timestamp.

[0026] According to the information recommendation method provided in this application, the first importance score is determined by the following formula (3), and the second importance score is determined by the following formula (4);

[0027]

[0028]

[0029] in, For entities The first importance score, For entities Feature representation, The damping factor, For entities Feature representation, For pointing to entities The set of features representing entities, For entities With entity The timestamps of events corresponding to the relationships between entities. For entities With entity The first decay weight of the events corresponding to the inter-entity relationships on the historical time scale. For entities Feature representation, For entities The set of characteristic representations of an entity is indicated. For entities With entity The timestamps of events corresponding to the relationships between entities. For entities With entity The third decay weight of events corresponding to the relationships between entities on the historical time scale. For entities The first importance score; For entities The second most important score, For entities With entity The second decay weight of events corresponding to the relationships between entities on future time scales. For entities With entity The fourth decay weight of events corresponding to the relationships between entities on future time scales. For entities The second importance score.

[0030] According to the information recommendation method provided in this application, the step of determining the feature representation of the first entity based on the importance composite score and the attention score, using a multi-head attention mechanism, includes:

[0031] Based on the attention score, determine the attention weight assigned by the first entity to the neighboring entity;

[0032] Based on the overall importance score, determine the relative importance score of the neighboring entity among all neighboring entities;

[0033] Based on the attention weights, attention scores, and relative importance scores, the feature representation of the first entity is determined using a multi-head attention mechanism.

[0034] According to the information recommendation method provided in this application, the feature representation of the first entity is determined by the following formula (5);

[0035] (5)

[0036] in, For entities Feature representation, For the number of attention heads, For entities The set of feature representations of neighboring entities, For the first An entity whose attention is determined. For neighboring entities The assigned attention weights For the first The transformation matrix of each attention head, For entities Feature representation, For entities The relative importance score, For the first Retain the entity in each attention head The residual connection weight matrix of the original features.

[0037] According to the information recommendation method provided in this application, the information query request includes a head entity and a tail entity. The step of obtaining candidate entities related to the entity to be queried from a time-series knowledge graph representing user interest features, based on the information query request, includes:

[0038] If the entity to be queried is the head entity, the entities in the time-series knowledge graph that have inter-entity relationships with the tail entity are determined as the candidate entities;

[0039] If the entity to be queried is the tail entity, the entities in the time-series knowledge graph that have inter-entity relationships with the head entity are determined as the candidate entities.

[0040] According to the information recommendation method provided in this application, determining the target entity among the candidate entities based on the information query request and each of the feature representations includes:

[0041] Determine the vector representation of the information query request;

[0042] Determine the matching score between the vector representation and each of the feature representations;

[0043] The candidate entities whose matching scores are greater than the matching score threshold are identified as the target entities.

[0044] This application also provides an information recommendation device based on a time-series knowledge graph, including:

[0045] The receiving module is used to receive information query requests sent by user terminals, wherein the information query requests include entities to be queried;

[0046] The first acquisition module is used to acquire candidate entities related to the entity to be queried from a time-series knowledge graph representing user interest features according to the information query request. The time-series knowledge graph includes multiple different entities and relationships between entities carrying timestamps.

[0047] The second acquisition module is configured to acquire feature representations of each of the candidate entities in the time sequence knowledge graph, wherein the feature representation of each entity in the time sequence knowledge graph is determined according to the importance scores of neighbor entities of the entity at different time scales, and the importance scores of the neighbor entities at the different time scales are determined according to the inter-entity relations carrying timestamps.

[0048] The first determination module is configured to determine a target entity among the candidate entities according to the information query request and the feature representations.

[0049] The sending module is configured to send the target entity to the user terminal in response to the information query request.

[0050] The present application also provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the information recommendation method based on the time sequence knowledge graph according to any of the above when executing the computer program.

[0051] The present application also provides a non-transitory computer-readable storage medium, which stores a computer program, and the computer program is executable on a processor to implement the information recommendation method based on the time sequence knowledge graph according to any of the above.

[0052] The present application also provides a computer program product, which includes a computer program, and the computer program is executable on a processor to implement the information recommendation method based on the time sequence knowledge graph according to any of the above.

[0053] When the method of the present application is implemented, after receiving an information query request, candidate entities related to a to-be-queried entity in the information query request are acquired in a time sequence knowledge graph representing user interest features, then feature representations of each of the candidate entities are acquired in the time sequence knowledge graph, and a target entity among the candidate entities is determined according to the information query request and the feature representations, and finally the target entity is returned to a user terminal as a recommendation result in response to the information query request. When acquiring the feature representation of each entity in the time sequence knowledge graph, the present application refers to the importance scores of all neighbor entities of the entity at different time scales and the attention scores assigned to the neighbor entities, and the importance scores of each of the neighbor entities at the different time scales are determined according to the inter-entity relations carrying timestamps between the neighbor entities and the entity pointing to the neighbor entities. In this way, a more comprehensive feature representation of each entity can be obtained, and user interest features can be avoided from being missed, and the final recommendation result is also more in line with the instant interest of the user, and the accuracy is also higher. Therefore, the scheme of the present application can significantly improve the personalized recommendation effect, and can effectively solve the problems in the related art. BRIEF DESCRIPTION OF DRAWINGS

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

[0055] Figure 1 is a flowchart of an information recommendation method based on a time sequence knowledge graph according to an embodiment of the present application;

[0056] Figure 2 is a structural block diagram of an information recommendation device based on a time sequence knowledge graph according to an embodiment of the present application;

[0057] Figure 3 is a physical structure schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0058] In order to make the objects, technical solutions and advantages of the present application clearer, the following will combine the drawings in the present application to clearly and completely describe the technical solutions in the present application. Obviously, the described embodiments are some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort fall within the scope of protection of the present application.

[0059] The execution subject of the information recommendation method based on the time sequence knowledge graph provided in the present application is any electronic device with data processing function deployed with an information recommendation system. After receiving an information query request sent by a user terminal, the electronic device responds to the information query request, obtains the best recommendation result through the information recommendation system, and finally returns the recommendation result to the user terminal, completing the information recommendation.

[0060] The following will combine Figure 1 to introduce the working process of the information recommendation system in detail. Figure 1 is a flowchart of an information recommendation method based on a time sequence knowledge graph according to an embodiment of the present application. Referring to Figure 1 , the electronic device in the information recommendation can include the following steps:

[0061] Step 101, receiving an information query request sent by a user terminal, the information query request including a to-be-queried entity.

[0062] In the present application, all terminals that need to obtain recommended information through the information recommendation system are collectively referred to as user terminals, and the device type of the user terminal is not specifically limited in the present application.

[0063] An entity is an independent thing or concept described in a knowledge graph, and is a basic unit of knowledge. For example, in (user A, likes, science fiction, 2022), user A and science fiction are different entities.

[0064] In this application, the entity to be queried is an unknown entity (i.e., the entity to be queried) in the information query request. For example, an information query request is (user A, likes, unknown character, 2022), and the unknown character indicates the entity to be queried.

[0065] Step 102, according to the information query request, obtaining candidate entities related to the entity to be queried in the time sequence knowledge graph representing the user interest feature, the time sequence knowledge graph including a plurality of different entities and entity relationship carrying time stamp.

[0066] In this application, the information recommendation system has learned the time sequence knowledge graph representing the user interest feature in advance, and has the function of recommending personalized information to the user according to the time sequence knowledge graph.

[0067] The time sequence knowledge graph used in this application is mainly used to record information related to the user's interest feature, and all events related to the user's interest feature in the time sequence knowledge graph carry time stamps. In other words, according to the time sequence knowledge graph, the change of the user's interest over time can be determined.

[0068] Among them, the time sequence knowledge graph contains all the information of the user, that is, all users share a time sequence knowledge graph.

[0069] Specifically, the time sequence knowledge graph includes a plurality of different entities and entity relationship carrying time stamp. The time sequence knowledge graph uses nodes to represent different entities, and uses events to describe the relationship between different entities (i.e., entity relationship). For example, for (user A, likes, science fiction, 2022), the entity relationship between user A and science fiction is described using the event "likes", and the time stamp of the event is 2022. For example, for (user B, attention, comedy, 2021), the entity relationship between user B and comedy is described using the event "attention", and the time stamp of the event is 2021.

[0070] When performing step 102, all entities related to the entity to be queried in the time sequence knowledge graph can be obtained as candidate entities according to the information given in the information query request. The method of obtaining candidate entities is not limited in this application, and can be set according to actual needs.

[0071] Step 103, obtaining the feature representation of each candidate entity in the time sequence knowledge graph, wherein the feature representation of each entity in the time sequence knowledge graph is determined according to the importance score of its neighbor entity on different time scales and the attention score assigned by the current entity to the neighbor entity, and the importance score of the neighbor entity on different time scales is determined according to the inter-entity relationship between the neighbor entity and the entity pointing to the neighbor entity, and the neighbor entity is all the entities in the time sequence knowledge graph that have an inter-entity relationship with the current entity.

[0072] In the time sequence knowledge graph, each node (entity) has node features, and the node features are represented by vectors. Therefore, the feature representation of each entity is the vector form of the node features of the corresponding node.

[0073] In actual implementation, the information recommendation system updates the feature representation of each entity in the time sequence knowledge graph according to the pre-set update strategy. Therefore, when step 103 is executed, the feature representation of each candidate entity in the current time sequence knowledge graph can be directly obtained, and it is not necessary to temporarily calculate the feature representation of each candidate entity, so as to improve the information recommendation efficiency.

[0074] The update strategy can be regular update or update after receiving an update request, and the application does not make specific limitation on the update strategy.

[0075] The application improves the way of obtaining the feature representation of each entity in the time sequence knowledge graph. When determining the feature representation of a single entity, the importance score of each neighbor entity on different time scales is first calculated and the attention score of each neighbor entity is assigned, and then the importance score and the attention score of all neighbor nodes are integrated to determine the feature representation of the entity. When calculating the importance score of the neighbor entity, the inter-entity relationship between the neighbor entity and the entity pointing to the neighbor entity in the time sequence knowledge graph can be used to calculate. Through the above way, more comprehensive feature representation of each entity can be obtained, avoiding missing the user interest features, and thus the accuracy of the recommendation result can be significantly improved (i.e. more in line with the current interest of the user).

[0076] Step 104, determining the target entity in the candidate entity according to the information query request and the feature representation.

[0077] Step 104 is executed, and the information query request and the feature representation of each candidate entity are comprehensively analyzed, so that the candidate entity with low matching degree is filtered, and the remaining candidate entity with high matching degree is taken as the target entity.

[0078] Step 105, responding to the information query request, and sending the target entity to the user terminal.

[0079] In step 105, the target entity is sent to the user terminal as the information recommended to the user finally, and the information recommendation is completed.

[0080] In the method of the present application, after receiving the information query request, the candidate entities related to the to-be-queried entity in the information query request are first obtained in the time sequence knowledge graph representing the user interest features, then the feature representations of each candidate entity are obtained in the time sequence knowledge graph, and the target entity in the candidate entities is determined according to the information query request and each feature representation, and finally the target entity is returned to the user terminal as the recommendation result in response to the information query request. In the present application, when obtaining the feature representation of each entity in the time sequence knowledge graph, the importance scores of all neighbor entities of the entity at different time scales and the attention scores assigned to the neighbor entities are referred to, and the importance scores of the neighbor entities at different time scales are determined according to the inter-entity relationships carrying time stamps between the neighbor entities and the entities pointing to the neighbor entities in the time sequence knowledge graph. In this way, a more comprehensive feature representation of each entity can be obtained, the user interest features can be avoided to be missed, the accuracy of the final recommendation result is higher, and the personalized recommendation effect can be significantly improved, thereby solving the problems in the related art.

[0081] In combination with the above embodiments, in an implementation, the entities in the time sequence knowledge graph include a first entity, the first entity is any one of the entities in the time sequence knowledge graph, and the feature representation of the first entity is determined by the following steps:

[0082] In step 201, the first importance score of each neighbor entity of the first entity at a historical time scale and the second importance score at a future time scale are determined according to the inter-entity relationships carrying time stamps between the neighbor entities of the first entity and the entities pointing to the neighbor entities.

[0083] In the present application, the neighbor entities of an entity E are the entities having inter-entity relationships with the entity E, and include the entities pointing to the entity E and the entities pointed to by the entity E.

[0084] In step 201, the first importance score and the second importance score of each neighbor entity of the first entity need to be determined. For example, when the neighbor entities of the first entity are entity 1, entity 2 and entity 3, the first importance score and the second importance score of entity 1, the first importance score and the second importance score of entity 2, and the first importance score and the second importance score of entity 3 need to be determined.

[0085] In step 202, the importance comprehensive score of the neighbor entity is determined according to the first importance score and the second importance score.

[0086] In step 202, for each neighbor entity of the first entity, a comprehensive importance score is determined according to the first importance score and the second importance score of the neighbor entity. For example, when the neighbor entities of the first entity are entity 1, entity 2 and entity 3, the comprehensive importance score of entity 1 is determined according to the first importance score and the second importance score of entity 1, the comprehensive importance score of entity 2 is determined according to the first importance score and the second importance score of entity 2, and the comprehensive importance score of entity 3 is determined according to the first importance score and the second importance score of entity 3.

[0087] In the present application, the information recommendation system comprises a multi-scale entity importance module. Steps 201-202 can be implemented by the multi-scale entity importance module.

[0088] In step 203, an attention score assigned to each neighbor entity of the first entity is obtained.

[0089] In the present application, an attention score needs to be assigned to each neighbor entity of the first entity. Different neighbor entities can be assigned different attention scores. The higher the attention score assigned to a neighbor entity, the greater the influence of the neighbor entity on the feature representation of the first entity.

[0090] In the present application, the information recommendation system further comprises a local attention mechanism-based entity feature updating module. In step 203, the attention score assigned to each neighbor entity of the first entity can be determined by the local attention mechanism-based entity feature updating module.

[0091] In step 204, based on the multi-head attention mechanism, the feature representation of the first entity is determined according to the comprehensive importance score and the attention score.

[0092] In step 204, based on the multi-head attention mechanism, the final feature representation of the first entity is determined according to the comprehensive importance score of each neighbor entity of the first entity and the attention score assigned to each neighbor entity of the first entity.

[0093] In the present application, the information recommendation system further comprises a global information and local information fusion module. In step 204, the feature representation of the first entity can be determined by the global information and local information fusion module.

[0094] In actual implementation, the method for determining the feature representation of each entity in the time sequence knowledge graph is exactly the same as the method for determining the feature representation of the first entity.

[0095] In the present application, when determining the feature representation of an entity E, the importance comprehensive score of each neighbor entity (reflecting the global influence of the neighbor entity in the time dimension) is obtained according to the importance scores of the neighbor entity in multiple different time scales, and the final feature representation of the entity E is determined in combination with the attention score assigned to each neighbor entity of the entity E. This way can comprehensively evaluate the information of the entity E, so that the information recommendation system can not only capture global structural information (through the importance scores of the neighbor entity in the time dimension), but also reflect local relationships (through the attention score), which can effectively improve the accuracy and richness of the feature representation of the entity E, and make the information recommendation system better understand the complex role and connection of the entity E in the time knowledge graph.

[0096] In combination with the above embodiments, in an implementation, step 204 can specifically include:

[0097] Step 2041, according to the attention score, determining the attention weight assigned to the neighbor entity by the first entity.

[0098] In the entity feature updating module of the local attention mechanism, the local attention mechanism is adopted, and different attention weights are assigned to each neighbor entity, so as to more accurately capture the relationship between entities. The basic idea of the attention mechanism is to learn the attention score of each entity to its neighbor entity, so that the information recommendation system can better capture the local structure and feature information between entities. First, a conversion matrix is dynamically generated from the relationship and timestamp . Specifically, the relationship vector and the time vector are concatenated, and the calculation formula is:

[0099]

[0100] wherein, is a transformation function, and are trainable weight matrices, and are bias parameters, and represent different entities, represent the entity and the entity inter-entity relationship (represented by a vector), represent the timestamp of the event corresponding to the inter-entity relationship between the entity and the entity (represented by a vector).

[0101] Therefore, through the above formula, the conversion matrix between the entity and each neighbor entity can be obtained, for example, the conversion matrix between the entity the neighbor entities of entity , entity , and entity , the attention scores of , , and can be obtained.

[0102] In order to normalize the attention scores among all neighbor entities, the attention scores are converted into attention weights using the function. The specific formula is as follows:

[0103]

[0104] wherein, , represent different entities, is the set of feature representations of the neighbor entities of entity , and entity is the neighbor entity of entity . The greater the , , the higher the degree of attention of entity to entity . is the feature representation of entity . is the feature representation of entity . is the feature representation of entity . represents the attention score of entity assigned to entity .

[0105] For example, if the neighbor entities of entity are entity , entity , and entity , and the conversion matrices are , , and , respectively, based on the above formula, the attention weight assigned by entity to entity can be calculated according to , the attention weight assigned by entity to entity can be calculated according to , and the attention weight assigned by entity to entity can be calculated according to .The attention weight .

[0106] In the present application, by normalization, the sum of all attention weights is ensured to be 1, so that the attention degree of the entity to all neighbor entities can be reasonably allocated. This step is to ensure that when updating the feature representation of the node, the influence of all neighbor entities on the entity can be considered in balance.

[0107] Step 2042, according to the importance comprehensive score, determine the relative importance score of the neighbor entity in all neighbor entities.

[0108] Specifically, in the global information and local information fusion module, the relative importance score of each neighbor entity can be calculated by the following formula:

[0109]

[0110] wherein, denotes the relative importance score of the entity , and denotes the importance score of the entity .

[0111] Through the above formula, the relative importance score of each neighbor entity of the entity can be calculated. The higher the relative importance score of the neighbor entity , the higher the degree of attention of the neighbor entity to the entity in all neighbor entities of the entity .

[0112] Step 2043, according to the attention weight, the attention score and the relative importance score, determine the feature representation of the first entity based on the multi-head attention mechanism.

[0113] In the present application, by combining the multi-time scale entity importance score and the local attention mechanism, the global importance score of the entity is integrated into the local attention, and the multi-head attention mechanism is introduced, which can provide a more comprehensive feature representation of the entity, and thus can improve the accuracy of the subsequent recommendation results.

[0114] In combination with the above embodiments, in an implementation, step 2043 can be implemented by the following formula:

[0115]

[0116] wherein, is the number of attention heads, entity determined for the th attention head neighbor entity assigned attention weight, transition matrix for the th attention head residual connection weight matrix for preserving the original features of the entity in the th attention head , where the denotes the feature representation of the entity before updating, and the denotes the feature representation of the entity after updating.

[0117] In this application, in order to further improve the expressiveness and capture diversity of the information recommendation system, multi-head attention is introduced, which can be set according to actual needs, for example, it can be set to 16.

[0118] In this application, the global importance and local information of the entity are combined. The global importance reflects the influence of the entity in the entire network through the multi-time scale entity importance, while the local attention mechanism ensures the importance of the relationship between the entity and its neighbor entity in the update of the feature representation. By integrating the two, this application can achieve a comprehensive evaluation of the entity information, so that the information recommendation system can not only capture global structural information, but also reflect local relationships in detail.

[0119] In combination with the above embodiments, in an implementation manner, step 201 can include:

[0120] Step 2011, for the neighbor entity, determining a second entity and a third entity according to the relationship between entities, the second entity being an entity pointing to the neighbor entity, and the third entity being an entity pointed to by the second entity.

[0121] Since the relative importance score of each neighbor entity of the entity is needed when calculating the feature representation of the entity , the relative importance score is determined according to the importance comprehensive score, and the importance comprehensive score is determined according to the first importance score and the second importance score. The process of obtaining the first importance score and the second importance score of each neighbor entity will be described in detail below. This description takes the neighbor entity as an example , it can be understood that the principle of obtaining the first importance score and the second importance score of each entity in the time sequence knowledge graph is exactly the same as that of obtaining the first importance score and the second importance score of the entity .

[0122] In step 2011, for the neighbor entity , first determine the second entity and the third entity according to the relationship between the entities in the time sequence knowledge graph, the second entity is all entities pointing to the neighbor entity , and the third entity is all entities pointed to by the second entity.

[0123] Step 2012, according to the time stamp carried by the inter-entity relationship between the neighbor entity and the second entity, determine the first decay weight of the inter-entity relationship between the neighbor entity and the second entity on the historical time scale and the second decay weight on the future time scale respectively.

[0124] In the time sequence knowledge graph, the importance of an entity depends not only on its connection with other entities, but also on the time of the event. In order to more accurately capture the dynamic influence of time on entity importance, this application introduces a multi-scale time decay mechanism, which measures the importance of entities in different periods through two time dimensions of history and future. This mechanism enables the information recommendation system to flexibly capture the importance changes of entities in different time ranges, thereby improving the accuracy of entity importance evaluation. The definition of the time decay function is as follows:

[0125]

[0126]

[0127] Wherein, is the time stamp of the event corresponding to the inter-entity relationship. If the time information of the event is an interval, the middle point of the interval is used as the time stamp. For example, the event occurs in March 2023 (i.e. from March 1 to March 31), then the middle point is March 16.

[0128] is the decay weight of the event on the historical time scale. is used to measure the importance decay of the entity in the historical data. As time goes on, the farther the event is from the past time point , the less important it is to the entity.

[0129] is the decay weight of the event on the future time scale. is used to measure the influence of the event on the entity in the future. As the event approaches the future time point , the greater its influence on the future, and vice versa.

[0130] is the start time stamp, is the end time stamp. and is the timestamp of the start and end of the data set, which refers to the collection of all the time-series facts (or events) used to build and analyze the time-series knowledge graph.

[0131] In performing step 2012, according to the timestamp carried by the inter-entity relationship between the neighbor entity and the second entity, the first decay weight of the event corresponding to the inter-entity relationship between the neighbor entity and the second entity on the historical time scale is calculated using the formula , and the second decay weight of the event corresponding to the inter-entity relationship between the neighbor entity and the second entity on the future time scale is calculated using the formula .

[0132] For example, if the second entity is entity 1-entity 3, then the first decay weight and the second decay weight of the event corresponding to the inter-entity relationship between the neighbor entity and entity 1, the first decay weight and the second decay weight of the event corresponding to the inter-entity relationship between the neighbor entity and entity 2, and the first decay weight and the second decay weight of the event corresponding to the inter-entity relationship between the neighbor entity and entity 3 need to be calculated.

[0133] Step 2013, according to the timestamp carried by the inter-entity relationship between the second entity and the third entity, determine the third decay weight on the historical time scale and the fourth decay weight on the future time scale of the event corresponding to the inter-entity relationship between the second entity and the third entity.

[0134] In performing step 2013, according to the timestamp carried by the inter-entity relationship between the second entity and the third entity , the third decay weight of the event corresponding to the inter-entity relationship between the second entity and the third entity on the historical time scale is calculated using the formula , and the fourth decay weight of the event corresponding to the inter-entity relationship between the second entity and the third entity on the future time scale is calculated using the formula .

[0135] For example, if the third entity corresponding to a certain second entity is entity 4-entity 6, then the third decay weight and the fourth decay weight of the event corresponding to the inter-entity relationship between the second entity and entity 4, the third decay weight and the fourth decay weight of the event corresponding to the inter-entity relationship between the second entity and entity 5, and the third decay weight and the fourth decay weight of the event corresponding to the inter-entity relationship between the second entity and entity 6 need to be calculated.

[0136] Step 2014, according to the first decay weight and the third decay weight, determine the first importance score of the neighbor entity.

[0137] ​In the present application, the first importance score of the entity can be determined by the following formula:

[0138]

[0139] wherein, is the first importance score of the entity is a damping factor, is the feature representation of the entity is a set of feature representations of entities (i.e., second entities) pointing to the entity is a timestamp of the event corresponding to the inter-entity relationship between the entity and the entity , is a timestamp of the event corresponding to the inter-entity relationship between the entity and the entity , is the first decay weight of the event on the historical time scale corresponding to the inter-entity relationship between the entity and the entity , is the feature representation of the entity , is a set of feature representations of entities (i.e., third entities) pointing to the entity , is a timestamp of the event corresponding to the inter-entity relationship between the entity and the entity , is the third decay weight of the event on the historical time scale corresponding to the inter-entity relationship between the entity and the entity , is the first importance score of the entity .

[0140] In the present application, if there are multiple events corresponding to the inter-entity relationship between the entity and the entity , the first decay weight of each event on the historical time scale can be obtained first, and then the average of the first decay weights of all events is taken as .

[0141] Step 2015, determining the second importance score of the neighbor entity according to the second decay weight and the fourth decay weight.

[0142] In the present application, the second importance score can be determined by the following formula:

[0143]

[0144] wherein, is the second importance score of the entity , is the second importance score of the entity the second decay weight of the event corresponding to the inter-entity relationship between the entity and the entity in the future time scale, the second importance score of the entity . The remaining parameters are the same as in . the fourth decay weight of the event corresponding to the inter-entity relationship between the entity and the entity in the future time scale,

[0145] . In this application, if there are multiple events corresponding to the inter-entity relationship between the entity and the entity , the second decay weight of each event in the historical time scale can be obtained first, and then the average of the second decay weights of all events is taken as .

[0146] wherein the damping factor can be valued according to actual needs, for example, it can be set to 0.85. The damping factor plays a role in adjusting the balance between the inherent importance of the entity and the importance transmitted from other connected entities in the calculation of the importance score of the entity, ensuring the robustness of the importance score calculation.

[0147] In this application, the importance score of the entity is calculated based on the time decay weight in both historical and future time scales to reflect the importance of the entity in different time dimensions. Through this way of calculating the importance of the entity in historical and future time dimensions using the time decay function, the importance of each entity can be accurately evaluated.

[0148] In an embodiment, after obtaining the first importance score and the second importance score of the entity , the importance comprehensive score of the entity can be determined by the following formula:

[0149]

[0150] wherein and are learnable parameters corresponding to the weights of the entity in the history and the future respectively, reflecting the proportion of influence in different times. Through this comprehensive method, this application can more comprehensively utilize time information to capture the importance changes of the entity in different time ranges, improving the accuracy and reliability of the entity importance evaluation. This multi-scale entity importance not only reflects the timely activity of the entity, but also captures its sustained influence in a longer period of time, making the information recommendation model more robust and more practical.

[0151] In this application, the information query request is represented in the format of query quadruple. The query quadruple is a structure containing four elements: head entity, relation, tail entity and time.

[0152] In this application, the information recommendation system also includes a time-aware Transformer model, which is used to convert the query quadruple into low-dimensional semantic vectors that accurately encode the fact content and its temporal attributes. The input of the time-aware Transformer model consists of three parts: element embedding, position embedding and time embedding. Element embedding represents the head entity, relation and tail entity in the quadruple; position embedding describes the relative position of these elements in the quadruple; time embedding captures the time dimension of the quadruple. By fusing the three kinds of embedding, this application constructs the input of the time-aware Transformer to enhance the semantic expression ability of the model in processing time-related facts.

[0153] Specifically, for a query quadruple The input embedding is calculated by merging element embedding, position embedding and time embedding. The formula is as follows:

[0154]

[0155]

[0156]

[0157] wherein, 、 、 represents the position embedding, , , represents the element embedding, for each query quadruple , is a mask vector, represents the time embedding.

[0158] After obtaining the input embedding, it is input into the time-aware Transformer model stacked by K Transformer modules, which is represented as follows:

[0159]

[0160] wherein, represents the embedded head entity vector, represents the embedded relation vector, represents the embedded tail entity vector, denotes the number of Transformer layers.

[0161] Each Transformer layer adopts a multi-head self-attention mechanism to learn the interaction features between elements in the query quadruple. Finally, the vector representation of the query quadruple is obtained through a max-pooling layer, which is calculated as follows:

[0162]

[0163] wherein, denotes the vector representation of the query quadruple (hereinafter referred to as query vector), denotes the max-pooling layer, denotes the number of Transformer layers.

[0164] In the present application, step 102 can include:

[0165] If the entity to be queried is the head entity, the entities in the time sequence knowledge graph that have an inter-entity relationship with the tail entity are determined as candidate entities.

[0166] If the entity to be queried is the tail entity, the entities in the time sequence knowledge graph that have an inter-entity relationship with the head entity are determined as candidate entities.

[0167] In the present application, the information query request expressed in the format of a query quadruple can be or wherein the unknown character represents the entity to be queried.

[0168] In the present application, the entity to be queried can be either a head entity or a tail entity, which enables the information recommendation model to perform bidirectional link prediction, i.e., the information recommendation model can not only infer the tail entity from the head entity, but also deduce the head entity from the tail entity, making the information recommendation model more comprehensive in understanding and utilizing the time sequence knowledge graph, and enabling it to cope with more types of query scenarios and recommendation tasks in actual applications.

[0169] In combination with the above embodiments, in an implementation manner, step 104 can include:

[0170] determining the vector representation of the information query request;

[0171] determining the matching scores between the vector representation and each feature representation;

[0172] determining the candidate entity corresponding to the feature representation with a matching score greater than the matching score threshold in the candidate entities as the target entity.

[0173] In the present application, the method for determining the vector representation of the information query request has been described in the foregoing, and the present application will not be repeated here.

[0174] Secondly, the application also proposes a scoring mechanism. The scoring mechanism is used to evaluate the similarity or matching degree between the query vector of the query quadruple and each candidate entity . Specifically, the application defines a scoring function to calculate the matching score, the expression is as follows:

[0175]

[0176] wherein, denotes the transpose of the vector, denotes the candidate entity.

[0177] After obtaining the matching score, the candidate entity represented by the feature with a matching score greater than the matching score threshold is determined as the target entity.

[0178] In order to optimize the scoring mechanism, the application adopts the method of batch training, and uses negative sampling to train the model used by the information recommendation system. 1 represents the unique correct entity corresponding to the current query vector , and represents that the correct entity needs to be distinguished from all possible entities in the time sequence knowledge graph. When calculating the normalized probability, the matching score of the query vector with each entity in the entity set will be considered.

[0179] Specifically, for each quadruple in the time sequence knowledge graph, the score is evaluated by calculating the cross-entropy loss of all entities in the entity set , and the calculation formula is as follows:

[0180]

[0181] wherein, is the correct answer for the query vector , for example, for the query vector , the correct entity is , and for the query vector , the correct entity is , denotes the loss function, denotes all fact sets in the time sequence knowledge graph, and a fact in the time sequence knowledge graph is represented as a quadruple.

[0182] During training, the corresponding loss value of the loss function is taken as the target for training, and when the loss value is less than a pre-set threshold, it is considered that the model can accurately screen out all target entities. ​​

[0183] The information recommendation method of the present application not only focuses on entities and inter-entity relationships, but also values the time sequence arrangement and causal relationship of events. This helps the information recommendation system better understand complex user behaviors and event sequences, such as the order of user behaviors, key factors affecting user decisions, etc. Through in-depth analysis of time series data, the time sequence knowledge graph can predict future trends and events. In the information recommendation system, this means that new products or content that users may be interested in can be predicted based on past and current data, thereby achieving personalized recommendations to users.

[0184] The information recommendation device based on the time sequence knowledge graph provided by the present application is described below. The information recommendation device described below can be mutually corresponding with the information recommendation method described above.

[0185] Figure 2 is a structural block diagram of an information recommendation device based on a time sequence knowledge graph according to an embodiment of the present application. Referring to Figure 2 , the information recommendation device 200 of the present application can include:

[0186] The receiving module 201 is configured to receive an information query request sent by a user terminal, wherein the information query request includes a to-be-queried entity.

[0187] The first obtaining module 202 is configured to obtain candidate entities related to the to-be-queried entity in a time sequence knowledge graph representing user interest characteristics according to the information query request, wherein the time sequence knowledge graph includes a plurality of different entities and inter-entity relationships carrying timestamps.

[0188] The second obtaining module 203 is configured to obtain feature representations of each of the candidate entities in the time sequence knowledge graph, wherein the feature representation of each entity in the time sequence knowledge graph is determined according to the importance scores of its neighbor entities on different time scales and the attention scores assigned to the neighbor entities by the current entity, and the importance scores of the neighbor entities on different time scales are determined according to the neighbor entities, the inter-entity relationships carrying timestamps between the neighbor entities and the entities pointing to the neighbor entities, and the neighbor entities are all entities in the time sequence knowledge graph that have the inter-entity relationships with the current entity.

[0189] The first determining module 204 is configured to determine a target entity in the candidate entities according to the information query request and each of the feature representations.

[0190] The sending module 205 is configured to send the target entity to the user terminal in response to the information query request.

[0191] According to the information recommendation apparatus 200 provided in the present application, the entity in the time sequence knowledge graph comprises a first entity, the first entity is any one entity in the time sequence knowledge graph, the information recommendation apparatus 200 further comprises a second determination module, configured to determine a feature representation of the first entity, the second determination module comprises:

[0192] a first determination submodule, configured to determine a first importance score of a neighbor entity of the first entity on a historical time scale and a second importance score of the neighbor entity on a future time scale according to the neighbor entity of the first entity and the time-stamped inter-entity relationship between the entity pointing to the neighbor entity;

[0193] a second determination submodule, configured to determine an importance comprehensive score of the neighbor entity according to the first importance score and the second importance score;

[0194] an acquisition submodule, configured to acquire an attention score allocated to the neighbor entity by the first entity;

[0195] a third determination submodule, configured to determine the feature representation of the first entity based on a multi-head attention mechanism according to the importance comprehensive score and the attention score.

[0196] According to the information recommendation apparatus 200 provided in the present application, the inter-entity relationship is described by an event, and the first determination submodule comprises:

[0197] a fourth determination submodule, configured to determine a second entity and a third entity according to the inter-entity relationship for the neighbor entity, the second entity being an entity pointing to the neighbor entity, and the third entity being an entity pointed to by the second entity;

[0198] a fifth determination submodule, configured to determine a first decay weight of an event corresponding to the inter-entity relationship between the neighbor entity and the second entity on a historical time scale and a second decay weight of the event on a future time scale according to a time stamp carried by the inter-entity relationship between the neighbor entity and the second entity;

[0199] a sixth determination submodule, configured to determine a third decay weight of an event corresponding to the inter-entity relationship between the second entity and the third entity on a historical time scale and a fourth decay weight of the event on a future time scale according to a time stamp carried by the inter-entity relationship between the second entity and the third entity;

[0200] a seventh determination submodule, configured to determine the first importance score of the neighbor entity according to the first decay weight and the third decay weight;

[0201] An eighth determining sub-module is configured to determine a second importance score of the neighbor entity according to the second decay weight and the fourth decay weight.

[0202] According to the information recommendation apparatus 200 provided in the present application, the first decay weight is determined by formula (1) as follows, and the second decay weight is determined by formula (2) as follows.

[0203]

[0204]

[0205] wherein, is a timestamp of an event corresponding to the inter-entity relationship between the entity and the entity, is a decay weight of the event on a historical time scale, is a decay weight of the event on a future time scale, is a start timestamp, is an end timestamp.

[0206] According to the information recommendation apparatus 200 provided in the present application, the first importance score is determined by formula (3) as follows, and the second importance score is determined by formula (4) as follows.

[0207]

[0208]

[0209] wherein, is a first importance score of the entity, is a feature representation of the entity, is a damping factor, is a feature representation of the entity, is a set of feature representations of entities pointing to the entity, is a timestamp of an event corresponding to the inter-entity relationship between the entity and the entity, is a first decay weight of the event on a historical time scale corresponding to the inter-entity relationship between the entity and the entity, is a feature representation of the entity, is a set of feature representations of entities pointing to the entity, is a timestamp of an event corresponding to the inter-entity relationship between the entity and the entity, is a first decay weight of the event on a historical time scale corresponding to the inter-entity relationship between the entity and the entity, is a feature representation of the entity, is a set of feature representations of entities pointing to the entity, is a timestamp of an event corresponding to the inter-entity relationship between the entity and the entity, is a first decay weight of the event on a historical time scale corresponding to the inter-entity relationship between the entity and the entity, is a feature representation of the entity, is a set of feature representations of entities pointing to the entity, is a timestamp of an event corresponding to the inter-entity relationship between the entity and the entity, is a first decay weight of the event on a historical time scale corresponding to the inter-entity relationship between the entity and the entity, is a feature representation of the entity, is a set of feature representations of entities pointing to the entity, The timestamps of events corresponding to the relationships between entities. For entities With entity The third decay weight of events corresponding to the relationships between entities on the historical time scale. For entities The first importance score; For entities The second most important score, For entities With entity The second decay weight of events corresponding to the relationships between entities on future time scales. For entities With entity The fourth decay weight of events corresponding to the relationships between entities on future time scales. For entities The second importance score.

[0210] According to the information recommendation device 200 provided in this application, the third determining submodule includes:

[0211] The ninth determining submodule is used to determine the attention weight assigned by the first entity to the neighboring entity based on the attention score;

[0212] The tenth determination submodule is used to determine the relative importance score of the neighbor entity among all neighbor entities based on the overall importance score;

[0213] The eleventh determination submodule is used to determine the feature representation of the first entity based on the attention weight, the attention score, and the relative importance score, using a multi-head attention mechanism.

[0214] According to the information recommendation device 200 provided in this application, the feature representation of the first entity is determined by the following formula (5);

[0215] (5)

[0216] in, For entities Feature representation, For the number of attention heads, For entities The set of feature representations of neighboring entities, For the first An entity whose attention is determined. For neighboring entities The assigned attention weights For the first The transformation matrix of each attention head, characteristic representation of an entity, relative importance score of an entity, residual connection weight matrix for retaining original features of an entity in the i-th attention head. According to the information recommendation device 200 provided in the application, the information query request includes a head entity and a tail entity, and the first acquisition module 202 includes:

[0217] The twelfth determination sub-module is configured to, if the to-be-queried entity is the head entity, determine an entity in the time sequence knowledge graph that has an inter-entity relationship with the tail entity as the candidate entity.

[0218] The thirteenth determination sub-module is configured to, if the to-be-queried entity is the tail entity, determine an entity in the time sequence knowledge graph that has an inter-entity relationship with the head entity as the candidate entity.

[0219] The thirteenth determination sub-module is configured to, if the to-be-queried entity is the tail entity, determine an entity in the time sequence knowledge graph that has an inter-entity relationship with the head entity as the candidate entity.

[0220] According to the information recommendation device 200 provided in the application, the first acquisition module 202 includes:

[0221] The fourteenth determination sub-module is configured to determine a vector representation of the information query request.

[0222] The fifteenth determination sub-module is configured to determine a matching score between the vector representation and each of the characteristic representations.

[0223] The sixteenth determination sub-module is configured to determine, as the target entity, a candidate entity corresponding to a characteristic representation in the candidate entities, the characteristic representation having a matching score greater than a matching score threshold.

[0224] Figure 3 is an entity structure schematic diagram of an electronic device according to an embodiment of the application. As shown in the figure, the electronic device can include a processor 310, a communications interface 320, a memory 330 and a communications bus 340, wherein the processor 310, the communications interface 320 and the memory 330 complete mutual communication through the communications bus 340. The processor 310 can invoke a logical instruction in the memory 330 to execute an information recommendation method based on a time sequence knowledge graph. Figure 3

[0225] ​​​​In addition, the logic instructions in the memory 330 described above can be implemented in the form of a software function unit and sold or used as an independent product, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0226] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program is executed by a processor, so that the computer can execute the information recommendation method based on the time sequence knowledge graph provided by the above-mentioned method.

[0227] In another aspect, the present application also provides a non-transitory computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the information recommendation method based on the time sequence knowledge graph provided by the above-mentioned method.

[0228] The device embodiments described above are only schematic, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment. Those skilled in the art can understand and implement without creative labor.

[0229] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be realized by means of software plus necessary general hardware platforms, and of course can also be realized by hardware. Based on such understanding, the technical solutions described above essentially or the parts that make contributions to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0230] It should be noted that the above examples are only used to illustrate the technical solutions of the present application, and are not intended to limit the same. Although the present application has been described in detail with reference to the foregoing examples, it should be understood by those skilled in the art that the technical solutions recorded in the foregoing examples can still be modified, or some technical features thereof can be replaced by equivalent replacements. Such modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for information recommendation based on a time-based knowledge graph, characterized in that, The method comprises: receiving an information query request sent by a user terminal, the information query request comprising a to-be-queried entity; obtaining candidate entities related to the to-be-queried entity in a time-series knowledge graph representing user interest characteristics according to the information query request, the time-series knowledge graph comprising a plurality of different entities and inter-entity relationships carrying timestamps; obtaining feature representations of each of the candidate entities in the time-series knowledge graph, wherein the feature representation of each entity in the time-series knowledge graph is determined according to the importance scores of neighbor entities of the current entity on different time scales and the attention scores assigned by the current entity to the neighbor entities, the importance scores of the neighbor entities on different time scales being determined according to the neighbor entities and the inter-entity relationships carrying timestamps between the entities pointing to the neighbor entities, the neighbor entities being all entities in the time-series knowledge graph having the inter-entity relationship with the current entity; determining a target entity among the candidate entities according to the information query request and the feature representations; sending the target entity to the user terminal in response to the information query request; wherein the entities in the time-series knowledge graph comprise a first entity, the first entity being any one of the entities in the time-series knowledge graph, and the feature representation of the first entity being determined by the following steps: determining first importance scores of neighbor entities of the first entity on a historical time scale and second importance scores of the neighbor entities on a future time scale according to the inter-entity relationships carrying timestamps between the neighbor entities and the entities pointing to the neighbor entities; determining an importance comprehensive score of the neighbor entities according to the first importance scores and the second importance scores; obtaining attention scores assigned by the first entity to the neighbor entities; determining the feature representation of the first entity based on a multi-head attention mechanism according to the importance comprehensive score and the attention scores; wherein determining the feature representation of the first entity based on the multi-head attention mechanism according to the importance comprehensive score and the attention scores comprises: determining attention weights assigned by the first entity to the neighbor entities according to the attention scores; determining relative importance scores of the neighbor entities among all neighbor entities according to the importance comprehensive score; determining the feature representation of the first entity based on the multi-head attention mechanism according to the attention weights, the attention scores, and the relative importance scores.

2. The information recommendation method according to claim 1, characterized by, The inter-entity relationship is described by an event, and the determination of the first importance scores of the neighbor entities of the first entity on the historical time scale and the second importance scores of the neighbor entities on the future time scale according to the inter-entity relationships carrying timestamps between the neighbor entities and the entities pointing to the neighbor entities comprises: determining a second entity and a third entity according to the inter-entity relationship for the neighbor entity, the second entity being an entity pointing to the neighbor entity, and the third entity being an entity pointed to by the second entity. determine, according to a timestamp carried by the inter-entity relationship between the neighbor entity and the second entity, a first decay weight of an event corresponding to the inter-entity relationship between the neighbor entity and the second entity on a historical time scale and a second decay weight of the event on a future time scale; determine, according to a timestamp carried by the inter-entity relationship between the second entity and the third entity, a third decay weight of an event corresponding to the inter-entity relationship between the second entity and the third entity on the historical time scale and a fourth decay weight of the event on the future time scale; determine, according to the first decay weight and the third decay weight, a first importance score of the neighbor entity; determine, according to the second decay weight and the fourth decay weight, a second importance score of the neighbor entity.

3. The information recommendation method according to claim 2, characterized by, The first decay weight is determined by formula (1) as follows, and the second decay weight is determined by formula (2) as follows; (1) (2) wherein, is a timestamp of an occurrence of an event corresponding to the inter-entity relationship, is a decay weight of the event on a historical time scale, is a decay weight of the event on a future time scale, is a start timestamp, is an end timestamp.

4. The information recommendation method according to claim 2, characterized by, The first importance score is determined by formula (3) as follows, and the second importance score is determined by formula (4) as follows; (3) (4) in, For entities The first importance score, For entities Feature representation, The damping factor, For entities Feature representation, For pointing to entities The set of features representing entities, For entities With entity The timestamps of events corresponding to the relationships between entities. For entities With entity The first decay weight of the events corresponding to the inter-entity relationships on the historical time scale. For entities Feature representation, For entities The set of characteristic representations of an entity is indicated. For entities With entity The timestamps of events corresponding to the relationships between entities. For entities With entity The third decay weight of events corresponding to the relationships between entities on the historical time scale. For entities The first importance score; For entities The second most important score, For entities With entity The second decay weight of events corresponding to the relationships between entities on future time scales. For entities With entity The fourth decay weight of events corresponding to the relationships between entities on future time scales. For entities The second importance score.

5. The information recommendation method according to claim 1, characterized by, The feature representation of the first entity is determined by formula (5) as follows; (5) in, For entities Feature representation, For the number of attention heads, For entities The set of feature representations of neighboring entities, For the first An entity whose attention is determined. For neighboring entities The assigned attention weights For the first The transformation matrix of each attention head, For entities Feature representation, For entities The relative importance score, For the first Retain the entity in each attention head The residual connection weight matrix of the original features.

6. The information recommendation method according to claim 1, characterized by, The information query request includes a head entity and a tail entity, and the candidate entities related to the to-be-queried entity are obtained in the time sequence knowledge graph representing the user interest feature according to the information query request, including: If the to-be-queried entity is the head entity, the entities in the time sequence knowledge graph that have an inter-entity relationship with the tail entity are determined as the candidate entities; If the to-be-queried entity is the tail entity, the entities in the time sequence knowledge graph that have an inter-entity relationship with the head entity are determined as the candidate entities.

7. The information recommendation method according to Claim 1, characterized by, The target entity in the candidate entities is determined according to the information query request and each feature representation, including: determining a vector representation of the information query request; determining a matching score between the vector representation and each feature representation; determining, as the target entity, the candidate entity corresponding to the feature representation in the candidate entities whose matching score is greater than a matching score threshold.

8. An information recommendation device based on a time sequence knowledge graph, characterized in that, including: a receiving module configured to receive an information query request sent by a user terminal, the information query request including a to-be-queried entity; a first obtaining module configured to obtain, according to the information query request, candidate entities related to the to-be-queried entity in a time sequence knowledge graph representing a user interest feature, the time sequence knowledge graph including a plurality of different entities and inter-entity relationships carrying timestamps; a second obtaining module configured to obtain, in the time sequence knowledge graph, a feature representation of each candidate entity, wherein the feature representation of each entity in the time sequence knowledge graph is determined according to importance scores of neighbor entities of the entity on different time scales and attention scores assigned by the entity to the neighbor entities, the importance scores of the neighbor entities on different time scales being determined according to the neighbor entities and the inter-entity relationships carrying timestamps between the neighbor entities and entities pointing to the neighbor entities, the neighbor entities being all entities in the time sequence knowledge graph that have the inter-entity relationships with the current entity; The first determining module is configured to determine a target entity from the candidate entities according to the information query request and the respective feature representations; The sending module is configured to send the target entity to the user terminal in response to the information query request; The entity in the time-series knowledge graph includes a first entity, and the first entity is any one of the entities in the time-series knowledge graph. The information recommendation device further includes a second determining module configured to determine a feature representation of the first entity. The second determining module includes: A first determining submodule configured to determine a first importance score of a neighbor entity of the first entity on a historical time scale and a second importance score of the neighbor entity on a future time scale according to the neighbor entity of the first entity and the entity-to-entity relationship carrying the time stamp between the neighbor entity and an entity pointing to the neighbor entity; A second determining submodule configured to determine an importance comprehensive score of the neighbor entity according to the first importance score and the second importance score; An obtaining submodule configured to obtain an attention score assigned to the neighbor entity by the first entity; A third determining submodule configured to determine the feature representation of the first entity based on a multi-head attention mechanism according to the importance comprehensive score and the attention score; The third determining submodule includes: A ninth determining submodule configured to determine an attention weight assigned to the neighbor entity by the first entity according to the attention score; A tenth determining submodule configured to determine a relative importance score of the neighbor entity among all neighbor entities according to the importance comprehensive score; An eleventh determining submodule configured to determine the feature representation of the first entity based on a multi-head attention mechanism according to the attention weight, the attention score, and the relative importance score.

Citation Information

Patent Citations

  • Local-global time sequence knowledge graph reasoning method based on relational graph

    CN117787411A

  • Relation perception learning method of time sequence knowledge graph based on attention mechanism

    CN119443225A