Rule mining method and device for interpretation of recommendation model, equipment and medium
By determining and evaluating the subgraphs of user item pairs in the graph data, extracting simulated path patterns and candidate prerequisites, and generating target interpretation rules, the problem of insufficient integrity of interpretation component information in the prior art is solved, and a more effective recommendation model interpretation is achieved.
Patent Information
- Application Number
- CN202411938233.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-26
AI Technical Summary
The prior art is difficult to effectively capture the attribute relationship between nodes in the interpretation of recommendation model, resulting in insufficient information integrity of the interpretation component and lack of practical feasibility.
By determining the neighborhood map and connected sub-graph of the user item pair in the graph data, the candidate sub-graph is evaluated, the simulated path pattern in the target sub-graph is extracted, and the candidate prerequisites are formed by combining variables and predicates, and the target interpretation rules for the recommendation model interpretation are finally generated.
This method effectively captures the sub-graph information and predicate information closely related to the prediction of the recommended model in the graph data. The generated interpretation rules can reproduce the prediction results of the recommendation model and improve the effectiveness and reliability of the explanation.
Smart Images

Figure CN119761494A_ABST
Abstract
Description
Technical Field
[0001] The present application is applicable to the field of model interpretation, and in particular relates to a rule mining method, device, equipment and medium for recommendation model interpretation. Background Art
[0002] With the rapid development of artificial intelligence technology, Graph Neural Networks (GNN) have shown great potential in recommendation systems. GNN can use multi-hop relationships in graph data to accurately model user preferences and analyze historical user-item interactions to provide users with personalized recommendations. With the popularity of GNN recommendation models, the interpretability of models has become an increasingly important research direction. In recommendation systems, interpretability means being able to clearly explain why a specific item is recommended to a user. This is crucial for users because it can help users understand the source of recommendation results and enhance their trust in the recommendation system. At the same time, for developers, being able to explain GNN recommendation results is also the key to optimizing and debugging models.
[0003] In the prior art, the global interpretation method is an implementation solution that is closer to the present application. The global interpretation method analyzes the graph structure data and extracts the graph-based pattern as the global interpretation of the model. However, this method generally relies on pre-processed graph patterns as input, or assumes that the explained substructure follows the characteristics of the Gilbert random graph, which is difficult to achieve in practice and lacks practical feasibility. In addition, the extracted graph pattern fails to integrate the attribute relationship between nodes and the information integrity is insufficient.
[0004] Therefore, how to optimize the generation of explanation components to improve the interpretability of recommendation models becomes an urgent problem to be solved. Summary of the invention
[0005] In view of this, the embodiments of the present application provide a rule mining method, apparatus, device and medium for recommendation model interpretation to solve the problem of how to optimize the generation of interpretation components to improve the interpretability of the recommendation model.
[0006] In a first aspect, an embodiment of the present application provides a rule mining method for recommendation model interpretation, the rule mining method comprising: Acquire graph data, and determine all user-item pairs in the graph data, wherein the user-item pairs are node pairs representing a 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, determine a neighborhood graph of the user-item pair from the graph data, and all connected subgraphs in the neighborhood graph that contain the user-item pair, determine at least one candidate subgraph from all connected subgraphs, for any candidate subgraph, evaluate the candidate subgraph according to the neighborhood graph to obtain a graph evaluation score, and determine a target subgraph from all candidate subgraphs according to the graph evaluation score; In the target subgraph, starting from the user-item pair, walking is performed to obtain a simulation path, for any simulation path, pattern extraction is performed on the simulation path to obtain a pattern path, and all pattern paths are formed into 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; Traversing all variables in the pattern path, obtaining candidate preconditions corresponding to each variable in the pattern path, and combining the candidate preconditions corresponding to all variables in the pattern path to form a candidate precondition set corresponding to the pattern path; At least one candidate interpretation rule is obtained according to the target graph pattern and a set of candidate preconditions corresponding to all pattern paths in the target graph pattern, and a candidate interpretation rule that meets preset conditions is determined as a target interpretation rule from among all candidate interpretation rules.
[0007] In a second aspect, an embodiment of the present application provides a rule mining device for recommendation model interpretation, the rule mining device comprising: An acquisition module, configured to acquire graph data and determine all user-item pairs in the graph data, wherein the user-item pairs are node pairs representing a mapping relationship between users and items obtained by recommending items to users in the graph data based on a recommendation model; A subgraph determination module is used to determine, for any user-item pair, 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, and for any candidate subgraph, evaluate the candidate subgraph according to the neighborhood graph to obtain a graph evaluation score, and determine a target subgraph from all candidate subgraphs according to the graph evaluation score; A graph pattern determination module is used to walk in the target subgraph with the user-item pair as the starting point to obtain a simulation path, and for any simulation path, extract the pattern of the simulation path to obtain a pattern path, and form a target graph pattern from all the pattern paths; A condition mining module, for determining, for any pattern path in the target graph pattern, all variables in the pattern path and all predicates defined on each variable, for any variable in the pattern path, determining a target predicate from all predicates corresponding to the variable, and forming a candidate precondition with the variable and the target predicate; A condition determination module, used for traversing all variables in the pattern path, obtaining candidate preconditions corresponding to each variable in the pattern path, and combining the candidate preconditions corresponding to all variables in the pattern path to form a candidate precondition set corresponding to the pattern path; A rule mining module is used to obtain at least one candidate interpretation rule based on the target graph pattern and the candidate prerequisite set corresponding to all pattern paths in the target graph pattern, and determine the candidate interpretation rule that meets the preset conditions as the target interpretation rule from all candidate interpretation rules.
[0008] In a third aspect, an embodiment of the present application provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor implements the rule mining method as described in the first aspect when executing the computer program.
[0009] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the rule mining method as described in the first aspect is implemented.
[0010] Compared with the prior art, the embodiments of the present application have the following beneficial effects: for any user-item pair in graph data, the present application determines the corresponding neighborhood graph and connected subgraph, determines a candidate subgraph from the connected subgraph, evaluates the candidate subgraph based on the neighborhood graph, determines a target subgraph from the candidate subgraph based on the graph evaluation score, walks in the target subgraph starting from the user-item pair to obtain a simulation path, extracts patterns from the simulation path to obtain a pattern path, forms a target graph pattern from the pattern path, determines all variables in the pattern path and all predicates defined on each variable 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 candidate precondition set 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 candidate precondition set corresponding to all pattern paths in the target graph pattern, and determines a candidate interpretation rule that meets preset conditions from all candidate interpretation rules as the target interpretation rule.
[0011] Based on graph data and recommendation models, this application mines target explanation rules (explanation components) that can reflect the prediction principle of the recommendation model from the graph data as a global explanation of the recommendation model. To achieve this goal, first, the neighborhood graph and connected subgraph centered on the user-item pair in the graph data are selected and evaluated to determine the target subgraph, and the target graph pattern is extracted from the target subgraph. This process effectively captures the subgraph information in the graph data that is closely related to the recommendation prediction of the recommendation model, so that the target graph pattern extracted based on the target subgraph can 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 variable are selected and evaluated. , in order to mine candidate preconditions. This process effectively captures the predicate information in the target graph pattern that is closely related to the recommendation prediction of the recommendation model, so that the candidate preconditions generated based on the target predicates can comprehensively and accurately reflect the prediction logic of the recommendation model. Finally, based on the target graph pattern and the mined candidate preconditions, the target interpretation rules for explaining the recommendation model are formed, which optimizes the interpretation method and ensures that the target interpretation rules mined based on the target graph pattern and the candidate preconditions can reproduce the prediction results of the recommendation model, improves the effectiveness and reliability of the generated target interpretation rules for explaining the recommendation model, and provides users and developers with a clearer and more transparent model decision process. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0013] Figure 1 This is a schematic diagram of an application environment of a rule mining method provided in Example 1 of the present application; Figure 2 It is a flowchart of a rule mining method provided in Example 2 of the present application; Figure 3 This is a schematic diagram of a graph data provided in Example 2 of the present application; Figure 4 is a schematic diagram of a target interpretation rule provided in Example 2 of the present application; Figure 5 It is a flowchart of a rule mining method provided in Example 3 of the present application; Figure 6 This is a flowchart of a rule mining method provided in Example 4 of the present application; Figure 7This is a flowchart of a rule mining method provided in Example 5 of the present application; Figure 8 This is a flowchart of a rule mining method provided in Example 6 of the present application; Fig. 9 It is a structural schematic diagram of a rule mining device provided in Embodiment 7 of the present application; Fig.10 It is a structural diagram of a computer device provided in Example 8 of the present application. DETAILED DESCRIPTION
[0014] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0015] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0016] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0017] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0018] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0019] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0020] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, 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 knowledge to obtain the best results.
[0021] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0022] It should be understood that the size of the serial numbers of the steps in the following embodiments does not mean 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 the present application.
[0023] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.
[0024] A rule mining method for explaining a recommendation model provided in the first embodiment of the present application can be applied in the following aspects: Figure 1 In the application environment, the server communicates with the client, the server provides rule mining services, and the client triggers rule mining tasks to the server. The client includes but is not limited to PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, personal digital assistants (PDAs), and other devices. The computer device corresponding to the server can be implemented with an independent server or a server cluster consisting of multiple servers.
[0025] See also Figure 2 , is a flow chart of a rule mining method for recommendation model interpretation provided in the second embodiment of the present application. The rule mining method is applied to Figure 1 The server in the example connects to the client to obtain the graph data sent by the client. Figure 2 As shown, the rule mining method may include the following steps: Step S201, obtain graph data, and determine all user-item pairs in the graph data.
[0026] In this embodiment, the user-item pair is a node pair that represents the mapping relationship between users and items, which is obtained by recommending items to users in the graph data based on a recommendation model. The recommendation model may refer to a GNN recommendation model.
[0027] For example, Figure 3 The figure is a schematic diagram of a graph data provided by the second embodiment of the present application. w15 is a node representing a specific entity in the graph data. Each node has corresponding attributes and attribute values of the corresponding attributes. For example, for node w1, its corresponding attributes may include: film name, genre; the attribute values of the corresponding attributes are: , Action, the connection edge between nodes represents the relationship between nodes. For example, the watch connection edge between node u and node w1 can represent that the user of node u watches the movie of node w1. is a user-item pair in the graph data, , M is the recommendation model, u represents the user, and v represents the item.
[0028] 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, and for any candidate subgraph, evaluate the candidate subgraph based on the neighborhood graph to obtain a graph evaluation score, and determine a target subgraph from all candidate subgraphs based on the graph evaluation score.
[0029] In this embodiment, since the k-layer recommendation model makes decision recommendations mainly by aggregating information from the k-hop neighborhood of two nodes in the user-item pair (the user node representing the user and the item node representing the item), the neighborhood graph may refer to the union of two subgraphs formed by taking the user node and the item node as starting points in the graph data, respectively, and traversing all nodes that can be reached in k steps along the edges in the graph data and their mutual connection relationships, wherein k is an integer greater than zero, a connected subgraph may refer to a connected subgraph in the neighborhood graph that contains two nodes in the user-item pair, a candidate subgraph may refer to any connected subgraph among all connected subgraphs, a graph evaluation score may refer to a score obtained by evaluating the candidate subgraph according to the neighborhood graph, and a target score may refer to a candidate subgraph selected from all candidate subgraphs according to the graph evaluation score.
[0030] 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. The root node in the search tree 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. According to 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 to be a candidate subgraph. According to the neighborhood graph, the candidate subgraph represented by the leaf node is evaluated to obtain a graph evaluation score until the preset iteration stop 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.
[0031] Step S203, in the target subgraph, starting from the user-item pair, walking to obtain a simulation path, for any simulation path, extracting the pattern of the simulation path to obtain a pattern path, and forming all the pattern paths into a target graph pattern.
[0032] In this embodiment, the simulation path may refer to the path obtained by walking in the target subgraph with two nodes in the user-item pair as starting points respectively, the pattern path may refer to the path pattern extracted by replacing the specific entity vertices (or edges) in the simulation path with pattern vertices (or edges) with the same label, and the target graph pattern may refer to the graph pattern formed by the combination of all pattern paths.
[0033] Specifically, first, in the target subgraph, random walks are performed with the two nodes in the user-item pair as starting points to obtain a first simulation path with the user node as the starting point and a second simulation path with the item node as the starting point. Secondly, for any first simulation path, the specific entity vertices (or edges) in the first simulation path are replaced by pattern vertices (or edges) with the same label to obtain the first pattern path. Correspondingly, for any second simulation path, the specific entity vertices (or edges) in the second simulation path are replaced by pattern vertices (or edges) with the same label to obtain the 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-pattern target graph pattern.
[0034] 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 predicates corresponding to the variable, and form a candidate precondition with the variable and the target predicate.
[0035] Step S205, traverse all variables in the pattern path, obtain candidate preconditions corresponding to each variable in the pattern path, and combine the candidate preconditions corresponding to all variables in the pattern path to form a candidate precondition set corresponding to the pattern path.
[0036] In this embodiment, in the process of performing pattern extraction on the simulation path to obtain the pattern path, the pattern path is obtained by replacing the specific entity vertices (or edges) in the simulation path with pattern vertices (or edges) with the same label. The pattern vertices with the same label that replace the specific entity vertices in the simulation path are the variables in the pattern path, the attributes and corresponding attribute values of the specific entity vertices that are not replaced in the simulation path are the predicates defined on the variables, the target predicate may refer to any predicate defined on the variable, the candidate precondition may refer to the precondition formed by the variable and the target predicate, and the candidate precondition set may refer to the set of candidate preconditions corresponding to all variables in the pattern path.
[0037] Specifically, for any pattern path in the target graph pattern, the candidate preconditions corresponding to each variable in the pattern path are generated one by one until the candidate preconditions corresponding to all variables in the pattern path are obtained, and the candidate preconditions corresponding to all variables in the pattern path are combined to form a candidate precondition set corresponding to the pattern path. , where N is a hyperparameter and each For the pattern path A candidate prerequisite on .
[0038] For example, given a pattern path , the pattern path includes two variables, namely and , if the variable The attributes include: name, sex; the corresponding attribute values are: , male, then we can determine the variable All predicates defined above include: name= , sex=male; accordingly, if the variable The attributes include: name, job; the corresponding attribute values are: , director, then you can determine the variable All predicates defined above include: name= 、job=director; Getting the pattern path In the process of corresponding candidate prerequisite set, from the variable Start by traversing the variables in the pattern path in turns, selecting the target predicate defined on each variable until you reach a leaf node. First, if you start from the variable In the example, we determine that the target predicate is sex=male, then we set the variable A candidate antecedent formed with the target predicate sex=male for , then, reaching the leaf node variable , from the variable In the target predicate job=director, the variable A candidate precondition formed with the target predicate job=director for ; Finally, the pattern path The candidate prerequisites corresponding to all variables in form a pattern path The set of candidate prerequisites = ,Right now, ={ , }.
[0039] Step S206, obtaining at least one candidate interpretation rule according to the target graph pattern and the candidate precondition set corresponding to all pattern paths in the target graph pattern, and determining a candidate interpretation rule that meets the preset conditions from all candidate interpretation rules as the target interpretation rule.
[0040] In this embodiment, the candidate interpretation rule may refer to a logical rule formed according to a target graph pattern and a set of candidate prerequisite conditions corresponding to all pattern paths in the target graph pattern, the preset condition may refer to a pre-set condition for screening the candidate interpretation rules, and the target interpretation rule may refer to a candidate interpretation rule that meets the preset condition.
[0041] The basic form of the target interpretation rules (Rules for ExPlanations, REPs) is ,in, is the target graph mode, , is the graph mode corresponding to the user node, is the graph mode corresponding to the item node, It is used to describe the topological structure between user x and item y related to the recommendation decision. The node set related to the user can be expressed as , nodes related to items are represented as , when referring to any node in the graph pattern, it can be represented by z, that is, , It is a rule premise consisting of a set of predicates, which are used to describe the conditions and features related to the node features; For example, Figure 4 As shown, it is a schematic diagram of a target interpretation rule provided in Example 2 of the present application.
[0042] Target interpretation rules The basic form is ,in, for , target interpretation rule Combination Mode and prerequisites , explains the Recommended Movies The reasons are: 1) Watched at least two action movies before (they are similar to of the same type); 2) There is a person who likes high-rated movies (Movie rating ≥ 6) and by Director; 3) Is Director's award-winning film (because ).
[0043] 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 candidate precondition set corresponding to the pattern path, the candidate preconditions extracted from all pattern paths are formed into a rule precondition, the target graph pattern and the rule precondition are combined to obtain the candidate interpretation rule.
[0044] For example, if the target graph pattern includes two pattern paths, , , each pattern path includes two variables, the pattern path The candidate precondition set of includes two candidate preconditions, which are expressed as , pattern path The candidate prerequisite set of also includes two candidate prerequisites, expressed as , if from the pattern path and Extract a candidate precondition from the candidate precondition set of , then extract the candidate preconditions from the two pattern paths to form four rule preconditions, namely and Can form rule conditions for ; and Can form rule conditions for ; and Can form rule conditions for ; and Can form rule conditions for , each rule premise is combined with the target graph pattern respectively to obtain all candidate interpretation rules, and the candidate interpretation rules that meet the preset conditions are determined as the target interpretation rules from all candidate interpretation rules.
[0045] In the embodiment of the present application, based on graph data and recommendation model, the present application mines target explanation rules (explanation components) that can reflect the prediction principle of the recommendation model from the graph data as a global explanation of the recommendation model. In order to achieve this goal, first, the neighborhood graph and connected subgraph centered on the user-item pair in the graph data are selected and evaluated to determine the target subgraph, and the target graph pattern is extracted from the target subgraph. This process effectively captures the subgraph information in the graph data that is closely related to the recommendation prediction of the recommendation model, so that the target graph pattern extracted based on the target subgraph can 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 variable are selected. This process effectively captures the predicate information in the target graph pattern that is closely related to the recommendation prediction of the recommendation model, so that the candidate preconditions generated based on the target predicates can comprehensively and accurately reflect the prediction logic of the recommendation model. Finally, based on the target graph pattern and the mined candidate preconditions, the target interpretation rules for explaining the recommendation model are formed, which optimizes the interpretation method and ensures that the target interpretation rules mined based on the target graph pattern and the candidate preconditions can reproduce the prediction results of the recommendation model, improves the effectiveness and reliability of the generated target interpretation rules for explaining the recommendation model, and provides users and developers with a clearer and more transparent model decision process.
[0046] See also Figure 5 , is a flow chart of a rule mining method provided in Example 3 of the present application. Figure 5 As shown, in the above step S202, at least one candidate subgraph is determined from all connected subgraphs, and for any candidate subgraph, the candidate subgraph is evaluated according to the neighborhood graph to obtain a graph evaluation score, and a target subgraph is determined from all candidate subgraphs according to the graph evaluation score, which may include the following steps: Step S501, constructing a search tree according to the neighborhood graph and all connected subgraphs.
[0047] Step S502, calculating a first recommendation strength value of a user-item pair recommended by a recommendation model on the neighborhood graph.
[0048] Step S503, in the search tree, according to the preset selection strategy, select a path from the root node to reach a leaf node, determine the connected subgraph represented by the leaf node as the candidate subgraph, calculate the second recommendation strength value of the user-item pair recommended by the recommendation model on the candidate subgraph, evaluate the candidate subgraph according to the second recommendation strength value and the first recommendation strength value, and obtain the graph evaluation score of the candidate subgraph.
[0049] Step S504, returning to the step of selecting a path from the root node to a leaf node according to a preset selection strategy, until a preset iteration stop condition is reached, and obtaining graph evaluation scores of all candidate subgraphs.
[0050] Step S505 : Determine, from all candidate subgraphs, the candidate subgraph corresponding to the highest graph evaluation score as the target subgraph.
[0051] In this embodiment, the root node in the search tree represents a 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, wherein the search tree may refer to a Monte Carlo Tree Search (MCTS); the first recommendation strength may refer to a recommendation strength value representing the user-item pair recommended by the recommendation model on the neighborhood graph, and the second recommendation strength may refer to a recommendation strength value representing the user-item pair recommended by the recommendation model on the candidate subgraph; the preset selection strategy may refer to a preset path selection strategy, and the preset iteration stop condition may refer to a preset iteration stop condition, for example, the preset iteration stop condition may refer to reaching a preset number of iterations or reaching a resource limit, etc.
[0052] Specifically, first, a Monte Carlo search tree is constructed based on the neighborhood graph and all connected subgraphs of the user-item pair, wherein the root node in the Monte Carlo search tree 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. 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, 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, and the second recommendation strength value is combined with the first recommendation strength value of the user-item pair recommended by the recommendation model on the neighborhood graph. A comparison is performed, and the evaluation score of the candidate subgraph is determined according to the comparison result, wherein the closer the second recommendation strength value is to the first recommendation strength value, the higher the evaluation score is given to the corresponding candidate subgraph, and then, the step of selecting a path from the root node to reach a leaf node according to the preset selection strategy is returned to be executed until the preset iteration stop condition is reached, and the graph evaluation scores of all candidate subgraphs are obtained. Finally, from all candidate subgraphs, the candidate subgraph corresponding to the highest graph evaluation score is determined as the target subgraph, and the result of the recommendation prediction made by the recommendation model on the target subgraph is closest to the result of the recommendation prediction made on the neighborhood graph, so that the recommendation model can reproduce its prediction in the target subgraph.
[0053] In an embodiment of the present application, a search tree is constructed based on the neighborhood graph and connected subgraph corresponding to the user-item pairs, and the most promising target subgraph (with the highest graph evaluation score) is determined from all candidate subgraphs according to a preset selection strategy, so that the recommendation model can reproduce its prediction in the target subgraph. This process effectively captures the target subgraph information in the graph data that is closely related to the recommendation prediction of the recommendation model, improves the 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, thereby improving the effectiveness and reliability of the mined target interpretation rules, thereby improving the effectiveness and reliability of the global interpretation.
[0054] See also Figure 6 , is a flow chart of a rule mining method provided in Example 4 of the present application. Figure 6 As shown, in the above step S203, in the target subgraph, starting from the user-item pair, walking, obtaining a simulation path, for any simulation path, performing pattern extraction on the simulation path, obtaining a pattern path, and forming all pattern paths into a target graph pattern, the following steps may be included: Step S601, determining a user node representing a user and an item node representing an item in a user-item pair.
[0055] Step S602, in the target subgraph, starting from the user node, performing random walk with a preset probability, obtaining a first simulation path, returning to execute the step of performing random walk with the user node as the starting point and the preset probability, until the preset walking stop condition is met, and obtaining all first simulation paths starting from the user node.
[0056] Step S603, taking the item node as the starting point, performing random walk with a preset probability to obtain a second simulation path, returning to execute the step of taking the item node as the starting point and performing random walk with a preset probability until the preset walk stop condition is met, and obtaining all second simulation paths starting from the item node.
[0057] 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.
[0058] Step S605, forming all first pattern paths into a graph pattern corresponding to the user node, and forming all second pattern paths into a graph pattern corresponding to the item node.
[0059] Step S606, the graph pattern corresponding to the user node and the graph pattern corresponding to the item node are combined to form a target graph pattern.
[0060] In this embodiment, the preset probability may refer to a preset wandering termination probability, and the preset wandering stop condition may refer to a preset wandering stop condition, for example, the preset wandering stop condition may refer to the number of first simulation paths and the number of second simulation paths reaching a preset value; the first simulation path may refer to a path obtained by wandering in the target subgraph with the node representing the user in the user-item pair as the starting point, and the second simulation path may refer to a path obtained by wandering in the target subgraph with the node representing the item in the user-item pair as the starting point; the first pattern path may refer to a path pattern extracted by replacing specific entity vertices (or edges) in the first simulation path with pattern vertices (or edges) of the same label, and the second pattern path may refer to a path pattern extracted by replacing specific entity vertices (or edges) in the second simulation path with pattern vertices (or edges) of the same label.
[0061] Specifically, first, in the target subgraph, starting from the user node and the item node, respectively, walk with the preset probability to obtain the first simulation path and the second simulation path. For example, if the preset probability is , starting from the user node and the item node, respectively, and performing random walks. At each step, either End the walk, either with 1- The probability of moving to an outgoing neighbor of the current node is , thereby obtaining the first simulation path and the second simulation path, until the number of the first simulation path and the second simulation path reaches the preset value, stop wandering, and obtain all the first simulation paths and the second simulation paths. Then, for any first simulation path, replace the specific entity vertex (or edge) in the first simulation path with the pattern vertex (or edge) of the same label to obtain the first pattern path. For any second simulation path, replace the specific entity vertex (or edge) in the second simulation path with the pattern vertex (or edge) of the same label to obtain the second pattern path. Finally, all the first pattern paths are combined to form a star pattern centered on the user node, which is recorded as , and all second mode paths are combined to form a star mode centered on the item node, recorded as , the star pattern corresponding to the user node and the star pattern corresponding to the item node are combined to form the target graph pattern, which is recorded as .
[0062] In the embodiment of the present application, a simulated path is obtained by taking the user node and the item node as the starting point in the target subgraph, respectively, and performing random walks according to preset probabilities and preset termination conditions, thereby avoiding endless path exploration. The path pattern is extracted from the simulated path to obtain a target graph pattern that can reflect the prediction of the recommendation model at the user-item pair, thereby improving the efficiency of graph pattern extraction, ensuring that the target interpretation rules mined based on the target graph pattern can reproduce the prediction results of the recommendation model, and improving the effectiveness and reliability of the global interpretation.
[0063] See also Figure 7 , is a flow chart of a rule mining method provided in Example 5 of the present application, such as Figure 7 As shown, in the above step S204, for any variable in the pattern path, determining a target predicate from all predicates corresponding to the variable may include the following steps: Step S701, for any predicate corresponding to the variable, the importance of the predicate is evaluated to obtain a predicate evaluation score; Step S702: According to the predicate evaluation scores, determine the predicate corresponding to the highest predicate evaluation score from all predicates corresponding to the variable as the target predicate.
[0064] In this embodiment, the predicate evaluation score may refer to a score representing the importance of the predicate.
[0065] Specifically, in the process of obtaining the predicate evaluation score, for any predicate corresponding to the variable, the predicate support score representing the matching frequency of the predicate in the graph data is calculated, the candidate predicates already in the pattern path are determined, and the difference score representing the degree of difference between the predicate and the candidate predicates already in the pattern path is calculated. According to the predicate support score and the difference score, the predicate evaluation score is obtained. According to the predicate evaluation score, the predicate corresponding to the highest predicate evaluation score is determined from all the predicates corresponding to the variable as the target predicate.
[0066] For example, for any variable in the pattern path, in order to decide which predicate among all predicates defined on the variable can be used as the target predicate to combine with the variable to form a candidate antecedent condition, the predicate support score and the difference score of the predicate are considered at the same time to obtain the predicate evaluation score; Remember variables The candidate prerequisites to be generated are , in this variable The predicate defined above is p, then for the variable For any predicate, the calculation formula for the predicate evaluation score of the predicate can be: in, Score the predicate evaluation; and is the weight, + =1; is graph data, Q is the target graph model, which is used to describe the users related to the recommendation decision. and items The topological structure between For variables The mode path where it is located; In the embodiment of the present application, for any predicate corresponding to a variable, the predicate support score representing the matching frequency of the predicate in the graph data and the difference score representing the degree of difference between the predicate and the candidate preconditions already in the pattern path are comprehensively considered to obtain the predicate evaluation score, thereby selecting the predicate corresponding to the highest predicate evaluation score as the target predicate. The candidate preconditions generated based on the target predicate can fully reflect the prediction of the recommendation model, thereby improving the effectiveness and reliability of the target interpretation rules obtained by mining, thereby improving the effectiveness and reliability of the global interpretation.
[0067] See also Figure 8 , is a flow chart of a rule mining method provided in Example 6 of the present application, such as Figure 8 As shown, in the above step S206, determining the candidate interpretation rule that meets the preset condition from all the candidate interpretation rules as the target interpretation rule may include the following steps: Step S801, for any candidate interpretation rule, calculate a rule support score representing the matching frequency of the candidate interpretation rule in the graph data, and calculate a confidence score representing the strength of association between the rule premise corresponding to the candidate interpretation rule and the predicted user-item pair.
[0068] Step S802: If the rule support score reaches a preset first threshold and the confidence score reaches a preset second threshold, it is determined that the candidate interpretation rule meets the preset conditions and the candidate interpretation rule is determined to be the target interpretation rule.
[0069] In this embodiment, the rule support score may refer to a score that characterizes the matching frequency of a candidate interpretation rule in the graph data, the confidence score may refer to a score that characterizes the strength of association between the candidate interpretation rule's corresponding rule prerequisite and the predicted user-item pair, and the preset first threshold and the preset second threshold may refer to pre-set score values.
[0070] Specifically, the rule support score that characterizes the matching frequency of the candidate interpretation rule in the graph data is defined as: in, is the rule support score, is a candidate interpretation rule, is graph data, X is the rule premise, and Q is the target graph pattern, which is used to describe the users related to the recommendation decision. and items The topological structure between is a user-item pair; Characterize the candidate interpretation rules corresponding to the rule premise and predict the user-item pair The confidence score for the strength of association is defined as: in, is the confidence score; If the preset first threshold is , the second threshold is preset to , then for any target interpretation rule, , .
[0071] In the embodiment of the present application, by calculating the rule support score representing the matching frequency of the candidate interpretation rule in the graph data, and calculating the confidence score representing the correlation strength between the candidate interpretation rule corresponding to the rule premise and the predicted user-item pair, the candidate interpretation rule whose rule support score reaches the preset first threshold and whose confidence score reaches the preset second threshold is selected as the target interpretation rule. The validity and reliability of the target interpretation rule obtained by mining are improved, thereby improving the validity and reliability of the global interpretation.
[0072] Corresponding to the rule mining method for recommendation model interpretation in the above embodiment, Fig. 9 The structure diagram of the rule mining device for recommendation model interpretation provided by the seventh embodiment of the present application is shown. The rule mining device is applied to Figure 1 For ease of description, only the parts related to the embodiment of the present application are shown.
[0073] See also Fig. 9 , the rule mining device comprises: An 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 a mapping relationship between users and items obtained by recommending items to users in the graph data based on a recommendation model; A subgraph determination module 92 is used to determine, for any user-item pair, 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, evaluate any candidate subgraph based on the neighborhood graph to obtain a graph evaluation score, and determine a target subgraph from all candidate subgraphs based on the graph evaluation score; A graph pattern determination module 93 is used to walk in the target subgraph with the user-item pair as the starting point to obtain a simulation path, and for any simulation path, extract a pattern from the simulation path to obtain a pattern path, and form a target graph pattern from all pattern paths; A condition mining module 94 is used to determine, for any pattern path in the target graph pattern, all variables in the pattern path and all predicates defined on each variable, and 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; The condition determination module 95 is used to traverse all variables in the pattern path, obtain candidate preconditions corresponding to each variable in the pattern path, and form a candidate precondition set corresponding to the pattern path by combining the candidate preconditions corresponding to all variables in the pattern path; The rule mining module 96 is used to obtain at least one candidate interpretation rule based on the target graph pattern and the candidate prerequisite set corresponding to all pattern paths in the target graph pattern, and determine the candidate interpretation rule that meets the preset conditions as the target interpretation rule from all candidate interpretation rules.
[0074] Optionally, the subgraph determining module 92 includes: A tree construction unit, configured to construct a search tree according to the neighborhood graph and all connected subgraphs, wherein a 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 on the path from the root node to any leaf node; A first calculation unit, configured to calculate a first recommendation strength value of the user-item pair recommended by the recommendation model on the neighborhood graph; an evaluation unit, configured to select a path from the root node to a leaf node in the search tree according to a preset selection strategy, determine a 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, and evaluate the candidate subgraph according to the second recommendation strength value and the first recommendation strength value to obtain a graph evaluation score of the candidate subgraph; An iteration unit, used for returning to execute the step of selecting a path from the root node to reach a leaf node according to a preset selection strategy, until a preset iteration stop condition is reached, and obtaining graph evaluation scores of all candidate subgraphs; The selection unit is used to determine, from all candidate subgraphs, the candidate subgraph corresponding to the highest graph evaluation score as the target subgraph.
[0075] Optionally, the graph mode determination module 93 includes: A node determination unit, configured to determine a user node representing a user and an item node representing an item in the user-item pair; A first walking unit is used to take the user node as a starting point and perform random walking with a preset probability in the target subgraph to obtain a first simulation path, and return to execute the step of taking the user node as a starting point and performing random walking with a preset probability until a preset walking stop condition is met, thereby obtaining all first simulation paths starting from the user node; A second walking unit is used to take the item node as a starting point, perform random walking with the preset probability, obtain a second simulation path, return to execute the step of taking the item node as a starting point, and perform random walking with the preset probability, until the preset walking stop condition is met, and obtain all second simulation paths starting from the item node; an extraction unit, configured to, 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; A first pattern forming unit, configured 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; 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.
[0076] Optionally, the condition mining module 94 includes: A predicate evaluation unit, configured to evaluate the importance of any predicate corresponding to the variable to obtain a predicate evaluation score; The predicate determination unit is configured to determine, according to the predicate evaluation score, from among all predicates corresponding to the variable, a predicate corresponding to the highest predicate evaluation score as the target predicate.
[0077] Optionally, a predicate evaluation unit, comprising: A second calculation subunit is used to calculate, for any predicate corresponding to the variable, a predicate support score representing the degree to which the predicate can be matched in the graph data; A third calculation subunit is used to determine the candidate preconditions already in the pattern path, and calculate a difference score representing the degree of difference between the predicate and the candidate preconditions already in the pattern path; The fourth calculation subunit is used to obtain the predicate evaluation score according to the predicate support score and the difference score.
[0078] Optionally, the rule mining module 96 includes: an extraction unit, configured to extract, for any pattern path in the target graph pattern, a preset number of candidate preconditions from a set of candidate preconditions corresponding to the pattern path; A rule condition forming unit, used for forming a rule precondition from candidate preconditions extracted from all pattern paths; A rule forming unit is used to combine the target graph pattern and the rule premise to obtain the candidate interpretation rule.
[0079] Optionally, the rule mining module 96 includes: a fifth calculation unit, for calculating, for any candidate interpretation rule, a rule support score representing a matching frequency of the candidate interpretation rule in the graph data, and a confidence score representing a correlation strength between the candidate interpretation rule corresponding to a rule premise and the predicted association strength of the user-item pair; A rule screening unit is used to determine that the candidate interpretation rule meets the preset condition and determines that the candidate interpretation rule is the target interpretation rule if the rule support score reaches a preset first threshold and the confidence score reaches a preset second threshold.
[0080] It should be noted that the information interaction, execution process and other contents between the above-mentioned modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0081] Fig.10 This is a schematic diagram of the structure of a computer device provided in Example 8 of the present application. Fig.10 As shown, the computer device of this embodiment includes: at least one processor ( Fig.10 Only one is shown in the figure), a memory, and a computer program stored in the memory and executable on at least one processor, wherein when the processor executes the computer program, the steps in any of the above-mentioned rule mining method embodiments are implemented.
[0082] The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that Fig.10 This is merely an example of a computer device and does not constitute a limitation on the computer device. The computer device may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, it may also include a network interface, a display screen, and an input device.
[0083] The processor may be a CPU, or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0084] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory may be the memory of a computer device, and the internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The readable storage medium may be a hard disk of a computer device, and in other embodiments, it may also be an external storage device of the computer device, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device. Further, the memory may also include both an internal storage unit of the computer device and an external storage device. The memory is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of a computer program, etc. The memory may also be used to temporarily store data that has been output or is to be output.
[0085] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the above-mentioned method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of 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, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiment can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0086] The present application implements all or part of the processes in the above-mentioned embodiment method, and may also be completed through a computer program product. When the computer program product runs on a computer device, the computer device can implement the steps in the above-mentioned method embodiment when executing the computer program product.
[0087] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0088] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example 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 performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0089] In the embodiments provided in the present application, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0090] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0091] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A rule mining method for recommendation model interpretation, characterized in that: The rule mining method comprises: Acquire graph data, and determine all user-item pairs in the graph data, wherein the user-item pairs are node pairs representing a 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, determine a neighborhood graph of the user-item pair from the graph data, and all connected subgraphs in the neighborhood graph that contain the user-item pair, determine at least one candidate subgraph from all connected subgraphs, for any candidate subgraph, evaluate the candidate subgraph according to the neighborhood graph to obtain a graph evaluation score, and determine a target subgraph from all candidate subgraphs according to the graph evaluation score; In the target subgraph, walking is performed with the user-item pair as the starting point to obtain a simulation path, and for any simulation path, pattern extraction is performed on the simulation path to obtain a pattern path, and all pattern paths are formed into 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; Traversing all variables in the pattern path, obtaining candidate preconditions corresponding to each variable in the pattern path, and combining the candidate preconditions corresponding to all variables in the pattern path to form a candidate precondition set corresponding to the pattern path; At least one candidate interpretation rule is obtained according to the target graph pattern and the candidate precondition set corresponding to all pattern paths in the target graph pattern, and a candidate interpretation rule that meets preset conditions is determined as a target interpretation rule from all candidate interpretation rules.
2. The rule mining method according to claim 1, characterized in that: The step of determining at least one candidate subgraph from all connected subgraphs, evaluating any candidate subgraph according to the neighborhood graph to obtain a graph evaluation score, and determining a target subgraph from all candidate subgraphs according to the graph evaluation score includes: Constructing a search tree according to 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 on the path from the root node to any leaf node; Calculate a first recommendation strength value of the user-item pair recommended by the recommendation model on the neighborhood graph; In the search tree, according to a preset selection strategy, a path is selected from the root node to reach a leaf node, a connected subgraph represented by the leaf node is determined as the candidate subgraph, a second recommendation strength value of the user-item pair recommended by the recommendation model on the candidate subgraph is calculated, and the candidate subgraph is evaluated according to the second recommendation strength value and the first recommendation strength value to obtain a graph evaluation score of the candidate subgraph; Return to executing the step of selecting a path from the root node to reach a leaf node according to the preset selection strategy, until a preset iteration stop condition is reached, and obtain graph evaluation scores of all candidate subgraphs; From all candidate subgraphs, determine the candidate subgraph corresponding to the highest graph evaluation score as the target subgraph.
3. The rule mining method according to claim 1, characterized in that: In the target subgraph, walking with the user-item pair as the starting point to obtain a simulation path, for any simulation path, performing pattern extraction on the simulation path to obtain a pattern path, and forming all pattern paths into a target graph pattern, including: Determine a user node representing the user and an item node representing the item in the user-item pair; In the target subgraph, taking the user node as the starting point, performing random walk with a preset probability, obtaining a first simulation path, returning to execute the step of taking the user node as the starting point, performing random walk with a preset probability, until a preset walk stop condition is met, and obtaining all first simulation paths starting from the user node; Taking the item node as the starting point, performing random walk with the preset probability to obtain a second simulation path, returning to execute the step of taking the item node as the starting point and performing random walk with the preset probability until the preset walk stop condition is met, and obtaining all second simulation paths starting with the item node; For any first simulation path, performing pattern extraction on the first simulation path to obtain a first pattern path, and for any second simulation path, performing pattern extraction on the second simulation path to obtain a second pattern path; All first pattern paths are formed into a graph pattern corresponding to the user node, and all second pattern paths are formed into a graph pattern corresponding to the item node; The graph pattern corresponding to the user node and the graph pattern corresponding to the item node are combined to form the target graph pattern.
4. 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, perform importance evaluation on the predicate to obtain a predicate evaluation score; According to the predicate evaluation score, the predicate corresponding to the highest predicate evaluation score is determined from all predicates corresponding to the variable as the target predicate.
5. The rule mining method according to claim 4, characterized in that: The step of performing importance evaluation on any predicate corresponding to the variable to obtain a predicate evaluation score includes: For any predicate corresponding to the variable, calculating a predicate support score representing a matching frequency of the predicate in the graph data; Determining candidate preconditions existing in the pattern path, and calculating a difference score representing the degree of difference between the predicate and the candidate preconditions existing in the pattern path; The predicate evaluation score is obtained according to the predicate support score and the difference score.
6. The rule mining method according to claim 1, characterized in that: The step of obtaining at least one candidate interpretation rule according to the target graph pattern and the candidate precondition set corresponding to all pattern paths in the target graph pattern includes: For any pattern path in the target graph pattern, extracting a preset number of candidate preconditions from a set of candidate preconditions corresponding to the pattern path; The candidate preconditions extracted from all pattern paths form a rule precondition; The target graph pattern and the rule premise are combined to obtain the candidate interpretation rule.
7. The rule mining method according to claim 1, characterized in that: The step of determining a candidate interpretation rule that satisfies a preset condition from among all candidate interpretation rules as a target interpretation rule includes: For any candidate interpretation rule, calculate a rule support score representing the matching frequency of the candidate interpretation rule in the graph data, and calculate a confidence score representing the strength of association between the candidate interpretation rule and the rule premise and the predicted association between the user-item pair; If the rule support score reaches a preset first threshold and the confidence score reaches a preset second threshold, it is determined that the candidate interpretation rule meets the preset condition and the candidate interpretation rule is determined to be the target interpretation rule.
8. A rule mining device for recommendation model interpretation, characterized in that: The rule mining device comprises: An acquisition module, configured to acquire graph data and determine all user-item pairs in the graph data, wherein the user-item pairs are node pairs representing a mapping relationship between users and items obtained by recommending items to users in the graph data based on a recommendation model; A subgraph determination module is used to determine, for any user-item pair, 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, and for any candidate subgraph, evaluate the candidate subgraph according to the neighborhood graph to obtain a graph evaluation score, and determine a target subgraph from all candidate subgraphs according to the graph evaluation score; A graph pattern determination module is used to walk in the target subgraph with the user-item pair as the starting point to obtain a simulation path, and for any simulation path, extract the pattern of the simulation path to obtain a pattern path, and form a target graph pattern from all the pattern paths; A condition mining module, for determining, for any pattern path in the target graph pattern, all variables in the pattern path and all predicates defined on each variable, for any variable in the pattern path, determining a target predicate from all predicates corresponding to the variable, and forming a candidate precondition with the variable and the target predicate; A condition determination module, used for traversing all variables in the pattern path, obtaining candidate preconditions corresponding to each variable in the pattern path, and combining the candidate preconditions corresponding to all variables in the pattern path to form a candidate precondition set corresponding to the pattern path; A rule mining module is used to obtain at least one candidate interpretation rule based on the target graph pattern and the candidate prerequisite set corresponding to all pattern paths in the target graph pattern, and determine the candidate interpretation rule that meets the preset conditions as the target interpretation rule from all candidate interpretation rules.
9. 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. When the processor executes the computer program, the rule mining method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the rule mining method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method and device for obtaining recommendation information and computer readable storage medium
CN110196904A
Product recommendation method, device and equipment and medium
CN112418978A
Recommendation result optimization method and device of recommendation model, equipment and medium
CN117194777A
Prediction rule generation method and device based on attribute graph data, equipment and medium
CN117194778A
Graph optimization and controllable generation-based interpretable recommendation method and system
CN117874360A