Recommendation model explanation method and apparatus based on rules, and device and medium
By using interpretation rules and heap structures in the recommendation model, high-priority evidence that has a decisive impact on the recommendation results is selected, which solves the problem of inaccurate or complex interpretation results in the prior art and achieves more efficient model interpretation and enhanced user trust.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- SHENZHEN INST OF COMPUTING SCI
- Filing Date
- 2025-01-22
- Publication Date
- 2026-06-25
AI Technical Summary
Existing explanation methods for recommendation models have failed to meet practitioners' expectations in terms of fidelity and sparsity, resulting in inaccurate or overly complex explanations that make it difficult to improve the interpretability of recommendation models.
By acquiring interpretation rules, graph data, and user-item pairs, and utilizing the initial matching subgraph and heap structure, evidence scores are extracted and updated. High-priority evidence that has a decisive impact on recommendation results is selected, and the interpretation method is optimized to improve the effectiveness and reliability of the model's interpretation.
It enhances users' trust in the model results, improves the effectiveness and reliability of the interpretation, reduces computational complexity, improves algorithm efficiency, and enables users to quickly obtain the most explanatory evidence.
Smart Images

Figure CN2025074043_25062026_PF_FP_ABST
Abstract
Description
Rule-based recommendation model interpretation methods, devices, equipment, and media
[0001] This application is based on and claims priority to Chinese Invention Application No. 202411882772.2, filed on December 19, 2024, entitled "Rule-based Recommendation Model Interpretation Method, Apparatus, Device and Medium". Technical Field
[0002] This application applies to the field of model interpretation, and particularly relates to a rule-based recommendation model interpretation method, apparatus, device, and medium. Background Technology
[0003] With the rapid development of artificial intelligence technology, Graph Neural Networks (GNNs) have shown great 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 to users. 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.
[0004] Existing explanation methods are mainly divided into two categories: self-explanatory GNN models and post-explanation methods. Self-explanatory GNN models build an explanation mechanism within the model, generating explanations in real-time as the model makes predictions. While these models can generate meta-paths or explanations for recommendations, they often cannot distinguish which features are decisive or under what conditions a recommendation can be made. Post-explanation methods generate explanations after the model makes predictions, providing explanations for recommendation results by analyzing model outputs and extracting subgraphs or features. However, they also face challenges. Fidelity and sparsity are two key indicators for measuring the effectiveness of explanations, and many existing methods have failed to meet practitioners' expectations in these two metrics, resulting in potentially inaccurate or overly complex explanations. Therefore, improving the interpretability of recommendation results from 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-based recommendation model interpretation method, apparatus, device, and medium to address the problem of how to improve the interpretability of recommendation results from recommendation models.
[0006] In a first aspect, embodiments of this application provide a rule-based recommendation model interpretation method, the recommendation model interpretation method comprising:
[0007] Obtain N interpretation rules, graph data, and user-item pairs to be interpreted 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, and N is an integer greater than zero;
[0008] Using any interpretation rule, extract an initial matching subgraph corresponding to the user item pair from the graph data, and determine the upper bound of the initial rule score of the interpretation rule based on the node score of the matching node in the initial matching subgraph.
[0009] When the upper bound of the initial rule score reaches the initial score threshold, a target node and all matching paths containing the target node are determined from the initial matching subgraph, and each matching path is combined with the interpretation rule to form a candidate piece of evidence.
[0010] For any candidate evidence, the evidence score of the candidate evidence is determined based on the rule score representing the importance of the interpretation rule and the path score representing the importance of the corresponding matching path. All candidate evidence is traversed to obtain the evidence score of each candidate evidence. The target evidence is obtained based on the evidence scores of all candidate evidence and the initial score threshold.
[0011] The target evidence is written into a heap structure, the initial score threshold is updated using the lowest evidence score in the heap structure, and the updated score threshold is obtained. The target node and its child nodes are removed from the initial matching subgraph, and the updated matching subgraph is obtained. The upper bound of the initial rule score is updated using the updated matching subgraph, and the upper bound of the updated rule score is obtained. The heap structure is used to store the target evidence that meets the conditions.
[0012] If the updated score threshold is used as the initial score threshold, and the upper bound of the updated rule score reaches the updated score threshold, then the updated matching subgraph is used as the initial matching subgraph, and the process of determining a target node from the initial matching subgraph is returned. If the upper bound of the updated rule score does not reach the updated score threshold, then all interpretation rules are traversed, and all target evidence in the heap structure is returned.
[0013] Secondly, embodiments of this application provide a rule-based recommendation model interpretation device, the recommendation model interpretation device comprising:
[0014] The acquisition module is used to acquire N interpretation rules, graph data, and user-item pairs to be interpreted in the graph data. 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. N is an integer greater than zero.
[0015] The rule score determination module is used to extract an initial matching subgraph corresponding to the user item pair from the graph data using any interpretation rule, and to determine the upper bound of the initial rule score of the interpretation rule based on the node score of the matching node in the initial matching subgraph.
[0016] The rule score judgment module is used to determine a target node and all matching paths containing the target node from the initial matching subgraph when the upper bound of the initial rule score reaches the initial score threshold, and to form a candidate evidence with each matching path and the interpretation rule respectively.
[0017] The target evidence determination module is used to determine the evidence score of any candidate evidence based on the rule score representing the importance of the interpretation rule and the path score representing the importance of the corresponding matching path, traverse all candidate evidence to obtain the evidence score of each candidate evidence, and obtain the target evidence based on the evidence scores of all candidate evidence and the initial score threshold.
[0018] The update module is used to write the target evidence into a heap structure, update the initial score threshold using the lowest evidence score in the heap structure to obtain an updated score threshold, remove the target node and child nodes whose parent node is the target node from the initial matching subgraph to obtain an updated matching subgraph, and update the upper bound of the initial rule score using the updated matching subgraph to obtain an updated rule score upper bound. The heap structure is used to store target evidence that meets the conditions.
[0019] The loop module is used to take the updated score threshold as the initial score threshold. If the upper bound of the updated rule score reaches the updated score threshold, the updated matching subgraph is taken as the initial matching subgraph, and the process of determining a target node from the initial matching subgraph is returned. If the upper bound of the updated rule score does not reach the updated score threshold, all interpretation rules are traversed and all target evidence in the heap structure is returned.
[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 recommendation model interpretation 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 recommendation model interpretation method as described in the first aspect.
[0022] The beneficial effects of this application embodiment compared with the prior art are as follows: This application obtains N interpretation rules, graph data, and user item pairs to be interpreted in the graph data. For any interpretation rule, if the upper bound of the initial rule score reaches the initial score threshold, a target node and matching path are determined from the initial matching subgraph. The matching path and the interpretation rule are used to form candidate evidence, and the evidence score is determined. Based on the evidence score and the initial score threshold, the target evidence is obtained. The target evidence is written to the heap structure. The initial score threshold, the initial matching subgraph, and the upper bound of the initial rule score are updated to obtain the updated score threshold, the updated initial matching subgraph, and the updated rule score upper bound. The updated score threshold is set to the initial score threshold. If the upper bound of the updated rule score reaches the updated score threshold, the updated matching subgraph is set to the initial matching subgraph. The process of determining a target node from the initial matching subgraph is returned, and / or if not, all interpretation rules are traversed, and all target evidence in the heap structure is returned.
[0023] Specifically, the algorithm interprets the item recommendation results made by the recommendation model in graph data through interpretation rules. Based on the subgraph, it extracts the topological structure and node features that have a decisive impact on the recommendation results, forming target evidence. This optimizes the interpretation method and further helps users understand which features play a key role in the model's decision-making, thereby enhancing users' trust in the model results and improving the effectiveness (fidelity and sparsity) and reliability of the interpretation. Based on the upper bound of the rule score and the initial score threshold, it ensures that high-priority (higher evidence score) target evidence with a decisive impact on the recommendation results can be efficiently screened, reducing computational complexity and improving the efficiency of the algorithm. Furthermore, by maintaining a heap structure, it dynamically updates and stores the current high-priority (higher evidence score) target evidence, enabling users to quickly obtain the most explanatory and influential evidence, thus improving the user experience. 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 is a schematic diagram of an application environment for a rule-based recommendation model interpretation method provided in Embodiment 1 of this application;
[0026] Figure 2 is a flowchart illustrating a rule-based recommendation model interpretation method provided in Embodiment 2 of this application;
[0027] Figure 3 is a schematic diagram of a graph data provided in Embodiment 2 of this application;
[0028] Figure 4 is a schematic diagram of an interpretation rule provided in Embodiment 2 of this application;
[0029] Figure 5 is a schematic diagram of an initial matching subgraph provided in Embodiment 2 of this application;
[0030] Figure 6 is a schematic diagram of the upper bound of variable scores provided in Embodiment 2 of this application;
[0031] Figure 7 is a schematic diagram of an influence on the score provided in Embodiment 2 of this application;
[0032] Figure 8 is a flowchart illustrating a rule-based recommendation model interpretation method provided in Embodiment 3 of this application;
[0033] Figure 9 is a flowchart illustrating a rule-based recommendation model interpretation method provided in Embodiment 4 of this application;
[0034] Figure 10 is a flowchart illustrating a rule-based recommendation model interpretation method provided in Embodiment 5 of this application;
[0035] Figure 11 is a schematic diagram of the structure of a rule-based recommendation model interpretation device provided in Embodiment 6 of this application;
[0036] Figure 12 is a schematic diagram of the structure of a computer device provided in Embodiment 7 of this application. Detailed Implementation
[0037] 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.
[0038] 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.
[0039] 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.
[0040] 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 phrase "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]."
[0041] 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.
[0042] 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.
[0043] 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.
[0044] 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.
[0045] 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.
[0046] To illustrate the technical solution of this application, specific embodiments are described below.
[0047] This application provides a rule-based recommendation model interpretation method, applicable to the environment shown in Figure 1. The server and client communicate, with the server providing recommendation model interpretation services and the client triggering a recommendation model interpretation task to the server. The client includes, but is not limited to, devices such as PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, and personal digital assistants (PDAs). The server can be implemented using a dedicated server or a server cluster consisting of multiple servers.
[0048] Referring to Figure 2, which is a flowchart illustrating a rule-based recommendation model interpretation method according to Embodiment 2 of this application, the above-described recommendation model interpretation method is applied to the server in Figure 1. The server connects to the client to obtain N interpretation rules, graph data, and user-item pairs to be interpreted from the graph data sent by the client. As shown in Figure 2, the recommendation model interpretation method may include the following steps:
[0049] Step S201: Obtain N interpretation rules, graph data, and user item pairs to be interpreted from the graph data.
[0050] 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 the recommendation model, where N is an integer greater than zero;
[0051] For example, Figure 3 shows a schematic diagram of graph data provided in Embodiment 2 of this application. Here, M(u,v) is a user-item pair in the graph data, M(u,v) = true, M is the recommendation model, u represents the user, and v represents the item.
[0052] The basic form of rules for explanations (REPs) is as follows: Here, Q is a graph schema used to depict the topological structure between users x and items y related to recommendation decisions. The set of nodes related to a user can be represented as follows: Nodes related to items are represented as When referring to any node in the graph pattern, it can be represented by z, that is, z∈x∪y, where X is a set of preconditions that describe the conditions and features related to the node features;
[0053] For example, Figure 4 is a schematic diagram of an interpretation rule provided in Embodiment 2 of this application.
[0054] Interpretation rules The basic form is Where X1 is x0.sex=Male^x1.sex=Male^x2.rating≥6^x3.id=y1.id^x4.genre=Action^x5.gener=action^y0.genre=Action, interpreting the rules. Combining pattern Q1 and precondition X1, the reasons for recommending movie y0 to male user x0 are explained as follows: 1) x0 has watched at least two action movies (which are of the same type as y0); 2) x0 has a favorite highly rated movie x2 (movie rating ≥ 6) and is directed by x3; 3) y0 is an award-winning movie directed by x3 (because x3.id = y1.id).
[0055] Step S202: Using any interpretation rule, extract the initial matching subgraph corresponding to the user item pair from the graph data, and determine the upper bound of the initial rule score of the interpretation rule based on the node score of the matching node in the initial matching subgraph.
[0056] Step S203: When the upper bound of the initial rule score reaches the initial score threshold, a target node and all matching paths containing the target node are determined from the initial matching subgraph, and each matching path is combined with the interpretation rule to form a candidate piece of evidence.
[0057] In this embodiment, the initial matching subgraph can refer to the matching subgraph of the interpretation rule at the user-item pair in the graph data. For any interpretation rule, there may be multiple matching results for a user-item pair in the graph data. The initial matching subgraph includes all the matching results of the interpretation rule at the user-item pair. The matching node can refer to the node in the matching subgraph, and the node score can refer to the score that represents the importance of the node.
[0058] The initial score threshold can refer to a pre-set score threshold; the matching path can refer to the path in the initial matching subgraph that represents any matching result of the interpretation rule; the target node can refer to any node in the initial matching subgraph; and the candidate evidence can consist of the interpretation rule and any matching path (matching result) of the interpretation rule, used to provide a local interpretation of the user-item pairs obtained by the recommendation model decision.
[0059] Given N interpretation rules, a simple algorithm for calculating all target evidence corresponding to each interpretation rule is as follows: For each interpretation rule, find all matching results (matching paths) with the graph pattern at the user-item pair in the graph data, and combine the matching results (matching paths) that satisfy the interpretation rule with the interpretation rule to form evidence. However, this algorithm has certain limitations in practical applications: 1) When the graph data is dense, finding all matching results (matching paths) at the user-item pair that can match the interpretation rule is very costly; 2) Multiple interpretation rules may apply to the user-item pair, and there may be multiple matching results (matching paths) for each interpretation rule.
[0060] Therefore, this application employs a pruning strategy to filter out evidence with low priority (lower evidence scores) and ultimately obtain evidence with high priority (higher evidence scores). The core of the pruning strategy is the upper bound of the ranking scores of all evidence involving the interpretation rules, denoted as: in, This is the upper bound of the initial rule score. Score the evidence.
[0061] Specifically, given an interpretation rule, if the upper bound of the initial rule score (upper bound of the updated rule score) corresponding to the interpretation rule does not reach the initial score threshold (upper bound of the updated score threshold), it means that all the evidence formed by the interpretation rule and the corresponding matching result cannot contribute to the evidence with higher priority (higher evidence score). The processing of the interpretation rule should be stopped as soon as possible, and the unprocessed interpretation rules among the N interpretation rules should be traversed to return all target evidence with higher priority (higher evidence score) in the heap structure. If the upper bound of the initial rule score (upper bound of the updated rule score) corresponding to the interpretation rule reaches the initial score threshold (upper bound of the updated score threshold), it means that there is evidence among all the evidence formed by the interpretation rule and the corresponding matching result that can contribute to the evidence with higher priority (higher evidence score). The interpretation rule should then be processed by performing the step of determining a target node and all matching paths containing the target node from the initial matching subgraph, and forming a candidate piece of evidence with each matching path and the interpretation rule.
[0062] Specifically, when the upper bound of the initial rule score reaches the initial score threshold, in the process of determining the target node, for any variable in the interpretation rule, the influence score of removing any matching node mapped to the variable on the upper bound of the variable score is calculated, and the matching node with the largest influence score is determined as the target node; after determining the target node, all matching paths (matching results) containing the target node are determined from the initial matching subgraph, and each matching path is combined with the interpretation rule to form a candidate piece of evidence.
[0063] For example, Figure 5 shows a schematic diagram of an initial matching subgraph provided in Embodiment 2 of this application; Figure 6 shows a schematic diagram of an upper bound of variable scores provided in Embodiment 2 of this application.
[0064] In determining the upper bound of variable scores, the interpretation rules are shown in Figure 4. In the Chinese diagram, the pattern path ρ in pattern Q1 x Taking (x0, x1, x2, x3) as an example, for the pattern path ρ x For any variable z, the matching nodes mapped to variable z in the initial matching subgraph shown in Figure 5 are shown in Figure 6. Referring to Figure 6, for any variable z, Let z be the set of all matching nodes in the initial matching subgraph that can be mapped to the variable z. For example, for the pattern path ρ, the upper bound of the variable score. x In the initial matching subgraph, the matching nodes mapped to variable x1 are w1 and w2, where w1 has a node score of 0.6 and w2 has a node score of 0.9. Therefore, the upper bound of the variable score of x1 can be determined as max{0.6,0.9}=0.9.
[0065] Figure 7 shows a schematic diagram of an influence score provided in Embodiment 2 of this application;
[0066] In the process of determining the target node, the above-mentioned path ρ is used. x Taking (x0, x1, x2, x3) as an example, for the pattern path ρ x For any variable z, the influence of removing any matching node mapped to that variable on the upper bound of the variable score is shown in Figure 7. Referring to Figure 7, for any variable z, h(z) is... For any matching node in the pattern path ρ, Δw is the score that affects the score. x In the initial matching subgraph, the matching nodes mapped to variable x1 are w1 and w2, respectively. If w1 is removed, the only remaining matching node mapped to variable x1 is w2, and the upper bound of variable x1's score will become 0.9. Based on the upper bounds of variable x1's score before and after removal, the impact score Δw of removing w1 on the upper bound of variable x1's score is calculated to be 0.9 - 0.9 = 0. Similarly, if w2 is removed, the only remaining matching node mapped to variable x1 is w1, and the upper bound of variable x1's score will become 0.6. Based on the upper bounds of variable x1's score before and after removal, the impact score Δw of removing w2 on the upper bound of variable x1's score is calculated to be 0.9 - 0.6 = 0.3. As shown in Figure 7, the maximum impact score Δw is determined to be 0.3, thus w2 can be identified as the target node.
[0067] Step S204: For any candidate evidence, determine the evidence score of the candidate evidence based on the rule score representing the importance of the interpretation rule and the path score representing the importance of the corresponding matching path. Iterate through all candidate evidence to obtain the evidence score of each candidate evidence. Based on the evidence scores of all candidate evidence and the initial score threshold, obtain the target evidence.
[0068] Rule score can refer to the score that represents the importance of interpreting the rule, path score can refer to the score that represents the importance of the matching path (matching result), evidence score can refer to the score that represents the importance of the evidence, and target evidence can refer to candidate evidence whose evidence score reaches the initial score threshold.
[0069] Specifically, for any candidate evidence, the evidence score of the candidate evidence is determined based on the rule score representing the importance of the interpretation rule and the path score representing the importance of the corresponding matching path. All candidate evidence is traversed to obtain the evidence score of each candidate evidence, and the candidate evidence whose evidence score reaches the initial score threshold is determined as the target evidence.
[0070] Step S205: Write the target evidence into the heap structure, update the initial score threshold using the lowest evidence score in the heap structure to obtain the updated score threshold, remove the target node and child nodes whose parent node is the target node from the initial matching subgraph to obtain the updated matching subgraph, and update the upper bound of the initial rule score using the updated matching subgraph to obtain the updated rule score upper bound.
[0071] In this embodiment, the heap structure is used to store target evidence that meets the conditions. Target evidence that meets the conditions can refer to target evidence with high priority (higher evidence score).
[0072] Specifically, the target evidence is written into the heap structure. After writing is complete, the lowest evidence score in the heap structure is used to update and increase the initial score threshold, thereby obtaining an updated score threshold. This updated score threshold is then applied as the new initial score threshold in step S206. If the upper bound of the updated rule score reaches the updated score threshold, the updated matching subgraph is used as the initial matching subgraph, and the step of determining a target node from the initial matching subgraph is re-executed. Alternatively, if the upper bound of the updated rule score does not reach the updated score threshold, the step of traversing all interpretation rules is executed. In this step, the initial score threshold is ensured to be continuously increasing. Thus, interpretation rules with higher upper bounds of initial rule scores can be selected based on the continuously increasing initial score threshold. Evidence involving these interpretation rules with higher upper bounds of initial rule scores will contribute to the target evidence with high priority (higher evidence score) in the heap structure.
[0073] In the process of obtaining the updated matching subgraph, the target node and its child nodes are removed from the initial matching subgraph. For example, combining the initial matching subgraph shown in Figure 5 and the target node w2 shown in Figure 7, in the process of obtaining the updated matching subgraph, referring to Figure 5, if w2 is removed, since w2 is the only parent node of w6, w6 also needs to be removed at the same time as w2 to obtain the updated matching subgraph.
[0074] In obtaining the upper bound of the update rule score, you can refer to the content in steps S801 to S803 to obtain the upper bound of the update rule score based on the update matching subgraph.
[0075] Step S206: Use the updated score threshold as the initial score threshold. If the upper bound of the updated rule score reaches the updated score threshold, use the updated matching subgraph as the initial matching subgraph and return to determine a target node from the initial matching subgraph. And / or, if the upper bound of the updated rule score does not reach the updated score threshold, traverse all interpretation rules and return all target evidence in the heap structure.
[0076] Specifically, the updated score threshold is applied as the new initial score threshold. If the upper bound of the updated rule score reaches the updated score threshold, the updated matching subgraph is applied as the new initial matching subgraph. The step of determining a target node from the initial matching subgraph in step S203 is re-executed, and the interpretation rule is processed until the upper bound of the updated rule score of the interpretation rule does not reach the updated score threshold. The processing of the interpretation rule is stopped, and the unprocessed interpretation rules among the N interpretation rules are traversed. The step of extracting the initial matching subgraph corresponding to the user item pair from the graph data using any interpretation rule in step S202 is executed until all N interpretation rules have been processed (the upper bound of the initial rule score of the N interpretation rules does not reach the initial score threshold, or the upper bound of the updated rule does not reach the updated score threshold). All target evidence in the heap structure is returned.
[0077] If the upper bound of the update rule score does not reach the update score threshold, the processing of the interpretation rule is stopped directly. The unprocessed interpretation rules among the N interpretation rules are traversed, and the step of using any interpretation rule to extract the initial matching subgraph corresponding to the user item pair from the graph data is executed in step S202 above, until all N interpretation rules have been processed, and all target evidence in the heap structure is returned.
[0078] This application's embodiments interpret the recommendation results of a recommendation model in graph data by using interpretation rules. Based on the subgraph, it extracts the topological structure and node features that have a decisive impact on the recommendation results, forming target evidence. This optimizes the interpretation method and further helps users understand which features play a key role in the model's decision-making, thereby enhancing users' trust in the model's results and improving the effectiveness (fidelity and sparsity) and reliability of the interpretation. Based on the upper bound of the rule score and the initial score threshold, it ensures that high-priority (higher evidence score) target evidence that has a decisive impact on the recommendation results can be efficiently screened, reducing computational complexity and improving algorithm efficiency. Furthermore, by maintaining a heap structure to dynamically update and store the current high-priority (higher evidence score) target evidence, users can quickly obtain the most explanatory and influential evidence, improving the user experience.
[0079] Referring to Figure 8, which is a flowchart illustrating a rule-based recommendation model interpretation method provided in Embodiment 3 of this application, as shown in Figure 8, the step S202 above, which determines the upper bound of the initial rule score for interpretation based on the node scores of the matching nodes in the initial matching subgraph, may include the following steps:
[0080] Step S801: Determine the variables in the interpretation rules.
[0081] Step S802: For any variable, determine all matching nodes mapped to the variable in the initial matching subgraph, and determine the highest node score from the node scores of all matching nodes mapped to the variable as the upper bound of the variable score.
[0082] Step S803: Based on the rule scores that characterize the importance of the interpretation rule and the upper bound of the variable scores of all variables in the interpretation rule, the initial upper bound of the rule score of the interpretation rule is obtained.
[0083] In this embodiment, the variable can refer to the predicate variable in the precondition of the interpretation rule. The interpretation rule includes at least one variable. The upper bound of the variable score can refer to the highest node score among all matching nodes mapped to the variable in the initial matching subgraph.
[0084] Specifically, explain the rules The formula for calculating the upper bound of the initial rule score can be expressed as:
[0085] in, This is the upper bound of the initial rule score. To score points according to the rules, This represents the upper bound of the variable's score.
[0086] That is, in the process of obtaining the initial upper bound of the rule score of the interpretation rule, for any variable in the interpretation rule, all matching nodes mapped to the variable are determined in the initial matching subgraph, and the highest node score among all matching nodes mapped to the variable is determined as the upper bound of the variable score; the upper bounds of the variable scores of all variables in the interpretation rule are summed to obtain the summed result, and the summed result is multiplied by the rule score that represents the importance of the interpretation rule to obtain the initial upper bound of the rule score of the interpretation rule.
[0087] Optionally, after calculating the upper bound of the variable scores of all variables in the interpretation rule, the sum of the upper bounds of the variable scores of all variables in the interpretation rule is directly used as the initial upper bound of the rule score of the interpretation rule.
[0088] In this embodiment, the initial rule score upper bound of the interpretation rule is obtained by using the rule score that characterizes the importance of the interpretation rule and the upper bound of the variable scores of all variables in the interpretation rule. Based on the initial rule score upper bound and the initial score threshold, evidence with low priority (lower evidence score) can be filtered out earlier, and evidence with high priority (higher evidence score) can be obtained in the end, which reduces the computational complexity and improves the efficiency of the algorithm.
[0089] Referring to Figure 9, which is a flowchart illustrating a rule-based recommendation model interpretation method provided in Embodiment 4 of this application, as shown in Figure 9, step S204 above, for any candidate evidence, determines the evidence score of the candidate evidence based on the rule score representing the importance of the interpretation rule and the path score representing the importance of the corresponding matching path. This may include the following steps:
[0090] Step S901: Calculate the rule score representing the importance of the interpretation rule, and calculate the path score representing the importance of the corresponding matching path.
[0091] Step S902: Multiply the rule score and the path score to obtain the evidence score.
[0092] In this embodiment, the rule score is used to characterize the importance of the information expressed by the explanatory rule, and the path score is used to characterize the contribution of the matching path (matching result) to the recommendation model in the prediction result of the user item pair.
[0093] Specifically, the formula for calculating the evidence score can be expressed as:
[0094] in, To score points for evidence, To score points according to the rules, Score the path;
[0095] Furthermore, for forms of The interpretation rules, and the formula for calculating the rule score, can be expressed as:
[0096] in, To interpret the rules The pattern score of pattern Q in the Chinese diagram. To interpret the rules The conditional score for premise X;
[0097] For pattern score The result can be obtained by comprehensively considering the number and length of paths in pattern Q, prioritizing simpler patterns; for conditional scores... The Gini Index (GINI) can be used as an effective standard to measure how the premise X can classify the interpretation rule matching results (matching paths) into different categories based on the prediction of the recommendation model.
[0098] Furthermore, path score The calculation formula can be expressed as:
[0099] Where s(h(z)) is the node score of any matching node h(z) in the matching path;
[0100] The node score s(h(z)) can be defined by taking into account the actual value and degree of the matching node h(z). Intuitively, nodes with higher degrees (or nodes whose actual values are closer to the optimal value, for example, nodes with higher scores are more popular) can be given higher scores.
[0101] In the process of obtaining the evidence score for candidate evidence, firstly, the rule score, representing the importance of the interpretation rule, is calculated. The graph pattern corresponding to the interpretation rule and the preconditions of the interpretation rule are determined. The pattern score, representing the importance of the graph pattern, and the condition score, representing the importance of the preconditions, are calculated. The pattern score and condition score are multiplied to obtain the rule score. Next, the path score, representing the importance of the corresponding matching path, is calculated. The node scores of all matching nodes in the matching path are determined. The node scores of all matching nodes in the matching path are summed to obtain the path score, representing the importance of the corresponding matching path. Finally, the rule score and path score are multiplied to obtain the evidence score.
[0102] In this embodiment, the evidence score is calculated by combining the rule score representing the importance of the interpretation rule and the path score representing the importance of the corresponding matching path. By comprehensively considering the importance of the rule and the importance of the subgraph and node features, the obtained evidence score can more accurately reflect the role of the target evidence in the process of the recommendation model obtaining the recommendation result, thereby improving the effectiveness and reliability of the interpretation.
[0103] Referring to Figure 10, which is a flowchart illustrating a rule-based recommendation model interpretation method provided in Embodiment 5 of this application, as shown in Figure 10, the interpretation method of the recommendation model may further include the following steps:
[0104] Step S1001: Construct a heap structure of size k;
[0105] The step S205 above, which involves writing the target evidence into the heap structure, includes:
[0106] Step S1002: If the heap structure is not full, the target evidence is directly written into the heap structure.
[0107] Step S1003: If the heap structure is full, after removing the target evidence with the lowest evidence score from the heap structure, the target evidence is written into the heap structure.
[0108] In this embodiment, the heap structure is used to store target evidence that meets the conditions. Target evidence that meets the conditions can refer to the top k target evidence with high priority (higher evidence score), where k is an integer greater than zero.
[0109] If the heap structure is not full, the target evidence is directly written into the heap structure; if the heap structure is full, the target evidence with the lowest evidence score is removed from the heap structure and then the target evidence is written into the heap structure. Thus, after traversing all interpretation rules, the top k target evidences with high priority (higher evidence scores) in the heap structure are returned.
[0110] For example, to obtain the top k pieces of evidence with high priority (higher evidence scores), a heap structure of size k is constructed. The overall flow of the interpretation method for the recommendation model can then be:
[0111] 1) For any interpretation rule, calculate its initial rule score upper bound. If the initial rule score upper bound does not reach the initial score threshold, stop processing the interpretation rule based on the pruning strategy; 2) If the initial rule score upper bound reaches the initial score threshold, continue processing the interpretation rule, determine a target node and all matching paths containing the target node from the initial matching subgraph, and form a candidate piece of evidence with each matching path and the interpretation rule; 3) Calculate the evidence score of each candidate piece of evidence, and determine the candidate evidence whose evidence score reaches the initial score threshold as the target evidence; 4) Write the target evidence into the heap structure. During the writing process, if the heap structure is not full, directly write the target evidence into the heap structure. If the heap structure is full, remove the target evidence with the lowest evidence score from the heap structure, and then write the target evidence into the heap structure. After writing is completed, use the lowest evidence in the heap structure to obtain the final score. The process involves updating the initial score threshold, removing the target node and its child nodes from the initial matching subgraph, and updating the upper bound of the initial rule score using the updated matching subgraph. The updated rule score upper bound is then obtained. The updated score threshold is used as the new initial score threshold. If the upper bound of the updated rule score reaches the updated score threshold, the interpretation rule is processed again, and the updated matching subgraph is used as the new initial matching subgraph. The process then returns to steps 2), 3), and 4) above, continuing until the upper bound of the updated rule score does not reach the updated score threshold. Based on the pruning strategy, the processing of the interpretation rule is stopped. All unprocessed interpretation rules are traversed, and steps 1), 2), 3), 4), and 5) above are executed, until all interpretation rules have been processed. Finally, the top k target pieces of evidence with high priority (higher evidence scores) in the heap structure are returned.
[0112] In this embodiment, by constructing a heap structure of size k, after obtaining the target evidence, if the heap structure is not full, the target evidence is directly written into the heap structure; if the heap structure is full, the target evidence with the lowest evidence score is removed from the heap structure and then written into the heap structure. This ensures that the heap structure is always dynamically updated and stored with the k highest priority (higher evidence scores), enabling users to quickly obtain the most explanatory and influential evidence and improving the user experience.
[0113] Corresponding to the rule-based recommendation model interpretation method in the above embodiments, Figure 11 shows a structural block diagram of the rule-based recommendation model interpretation device provided in Embodiment Six of this application. The recommendation model interpretation device is applied to the server in Figure 1. For ease of explanation, only the parts related to the embodiments of this application are shown.
[0114] Referring to Figure 11, the recommendation model interpretation device includes:
[0115] The acquisition module 1101 is used to acquire N interpretation rules, graph data, and user-item pairs to be interpreted 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, and N is an integer greater than zero;
[0116] The rule score determination module 1102 is used to extract an initial matching subgraph corresponding to the user item pair from the graph data using any interpretation rule, and determine the upper bound of the initial rule score of the interpretation rule based on the node score of the matching node in the initial matching subgraph.
[0117] The rule score judgment module 1103 is used to determine a target node and all matching paths containing the target node from the initial matching subgraph when the upper bound of the initial rule score reaches the initial score threshold, and to form a candidate evidence with each matching path and the interpretation rule respectively.
[0118] The target evidence judgment module 1104 is used to determine the evidence score of any candidate evidence based on the rule score representing the importance of the interpretation rule and the path score representing the importance of the corresponding matching path, traverse all candidate evidence to obtain the evidence score of each candidate evidence, and obtain the target evidence based on the evidence scores of all candidate evidence and the initial score threshold.
[0119] The update module 1105 is used to write the target evidence into a heap structure, update the initial score threshold using the lowest evidence score in the heap structure to obtain an updated score threshold, remove the target node and child nodes whose parent node is the target node from the initial matching subgraph to obtain an updated matching subgraph, and update the upper bound of the initial rule score using the updated matching subgraph to obtain an updated rule score upper bound. The heap structure is used to store target evidence that meets the conditions.
[0120] The loop module 1106 is used to take the updated score threshold as the initial score threshold, and if the upper bound of the updated rule score reaches the updated score threshold, then take the updated matching subgraph as the initial matching subgraph and return to execute the step of determining a target node from the initial matching subgraph, and / or, if the upper bound of the updated rule score does not reach the updated score threshold, then traverse all interpretation rules and return all target evidence in the heap structure.
[0121] Optionally, the rule score determination module 1102 includes:
[0122] A variable determination unit is used to determine the variables in the interpretation rule, wherein the interpretation rule includes at least one variable;
[0123] The variable score determination unit is used to determine all matching nodes mapped to the variable in the initial matching subgraph for any variable, and to determine the highest node score as the upper bound of the variable score from the node scores of all matching nodes mapped to the variable.
[0124] The rule score calculation unit is used to obtain the initial rule score upper bound of the interpretation rule based on the rule score that characterizes the importance of the interpretation rule and the upper bound of the variable scores of all variables in the interpretation rule.
[0125] Optionally, the rule scoring judgment module 1103 includes:
[0126] The influence score calculation unit is used to calculate the influence score of removing any matching node mapped to the variable on the upper bound of the variable score for any variable in the interpretation rule.
[0127] The target node determination unit is used to determine the matching node with the greatest influence on the score as the target node.
[0128] Optionally, the target evidence judgment module 1104 includes:
[0129] An importance calculation unit is used to calculate the rule score that represents the importance of the interpretation rule, and to calculate the path score that represents the importance of the corresponding matching path;
[0130] The first multiplication unit is used to multiply the rule score and the path score to obtain the evidence score.
[0131] Optionally, the importance calculation unit includes:
[0132] The first condition determination subunit is used to determine the graph pattern corresponding to the interpretation rule and the preconditions of the interpretation rule;
[0133] The condition calculation subunit is used to calculate the pattern score characterizing the importance of the graph pattern, and to calculate the condition score characterizing the importance of the preconditions;
[0134] The second multiplication subunit is used to multiply the pattern score and the condition score to obtain a rule score that characterizes the importance of the interpretation rule.
[0135] Optionally, the importance calculation unit includes:
[0136] The second condition determination subunit is used to determine the node score of all matching nodes in the matching path;
[0137] The summation subunit is used to sum the node scores of all matching nodes in the matching path to obtain the path score that represents the importance of the corresponding matching path.
[0138] Optionally, the recommendation model interpretation device also includes:
[0139] The building module is used to construct a heap structure of size k, where k is an integer greater than zero;
[0140] Update module 1105, including:
[0141] The first writing unit is used to directly write the target evidence into the heap structure if the heap structure is not full.
[0142] The second writing unit is used to write the target evidence into the heap structure after removing the target evidence with the lowest evidence score from the heap structure if the heap structure is full.
[0143] In one embodiment, a computer device, which may be a server, is provided, and its internal structure is shown in Figure 12. The computer device includes a processor, memory, a network interface, and a database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, a readable storage medium, and the database. The internal memory provides an environment for the operation of the operating system and the readable storage medium. The database stores N interpretation rules, graph data, and pairs of user items to be interpreted within the graph data. The network interface communicates with external terminals via a network connection. When executed by the processor, the readable storage medium implements a rule-based recommendation model interpretation method.
[0144] In one embodiment, a computer device is provided, including a memory, a processor, and a readable storage medium stored on the memory and executable on the processor. When the processor executes the readable storage medium, it implements the steps of the rule-based recommendation model interpretation method in the above embodiments, such as steps S201-S206 shown in FIG2, or the steps shown in FIG3 to FIG10. To avoid repetition, these steps will not be described again here. Alternatively, the processor executes the readable storage medium, which includes the functions of various modules / units in this embodiment of the rule-based recommendation model interpretation device, such as the functions of the acquisition module 1101, rule score determination module 1102, rule score judgment module 1103, target evidence judgment module 1104, update module 1105, and loop module 1106 shown in FIG11. To avoid repetition, these functions will not be described again here.
[0145] In one embodiment, one or more readable storage media storing computer-readable instructions are provided. When executed by one or more processors, these computer-readable instructions cause the processors to perform the steps of the rule-based recommendation model interpretation method described in the above embodiments, such as steps S201-S206 shown in FIG2, or the steps shown in FIG3 to FIG10. To avoid repetition, these steps will not be described again here. Alternatively, the functions of each module / unit in this embodiment of the rule-based recommendation model interpretation device when the processor executes the readable storage medium may be described, such as the functions of the acquisition module 1101, rule score determination module 1102, rule score judgment module 1103, target evidence judgment module 1104, update module 1105, and loop module 1106 shown in FIG11. To avoid repetition, these functions will not be described again here.
[0146] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by instructing related hardware through a readable storage medium. The readable storage medium can be stored in a non-volatile computer-readable storage medium, which, when executed, can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0147] 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.
[0148] The above-described 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-based explanation method for recommendation models, wherein, The method for interpreting the recommendation model includes: Obtain N interpretation rules, graph data, and user-item pairs to be interpreted 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, and N is an integer greater than zero; Using any interpretation rule, extract an initial matching subgraph corresponding to the user item pair from the graph data, and determine the upper bound of the initial rule score of the interpretation rule based on the node score of the matching node in the initial matching subgraph. When the upper bound of the initial rule score reaches the initial score threshold, a target node and all matching paths containing the target node are determined from the initial matching subgraph, and each matching path is combined with the interpretation rule to form a candidate piece of evidence. For any candidate evidence, the evidence score of the candidate evidence is determined based on the rule score representing the importance of the interpretation rule and the path score representing the importance of the corresponding matching path. All candidate evidence is traversed to obtain the evidence score of each candidate evidence. The target evidence is obtained based on the evidence scores of all candidate evidence and the initial score threshold. The target evidence is written into a heap structure, the initial score threshold is updated using the lowest evidence score in the heap structure, and the updated score threshold is obtained. The target node and its child nodes are removed from the initial matching subgraph, and the updated matching subgraph is obtained. The upper bound of the initial rule score is updated using the updated matching subgraph, and the upper bound of the updated rule score is obtained. The heap structure is used to store the target evidence that meets the conditions. If the updated score threshold is used as the initial score threshold, and the upper bound of the updated rule score reaches the updated score threshold, then the updated matching subgraph is used as the initial matching subgraph, and the process of determining a target node from the initial matching subgraph is returned. If the upper bound of the updated rule score does not reach the updated score threshold, then all interpretation rules are traversed, and all target evidence in the heap structure is returned.
2. The recommendation model interpretation method according to claim 1, wherein, The step of determining the initial rule score upper bound of the interpretation rule based on the node scores of the matching nodes in the initial matching subgraph includes: Determine the variables in the interpretation rule, wherein the interpretation rule includes at least one variable; For any variable, determine all matching nodes mapped to the variable in the initial matching subgraph, and determine the highest node score from the node scores of all matching nodes mapped to the variable as the upper bound of the variable score. The initial upper bound of the rule score for the interpretation rule is obtained based on the rule score that characterizes the importance of the interpretation rule and the upper bound of the variable scores of all variables in the interpretation rule.
3. The recommendation model interpretation method according to claim 2, wherein, Determining a target node from the initial matching subgraph includes: For any variable in the interpretation rules, calculate the impact score of removing any matching node mapped to the variable on the upper bound of the variable score; The matching node with the greatest impact on the score is determined as the target node.
4. The recommendation model interpretation method according to claim 1, wherein, For any candidate evidence, the evidence score is determined based on the rule score characterizing the importance of the interpretation rule and the path score characterizing the importance of the corresponding matching path, including: Calculate the rule score that represents the importance of the interpretation rule, and calculate the path score that represents the importance of the corresponding matching path; The evidence score is obtained by multiplying the rule score and the path score.
5. The recommendation model interpretation method according to claim 4, wherein, The calculation of rule scores, which characterize the importance of the interpretation rules, includes: Determine the graph pattern corresponding to the interpretation rule and the preconditions for the interpretation rule; Calculate the pattern score that characterizes the importance of the graph pattern, and calculate the condition score that characterizes the importance of the preconditions; Multiply the pattern score and the condition score to obtain the rule score that represents the importance of the interpretation rule.
6. The recommendation model interpretation method according to claim 4, wherein, The calculation of the path score, which represents the importance of the corresponding matching path, includes: Determine the node score of all matching nodes in the matching path; The node scores of all matching nodes in the matching path are summed to obtain the path score, which represents the importance of the corresponding matching path.
7. The recommendation model interpretation method according to claim 1, wherein, The recommendation model interpretation method also includes: Construct a heap structure of size k, where k is an integer greater than zero; The step of writing the target evidence into the heap structure includes: If the heap structure is not full, the target evidence is directly written into the heap structure; If the heap structure is full, the target evidence with the lowest evidence score is removed from the heap structure and then written into the heap structure.
8. A rule-based recommendation model interpretation device, wherein, The recommendation model interpretation device includes: The acquisition module is used to acquire N interpretation rules, graph data, and user-item pairs to be interpreted in the graph data. 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. N is an integer greater than zero. The rule score determination module is used to extract an initial matching subgraph corresponding to the user item pair from the graph data using any interpretation rule, and to determine the upper bound of the initial rule score of the interpretation rule based on the node score of the matching node in the initial matching subgraph. The rule score judgment module is used to determine a target node and all matching paths containing the target node from the initial matching subgraph when the upper bound of the initial rule score reaches the initial score threshold, and to form a candidate evidence with each matching path and the interpretation rule respectively. The target evidence determination module is used to determine the evidence score of any candidate evidence based on the rule score representing the importance of the interpretation rule and the path score representing the importance of the corresponding matching path, traverse all candidate evidence to obtain the evidence score of each candidate evidence, and obtain the target evidence based on the evidence scores of all candidate evidence and the initial score threshold. The update module is used to write the target evidence into a heap structure, update the initial score threshold using the lowest evidence score in the heap structure to obtain an updated score threshold, remove the target node and child nodes whose parent node is the target node from the initial matching subgraph to obtain an updated matching subgraph, and update the upper bound of the initial rule score using the updated matching subgraph to obtain an updated rule score upper bound. The heap structure is used to store target evidence that meets the conditions. The loop module is used to take the updated score threshold as the initial score threshold. If the upper bound of the updated rule score reaches the updated score threshold, the updated matching subgraph is taken as the initial matching subgraph, and the process of determining a target node from the initial matching subgraph is returned. If the upper bound of the updated rule score does not reach the updated score threshold, all interpretation rules are traversed and all target evidence in the heap structure is returned.
9. A computer device comprising a memory, a processor, and a readable storage medium stored in the memory and operable on the processor, wherein, When the processor executes the readable storage medium, it performs the following steps: Obtain N interpretation rules, graph data, and user-item pairs to be interpreted 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, and N is an integer greater than zero; Using any interpretation rule, extract an initial matching subgraph corresponding to the user item pair from the graph data, and determine the upper bound of the initial rule score of the interpretation rule based on the node score of the matching node in the initial matching subgraph. When the upper bound of the initial rule score reaches the initial score threshold, a target node and all matching paths containing the target node are determined from the initial matching subgraph, and each matching path is combined with the interpretation rule to form a candidate piece of evidence. For any candidate evidence, the evidence score of the candidate evidence is determined based on the rule score representing the importance of the interpretation rule and the path score representing the importance of the corresponding matching path. All candidate evidence is traversed to obtain the evidence score of each candidate evidence. The target evidence is obtained based on the evidence scores of all candidate evidence and the initial score threshold. The target evidence is written into a heap structure, the initial score threshold is updated using the lowest evidence score in the heap structure, and the updated score threshold is obtained. The target node and its child nodes are removed from the initial matching subgraph, and the updated matching subgraph is obtained. The upper bound of the initial rule score is updated using the updated matching subgraph, and the upper bound of the updated rule score is obtained. The heap structure is used to store the target evidence that meets the conditions. If the updated score threshold is used as the initial score threshold, and the upper bound of the updated rule score reaches the updated score threshold, then the updated matching subgraph is used as the initial matching subgraph, and the process of determining a target node from the initial matching subgraph is returned. If the upper bound of the updated rule score does not reach the updated score threshold, then all interpretation rules are traversed, and all target evidence in the heap structure is returned.
10. The computer device according to claim 9, wherein, The step of determining the initial rule score upper bound of the interpretation rule based on the node scores of the matching nodes in the initial matching subgraph includes: Determine the variables in the interpretation rule, wherein the interpretation rule includes at least one variable; For any variable, determine all matching nodes mapped to the variable in the initial matching subgraph, and determine the highest node score from the node scores of all matching nodes mapped to the variable as the upper bound of the variable score. The initial upper bound of the rule score for the interpretation rule is obtained based on the rule score that characterizes the importance of the interpretation rule and the upper bound of the variable scores of all variables in the interpretation rule.
11. The computer device according to claim 10, wherein, Determining a target node from the initial matching subgraph includes: For any variable in the interpretation rules, calculate the impact score of removing any matching node mapped to the variable on the upper bound of the variable score; The matching node with the greatest impact on the score is determined as the target node.
12. The computer device according to claim 9, wherein, For any candidate evidence, the evidence score is determined based on the rule score characterizing the importance of the interpretation rule and the path score characterizing the importance of the corresponding matching path, including: Calculate the rule score that represents the importance of the interpretation rule, and calculate the path score that represents the importance of the corresponding matching path; The evidence score is obtained by multiplying the rule score and the path score.
13. The computer device according to claim 12, wherein, The calculation of rule scores, which characterize the importance of the interpretation rules, includes: Determine the graph pattern corresponding to the interpretation rule and the preconditions for the interpretation rule; Calculate the pattern score that characterizes the importance of the graph pattern, and calculate the condition score that characterizes the importance of the preconditions; Multiply the pattern score and the condition score to obtain the rule score that represents the importance of the interpretation rule.
14. The computer device according to claim 12, wherein, The calculation of the path score, which represents the importance of the corresponding matching path, includes: Determine the node score of all matching nodes in the matching path; The node scores of all matching nodes in the matching path are summed to obtain the path score, which represents the importance of the corresponding matching path.
15. The computer device according to claim 9, wherein, Also includes: Construct a heap structure of size k, where k is an integer greater than zero; The step of writing the target evidence into the heap structure includes: If the heap structure is not full, the target evidence is directly written into the heap structure; If the heap structure is full, the target evidence with the lowest evidence score is removed from the heap structure and then written into the heap structure.
16. One or more readable storage media storing computer-readable instructions, wherein, When the computer-readable instructions are executed by one or more processors, the one or more processors cause the processors to perform the following steps: Obtain N interpretation rules, graph data, and user-item pairs to be interpreted 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, and N is an integer greater than zero; Using any interpretation rule, extract an initial matching subgraph corresponding to the user item pair from the graph data, and determine the upper bound of the initial rule score of the interpretation rule based on the node score of the matching node in the initial matching subgraph. When the upper bound of the initial rule score reaches the initial score threshold, a target node and all matching paths containing the target node are determined from the initial matching subgraph, and each matching path is combined with the interpretation rule to form a candidate piece of evidence. For any candidate evidence, the evidence score of the candidate evidence is determined based on the rule score representing the importance of the interpretation rule and the path score representing the importance of the corresponding matching path. All candidate evidence is traversed to obtain the evidence score of each candidate evidence. The target evidence is obtained based on the evidence scores of all candidate evidence and the initial score threshold. The target evidence is written into a heap structure, the initial score threshold is updated using the lowest evidence score in the heap structure, and the updated score threshold is obtained. The target node and its child nodes are removed from the initial matching subgraph, and the updated matching subgraph is obtained. The upper bound of the initial rule score is updated using the updated matching subgraph, and the upper bound of the updated rule score is obtained. The heap structure is used to store the target evidence that meets the conditions. If the updated score threshold is used as the initial score threshold, and the upper bound of the updated rule score reaches the updated score threshold, then the updated matching subgraph is used as the initial matching subgraph, and the process of determining a target node from the initial matching subgraph is returned. If the upper bound of the updated rule score does not reach the updated score threshold, then all interpretation rules are traversed, and all target evidence in the heap structure is returned.
17. The readable storage medium according to claim 16, wherein, The step of determining the initial rule score upper bound of the interpretation rule based on the node scores of the matching nodes in the initial matching subgraph includes: Determine the variables in the interpretation rule, wherein the interpretation rule includes at least one variable; For any variable, determine all matching nodes mapped to the variable in the initial matching subgraph, and determine the highest node score from the node scores of all matching nodes mapped to the variable as the upper bound of the variable score. The initial upper bound of the rule score for the interpretation rule is obtained based on the rule score that characterizes the importance of the interpretation rule and the upper bound of the variable scores of all variables in the interpretation rule.
18. The readable storage medium according to claim 17, wherein, Determining a target node from the initial matching subgraph includes: For any variable in the interpretation rules, calculate the impact score of removing any matching node mapped to the variable on the upper bound of the variable score; The matching node with the greatest impact on the score is determined as the target node.
19. The readable storage medium according to claim 16, wherein, For any candidate evidence, the evidence score is determined based on the rule score characterizing the importance of the interpretation rule and the path score characterizing the importance of the corresponding matching path, including: Calculate the rule score that represents the importance of the interpretation rule, and calculate the path score that represents the importance of the corresponding matching path; The evidence score is obtained by multiplying the rule score and the path score.
20. The readable storage medium according to claim 19, wherein, The calculation of rule scores, which characterize the importance of the interpretation rules, includes: Determine the graph pattern corresponding to the interpretation rule and the preconditions for the interpretation rule; Calculate the pattern score that characterizes the importance of the graph pattern, and calculate the condition score that characterizes the importance of the preconditions; Multiply the pattern score and the condition score to obtain the rule score that represents the importance of the interpretation rule.