Rule mining method, device and equipment for recommendation model explanation and medium
By mining neighborhood graphs and connected subgraphs in graph data, target graph patterns and candidate preconditions are extracted to form target interpretation rules, which solves the problem of insufficient interpretability of graph neural network recommendation models and achieves more efficient model interpretation and optimization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN INST OF COMPUTING SCI
- Filing Date
- 2024-12-26
- Publication Date
- 2026-04-24
AI Technical Summary
In existing technologies, the global interpretation methods of graph neural network recommendation models are difficult to effectively incorporate the attribute relationships between nodes, resulting in insufficient information completeness and a lack of practical feasibility, thus leading to insufficient model interpretability.
By acquiring user-item pairs from graph data, we determine neighborhood graphs and connected subgraphs, evaluate candidate subgraphs, extract target subgraphs, perform simulated path and pattern path analysis, mine candidate preconditions, form target interpretation rules, and optimize the generation of interpretation components.
It improves the interpretability of the recommendation model, provides a clear and transparent model decision-making process, and enhances user trust and model optimization capabilities.
Smart Images

Figure CN119761494B_ABST
Abstract
Description
Technical Field
[0001] This application applies to the field of model interpretation, and in particular relates to a rule mining method, apparatus, device, and medium for interpreting recommendation models. Background Technology
[0002] With the rapid development of artificial intelligence technology, Graph Neural Networks (GNNs) have demonstrated enormous potential in recommender systems. GNNs can utilize multi-hop relationships in graph data to accurately model user preferences and analyze historical user-item interactions, thereby providing personalized recommendations. As GNN recommendation models become more widespread, model interpretability has become an increasingly important research direction. In recommender systems, interpretability refers to the ability to clearly explain why a specific item is recommended to a particular user. This is crucial for users because it helps them understand the source of the recommendation results, enhancing their trust in the recommender system. Simultaneously, for developers, the ability to interpret GNN recommendation results is key to optimizing and debugging the model.
[0003] In the prior art, the global interpretation method is an implementation scheme that is relatively close to that of this application. The global interpretation method extracts graph-based patterns by analyzing graph structure data, thereby serving as a global interpretation of the model. However, this method generally relies on pre-processed graph patterns as input, or assumes that the interpreted substructure follows the characteristics of Gilbert random graphs, which is difficult to implement in practice and lacks practical feasibility. Furthermore, the extracted graph patterns fail to incorporate the attribute relationships between nodes, resulting in insufficient information completeness.
[0004] Therefore, optimizing the generation of explanatory components to improve the interpretability of recommendation models has become an urgent problem to be solved. Summary of the Invention
[0005] In view of this, embodiments of this application provide a rule mining method, apparatus, device, and medium for interpreting recommendation models, in order to solve the problem of how to optimize the generation of interpretation components to improve the interpretability of recommendation models.
[0006] In a first aspect, embodiments of this application provide a rule mining method for interpreting recommendation models, the rule mining method comprising:
[0007] Obtain graph data and determine all user-item pairs in the graph data, wherein the user-item pair is a node pair representing the mapping relationship between users and items obtained by recommending items to users in the graph data based on a recommendation model;
[0008] For any user item pair, a neighborhood graph of the user item pair is determined from the graph data, and all connected subgraphs of the neighborhood graph containing the user item pair are determined. At least one candidate subgraph is determined from all connected subgraphs. For any candidate subgraph, the candidate subgraph is evaluated according to the neighborhood graph to obtain a graph evaluation score. Based on the graph evaluation score, a target subgraph is determined from all candidate subgraphs.
[0009] In the target subgraph, a simulated path is obtained by traversing the user item pair as the starting point. For any simulated path, a pattern is extracted from the simulated path to obtain a pattern path. All pattern paths are then combined to form a target graph pattern.
[0010] For any pattern path in the target graph pattern, determine all variables in the pattern path and all predicates defined on each variable. For any variable in the pattern path, determine a target predicate from all predicates corresponding to the variable, and form a candidate precondition with the variable and the target predicate.
[0011] Traverse all variables in the pattern path to obtain the candidate preconditions corresponding to each variable in the pattern path, and form a set of candidate preconditions corresponding to the pattern path by combining all the candidate preconditions corresponding to the variables in the pattern path.
[0012] Based on the target graph pattern and the set of candidate preconditions corresponding to all pattern paths in the target graph pattern, at least one candidate interpretation rule is obtained, and the candidate interpretation rule that satisfies the preset conditions is determined from all candidate interpretation rules as the target interpretation rule.
[0013] Secondly, embodiments of this application provide a rule mining apparatus for interpreting recommendation models, the rule mining apparatus comprising:
[0014] The acquisition module is used to acquire graph data and determine all user-item pairs in the graph data, wherein the user-item pairs are node pairs representing the mapping relationship between users and items, obtained by recommending items to users in the graph data based on a recommendation model;
[0015] The subgraph determination module is used to, for any user item pair, determine a neighborhood graph of the user item pair from the graph data, and all connected subgraphs of the neighborhood graph containing the user item pair, determine at least one candidate subgraph from all connected subgraphs, evaluate the candidate subgraph according to the neighborhood graph for any candidate subgraph to obtain a graph evaluation score, and determine a target subgraph from all candidate subgraphs according to the graph evaluation score;
[0016] The graph pattern determination module is used to traverse the target subgraph starting from the user item pair to obtain a simulated path, extract a pattern from the simulated path for any simulated path to obtain a pattern path, and form a target graph pattern from all the pattern paths.
[0017] The condition mining module is used to determine all variables and all predicates defined on each variable in any pattern path in the target graph pattern, and to determine a target predicate from all predicates corresponding to any variable in the pattern path, and to form a candidate precondition by combining the variable and the target predicate.
[0018] The condition determination module is used to traverse all variables in the pattern path, obtain the candidate preconditions corresponding to each variable in the pattern path, and form a set of candidate preconditions corresponding to the pattern path by combining the candidate preconditions corresponding to all variables in the pattern path.
[0019] The rule mining module is used to obtain at least one candidate interpretation rule based on the target graph pattern and the set of candidate preconditions corresponding to all pattern paths in the target graph pattern, and to determine the candidate interpretation rule that meets the preset conditions from all candidate interpretation rules as the target interpretation rule.
[0020] Thirdly, embodiments of this application provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the rule mining method as described in the first aspect.
[0021] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the rule mining method as described in the first aspect.
[0022] The beneficial effects of this application embodiment compared with the prior art are as follows: For any user-item pair in graph data, this application determines its corresponding neighborhood graph and connected subgraph, determines candidate subgraphs from the connected subgraphs, evaluates the candidate subgraphs based on the neighborhood graph, determines the target subgraph from the candidate subgraphs based on the graph evaluation score, traverses the target subgraph starting from the user-item pair to obtain a simulated path, extracts patterns from the simulated path to obtain a pattern path, forms a target graph pattern from the pattern path, determines all variables and all predicates defined on each variable in the pattern path for any pattern path in the target graph pattern, determines a target predicate from all predicates corresponding to the variable for any variable in the pattern path, forms a candidate precondition with the variable and the target predicate, forms a set of candidate preconditions corresponding to the pattern path from the candidate preconditions corresponding to all variables in the pattern path, obtains at least one candidate interpretation rule based on the target graph pattern and the set of candidate preconditions corresponding to all pattern paths in the target graph pattern, and determines the candidate interpretation rule that meets the preset conditions from all candidate interpretation rules as the target interpretation rule.
[0023] This application, based on graph data and a recommendation model, mines target explanatory rules (explanatory components) from graph data that reflect the prediction principles of the recommendation model as a global explanation of the model. To achieve this goal, firstly, the neighborhood graph and connected subgraphs centered on user-item pairs in the graph data are selected and evaluated to determine the target subgraph. Target graph patterns are then extracted from the target subgraphs. This process effectively captures subgraph information closely related to the recommendation model's prediction within the graph data, ensuring that the target graph patterns extracted from the target subgraphs comprehensively and accurately reflect the recommendation model's prediction logic. Then, for each pattern path in the target graph pattern, all predicates corresponding to the variables are selected and evaluated. This process effectively captures predicate information closely related to the recommendation model's prediction within the target graph pattern, enabling the candidate predicates generated based on the target predicates to comprehensively and accurately reflect the recommendation model's prediction logic. Finally, based on the target graph pattern and the mined candidate predicates, target explanation rules are formed for interpreting the recommendation model, optimizing the explanation method and ensuring that the target explanation rules mined based on the target graph pattern and candidate predicates can reproduce the recommendation model's prediction results. This improves the effectiveness and reliability of the generated target explanation rules in interpreting the recommendation model, providing users and developers with a clearer and more transparent model decision-making process. Attached Figure Description
[0024] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0025] Figure 1 This is a schematic diagram of an application environment for a rule mining method provided in Embodiment 1 of this application;
[0026] Figure 2 This is a flowchart illustrating a rule mining method provided in Embodiment 2 of this application;
[0027] Figure 3 This is a schematic diagram of a graph data provided in Embodiment 2 of this application;
[0028] Figure 4 This is a schematic diagram of a target interpretation rule provided in Embodiment 2 of this application;
[0029] Figure 5 This is a flowchart illustrating a rule mining method provided in Embodiment 3 of this application;
[0030] Figure 6 This is a flowchart illustrating a rule mining method provided in Embodiment 4 of this application;
[0031] Figure 7 This is a flowchart illustrating a rule mining method provided in Embodiment 5 of this application;
[0032] Figure 8 This is a flowchart illustrating a rule mining method provided in Embodiment Six of this application;
[0033] Figure 9 This is a schematic diagram of the structure of a rule mining device provided in Embodiment 7 of this application;
[0034] Figure 10 This is a schematic diagram of the structure of a computer device provided in Embodiment 8 of this application. Detailed Implementation
[0035] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0036] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0037] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0038] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrases "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0039] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0040] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0041] The embodiments of this application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.
[0042] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.
[0043] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0044] To illustrate the technical solution of this application, specific embodiments are described below.
[0045] The rule mining method for interpreting recommendation models provided in Embodiment 1 of this application can be applied to, for example, Figure 1 In this application environment, the server and client communicate with each other. The server provides rule mining services, and the client triggers rule mining tasks to the server. Clients include, but are not limited to, handheld computers, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, and personal digital assistants (PDAs). The server-side computing equipment can be implemented using a dedicated server or a server cluster consisting of multiple servers.
[0046] See Figure 2 This is a flowchart illustrating a rule mining method for interpreting recommendation models provided in Embodiment 2 of this application. The rule mining method described above is applied to... Figure 1 The server in the diagram connects to the client to retrieve graph data sent by the client. For example... Figure 2 As shown, the rule mining method may include the following steps:
[0047] Step S201: Obtain graph data and identify all user item pairs in the graph data.
[0048] In this embodiment, the user-item pair is a node pair representing the mapping relationship between users and items, obtained by recommending items to users in graph data based on a recommendation model. The recommendation model can refer to the GNN recommendation model.
[0049] For example, such as Figure 3 The image shown is a schematic diagram of graph data provided in Embodiment 2 of this application. Wherein, u, v, w1, w2... w15 is a node representing a specific entity in the graph data. Each node has corresponding attributes and attribute values. For example, for node w1, its corresponding attributes may include: film name, genre; the attribute values are as follows: Action, the edges connecting nodes represent the relationships between them. For example, the "watch" edge between node u and node w1 could indicate that a user of node u is watching a movie on node w1. For a user-item pair in the graph data, M represents the recommendation model, u represents the user, and v represents the item.
[0050] Step S202: For any user-item pair, determine a neighborhood graph of the user-item pair from the graph data, and all connected subgraphs containing the user-item pair in the neighborhood graph. Determine at least one candidate subgraph from all connected subgraphs. For any candidate subgraph, evaluate the candidate subgraph based on the neighborhood graph to obtain a graph evaluation score. Determine the target subgraph from all candidate subgraphs based on the graph evaluation score.
[0051] In this embodiment, since the k-layer recommendation model mainly aggregates information from the k-hop neighborhood of the two nodes (the user node representing the user and the item node representing the item) in the user-item pair, the neighborhood graph can be the union of two subgraphs formed by traversing all nodes reachable in k steps along the edges of the graph data, starting from the user node and the item node respectively, and their interconnections. Here, k is an integer greater than zero. A connected subgraph can be a connected subgraph in the neighborhood graph that contains the two nodes in the user-item pair. A candidate subgraph can be any connected subgraph in all connected subgraphs. The graph evaluation score can be the score obtained by evaluating the candidate subgraph based on the neighborhood graph. The target score can be the candidate subgraph selected from all candidate subgraphs based on the graph evaluation score.
[0052] Specifically, for any user-item pair, a search tree can be constructed based on the neighborhood graph and all connected subgraphs of the user-item pair. In the search tree, the root node represents the neighborhood graph, and any non-root node represents a connected subgraph. On the path from the root node to any leaf node, the size of the connected subgraph gradually decreases. Based on the search tree iteration, a path is selected from the root node to reach the leaf node, and the connected subgraph represented by the leaf node is determined as a candidate subgraph. Based on the neighborhood graph, the candidate subgraphs represented by the leaf nodes are evaluated to obtain a graph evaluation score. This process continues until a preset iteration stopping condition is met, and the graph evaluation scores of all candidate subgraphs are obtained. From all candidate subgraphs, the candidate subgraph corresponding to the highest graph evaluation score is determined as the target subgraph.
[0053] Step S203: In the target subgraph, walk around starting from the user item pair to obtain a simulated path. For any simulated path, extract the pattern of the simulated path to obtain a pattern path. Combine all the pattern paths into a target graph pattern.
[0054] In this embodiment, the simulated path can refer to the path obtained by walking around the two nodes in the user item pair as starting points in the target subgraph, the pattern path can refer to the path pattern extracted by replacing the specific entity vertices (or edges) in the simulated path with pattern vertices (or edges) with the same label, and the target graph pattern can refer to the graph pattern formed by the combination of all pattern paths.
[0055] Specifically, firstly, in the target subgraph, random walks are performed starting from the two nodes in the user-item pair to obtain a first simulated path starting from the user node and a second simulated path starting from the item node. Secondly, for any first simulated path, the specific entity vertices (or edges) in the first simulated path are replaced with pattern vertices (or edges) with the same label to obtain a first pattern path. Correspondingly, for any second simulated path, the specific entity vertices (or edges) in the second simulated path are replaced with pattern vertices (or edges) with the same label to obtain a second pattern path. Then, all the first pattern paths are combined to form a star pattern centered on the user node, and all the second pattern paths are combined to form a star pattern centered on the item node. Finally, the star pattern centered on the user node and the star pattern centered on the item node are combined to obtain a dual-mode target graph pattern.
[0056] Step S204: For any pattern path in the target graph pattern, determine all variables in the pattern path and all predicates defined on each variable. For any variable in the pattern path, determine a target predicate from all the predicates corresponding to the variable, and form a candidate precondition by combining the variable and the target predicate.
[0057] Step S205: Traverse all variables in the pattern path to obtain the candidate premises corresponding to each variable in the pattern path, and form a set of candidate premises corresponding to all variables in the pattern path.
[0058] In this embodiment, during the process of extracting patterns from the simulated path to obtain the pattern path, the pattern path is obtained by replacing the specific entity vertices (or edges) in the simulated path with pattern vertices (or edges) of the same label. The pattern vertices of the same label that replace the specific entity vertices in the simulated path are the variables in the pattern path. The attributes and corresponding attribute values of the specific entity vertices in the simulated path that are not replaced are the predicates defined on the variables. The target predicate can refer to any predicate defined on the variables. The candidate preconditions can refer to the preconditions formed by the variables and the target predicates. The candidate precondition set can refer to the set of candidate preconditions corresponding to all variables in the pattern path.
[0059] Specifically, for any pattern path in the target graph pattern, candidate prerequisites are generated one by one for each variable in that pattern path until all candidate prerequisites for all variables in that pattern path are obtained. These candidate prerequisites for all variables in that pattern path are then combined to form a set of candidate prerequisites for that pattern path. Where N is a hyperparameter, each For pattern path One of the candidate prerequisites, .
[0060] For example, given a pattern path The pattern path includes two variables, namely... and If variable The attributes include: name, sex; the corresponding attribute values are as follows: If male, then the variable can be determined. All predicates defined above include: name= , sex=male; correspondingly, if the variable The attributes include: name, job; the corresponding attribute values are as follows: director, then the variable can be determined All predicates defined above include: name= job = director;
[0061] After obtaining the pattern path In the process of setting the corresponding candidate preconditions, from the variables Initially, iterate through the variables in the pattern path round by round, selecting the target predicate defined on each variable until a leaf node is reached. First, if starting from the variable... If a target predicate is defined as sex=male, then the variable... A candidate precondition formed with the target predicate sex=male for Then, the leaf node variable is reached. From variables If a target predicate is defined as job=director, then the variable... A candidate precondition formed with the target predicate job=director for Finally, the pattern path The candidate preconditions corresponding to all variables form the pattern path. The set of candidate preconditions = ,Right now, ={ , }
[0062] Step S206: Based on the target graph pattern and the set of candidate preconditions corresponding to all pattern paths in the target graph pattern, at least one candidate interpretation rule is obtained, and the candidate interpretation rule that meets the preset conditions is determined from all candidate interpretation rules as the target interpretation rule.
[0063] In this embodiment, the candidate interpretation rule can refer to the logical rule formed based on the target graph pattern and the set of candidate preconditions corresponding to all pattern paths in the target graph pattern. The preset condition can refer to the pre-set condition for filtering the candidate interpretation rule. The target interpretation rule can refer to the candidate interpretation rule that satisfies the preset condition.
[0064] The basic form of Rules for Explanations (REPs) is as follows: ,in, For target graph mode, , The graph pattern corresponding to the user node. The graph pattern corresponding to the item node. To depict the topological structure between users x and items y related to recommendation decisions, the set of user-related nodes can be represented as follows: Nodes related to items are represented as When referring to any node in a graph pattern, it can be represented by z, i.e. , It is a set of predicates that describe the conditions and features related to node features;
[0065] For example, such as Figure 4 The diagram shown is a schematic of a target interpretation rule provided in Embodiment 2 of this application.
[0066] Target Interpretation Rules The basic form is ,in, for Target interpretation rules Combination mode and prerequisites Explained to male users Recommended movies The reason is: 1) I've watched at least two action movies before (they are related to...) (same type); 2) There is a person who likes highly rated movies (Movie rating ≥ 6) and by Director; 3) It is by The director's award-winning film (because) ).
[0067] Specifically, in the process of obtaining candidate interpretation rules, for any pattern path in the target graph pattern, a preset number of candidate preconditions are extracted from the set of candidate preconditions corresponding to the pattern path. The candidate preconditions extracted from all pattern paths are combined to form a rule precondition. The target graph pattern and the rule precondition are combined to obtain the candidate interpretation rules.
[0068] For example, if the target graph pattern includes two pattern paths, respectively , Each pattern path includes two variables: the pattern path. The set of candidate prerequisites includes two candidate prerequisites, denoted as: mode path The set of candidate prerequisites also includes two candidate prerequisites, denoted as: If from the pattern path and If one candidate prerequisite is extracted from the set of candidate prerequisites, then the candidate prerequisites extracted from the two pattern paths can form four rule prerequisites, namely... and Rules and conditions can be formed for ; and Rules and conditions can be formed for ; and Rules and conditions can be formed for ; and Rules and conditions can be formed for Each rule's preconditions are combined with the target graph pattern to obtain all candidate interpretation rules. From all candidate interpretation rules, the candidate interpretation rule that meets the preset conditions is selected as the target interpretation rule.
[0069] In this embodiment, based on graph data and a recommendation model, target explanation rules (explanation components) that reflect the prediction principle of the recommendation model are mined from the graph data as a global explanation of the recommendation model. To achieve this goal, firstly, the neighborhood graph and connected subgraphs centered on user-item pairs in the graph data are selected and evaluated to determine the target subgraph. Target graph patterns are then extracted from the target subgraphs. This process effectively captures subgraph information in the graph data that is closely related to the recommendation model's prediction, enabling the target graph patterns extracted based on the target subgraphs to comprehensively and accurately reflect the prediction logic of the recommendation model. Then, for each pattern path in the target graph pattern, all predicates corresponding to the variables are selected. The selection and evaluation process for candidate predicate mining effectively captures predicate information closely related to the recommendation model's prediction within the target graph pattern. This ensures that the candidate predicates generated based on the target predicates comprehensively and accurately reflect the prediction logic of the recommendation model. Finally, based on the target graph pattern and the mined candidate predicates, target explanation rules are formed for interpreting the recommendation model. This optimizes the explanation method and ensures that the target explanation rules mined based on the target graph pattern and candidate predicates can reproduce the prediction results of the recommendation model. This improves the effectiveness and reliability of the generated target explanation rules in interpreting the recommendation model, providing users and developers with a clearer and more transparent model decision-making process.
[0070] See Figure 5 This is a flowchart illustrating a rule mining method provided in Embodiment 3 of this application. Figure 5 As shown, in step S202 above, at least one candidate subgraph is determined from all connected subgraphs. For any candidate subgraph, the candidate subgraph is evaluated based on the neighborhood graph to obtain a graph evaluation score. Based on the graph evaluation score, the target subgraph is determined from all candidate subgraphs. This may include the following steps:
[0071] Step S501: Construct a search tree based on the neighborhood graph and all connected subgraphs.
[0072] Step S502: Calculate the first recommendation strength value of the user item pair recommended by the recommendation model on the neighborhood graph.
[0073] Step S503: In the search tree, according to the preset selection strategy, a path is selected from the root node to a leaf node, and the connected subgraph represented by the leaf node is determined as a candidate subgraph. The second recommendation strength value of the user item pair recommended by the recommendation model on the candidate subgraph is calculated. The candidate subgraph is evaluated based on the second recommendation strength value and the first recommendation strength value to obtain the graph evaluation score of the candidate subgraph.
[0074] Step S504: Return to the step of selecting a path from the root node to a leaf node according to the preset selection strategy, until the preset iteration stop condition is met, and obtain the graph evaluation score of all candidate subgraphs.
[0075] Step S505: From all candidate subgraphs, determine the candidate subgraph corresponding to the highest graph evaluation score as the target subgraph.
[0076] In this embodiment, the root node in the search tree represents a neighborhood graph, and any non-root node represents a connected subgraph. Along the path from the root node to any leaf node, the size of the connected subgraph gradually decreases. This search tree can refer to a Monte Carlo Tree Search (MCTS). The first recommendation strength can represent the recommendation strength value of the user-item pair recommended by the recommendation model on the neighborhood graph, and the second recommendation strength can represent the recommendation strength value of the user-item pair recommended by the recommendation model on the candidate subgraph. The preset selection strategy can refer to a pre-set path selection strategy, and the preset iteration stopping condition can refer to a pre-set iteration stopping condition, such as reaching a preset number of iterations or reaching a resource limit.
[0077] Specifically, firstly, a Monte Carlo search tree is constructed based on the neighborhood graph and all connected subgraphs of the user-item pair. In the Monte Carlo search tree, the root node represents the neighborhood graph, and each non-root node represents a connected subgraph. Along the path from the root node to any leaf node, the size of the connected subgraph gradually decreases. Secondly, starting from the root node, the optimal child node is recursively selected according to a preset selection strategy until a leaf node is reached. The connected subgraph represented by the leaf node is then determined as a candidate subgraph. The second recommendation strength value of the user-item pair recommended by the recommendation model on the candidate subgraph is calculated. This second recommendation strength value is then compared with the first recommendation strength value of the user-item pair recommended by the recommendation model on the neighborhood graph. The evaluation scores of candidate subgraphs are compared, and the evaluation scores of candidate subgraphs are determined based on the comparison results. The closer the second recommendation strength value is to the first recommendation strength value, the higher the evaluation score is assigned to the corresponding candidate subgraph. Then, the process returns to the step of selecting a path from the root node to a leaf node according to the preset selection strategy until the preset iteration stopping condition is reached, and the graph evaluation scores of all candidate subgraphs are obtained. Finally, the candidate subgraph with the highest graph evaluation score is determined as the target subgraph. The recommendation prediction result of the recommendation model on the target subgraph is closest to the recommendation prediction result on the neighborhood graph, so that the recommendation model can reproduce its prediction in the target subgraph.
[0078] In this embodiment, a search tree is constructed based on the neighborhood graph and connected subgraphs corresponding to user item pairs. According to a preset selection strategy, the most promising target subgraph (with the highest graph evaluation score) is determined from all candidate subgraphs. This allows the recommendation model to reproduce its predictions in the target subgraph. This process effectively captures the target subgraph information in the graph data that is closely related to the recommendation model's recommendation predictions, improves graph evaluation efficiency, and enables the target graph pattern extracted based on the target subgraph to comprehensively and accurately reflect the prediction logic of the recommendation model. This, in turn, improves the effectiveness and reliability of the target interpretation rules obtained from mining, thereby improving the effectiveness and reliability of the global interpretation.
[0079] See Figure 6 This is a flowchart illustrating a rule mining method provided in Embodiment 4 of this application. Figure 6 As shown, in step S203 above, a simulated path is obtained by traversing the target sub-graph starting from the user item pair. For any simulated path, a pattern is extracted to obtain a pattern path. All pattern paths are then combined to form a target graph pattern. This may include the following steps:
[0080] Step S601: Determine the user node representing the user and the item node representing the item in the user-item pair.
[0081] Step S602: In the target subgraph, starting from the user node, perform a random walk with a preset probability to obtain the first simulated path. Then, return to execute the step of performing a random walk with a preset probability starting from the user node until the preset walk stopping condition is met, and obtain all the first simulated paths starting from the user node.
[0082] Step S603: Starting from the item node, perform a random walk with a preset probability to obtain a second simulated path. Then, return to execute the step of performing a random walk with a preset probability starting from the item node until the preset walk stopping condition is met, and obtain all second simulated paths starting from the item node.
[0083] Step S604: For any first simulation path, perform pattern extraction on the first simulation path to obtain a first pattern path; and for any second simulation path, perform pattern extraction on the second simulation path to obtain a second pattern path.
[0084] Step S605: Form all first mode paths into graph patterns corresponding to user nodes, and form all second mode paths into graph patterns corresponding to item nodes.
[0085] Step S606: Combine the graph patterns corresponding to the user nodes and the graph patterns corresponding to the item nodes to form a target graph pattern.
[0086] In this embodiment, the preset probability can refer to a pre-set walk termination probability, and the preset walk stopping condition can refer to a pre-set walk stopping condition. For example, the preset walk stopping condition can refer to the number of the first simulated paths and the number of the second simulated paths reaching a preset value. The first simulated path can refer to the path obtained by walking in the target subgraph with the node representing the user in the user-item pair as the starting point, and the second simulated path can refer to the path obtained by walking in the target subgraph with the node representing the item in the user-item pair as the starting point. The first pattern path can refer to the path pattern extracted by replacing the specific entity vertex (or edge) in the first simulated path with pattern vertices (or edges) of the same label, and the second pattern path can refer to the path pattern extracted by replacing the specific entity vertex (or edge) in the second simulated path with pattern vertices (or edges) of the same label.
[0087] Specifically, firstly, in the target subgraph, starting from the user node and the item node respectively, a traversal is performed with preset probabilities to obtain a first simulated path and a second simulated path. For example, if the preset probability is... Random walks are performed, starting from user nodes and item nodes respectively. At each step, either... To end the walk, either use 1- The probability of moving to an outgoing neighbor of the current node is used to obtain a first simulated path and a second simulated path. This process continues until the number of first and second simulated paths reaches a preset value, at which point the traversal stops. All first and second simulated paths are then obtained. For any first simulated path, a first pattern path is obtained by replacing the concrete entity vertices (or edges) in the first simulated path with pattern vertices (or edges) of the same label. Similarly, for any second simulated path, a second pattern path is obtained by replacing the concrete entity vertices (or edges) in the second simulated path with pattern vertices (or edges) of the same label. Finally, all first pattern paths are combined to form a star topology centered on the user node, denoted as […]. And combine all the second-mode paths into a star-shaped pattern centered on the item node, denoted as The star schema corresponding to user nodes and the star schema corresponding to item nodes are combined to form the target graph schema, denoted as . .
[0088] In this embodiment, by performing random walks in the target subgraph, starting from user nodes and item nodes respectively, according to preset probabilities and preset termination conditions, a simulated path is obtained, avoiding endless path exploration. Path patterns are extracted from the simulated path to obtain target graph patterns that reflect the predictions of the recommendation model at user-item pairs. This improves the efficiency of graph pattern extraction and ensures that the target interpretation rules mined based on the target graph patterns can reproduce the prediction results of the recommendation model, thereby improving the effectiveness and reliability of the global interpretation.
[0089] See Figure 7 This is a flowchart illustrating a rule mining method provided in Embodiment 5 of this application, as shown below. Figure 7 As shown, step S204 above, which determines a target predicate from all predicates corresponding to any variable in the pattern path, may include the following steps:
[0090] Step S701: For any predicate corresponding to the variable, evaluate the importance of the predicate and obtain the predicate evaluation score;
[0091] Step S702: Based on the predicate evaluation score, determine the predicate with the highest predicate evaluation score from all predicates corresponding to the variable as the target predicate.
[0092] In this embodiment, the predicate evaluation score can refer to the score that characterizes the importance of the predicate.
[0093] Specifically, in obtaining the predicate evaluation score, for any predicate corresponding to a variable, the predicate support score, representing the frequency of matching of the predicate in the graph data, is calculated. Existing candidate preconditions in the pattern path are identified, and the difference score, representing the degree of difference between the predicate and the existing candidate preconditions in the pattern path, is calculated. Based on the predicate support score and the difference score, the predicate evaluation score is obtained. Based on the predicate evaluation score, the predicate with the highest predicate evaluation score among all predicates corresponding to the variable is determined as the target predicate.
[0094] For example, for any variable in the pattern path, in order to determine which of the predicates defined on that variable can be used as the target predicate to form a candidate premise, the predicate support score and the dissimilarity score of the predicate are considered at the same time to obtain the predicate evaluation score.
[0095] Denote variables The prerequisites for generating the candidates are: In this variable If the predicate defined above is p, then it applies to the variable For any of the above predicates, the formula for calculating the predicate evaluation score can be:
[0096]
[0097] in, Assess the score for the predicate; and As weight, + =1; The data is graph data, where Q is the target graph pattern used to depict users related to recommendation decisions. and items The topology between them For variables The mode path it is located in;
[0098] In this embodiment, for any predicate corresponding to a variable, the predicate support score (representing the frequency of matching of the predicate in graph data) and the difference score (representing the degree of difference between the predicate and existing candidate predicates in the pattern path) are comprehensively considered to obtain a predicate evaluation score. The predicate with the highest predicate evaluation score is then selected as the target predicate. This ensures that the candidate predicates generated based on the target predicate can fully reflect the predictions of the recommendation model, thereby improving the effectiveness and reliability of the mined target explanation rules, and ultimately enhancing the effectiveness and reliability of the global explanation.
[0099] See Figure 8 This is a flowchart illustrating a rule mining method provided in Embodiment Six of this application, as shown below. Figure 8As shown, step S206 above, which involves determining the candidate interpretation rule that meets the preset conditions from all candidate interpretation rules as the target interpretation rule, may include the following steps:
[0100] Step S801: For any candidate explanatory rule, calculate the rule support score representing the frequency of matching of the candidate explanatory rule in the graph data, and calculate the confidence score representing the association strength between the rule premises corresponding to the candidate explanatory rule and the predicted user item pair.
[0101] Step S802: If the rule support score reaches a preset first threshold and the confidence score reaches a preset second threshold, then the candidate explanatory rule is determined to meet the preset conditions and is determined to be the target explanatory rule.
[0102] In this embodiment, the rule support score can be a score that represents the frequency of matching of candidate explanatory rules in graph data, the confidence score can be a score that represents the strength of association between the rule premises corresponding to the candidate explanatory rule and the predicted user item pair, and the preset first threshold and preset second threshold can be preset score values.
[0103] Specifically, the rule support score, which represents the frequency of matching of candidate explanatory rules in graph data, is defined as:
[0104]
[0105] in, Score the support for the rule. For candidate interpretation rules, The data is graph data, where X represents the rule prerequisites and Q represents the target graph pattern, used to depict users related to recommendation decisions. and items The topology between them For user item pairs;
[0106] The candidate interpretation rule corresponds to the rule preconditions and the predicted user item pair. The confidence score for association strength is defined as follows:
[0107]
[0108] in, Confidence score;
[0109] If the preset first threshold is The preset second threshold is Then for any target interpretation rule, we have , .
[0110] In this embodiment, the rule support score, which represents the frequency of matching of candidate explanatory rules in graph data, and the confidence score, which represents the association strength between the rule preconditions and the predicted user-item pair of the candidate explanatory rules, are calculated. Candidate explanatory rules whose rule support score reaches a preset first threshold and whose confidence score reaches a preset second threshold are selected as target explanatory rules. This improves the effectiveness and reliability of the target explanatory rules obtained through mining, thereby improving the effectiveness and reliability of the global explanatory process.
[0111] Corresponding to the rule mining method for interpreting the recommendation model in the above embodiments, Figure 9 This paper shows a structural block diagram of a rule mining device for recommendation model interpretation provided in Embodiment 7 of this application. The rule mining device is applied to... Figure 1 The server-side component is shown. For ease of explanation, only the parts relevant to the embodiments of this application are shown.
[0112] See Figure 9 The rule-based excavation device includes:
[0113] The acquisition module 91 is used to acquire graph data and determine all user-item pairs in the graph data, wherein the user-item pairs are node pairs representing the mapping relationship between users and items obtained by recommending items to users in the graph data based on a recommendation model;
[0114] The subgraph determination module 92 is configured to, for any user item pair, determine a neighborhood graph of the user item pair from the graph data, and all connected subgraphs of the neighborhood graph containing the user item pair, determine at least one candidate subgraph from all connected subgraphs, evaluate the candidate subgraph according to the neighborhood graph for any candidate subgraph to obtain a graph evaluation score, and determine a target subgraph from all candidate subgraphs according to the graph evaluation score;
[0115] The graph pattern determination module 93 is used to walk in the target subgraph starting from the user item pair to obtain a simulated path, extract a pattern from the simulated path for any simulated path to obtain a pattern path, and form a target graph pattern from all the pattern paths.
[0116] The condition mining module 94 is used to determine all variables and all predicates defined on each variable in any pattern path in the target graph pattern, and to determine a target predicate from all predicates corresponding to any variable in the pattern path, and to form a candidate precondition by combining the variable and the target predicate.
[0117] The condition determination module 95 is used to traverse all variables in the pattern path, obtain the candidate preconditions corresponding to each variable in the pattern path, and form a set of candidate preconditions corresponding to the pattern path by combining the candidate preconditions corresponding to all variables in the pattern path.
[0118] The rule mining module 96 is used to obtain at least one candidate interpretation rule based on the target graph pattern and the set of candidate preconditions corresponding to all pattern paths in the target graph pattern, and to determine the candidate interpretation rule that meets the preset conditions from all candidate interpretation rules as the target interpretation rule.
[0119] Optionally, the subgraph determination module 92 includes:
[0120] A tree construction unit is used to construct a search tree based on the neighborhood graph and all connected subgraphs, wherein the root node in the search tree represents the neighborhood graph, any non-root node represents a connected subgraph, and the size of the connected subgraph gradually decreases along the path from the root node to any leaf node.
[0121] The first calculation unit is used to calculate the first recommendation strength value of the user item pair recommended by the recommendation model on the neighborhood graph;
[0122] An evaluation unit is configured to, in the search tree, select a path from the root node to a leaf node according to a preset selection strategy, determine the connected subgraph represented by the leaf node as the candidate subgraph, calculate a second recommendation strength value of the user item pair recommended by the recommendation model on the candidate subgraph, evaluate the candidate subgraph based on the second recommendation strength value and the first recommendation strength value, and obtain a graph evaluation score for the candidate subgraph.
[0123] An iterative unit is used to return to the step of selecting a path from the root node to a leaf node according to the preset selection strategy, until the preset iteration stop condition is reached, and obtain the graph evaluation score of all candidate subgraphs;
[0124] The selection unit is used to determine the candidate subgraph corresponding to the highest graph evaluation score from all candidate subgraphs as the target subgraph.
[0125] Optionally, the graph pattern determination module 93 includes:
[0126] A node determination unit is used to determine the user node representing the user and the item node representing the item in the user-item pair.
[0127] The first walking unit is used to perform a random walk with a preset probability starting from the user node in the target subgraph to obtain a first simulated path, and then return to execute the step of performing a random walk with a preset probability starting from the user node until a preset walking stop condition is met, so as to obtain all the first simulated paths starting from the user node.
[0128] The second walking unit is used to perform a random walk with the preset probability starting from the item node to obtain a second simulated path, and then return to execute the step of performing a random walk with the preset probability starting from the item node until the preset walking stop condition is met, so as to obtain all the second simulated paths starting from the item node.
[0129] The extraction unit is configured to perform pattern extraction on any first simulation path to obtain a first pattern path, and to perform pattern extraction on any second simulation path to obtain a second pattern path.
[0130] The first pattern forming unit is used to form all first pattern paths into a graph pattern corresponding to the user node, and to form all second pattern paths into a graph pattern corresponding to the item node.
[0131] The second pattern forming unit is used to form the target graph pattern by combining the graph pattern corresponding to the user node and the graph pattern corresponding to the item node.
[0132] Optionally, the condition mining module 94 includes:
[0133] The predicate evaluation unit is used to evaluate the importance of any predicate corresponding to the variable and obtain a predicate evaluation score.
[0134] The predicate determination unit is used to determine the predicate corresponding to the highest predicate evaluation score from all predicates corresponding to the variable as the target predicate based on the predicate evaluation score.
[0135] Optionally, the predicate evaluation unit includes:
[0136] The second calculation subunit is used to calculate, for any predicate corresponding to the variable, a predicate support score that represents the degree to which the predicate can be matched in the graph data;
[0137] The third calculation subunit is used to determine the existing candidate preconditions in the pattern path and calculate the difference score, which represents the degree of difference between the predicate and the existing candidate preconditions in the pattern path.
[0138] The fourth calculation subunit is used to obtain the predicate evaluation score based on the predicate support score and the difference score.
[0139] Optionally, the rule mining module 96 includes:
[0140] An extraction unit is used to extract a preset number of candidate prerequisites from the candidate prerequisite set corresponding to any pattern path in the target graph pattern.
[0141] The rule condition forming unit is used to form a rule condition from the candidate preconditions extracted from all pattern paths;
[0142] The rule forming unit is used to combine the target graph pattern and the rule preconditions to obtain the candidate interpretation rule.
[0143] Optionally, the rule mining module 96 includes:
[0144] The fifth calculation unit is used to calculate, for any candidate explanatory rule, a rule support score that represents the frequency of matching of the candidate explanatory rule in the graph data, and a confidence score that represents the association strength between the rule premises corresponding to the candidate explanatory rule and the predicted user item pair.
[0145] The rule filtering unit is configured to determine that the candidate explanatory rule satisfies the preset conditions and is determined as the target explanatory rule if the rule support score reaches a preset first threshold and the confidence score reaches a preset second threshold.
[0146] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0147] Figure 10 This is a schematic diagram of the structure of a computer device provided in Embodiment 8 of this application. Figure 10 As shown, the computer device of this embodiment includes: at least one processor ( Figure 10 The diagram shows only one instance of a memory and a computer program stored in the memory that can run on at least one processor. When the processor executes the computer program, it implements the steps in any of the above-described rule mining method embodiments.
[0148] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 10The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.
[0149] The processor referred to can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.
[0150] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of the computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.
[0151] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0152] The implementation of all or part of the processes in the methods of the above embodiments can also be accomplished by a computer program product. When the computer program product is run on a computer device, it enables the computer device to execute the steps in the above method embodiments.
[0153] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0154] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0155] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0156] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0157] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions 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 this application, and should all be included within the protection scope of this application.
Claims
1. A rule mining method for interpreting recommendation models, characterized in that, The rule mining method includes: Obtain graph data and determine all user-item pairs in the graph data, wherein the user-item pair is a node pair representing the mapping relationship between users and items obtained by recommending items to users in the graph data based on a recommendation model; For any user item pair, a neighborhood graph of the user item pair is determined from the graph data, and all connected subgraphs of the neighborhood graph containing the user item pair are determined. At least one candidate subgraph is determined from all connected subgraphs. For any candidate subgraph, the candidate subgraph is evaluated according to the neighborhood graph to obtain a graph evaluation score. Based on the graph evaluation score, a target subgraph is determined from all candidate subgraphs. In the target sub-graph, a simulated path is obtained by traversing from the user item pair as the starting point. For any simulated path, a pattern is extracted from the simulated path to obtain a pattern path. All pattern paths are then combined to form a target graph pattern. For any pattern path in the target graph pattern, determine all variables in the pattern path and all predicates defined on each variable. For any variable in the pattern path, determine a target predicate from all predicates corresponding to the variable, and form a candidate precondition with the variable and the target predicate. Traverse all variables in the pattern path to obtain the candidate preconditions corresponding to each variable in the pattern path, and form a set of candidate preconditions corresponding to the pattern path by combining all the candidate preconditions corresponding to the variables in the pattern path. Based on the target graph pattern and the set of candidate preconditions corresponding to all pattern paths in the target graph pattern, at least one candidate interpretation rule is obtained, and the candidate interpretation rule that meets the preset conditions is determined from all candidate interpretation rules as the target interpretation rule; The step of determining at least one candidate subgraph from all connected subgraphs, evaluating the candidate subgraph based on the neighborhood graph for any candidate subgraph to obtain a graph evaluation score, and determining the target subgraph from all candidate subgraphs based on the graph evaluation score includes: Based on the neighborhood graph and all connected subgraphs, a search tree is constructed, wherein the root node in the search tree represents the neighborhood graph, any non-root node represents a connected subgraph, and the size of the connected subgraph gradually decreases along the path from the root node to any leaf node. The recommendation model is used to calculate the first recommendation strength value of the user item pair recommended on the neighborhood graph. In the search tree, according to a preset selection strategy, a path is selected from the root node to a leaf node, and the connected subgraph represented by the leaf node is determined as the candidate subgraph. The second recommendation strength value of the user item pair recommended by the recommendation model on the candidate subgraph is calculated. The candidate subgraph is evaluated based on the second recommendation strength value and the first recommendation strength value to obtain the graph evaluation score of the candidate subgraph. The closer the second recommendation strength value is to the first recommendation strength value, the higher the graph evaluation score is given to the candidate subgraph. Return to the step of selecting a path from the root node to a leaf node according to the preset selection strategy, until the preset iteration stopping condition is met, and obtain the graph evaluation score of all candidate subgraphs; From all candidate subgraphs, the candidate subgraph corresponding to the highest graph evaluation score is determined as the target subgraph.
2. The rule mining method according to claim 1, characterized in that, In the target subgraph, a simulated path is obtained by traversing the user item pair as the starting point. For any simulated path, a pattern is extracted to obtain a pattern path. All pattern paths are then combined to form a target graph pattern, including: Determine the user node representing the user and the item node representing the item in the user-item pair; In the target subgraph, starting from the user node, a random walk is performed with a preset probability to obtain a first simulated path. Then, the process of performing a random walk with a preset probability starting from the user node is repeated until a preset walk stopping condition is met, thus obtaining all first simulated paths starting from the user node. Starting from the item node, a random walk is performed with the preset probability to obtain a second simulated path. Then, the process of performing a random walk with the preset probability starting from the item node is repeated until the preset walk stopping condition is met, thus obtaining all second simulated paths starting from the item node. For any first simulation path, perform pattern extraction on the first simulation path to obtain a first pattern path; and for any second simulation path, perform pattern extraction on the second simulation path to obtain a second pattern path. All first-mode paths are formed into a graph pattern corresponding to the user node, and all second-mode paths are formed into a graph pattern corresponding to the item node. The target graph pattern is formed by combining the graph patterns corresponding to the user nodes and the graph patterns corresponding to the item nodes.
3. The rule mining method according to claim 1, characterized in that, The step of determining a target predicate from all predicates corresponding to any variable in the pattern path includes: For any predicate corresponding to the variable, the importance of the predicate is evaluated to obtain a predicate evaluation score; Based on the predicate evaluation score, the predicate with the highest predicate evaluation score is determined from all predicates corresponding to the variable as the target predicate.
4. The rule mining method according to claim 3, characterized in that, For any predicate corresponding to the variable, the importance of the predicate is evaluated to obtain a predicate evaluation score, including: For any predicate corresponding to the variable, calculate the predicate support score, which represents the frequency of matching of the predicate in the graph data; Identify the existing candidate preconditions in the pattern path and calculate the difference score, which characterizes the degree of difference between the predicate and the existing candidate preconditions in the pattern path. The predicate evaluation score is obtained based on the predicate support score and the dissimilarity score.
5. The rule mining method according to claim 1, characterized in that, The step of obtaining at least one candidate interpretation rule based on the target graph pattern and the set of candidate preconditions corresponding to all pattern paths in the target graph pattern includes: For any pattern path in the target graph pattern, a preset number of candidate preconditions are extracted from the candidate precondition set corresponding to the pattern path; The candidate preconditions extracted from all pattern paths are formed into a rule precondition; The candidate interpretation rule is obtained by combining the target graph pattern and the rule preconditions.
6. The rule mining method according to claim 1, characterized in that, The step of determining the candidate interpretation rule that meets the preset conditions from all candidate interpretation rules as the target interpretation rule includes: For any candidate explanatory rule, calculate the rule support score, which represents the frequency of matching of the candidate explanatory rule in the graph data, and calculate the confidence score, which represents the relationship between the rule premises corresponding to the candidate explanatory rule and the predicted association strength of the user item pair. If the rule support score reaches a preset first threshold and the confidence score reaches a preset second threshold, then the candidate explanatory rule is determined to meet the preset conditions, and the candidate explanatory rule is determined to be the target explanatory rule.
7. A rule mining apparatus for interpreting recommendation models, used to implement the rule mining method for interpreting recommendation models as described in any one of claims 1 to 6, characterized in that, The rule mining device includes: The acquisition module is used to acquire graph data and determine all user-item pairs in the graph data, wherein the user-item pairs are node pairs representing the mapping relationship between users and items, obtained by recommending items to users in the graph data based on a recommendation model; The subgraph determination module is used to, for any user item pair, determine a neighborhood graph of the user item pair from the graph data, and all connected subgraphs of the neighborhood graph containing the user item pair, determine at least one candidate subgraph from all connected subgraphs, evaluate the candidate subgraph according to the neighborhood graph for any candidate subgraph to obtain a graph evaluation score, and determine a target subgraph from all candidate subgraphs according to the graph evaluation score; The graph pattern determination module is used to traverse the target subgraph starting from the user item pair to obtain a simulated path, extract a pattern from the simulated path for any simulated path to obtain a pattern path, and form a target graph pattern from all the pattern paths. The condition mining module is used to determine all variables and all predicates defined on each variable in any pattern path in the target graph pattern, and to determine a target predicate from all predicates corresponding to any variable in the pattern path, and to form a candidate precondition by combining the variable and the target predicate. The condition determination module is used to traverse all variables in the pattern path, obtain the candidate preconditions corresponding to each variable in the pattern path, and form a set of candidate preconditions corresponding to the pattern path by combining the candidate preconditions corresponding to all variables in the pattern path. The rule mining module is used to obtain at least one candidate interpretation rule based on the target graph pattern and the set of candidate preconditions corresponding to all pattern paths in the target graph pattern, and to determine the candidate interpretation rule that meets the preset conditions from all candidate interpretation rules as the target interpretation rule.
8. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the rule mining method as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the rule mining method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Method and device for obtaining recommendation information and computer readable storage medium
CN110196904A
Interpretable recommendation method based on graph neural network inference
WO2022222037A1