CN112085559A - Interpretable commodity recommendation method and system based on time-sequence knowledge graph - Google Patents

Interpretable commodity recommendation method and system based on time-sequence knowledge graph Download PDF

Info

Publication number
CN112085559A
CN112085559A CN202010833009.6A CN202010833009A CN112085559A CN 112085559 A CN112085559 A CN 112085559A CN 202010833009 A CN202010833009 A CN 202010833009A CN 112085559 A CN112085559 A CN 112085559A
Authority
CN
China
Prior art keywords
time
knowledge graph
entity
sequence
state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010833009.6A
Other languages
Chinese (zh)
Inventor
刘士军
崔志红
潘丽
崔立真
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shandong University
Original Assignee
Shandong University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shandong University filed Critical Shandong University
Priority to CN202010833009.6A priority Critical patent/CN112085559A/en
Publication of CN112085559A publication Critical patent/CN112085559A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0631Item recommendations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Economics (AREA)
  • Biomedical Technology (AREA)
  • Development Economics (AREA)
  • Animal Behavior & Ethology (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Databases & Information Systems (AREA)
  • Biophysics (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an interpretable commodity recommendation method and system based on a time-sequence knowledge graph, wherein the method comprises the following steps: acquiring a historical click sequence of a user, and constructing a time-sequence knowledge graph based on the historical click sequence, wherein the time-sequence knowledge graph comprises entities of a plurality of time periods and relations among the entities; based on the initial entity, sequentially selecting the behavior of setting step length according to the knowledge graph of each time period to obtain the state and the true value of each time period; the state comprises an initial entity, a final entity and a corresponding path; and recommending commodities by adopting a GRU network and giving an explanation path according to the state and the real value of each time period. According to the method, the time-sequence knowledge graph is constructed, so that more potential interests of the user can be mined, and the effectiveness, the accuracy and the diversity of recommendation can be increased.

Description

Interpretable commodity recommendation method and system based on time-sequence knowledge graph
Technical Field
The invention belongs to the technical field of data mining, and particularly relates to an interpretable commodity recommendation method and system based on a time-sequence knowledge graph.
Background
The statements in this section merely provide background information related to the present disclosure and may not necessarily constitute prior art.
Knowledge maps (KGs) contain rich semantic heterogeneous information and are widely applied to the field of interpretable recommendation systems. On the one hand, the various and huge entities in the knowledge graph enrich the selection of the potential interest of the user, so that the recommendation system is helpful for providing accurate suggestions for the user and helping the user to make commodity purchasing decisions efficiently. On the other hand, various relation links exist among the entities in the knowledge graph, and the relations can be used as specific reasons for the final commodity selection of the user, so that the recommendation system is endowed with better interpretability. The application of knowledge maps in the field of recommendation systems mainly divides two genres. The first application is commodity recommendation based on KGs embedded methods, which typically map entities and relationships into fixed-length vectors and recommend commodities to users based on semantic similarity between each other. The second is a path query based approach, which typically trains the recommendation model to walk as many entities and relationships as possible in KGs according to certain strategies. Both methods can better recommend commodities to users and endow a recommendation system with certain interpretation capability. In fact, however, the information provided by such methods has certain limitations, and the influence of the historical click sequence of the user on the final selection of the commodity by the user is often ignored, so that the interest of the commodity hidden by the user cannot be truly and objectively judged.
In the field of time-series interpretable commodity recommendation, the time-series interpretable commodity recommendation is often a single-path time-series task. The method generally starts from a certain history of a plurality of time periods of a user for clicking the commodity, combines rich and diversified entities and relations in KGs to generate a plurality of paths and maps the paths into vectors, scores each path according to an evaluation index, and reflects the degree of the user interested in the final commodity, so that the commodity possibly liked by the maximum probability is recommended to the user according to the complete score. However, such scoring does not take into account the user's global history information and does not provide recommendations that are sufficiently valuable.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention provides an interpretable commodity recommendation method and system based on a time-sequence knowledge graph, which are used for comprehensively inferring the potential preference of a user in the next time period by combining the global historical record of the user and the abundant entity and diversified relation in KGs.
In order to achieve the above object, one or more embodiments of the present invention provide the following technical solutions:
an interpretable commodity recommendation method based on a time-series knowledge graph comprises the following steps:
acquiring a historical click sequence of a user, and constructing a time-sequence knowledge graph based on the historical click sequence, wherein the time-sequence knowledge graph comprises entities of a plurality of time periods and relations among the entities;
based on the initial entity, sequentially selecting the behavior of setting step length according to the knowledge graph of each time period to obtain the state and the true value of each time period; the state comprises an initial entity, a final entity and a corresponding path;
and recommending commodities by adopting a GRU network and giving an explanation path according to the state and the real value of each time period.
One or more embodiments provide a interpretable commodity recommendation system based on a time-series knowledge-graph, comprising:
the system comprises a knowledge graph construction module, a time sequence knowledge graph and a time sequence analysis module, wherein the knowledge graph construction module is configured to acquire a historical click sequence of a user and construct the time sequence knowledge graph based on the historical click sequence, and the time sequence knowledge graph comprises entities of a plurality of time periods and relations among the entities;
the state evaluation module is configured to perform behavior selection of set step length according to the knowledge graph of each time period in sequence based on the initial entity, and acquire the state and the real value of each time period; the state comprises an initial entity, a final entity and a corresponding path;
and the commodity recommending module is configured to recommend commodities and give an explanation path by adopting a GRU network according to the state and the real value of each time period.
One or more embodiments provide an electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the method for time-sequential knowledge-graph based interpretable item recommendation when executing the program.
One or more embodiments provide a computer-readable storage medium on which a computer program is stored, which when executed by a processor, implements the method for interpretable item recommendation based on a time-series knowledge-graph.
The above one or more technical solutions have the following beneficial effects:
the invention takes interpretable recommendation as a time-sequence task, and can efficiently and accurately acquire more information from the constructed time-sequence knowledge graph in the operation process, thereby enriching the potential interest of the user to the maximum extent and further increasing the effectiveness, accuracy and diversity of the recommendation.
The interpretable recommendation is carried out from the time sequence perspective, the potential interest of the user in the next stage can be further inferred according to the obtained rich and diversified information of the user in the recent stage, the efficient path explanation is given, the one-sidedness of the recommended commodity effect caused by the insufficient information in the past is effectively relieved, the most satisfactory commodity is recommended for the user, and the interaction experience of the user is improved.
Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, are included to provide a further understanding of the invention, and are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the invention and together with the description serve to explain the invention and not to limit the invention.
FIG. 1 is a flowchart of an interpretable commodity recommendation method based on a time-series knowledge graph according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating candidate behavior selection according to an embodiment of the invention.
Detailed Description
It is to be understood that the following detailed description is exemplary and is intended to provide further explanation of the invention as claimed. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of exemplary embodiments according to the invention. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
The embodiments and features of the embodiments of the present invention may be combined with each other without conflict.
Example one
The embodiment discloses an interpretable commodity recommendation method based on a time-series knowledge graph, which is based on RL (Reinforcement Learning) and GRU (Gated Current Unit), combines with the user global history and the abundant entity and diversified relationship in KGs, can more quickly, comprehensively and objectively infer the potential preference of a user in the next time period, provides more reasonable recommended commodities for the user and provides a recommendation reason. Specifically, the method comprises two stages:
stage one: acquiring a historical click sequence of a user, and constructing a time sequence knowledge graph based on the historical click sequence, wherein the time sequence knowledge graph comprises entities of a plurality of time periods and relations between the entities
The first stage specifically comprises:
step 1: acquiring a historical click sequence of a user for a commodity, and segmenting according to time;
the step1 specifically comprises:
step1.1: obtaining a historical user click sequence, and sequencing the history S' according to a time sequence;
step1.2: dividing the sorted user click sequence into a plurality of time segments S' ═ { S } according to a certain time interval1,s2,....,sk-1,skWhere k is the number of segmentation time segments.
Step 2: for the historical click sequence in each segmentation time period, combining with an Amazon Database knowledge graph to obtain corresponding entities and relations;
the Amazon Database comprises a large number of user browsing records, corresponding commodity sets, relation sets among the commodities and the like, and each historical record of the user in each segmentation time period is mined for corresponding entities and corresponding relations in an Amazon Database knowledge graph. In this embodiment, the entities and the relationships are subjected to class abstraction, and formats of the relationship dictionary and the entity dictionary E in the time-series knowledge graph are defined.
Specifically, the categories of the entities are abstracted into the following five categories: USER, PRODUCT, WORD, RPRODUCT, bran, CATEGORY. The types of relationships include 8 types: PURCHASE, MEATION, DESCRIBRED _ AS, PRODUCED _ BY, BELONG _ TO, ALSO _ BOUGHT, ALSO _ VIEWED, BOUGHT _ TOGETHER.
The format of the entity dictionary E comprises a user dictionary U, a commodity entity dictionary P, a brand entity dictionary B, a directory entity dictionary C and a feature dictionary F, and the format of the relation dictionary is defined as follows: the USER: { PURCHASE: PRODUCT, MENTION: WORD }, WORD: { MEATION: USER, DESCRIBED _ AS: PRODUCT }, PRODUCT: { PURCAHSE: USER, DERRIBED _ AS: WORD, PRODUCED _ BY: BRAND, BELONG _ TO: CATEGORY, ALSO _ BOUGHT: PRODUCT, ALSO _ VIEWD: PRODUCT, BOUGHT _ TOUGHTER: PRODUCT }, BRAND: { PRODUCED _ BY: PRODUCT }, CATEGORY: { BELONG _ TO: PRODUCT }, PRODUCT: { ALSO _ BOUGHT: PRODUCT, ALSO _ VIEWED: PRODUCT, BOUGHT _ TOGHTER: PRODUCT }.
And step 3: and for each divided time segment, constructing a corresponding knowledge graph of the time segment according to the entity and the relation.
The step3 specifically includes:
step 3.1: embedding each entity and relation mined in the step2 into a vector with a fixed length by using a TransE method, and labeling each entity and relation, namely each entity has a unique identifier eid and each relation has a unique identifier rid.
Step 3.2: all the extracted entity and relationship information is loaded using the Pickle component.
Step 3.3: and constructing an entity set of the time-sequence knowledge graph G and storing the entity set into the entity set of the dictionary G. The user click sequence s of each time period in the step2kWith the entities it mined in the AmazonDatabase knowledge graph*And (4) sequentially and completely importing the entity sets of the dictionary G, storing the embedded expression of each entity and the corresponding entity ID thereof each time and calculating the final number of the entities. All the divided K time periods are stored into a dictionary G according to the process, and the format of the dictionary is G [ entity ]atthe moment][eid1][]Where eid1 represents the id of the entity.
Step 3.4: and constructing a relation set R of the time-sequence knowledge graph set G, and storing the relation set R into a dictionary G. The addition pattern of each path is as follows.
For example: the added relationship is PURCAHSE, and the format added in the time-series knowledge graph is (USER, uid, PURCAHSE, PRODCUT, pid), wherein uid is the id of the USER and pid is the id of the product purchased by the USER. It should be noted that, in order to perform information mining on the time-series knowledge graph in a late-stage updating manner and efficiently, each addition of the relationship is a bidirectional addition. Illustrating the principle of adding relationships in a time-series knowledge graph: every time a relationship (type 1, eid1, relation, type2, eid2) is added, G [ type1 ] needs to be stored in the dictionary G][eid1][relation][etype2][eid2]And G [ etype2][eid2][relation][etype1][eid1]I.e. bidirectional edges, if present, from e1To e2Then there is e2To e1The edge of (2).
Step 3.5: the degree of each entity is calculated, i.e. the number of relationships to which each entity is connected is calculated at the time of logging.
Step 3.6: and storing all the information in the step 3.1-the step 3.5 into a storage path of the time-sequence knowledge graph.
Constructing a time-sequence knowledge map dictionary G, wherein the steps describe a user click sequence s of a time periodkAnd constructing a knowledge graph dictionary G of a period by combining the corresponding knowledge graphs.
And 4, step 4: and combining the knowledge maps corresponding to all the segmentation time periods to obtain the time-sequence knowledge map.
And (3) combining each click sequence of the user with entity and relation information mined in the Amazon Database knowledge graph, and constructing the corresponding knowledge graph of each period according to the steps 3.1-3.5 to finally obtain the constructed time-sequence knowledge graph.
And 5: generating a training set and a testing set, and carrying out the following steps on the data according to the ratio of 8: 2, one part is used as a training set, and the other part is used as a data set.
In a knowledge graph, once the type of a relationship is determined, the entity to which it is linked can also be determined, and when the term "behavior" is used in this specification, it is designated as a relationship in a time-ordered knowledge graph, which refers to a relationship and the entity to which it is linked.
And a second stage: based on the initial entity, sequentially selecting the behavior of setting step length according to the knowledge graph of each time period to obtain the state and the true value of each time period; the state includes an initial entity, a final entity and a corresponding path.
The basic principle of the stage two is that the training agent searches and selects a path in the established time sequence knowledge graph according to a certain strategy, and the final aim is to find the product I which is most likely to interact with the user. From this perspective and according to the method for constructing a time-series knowledge graph in the first embodiment, the initial entity of the path search is defined as the user U. In addition, it should be noted that the steps in the second embodiment represent a specific flow of dividing a time period in the first embodiment. Fig. 2 shows a functional block diagram of the present system in detail.
In this embodiment, an entity state set S, a behavior set a, a path set P, a reward set R, and a probability set Q are defined, where each state of an entity is a triple
Figure BDA0002638674020000071
Wherein u is from the startEntity U, etIs the final entity after T steps and the historical footprint thereof
Figure BDA0002638674020000074
(which includes all entities and relationships intermediate from the originating entity to the final entity),
Figure BDA0002638674020000072
wherein r istRelationships are represented. Second, the build format for each behavior is as follows:
Figure BDA0002638674020000073
the selection of the next relationship can only be made from the unselected relationships.
The second stage specifically comprises:
step 1: acquiring the entity and the relation of the time-sequence knowledge graph and formatting the entity and the relation;
step 2: and receiving an initial user entity, and performing probability evaluation on behaviors possibly selected by the user according to the knowledge graph to obtain a current state, a path and a corresponding probability corresponding to selection of each walking user for each walking and a path set when the set walking length is reached.
The step2 specifically comprises:
step 2.1: pruning the redundancy relation of the knowledge graph in each segmentation time period according to a certain strategy;
specifically, according to the relationship number of each entity link counted in step3 in the stage one, if the relationship number exceeds the set behavior number threshold, in order to improve the search efficiency, a Term Frequency-Inverse Document Frequency (TF-IDF) is used to eliminate less prominent features, and further, the redundant relationship in the knowledge graph is cut. If the TF-TDF of a certain relation is larger than the set TF-TDF threshold or the frequency of occurrence is smaller than the set frequency threshold, the relation is deleted. TF-IDF is defined as follows:
Figure BDA0002638674020000081
where c represents a document, j represents a relationship of some kind, tfc,jIs the number of times the relationship j appears in the current document c, tfcThe number of all relationships contained in the current document c. df is the total number of documents of all relationships, dfjIs the number of documents containing the relationship j, and 1 is added to avoid the denominator being 0.
Step 2.2: starting from an initial user entity, searching all behaviors connected with the knowledge graph as a candidate behavior set, performing probability evaluation, and selecting M behaviors with the highest probability evaluation;
step 2.3: for each of the M behaviors, searching all behaviors connected with the knowledge graph as a candidate behavior set of the behavior, performing probability evaluation, and selecting the M behaviors with the highest probability evaluation; repeating the steps until a preset T is reached;
step 2.4: each selected behavior and its corresponding probability are stored.
In this embodiment, the behaviors that the user has high possibility of interacting are screened. Recording the set of candidate behaviors in the current state
Figure BDA0002638674020000082
Where t represents the number of steps taken, i.e., the correlation coefficient.
After the pruning in step2.1, the remaining link relation of each entity is about 250, and if each step in the subsequent T steps is searched 250 times, the number of the late searches increases exponentially, so the search strategy design in each step in the system is as shown in fig. 2: starting from a first entity u, searching all behaviors linked with the first entity u as a candidate behavior set, calculating scores according to a multi-step evaluation function, and selecting M behaviors with highest evaluation scores (M is a preset threshold value of the number of candidate behaviors).
In the second step, all behaviors linked with the M behaviors selected in the first step are selected as a candidate behavior set, the score is calculated according to the multi-step evaluation function again, the M behaviors with the highest evaluation score are selected again,selecting according to the strategy in sequence until reaching a set step length T, storing the probability of M behaviors selected each time into a probability set Q, and finally selecting the following M candidate behavior sets
Figure BDA0002638674020000091
Figure BDA0002638674020000092
Where f ((r, e) | u) represents the multi-step path score.
In order to realize multi-step searching and storing in a time-sequence knowledge graph, Path-Pattern with the following steps of 3 and 4 is constructed, and different types of Path-Pattern are labeled, namely each Path-Pattern is labeled with a unique pid as shown below.
Path-Pattern={
1:((NONE,USER),(MENTION,WORD),(DESCRIBED_AS, PRODUCT),
11:((NONE,USER),(PURCAHSE,PRODUCT),(PURCAHSE,USER), (PURCAHSE,PRODUCT)),
12:((NONE,USER),(PURCAHSE,PRODUCT),(DESCRIBED_AS, WORD),(DESCRIBED_AS,PRODUCT)),
13:((NONE,USER),(PURCAHSE,PRODUCT),(PRODUCED_BY, BRAND),(PRODUCED_BY,PRODUCT)),
14:((NONE,USER),(PURCAHSE,PRODUCT),(BELONG_TO, CATEGORY),(BELONG_TO,PRODUCT)),
15:((NONE,USER),(PURCAHSE,PRODUCT),(ALSO_BOUGHT, PRODUCT),(ALSO_BOUGHT,PRODUCT)),
16:((NONE,USER),(PURCAHSE,PRODUCT),(ALSO_VIEWED, PRODUCT),(ALSO_VIEWED,PRODUCT)),
17:((NONE,USER),(PURCAHSE,PRODUCT), (BOUGHT_TOGETHER,PRODUCT),(BOUGHT_TOGETHER, PRODUCT)),
18:((NONE,USER),(MENTION,WORD),(MENTION,USER), (PURCHASE,PRODUCT)),
}
It should be noted that there may be a space between the starting entity and the final entityIn hundreds or thousands of Path-Pattern, therefore, to reduce the amount of computation, we compute only the Path-Pattern with the smallest forward propagation relationship, i.e., the one with the smallest forward propagation relationship
Figure BDA0002638674020000101
Figure BDA0002638674020000102
Figure BDA0002638674020000103
As shown in the Path-Pattern obtained after the user passes through the T step, a multipath evaluation function is designed in order to calculate the probability of selecting the final entity of the user more accurately. Typically, a user is in each state stSelection behavior at+1The above all behavior choices a must be accepted1,...,atThe probability that the user selects the end entity should therefore be the accumulation of all previous selection probabilities. From this perspective, the multipath evaluation function is defined as follows:
Figure BDA0002638674020000104
Figure BDA0002638674020000105
wherein, <, > represents a dot product,
Figure BDA0002638674020000106
a Path Pattern is represented with 1-inverse t steps, j represents the number of forward-passing relations in the Path Pattern, namely
Figure BDA0002638674020000107
t-j +1 denotes the number of backward-passing relations,namely, it is
Figure BDA0002638674020000108
t denotes the total number of the relations in the Path-Pattern, s denotes the currently selected relation position in the forward transfer relation or the backward transfer relation, betIs the offset of entity e.
When t ═ j ═ 0, he weighs two entities e as shown below0And etThe cosine similarity between the two signals is determined,
Figure BDA0002638674020000111
when t ═ j ═ 1, it estimates that two entities e are as shown below0And etBy the similarity of the embedded link relation,
Figure BDA0002638674020000112
and step 3: for the path set reaching the set step length, the possibility of each path is evaluated, and the reward is carried out according to the possibility.
For each state stSelection behavior at+1And rewarding or punishing the result which possibly appears later, if the reward mechanism indicates that the behavior selected by the agent is that the user can interact, amplifying the selection possibility of the behavior, otherwise, reducing the selection possibility of the behavior, storing the reward of each behavior into a reward set R, and storing the behavior into a path set P. If each state is awarded or punished immediately after a behavior is selected, a local optimal defect often exists, and therefore, in order to increase the accuracy of the user in interacting with the final entity and reduce the calculation amount, a global system evaluation method is used, namely the possibility of interaction between the user and the final entity after the user finishes T steps is evaluated, and awarding is carried out when the possibility is higher, otherwise punishing is carried out, as shown in the following.
Figure BDA0002638674020000113
Wherein e isTRepresented is the final entity reached after T steps, f (u, e)T) Estimated is the probability of the user interacting with the end entity, and Σ f (u, i) represents the sum of the probabilities of all the items selectable by the user.
Therefore, the current state, selectable behaviors, paths and rewards of the agent after random walk in the time-sequence knowledge graph are obtained and stored.
And 4, step 4: and for the path set reaching the set step length, carrying out diversity evaluation on each path.
When the agent starts to walk the selectable behavior from the user, a path set of step T can be obtained. To improve the interpretability of the system, we use the following diversity assessment feedback to make diversity assessment for all the interpretation paths that the user finds.
Figure BDA0002638674020000121
Where F is the number of existing paths,
Figure BDA0002638674020000122
are embedded vectors of all the relations in the existing path, i.e.
Figure BDA0002638674020000123
Is the current path.
And 5: from the perspective of an initial user, based on the information such as the probability and the reward of the alternative path acquired in each step, the path mined by the knowledge graph of the current segmentation time period is optimized, so that the cumulative reward of the state after T steps is selected is maximized, and the cumulative reward function is as follows.
Figure BDA0002638674020000124
The step 5 specifically includes:
and 5.1, from the perspective of a user, quantifying the state after the T steps by using Policy Network and Value Network, and calculating the accumulated reward of the state after the T steps of each path.
Wherein Policy network converts state stAnd a set of candidate behaviors
Figure BDA0002638674020000125
As an input, the probability of each behavior is output, with the probability output being 0 for behaviors not in the set of candidate behaviors. All states are mapped to a true Value using Value Network to measure the final reward evaluation over T-walk for states reached after selection. The structures of both are defined as follows:
Figure BDA0002638674020000126
Figure BDA0002638674020000127
wherein the content of the first and second substances,
Figure BDA0002638674020000128
is a Policy Network, and is a Policy Network,
Figure BDA0002638674020000129
is Value Network, x is a hidden feature of learned state s, which is a Hadamard product (Hadamard product), WpAnd WvThe parameter settings of Policy Network and Value Network are respectively.
Step 5.2: the system is optimized using GD (Gradient decline) to maximize the cumulative reward for the post-T-step state, as shown by the optimization function below.
Figure BDA0002638674020000131
Where Θ denotes the Policy Network and Value Network parameters, and G is the jackpot for the final state after s to T steps from the initial state.
Step 5.3: set the final state STAnd outputting the optimized accumulative reward optimal value of each state, namely, mining observation information of the knowledge graph in the current segmentation time period based on the angle of the user
Figure BDA0002638674020000132
Wherein the set of states st∈STIs to the initial entity u, the final entity etAnd history
Figure BDA0002638674020000133
The three are cascaded.
Step 6: processing the information of each segmentation time segment of the time-sequence knowledge graph according to the steps 6-8 to finally obtain the observation information of each segmentation time segment of the constructed time-sequence knowledge graph
Figure BDA0002638674020000134
And a third stage: and recommending commodities by adopting a GRU network and giving an explanation path according to the state and the real value of each time period.
Step 1: data preprocessing, namely cascading states and real values of the output time-sequence knowledge graph in the stage II as input;
step 2: the GRU network performs data analysis and integration according to the knowledge graph information of the K divided periods mined in the second embodiment, and recommends Top-N commodities which are ultimately potential for the user.
Step2.1: setting GRU neural network initial parameters, updating the weight and bias of gate and reset gate, and outputting a hidden description h of current state0And storing the data into a memory module.
Step2.2: knowledge graph observation information of each stage of mining
Figure BDA0002638674020000135
Is stored in the memory module of each period of the GRU.
Step2.3: knowledge-graph observation information of the first period obtained in the second neural network processing stage in GRU
Figure BDA0002638674020000136
Describing the hidden state of the initial setting h0And current knowledge-graph observation information
Figure BDA0002638674020000137
Analyzing the two together to predict a hidden description h of the current state1. The knowledge-graph observations at each time period are calculated as follows:
Figure BDA0002638674020000138
Figure BDA0002638674020000141
Figure BDA0002638674020000142
Figure BDA0002638674020000143
wherein the content of the first and second substances,
Figure BDA0002638674020000144
is an input vector representing the current time period knowledge-graph observation information,
Figure BDA0002638674020000145
representing the final output hidden state. U shapez
Figure BDA0002638674020000146
UcIs a parameter transfer matrix of GRU neural network, and sigma (x) is 1/(1+ e)x) Is a sigmoid function for implementing a non-linear mapping, a can is a product in units of elements between two vectors,
Figure BDA0002638674020000147
are candidate state values activated by tanh.
Step2.4: knowledge map observations for all time periods according to the principles in Step2.3
Figure BDA0002638674020000148
Carrying out data analysis to finally obtain the hidden description of the next period of the user
Figure BDA0002638674020000149
The description includes the observation information O in all the prior knowledge mapsk
Step2.5: and outputting the interaction possibility between the user and the commodities in the final hidden description by using a softmax function, and selecting Top-N commodities to recommend to the user.
Step 3: the Top-N commodity selection recommended in Step2 is combined to select a more efficient explanation path. And in the second stage, a path between each user and the recommended commodity is obtained, wherein the paths may have a plurality of paths, and a more efficient path is selected from the plurality of paths to serve as an explanation path for the commodity selected by the current user. The efficiency of a path is inversely proportional to its path length, as shown below.
Figure BDA00026386740200001410
Wherein the content of the first and second substances,
Figure BDA00026386740200001411
are all relationships in the path, i.e.
Figure BDA00026386740200001412
Step 4: the system loss function is optimized using average cross entropy to obtain the product that the user is most likely to interact with from a time perspective, as shown below.
Figure BDA00026386740200001413
Wherein, the training data are positive and negative sample training data,
Figure BDA00026386740200001414
is the optimal expected cumulative value based on the user by each entity in the second embodiment.
The first stage is optimization for space resource acquisition, and aims to enable a subsequent recommendation system to acquire more accurate, more comprehensive and diverse commodity and path information as efficiently as possible, so that abundant semantic information, structural information and the like in KGs are more comprehensively and deeply mined, which is generally regarded as a space completion task.
Stage two is directed to the optimization of time sequence selection, and the most interesting commodities are selected for the user from the time sequence perspective. The task is to score the commodities selected by the user according to the evaluation indexes based on the commodity sequence clicked by the user history, and then recommend the commodities which are possibly purchased in the future to the user, which is generally regarded as a time sequence prediction optimization task.
And in the recommendation process, joint optimization is carried out on the recommended commodities again according to the scores obtained by the evaluation indexes of the two optimization tasks. Our task is to recommend diverse products to the user and give reasonable explanations for the final score derived from the two-aspect optimization task.
Example two
The present embodiment aims to provide an interpretable commodity recommendation system based on a time-series knowledge graph, which includes:
the system comprises a knowledge graph construction module, a time sequence knowledge graph and a time sequence analysis module, wherein the knowledge graph construction module is configured to acquire a historical click sequence of a user and construct the time sequence knowledge graph based on the historical click sequence, and the time sequence knowledge graph comprises entities of a plurality of time periods and relations among the entities;
the state evaluation module is configured to perform behavior selection of set step length according to the knowledge graph of each time period in sequence based on the initial entity, and acquire the state and the real value of each time period; the state comprises an initial entity, a final entity and a corresponding path;
and the commodity recommending module is configured to recommend commodities and give an explanation path by adopting a GRU network according to the state and the real value of each time period.
EXAMPLE III
The embodiment aims at providing an electronic device.
An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of the first embodiment when executing the program.
Example four
An object of the present embodiment is to provide a computer-readable storage medium.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of the first embodiment.
The steps involved in the apparatuses of the above second, third and fourth embodiments correspond to the first embodiment of the method, and the detailed description thereof can be found in the relevant description of the first embodiment. The term "computer-readable storage medium" should be taken to include a single medium or multiple media containing one or more sets of instructions; it should also be understood to include any medium that is capable of storing, encoding or carrying a set of instructions for execution by a processor and that cause the processor to perform any of the methods of the present invention.
Those skilled in the art will appreciate that the modules or steps of the present invention described above can be implemented using general purpose computer means, or alternatively, they can be implemented using program code that is executable by computing means, such that they are stored in memory means for execution by the computing means, or they are separately fabricated into individual integrated circuit modules, or multiple modules or steps of them are fabricated into a single integrated circuit module. The present invention is not limited to any specific combination of hardware and software.
Although the embodiments of the present invention have been described with reference to the accompanying drawings, it is not intended to limit the scope of the present invention, and it should be understood by those skilled in the art that various modifications and variations can be made without inventive efforts by those skilled in the art based on the technical solution of the present invention.

Claims (10)

1. An interpretable commodity recommendation method based on a time-series knowledge graph is characterized by comprising the following steps:
acquiring a historical click sequence of a user, and constructing a time-sequence knowledge graph based on the historical click sequence, wherein the time-sequence knowledge graph comprises entities of a plurality of time periods and relations among the entities;
based on the initial entity, sequentially selecting the behavior of setting step length according to the knowledge graph of each time period to obtain the state and the true value of each time period; the state comprises an initial entity, a final entity and a corresponding path;
and recommending commodities by adopting a GRU network and giving an explanation path according to the state and the real value of each time period.
2. The interpretable commodity recommendation method based on a time-series knowledge graph as claimed in claim 1, wherein constructing the time-series knowledge graph based on historical click sequences comprises:
segmenting the historical click sequence according to a set time interval;
and for the historical click sequence in each time period, acquiring the entity and the relation in the historical click sequence, and constructing a corresponding knowledge graph of the time period according to the entity and the relation.
3. The interpretable commodity recommendation method based on the time-series knowledge graph as claimed in claim 2, wherein constructing the knowledge graph corresponding to the time period according to the entity and the relationship comprises:
embedding each entity and relationship into a fixed-length vector;
writing each entity and the ID thereof into the knowledge graph in a set expression form;
the relationships are added bi-directionally between the respective entities.
4. The interpretable commodity recommendation method based on the time-series knowledge graph as claimed in claim 1, wherein the step of obtaining the state of each time segment comprises the steps of:
based on the initial entity, searching all behaviors connected with the knowledge graph as a candidate behavior set, performing probability evaluation, and selecting M behaviors with the highest probability evaluation;
for each of the M behaviors, searching all behaviors connected with the knowledge graph as a candidate behavior set of the behavior, performing probability evaluation, and selecting the M behaviors with the highest probability evaluation; repeating the steps until the set step length is reached; the initial entity, the final entity and the corresponding path state set are obtained.
5. The interpretable commodity recommendation method based on the time-series knowledge graph as claimed in claim 4, wherein before the state of each time period is obtained, the knowledge graph of each time period is further pruned according to the degree of the entity.
6. The interpretable commodity recommendation method based on the time-series knowledge graph as claimed in claim 4, wherein the step of obtaining the true state value of each time segment comprises the steps of:
for the path set reaching the set step length, evaluating the possibility of each path, rewarding according to the possibility, and performing diversity evaluation;
starting from the initial user entity, optimizing the path of the current time period to maximize the state accumulated reward obtained through the selection of the set step length, and mapping each state into a real value to measure the final reward.
7. The interpretable commodity recommendation method based on the time-series knowledge graph as claimed in claim 1, wherein the recommending commodity and giving an interpretation path by using the GRU network comprises:
taking the state and the real value of each time period as input, and obtaining a plurality of candidate commodities and a path between the candidate commodities and the GRU network;
and determining the recommended commodity and the corresponding explanation path by combining the interaction probability of the user and each candidate commodity and the efficiency of each path.
8. An interpretable commodity recommendation system based on a time-series knowledge graph, comprising:
the system comprises a knowledge graph construction module, a time sequence knowledge graph and a time sequence analysis module, wherein the knowledge graph construction module is configured to acquire a historical click sequence of a user and construct the time sequence knowledge graph based on the historical click sequence, and the time sequence knowledge graph comprises entities of a plurality of time periods and relations among the entities;
the state evaluation module is configured to perform behavior selection of set step length according to the knowledge graph of each time period in sequence based on the initial entity, and acquire the state and the real value of each time period; the state comprises an initial entity, a final entity and a corresponding path;
and the commodity recommending module is configured to recommend commodities and give an explanation path by adopting a GRU network according to the state and the real value of each time period.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method for time-sequential knowledge-graph based interpretable item recommendation of any one of claims 1-7 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the method for interpretable item recommendation based on a time-sequential knowledge-graph according to any one of claims 1 to 7.
CN202010833009.6A 2020-08-18 2020-08-18 Interpretable commodity recommendation method and system based on time-sequence knowledge graph Pending CN112085559A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010833009.6A CN112085559A (en) 2020-08-18 2020-08-18 Interpretable commodity recommendation method and system based on time-sequence knowledge graph

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010833009.6A CN112085559A (en) 2020-08-18 2020-08-18 Interpretable commodity recommendation method and system based on time-sequence knowledge graph

Publications (1)

Publication Number Publication Date
CN112085559A true CN112085559A (en) 2020-12-15

Family

ID=73728331

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010833009.6A Pending CN112085559A (en) 2020-08-18 2020-08-18 Interpretable commodity recommendation method and system based on time-sequence knowledge graph

Country Status (1)

Country Link
CN (1) CN112085559A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632296A (en) * 2020-12-31 2021-04-09 上海交通大学 Knowledge graph-based paper recommendation method and system with interpretability and terminal
CN112633927A (en) * 2020-12-23 2021-04-09 浙江大学 Combined commodity mining method based on knowledge graph rule embedding
CN112733027A (en) * 2021-01-08 2021-04-30 西安交通大学 Hybrid recommendation algorithm based on local and global representation model joint learning
CN112800207A (en) * 2021-01-13 2021-05-14 桂林电子科技大学 Commodity information recommendation method and device and storage medium
CN113360772A (en) * 2021-07-02 2021-09-07 中国科学技术大学 Interpretable recommendation model training method and device
CN114817737A (en) * 2022-05-13 2022-07-29 北京世纪超星信息技术发展有限责任公司 Cultural relic hot spot pushing method and system based on knowledge graph
CN114969525A (en) * 2022-05-25 2022-08-30 天翼爱音乐文化科技有限公司 Music social contact recommendation method, system, device and storage medium
WO2022239975A1 (en) * 2020-05-20 2022-11-17 Samsung Electronics Co., Ltd. System and method for explainable embedding-based recommendation system
CN116701573A (en) * 2023-06-06 2023-09-05 哈尔滨理工大学 Query method and system based on time sequence knowledge graph
CN117495432A (en) * 2023-11-22 2024-02-02 北京亿家老小科技有限公司 Multi-time-scale voting type user potential demand analysis method and system

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022239975A1 (en) * 2020-05-20 2022-11-17 Samsung Electronics Co., Ltd. System and method for explainable embedding-based recommendation system
CN112633927A (en) * 2020-12-23 2021-04-09 浙江大学 Combined commodity mining method based on knowledge graph rule embedding
CN112633927B (en) * 2020-12-23 2021-11-19 浙江大学 Combined commodity mining method based on knowledge graph rule embedding
CN112632296A (en) * 2020-12-31 2021-04-09 上海交通大学 Knowledge graph-based paper recommendation method and system with interpretability and terminal
CN112733027A (en) * 2021-01-08 2021-04-30 西安交通大学 Hybrid recommendation algorithm based on local and global representation model joint learning
CN112733027B (en) * 2021-01-08 2022-10-25 西安交通大学 Hybrid recommendation method based on local and global representation model joint learning
CN112800207A (en) * 2021-01-13 2021-05-14 桂林电子科技大学 Commodity information recommendation method and device and storage medium
CN112800207B (en) * 2021-01-13 2022-05-13 桂林电子科技大学 Commodity information recommendation method and device and storage medium
CN113360772A (en) * 2021-07-02 2021-09-07 中国科学技术大学 Interpretable recommendation model training method and device
CN113360772B (en) * 2021-07-02 2022-09-09 中国科学技术大学 Interpretable recommendation model training method and device
CN114817737B (en) * 2022-05-13 2024-01-02 北京世纪超星信息技术发展有限责任公司 Cultural relic hot spot pushing method and system based on knowledge graph
CN114817737A (en) * 2022-05-13 2022-07-29 北京世纪超星信息技术发展有限责任公司 Cultural relic hot spot pushing method and system based on knowledge graph
CN114969525A (en) * 2022-05-25 2022-08-30 天翼爱音乐文化科技有限公司 Music social contact recommendation method, system, device and storage medium
CN114969525B (en) * 2022-05-25 2023-04-07 天翼爱音乐文化科技有限公司 Music social contact recommendation method, system, device and storage medium
CN116701573A (en) * 2023-06-06 2023-09-05 哈尔滨理工大学 Query method and system based on time sequence knowledge graph
CN117495432A (en) * 2023-11-22 2024-02-02 北京亿家老小科技有限公司 Multi-time-scale voting type user potential demand analysis method and system
CN117495432B (en) * 2023-11-22 2024-05-28 北京亿家老小科技有限公司 Multi-time-scale voting type user potential demand analysis method and system

Similar Documents

Publication Publication Date Title
CN112085559A (en) Interpretable commodity recommendation method and system based on time-sequence knowledge graph
Wu et al. Session-based recommendation with graph neural networks
US8341158B2 (en) User&#39;s preference prediction from collective rating data
US7080052B2 (en) Method and system for sample data selection to test and train predictive algorithms of customer behavior
Yang et al. Finding progression stages in time-evolving event sequences
CN111242310B (en) Feature validity evaluation method and device, electronic equipment and storage medium
CN107808278B (en) Github open source project recommendation method based on sparse self-encoder
CN110245285B (en) Personalized recommendation method based on heterogeneous information network
EP2860672A2 (en) Scalable cross domain recommendation system
CN110659742A (en) Method and device for acquiring sequence representation vector of user behavior sequence
CN113222711B (en) Commodity information recommendation method, system and storage medium
CN112288554B (en) Commodity recommendation method and device, storage medium and electronic device
CN103020289B (en) A kind of search engine user individual demand supplying method based on Web log mining
CN112258262A (en) Conversation recommendation method based on convolution self-attention network
CN115438787A (en) Training method and device of behavior prediction system
He et al. Blending pruning criteria for convolutional neural networks
CN112948681B (en) Multi-dimensional feature fused time series data recommendation method
CN112052990B (en) CNN-BilSTM hybrid model-based next activity prediction method for multi-angle business process
Nwankwo et al. Prediction of House Prices in Lagos-Nigeria Using Machine Learning Models
Kumar et al. A novel fuzzy rough sets theory based cf recommendation system
CN115712777A (en) Ranking method of literature recommendation system based on logistic regression
CN115659277A (en) E-commerce session recommendation method, system, device and medium based on multi-behavior feature fusion
CN115293812A (en) E-commerce platform session perception recommendation prediction method based on long-term and short-term interests
Misaii et al. Multiple imputation of masked competing risks data using machine learning algorithms
CN111652312B (en) Method, system and storage medium for measuring fit degree between sets with selective characteristics

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination