Entity enhancing rule mining method and apparatus, and computer device and medium
By introducing pruning conditions into the rule discovery method, the entity enhancement rules that cannot be the top-k rule are filtered out, which solves the problem of inefficient rule discovery in the prior art, and achieves the effect of quickly obtaining the top-k rule.
Patent Information
- Application Number
- PCT/CN2023/096334
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-16
- Filing Date
- 2023-05-25
- Publication Date
- 2024-11-21
AI Technical Summary
Existing rule discovery methods are inefficient in big data, requiring enumeration of all predicate permutations, resulting in extremely low efficiency when looking for top-k rules, especially when the data scale is huge.
By judging whether the candidate entity enhancement rules meet the preset pruning conditions, if they are satisfied, the expansion will be terminated. If they are not expanded, the entity enhancement rules that cannot become the top-k rule are filtered out using the pruning conditions, and the invalid operation will be terminated in advance.
It improves the efficiency of rule mining, reduces unnecessary calculations and processing, and can quickly obtain the required top-k rules, with an average speed of 134 times.
Smart Images

Figure CN2023096334_21112024_PF_FP_ABST
Abstract
Description
Entity enhancement rule mining method, device, computer equipment and medium Technical Field
[0001] The present application relates to the field of computers, and in particular to a method, apparatus, computer equipment, and medium for mining entity enhancement rules. Background Art
[0002] Discovering rules in big data is a time-consuming and labor-intensive process. However, a major challenge facing rule discovery is the large number of rule candidates it generates. Faced with this vast number of candidate rules, users often have to spend considerable time and effort manually reviewing and selecting the rules that suit their needs. This prohibitive cost hinders the development and applicability of rule discovery methods.
[0003] Before conducting rule discovery, domain experts often have already accumulated a certain number of useful "rules" from practical experience. For example, in the pharmaceutical industry, experts often already know the usage rules for existing drugs. These rules can be discovered using traditional rule discovery metrics. For example, rule support measures the frequency of rule application, and rule confidence measures the correlation between the rule's preconditions and consequences. However, these "general" objective metrics are often insufficient in practice, as they may return an excessive number of irrelevant rules. Domain experts prefer to focus their discovery efforts on rules that meet their target requirements. For example, the target requirement may be to discover new rules that are similar to the effective usage rules of existing drugs they already know, thereby helping them identify more uses for the drug. Pharmaceutical experts often find that the effectiveness of the numerous candidate rules returned by traditional rule discovery methods varies across therapeutic interventions. Therefore, they prioritize the most promising rules and prioritize them for the next stage, such as expensive clinical trials. Submitting all candidate rules to clinical trials is undesirable and prohibitively expensive.
[0004] The above rules consist of conditional predicates and result predicates. Existing methods essentially enumerate all possible permutations and combinations of predicates in the data and verify them one by one. For all possible conditional predicates, any one or more of them can potentially form a valid rule with the result predicate. Therefore, to discover rules, existing methods must try all possible permutations and combinations of predicates. For rules that meet support and confidence thresholds, their ranking scores are calculated, and the k highest-scoring rules are ultimately returned. When the data scale is large, this brute-force approach is undoubtedly inefficient.
[0005] Summary of the Invention
[0006] In view of the above problems, the present application is proposed to provide an entity enhancement rule mining method, apparatus, computer device and medium that overcomes the above problems or at least partially solves the above problems, including:
[0007] An entity enhancement rule mining method, comprising:
[0008] Acquire a data set and a target rule set; wherein the target rule set includes an expanded top K entity enhancement rule with a ranking score for the data set;
[0009] Determining candidate entity enhancement rules in the data set; wherein the candidate entity enhancement rules are entity enhancement rules that have not been fully expanded;
[0010] Determining whether the candidate entity enhancement rule satisfies at least one of the preset pruning conditions;
[0011] If so, the expansion of the candidate entity enhancement rule is terminated; if not, the expansion of the candidate entity enhancement rule is continued.
[0012] Furthermore, the pruning condition includes a rule minimization pruning condition; the candidate entity enhancement rule includes a condition predicate set and a result predicate; and the determining whether the candidate entity enhancement rule satisfies at least one of the preset pruning conditions includes:
[0013] Determining whether there is a subset of the conditional predicate set in the candidate entity enhancement rule, and the subset matches the result predicate of the candidate entity enhancement rule;
[0014] If the subset exists, it is determined that the candidate entity enhancement rule satisfies the rule minimization pruning condition.
[0015] Furthermore, the pruning condition includes a rule anti-monotonic pruning condition; and the determining whether the candidate entity enhancement rule satisfies at least one of the preset pruning conditions includes:
[0016] Determining the support value of the candidate entity enhancement rule;
[0017] When the support value is less than a preset support threshold, the rule anti-monotonic pruning condition is determined.
[0018] Furthermore, the pruning condition includes a ranking score upper bound pruning condition; and the determining whether the candidate entity enhancement rule satisfies at least one of the preset pruning conditions includes:
[0019] Determining an upper bound of the ranking scores of the candidate entity enhancement rules, and determining the entity enhancement rule in the first rule set with the smallest ranking score as a target ranking score;
[0020] When the ranking score upper bound is less than the target ranking score, it is determined that the candidate entity enhancement rule meets the ranking score upper bound pruning condition.
[0021] Further, after continuing to expand the candidate entity enhancement rule, the method includes:
[0022] Determining a first ranking score of the completed extended entity enhancement rule, and determining the entity enhancement rule in the first rule set with the smallest ranking score as a target ranking score;
[0023] When the candidate first ranking score is greater than the target ranking score, the completed expanded candidate entity enhancement rule is added to the target rule set, and the entity enhancement rule corresponding to the target ranking score in the first rule set is deleted.
[0024] Furthermore, before determining whether the candidate entity enhancement rule needs to be further expanded according to the preset pruning strategy information, the method further includes:
[0025] Determining whether the candidate entity enhancement rule is a minimization rule;
[0026] If the candidate entity enhancement rule is not a minimization rule, the step of determining whether the candidate entity enhancement rule needs to be further expanded according to the preset pruning strategy information is executed.
[0027] Furthermore, the method further comprises:
[0028] If the candidate entity enhancement rule is a minimization rule, determining a second ranking score of the candidate entity enhancement rule, and determining the entity enhancement rule with the smallest ranking score in the first rule set as a target ranking score;
[0029] When the candidate third ranking score is greater than the target ranking score, the candidate entity enhancement rule is added to the target rule set, and the entity enhancement rule corresponding to the target ranking score in the first rule set is deleted.
[0030] An entity enhancement rule mining device, comprising:
[0031] An acquisition module is configured to acquire a data set and a target rule set; wherein the target rule set includes an enhanced rule for the top K entities with the expanded ranking scores for the data set;
[0032] A candidate determination module, configured to determine candidate entity enhancement rules in the data set; wherein the candidate entity enhancement rules are entity enhancement rules that have not yet been expanded;
[0033] The pruning judgment module is used to judge whether the candidate entity enhancement rule meets at least one of the preset pruning conditions; if so, the termination module is called; if not, the expansion module is called.
[0034] The termination module is used to terminate the expansion of the candidate entity enhancement rule;
[0035] The expansion module is used to expand the candidate entity enhancement rule.
[0036] A computer device comprises a processor, a memory and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the above-mentioned entity enhancement rule mining steps when executed by the processor.
[0037] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned entity enhancement rule mining steps.
[0038] This application has the following advantages:
[0039] In an embodiment of the present application, compared with the prior art, in order to perform rule discovery, the existing method needs to try all permutations and combinations of predicates, that is, in the prior art, all entity enhancement rules need to be expanded before the top-k rules can be determined, resulting in a problem of low rule mining efficiency. The present application provides a solution for judging whether the candidate entity enhancement rule meets at least one of the preset pruning conditions; if so, terminating the expansion of the candidate entity enhancement rule; if not, expanding the candidate entity enhancement rule to screen out entity enhancement rules that cannot become top-k rules when the entity enhancement rule is not expanded. Specifically, the solution is as follows: obtaining a data set and a target rule set; wherein the target rule set includes the top K entity enhancement rules with the highest ranking scores that have been expanded for the data set; determining the candidate entity enhancement rules in the data set; wherein the candidate entity enhancement rule is the entity enhancement rule that has not been fully expanded; judging whether the candidate entity enhancement rule meets at least one of the preset pruning conditions; if so, terminating the expansion of the candidate entity enhancement rule; if not, expanding the candidate entity enhancement rule. The above technical solution solves the problem that in order to discover rules in the prior art, all permutations and combinations of predicates need to be tried, that is, the prior art needs to complete the expansion of all entity enhancement rules before the top-k rules can be determined, resulting in low rule mining efficiency. It achieves the effect of terminating the operation and processing of invalid candidate entity enhancement rules in advance, and can quickly obtain the required top-k rules without traversing all candidate entity enhancement rules. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for the description of the present application. 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 any creative work.
[0041] FIG1 is a flowchart of a method for mining entity enhancement rules according to an embodiment of the present application;
[0042] FIG2 is a flow chart of an entity enhancement rule mining method provided by an embodiment of the present application;
[0043] FIG3 is a schematic diagram of an application example of an entity enhancement rule mining method provided by an embodiment of the present application;
[0044] FIG4 is a structural block diagram of an entity enhancement rule mining device provided by an embodiment of the present application;
[0045] FIG5 is a schematic structural diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0046] To make the objectives, features, and advantages of this application more readily apparent, the present application is further described below in conjunction with the accompanying drawings and specific embodiments. It is apparent that the embodiments described are only a portion of the embodiments of this application, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments in this application without inventive effort are also within the scope of protection of this application.
[0047] The inventors found through analysis of the prior art that:
[0048] Entity Enhancing Rules (EER) are abbreviated as EER. The basic component of EER is the predicate p, which is defined as follows: p: = R(t) | tA◎c | tA◎sB | M(tA,sB)
[0049] Here, ◎ is an operator, which can be equal to or not equal to; R(t) indicates that t is a tuple variable in the relational table R; tA represents the attribute A of the variable t; and M is a machine learning model that returns true if tA and sB are related, and false otherwise. tA◎c with a constant is called a constant predicate; tA◎sB without a constant is called a variable predicate; M(tA,sB) is called a machine learning predicate.
[0050] Based on predicates, EERφ is defined as: X→e, where (1) X is a combination of multiple predicates, which is called the condition of this EER; (2) e is a predicate, which is called the result of this EER.
[0051] A specific EER example is as follows:
[0052] Express(t)∧Express(s)∧t.Recipient=s.Recipient∧t.Address="Province A, City B"→s.Zip Code="XYZZZZ"
[0053] The scenario described by this EER is that if the recipients of two express packages t and s are the same person, and t's address is in "Province A, City B", then s's zip code must be "XYZZZZ".
[0054] Objective metrics of traditional rule discovery techniques include support and confidence.
[0055] Support measures the frequency of application of an EER. Its support is defined as the number of data that simultaneously satisfies its premise and result, using express.
[0056] Confidence measures the strength of the correlation between the rule's premise and the result. It is defined as the proportion of rule premises that meet the rule's result. express.
[0057] In addition to support and confidence, attribute diversity and rule simplicity can also be used as objective metrics. Users can also customize personalized subjective metrics based on actual application needs.
[0058] Since the linear scoring function can achieve a good trade-off between multiple criteria, the EER ranking score is defined based on the linear scoring function by combining objective and subjective metrics.
[0059] A collection of objective and subjective measures. The ranking score of is defined as
[0060] where w f and w g is a non-negative weight associated with each metric. prefer represents the complete weight vector, which is used to represent the user's preference (i.e., the user's personal needs or the application needs shared by a group of experts). Intuitively, the larger the weight, the more important its corresponding metric is to the user. Once w preferOnce determined, the ranking score of each rule can be calculated based on the weight vector, thereby obtaining the top-k rules on the data.
[0061] Specifically, given the support threshold σ, the confidence threshold δ and the ranking score function Typical rule discovery algorithms are based on depth-first or breadth-first search to discover EER rules in relational data. For each EER result e, these methods store two predicate sets: P sel and P re . Among them, P sel What is stored is the predicate that has been selected to form the EER condition, and P re What is stored is the predicate to be selected. Initially, P sel is an empty set, P re is the set of all possible predicates. Then the rule discovery algorithm traverses the search space in a depth-first or breadth-first manner and iteratively selects P re The predicate in P is added to sel until one of the following conditions is met: (1) P re becomes an empty set; or (2)P sel →e is a valid EER, i.e. and
[0062] Essentially, this involves enumerating all possible combinations of predicates in the data and validating them one by one. For all possible predicates, any one or more of them can potentially form a valid rule with the EER result e. Therefore, to discover rules, existing methods must try all possible combinations of predicates. For rules that meet support and confidence thresholds, their ranking scores are calculated, ultimately returning the k highest-scoring rules. This brute-force approach is undoubtedly inefficient when the data scale is large.
[0063] It should be noted that, in any embodiment of the present invention, different entity enhancement rules consisting of one or more predicates may be applicable, and the embodiment of the present invention does not limit the applicable entity enhancement rules.
[0064] 1 , a method for mining entity enhancement rules provided by an embodiment of the present application is shown;
[0065] The method comprises:
[0066] S110, obtaining a data set and a target rule set; wherein the target rule set includes an enhanced rule for the top K entities with the expanded ranking scores for the data set;
[0067] S120: Determine candidate entity enhancement rules in the data set; wherein the candidate entity enhancement rules are entity enhancement rules that have not yet been expanded;
[0068] S130, determining whether the candidate entity enhancement rule satisfies at least one of the preset pruning conditions; if so, executing step S140; if not, executing step S150;
[0069] S140, terminating the expansion of the candidate entity enhancement rule;
[0070] S150: Expand the candidate entity enhancement rule.
[0071] In an embodiment of the present application, a data set and a target rule set are obtained; wherein the target rule set includes the top K entity enhancement rules with the highest ranking scores that have been expanded for the data set; candidate entity enhancement rules in the data set are determined; wherein the candidate entity enhancement rules are entity enhancement rules that have not yet been expanded; it is determined whether the candidate entity enhancement rules meet at least one of the preset pruning conditions; if so, the expansion of the candidate entity enhancement rules is terminated; if not, the candidate entity enhancement rules are expanded. The above technical solution solves the problem that in order to perform rule discovery in the prior art, all permutations and combinations of predicates need to be tried, that is, the prior art needs to complete the expansion of all entity enhancement rules before the top-k rules can be determined, resulting in low rule mining efficiency, and achieves the effect of terminating the operation and processing of invalid candidate entity enhancement rules in advance, while not having to traverse all candidate entity enhancement rules, and can also quickly obtain the required top-k rules.
[0072] Next, an entity enhancement rule mining method in this exemplary embodiment will be further described.
[0073] In one embodiment of the present invention, the specific process of "obtaining a data set and a target rule set; wherein the target rule set includes enhanced rules for the top K entities with expanded ranking scores for the data set" in step S110 can be further explained in combination with the following description.
[0074] The embodiment of the present application does not limit the method of obtaining the data set, and the data set can be read from a local storage medium or received online. In addition, the data set can also be in a dynamically updated state, that is, the data set can be data that changes regularly or irregularly.
[0075] After obtaining a dataset for entity enhancement rule mining, the search space is traversed in a predetermined manner to identify certain valid entity enhancement rules. When mining entity enhancement rules begins, a heap structure is constructed to store the K entity enhancement rules currently mined with the highest ranking scores. K is a positive integer, and its value can be set based on specific needs and is not specifically limited in this embodiment.
[0076] If the heap is empty, the mined valid entity enhancement rules are expanded, and the heap is used to record the entity enhancement rules that have been expanded and their corresponding ranking scores. That is, after a certain amount of rule mining is performed on the data set, the heap is used to store the target rule set, that is, to record a preset number (e.g., K) of entity enhancement rules that have been expanded and have the highest current ranking scores.
[0077] As described in step S120, candidate entity enhancement rules in the data set are determined; wherein the candidate entity enhancement rules are entity enhancement rules that have not been fully expanded.
[0078] When the heap has recorded K entity enhancement rules that have been expanded, if the data set is continuously processed, valid entity enhancement rules can be determined as candidate entity enhancement rules, and candidate entity enhancement rules are entity enhancement rules that have not been expanded.
[0079] In one embodiment of the present invention, whether a candidate entity enhancement rule needs to be further expanded is determined by preset pruning conditions, thereby filtering out candidate entity enhancement rules that are unlikely to become top-k rules, thereby greatly reducing the number of rules to be processed in top-k rule discovery (for example: conditional predicate expansion, ranking score calculation).
[0080] In the prior art, all valid entity enhancement rules are not screened, but are expanded and the ranking scores of all entity enhancement rules are calculated, and then the top K entity enhancement rules with the highest ranking scores, i.e., the top-k rules, are determined. However, in the embodiment of the present application, when the number of expanded entity enhancement rules stored in the heap reaches a preset number, the currently mined entity enhancement rule is first determined to be a candidate entity enhancement rule through step S120, and its ranking score is determined to be higher than the ranking score of any entity enhancement rule in the target rule set through step S130, that is, it is determined that the candidate entity enhancement rule needs to be expanded. When it is determined that the candidate entity enhancement rule meets certain conditions, the expansion of the candidate entity enhancement rule is terminated, thereby avoiding the need to expand all mined entity enhancement rules in the prior art, which affects the rule mining efficiency and wastes computing resources.
[0081] In one embodiment of the present invention, after step S150, the method includes: determining the first ranking score of the completed extended entity enhancement rule, and determining the entity enhancement rule with the smallest ranking score in the first rule set as the target ranking score; when the candidate first ranking score is greater than the target ranking score, adding the completed extended candidate entity enhancement rule to the target rule set, and deleting the entity enhancement rule corresponding to the target ranking score in the first rule set.
[0082] After expanding the candidate entity enhancement rule that needs to be expanded, first calculate the ranking score of the candidate entity enhancement rule that has completed the expansion, determine the ranking score as the first ranking score, and determine whether its ranking score is greater than the smallest ranking score of the entity enhancement rule in the target rule set, that is, the target ranking score. If the ranking score of the candidate entity enhancement rule is greater than the target ranking score, then the candidate entity enhancement rule cannot be further expanded and is one of the top-k rules. Therefore, the candidate entity enhancement rule is selected as one of the top-k rules and is updated to the target rule set. Since only a preset number of entity enhancement rules are retained in the target rule set, it is necessary to delete the entity enhancement rule corresponding to the original target ranking score.
[0083] In one embodiment of the present invention, before step 130, the method further includes: determining whether the candidate entity enhancement rule is a minimization rule; if the candidate entity enhancement rule is not a minimization rule, executing the determination of whether the candidate entity enhancement rule needs to be further expanded according to the preset pruning strategy information.
[0084] In practical applications, it is possible to first determine whether a candidate entity enhancement rule is a minimized rule. If the candidate entity enhancement rule is a minimized rule, it cannot be further expanded, and there is no need to determine whether it meets the pruning condition. If the candidate entity enhancement rule is not a minimized rule, that is, it can be expanded, step 130 is executed to determine whether the candidate entity enhancement rule needs to be expanded, thereby avoiding the need to use the pruning condition to determine all candidate entity enhancement rules, reducing data processing volume, and improving the efficiency of entity enhancement rule mining.
[0085] In one embodiment of the present invention, the method also includes: if the candidate entity enhancement rule is a minimization rule, determining the second ranking score of the candidate entity enhancement rule, and determining the entity enhancement rule with the smallest ranking score in the first rule set as the target ranking score; when the candidate third ranking score is greater than the target ranking score, adding the candidate entity enhancement rule to the target rule set, and deleting the entity enhancement rule corresponding to the target ranking score in the first rule set.
[0086] If the candidate entity enhancement rule is a minimization rule, determine whether its ranking score is greater than the lowest ranking score of the entity enhancement rules in the target rule set, i.e., the target ranking score. If the ranking score of the candidate entity enhancement rule is greater than the target ranking score, then the candidate entity enhancement rule cannot be further expanded and is one of the top-k rules. Therefore, the candidate entity enhancement rule is added to the top-k rules and is updated to the target rule set. Since only a preset number of entity enhancement rules are retained in the target rule set, the entity enhancement rule corresponding to the original target ranking score needs to be deleted.
[0087] The specific process of “determining whether the candidate entity enhancement rule satisfies at least one of the preset pruning conditions” in step S130 may be further explained in conjunction with the following description.
[0088] In one embodiment of the present invention, the pruning condition includes a rule minimization pruning condition; the candidate entity enhancement rule includes a conditional predicate set and a result predicate; step 130 includes: determining whether there is a subset of the conditional predicate set in the candidate entity enhancement rule, and the subset matches the result predicate of the candidate entity enhancement rule; if the subset exists, determining that the candidate entity enhancement rule meets the rule minimization pruning condition.
[0089] Before the X (conditional predicate) of the candidate entity enhancement rule, first check whether there is a known Let X' be a subset of X. If it exists, it means that even if the rule obtained by expanding the candidate entity enhancement rule has redundant predicates, the processing and expansion of the candidate entity enhancement rule can be skipped.
[0090] In one embodiment of the present invention, the pruning condition includes a rule anti-monotonic pruning condition; the step 130 includes: determining the support value of the candidate entity enhancement rule;
[0091] When the support value is less than a preset support threshold, the rule anti-monotonic pruning condition is determined.
[0092] EER rules are anti-monotonic, that is, the more predicates there are in X, the lower the support. So if No further To expand. Even if After the expansion is performed, the support of the obtained rule does not reach the support threshold, that is, the candidate entity enhancement rule is invalid and cannot be expanded to become a valid entity enhancement rule.
[0093] In one embodiment of the present invention, the pruning condition includes a ranking score upper bound pruning condition; the step 130 includes: determining the ranking score upper bound of the candidate entity enhancement rule, and determining the entity enhancement rule with the smallest ranking score in the first rule set as the target ranking score; when the ranking score upper bound is less than the target ranking score, determining that the candidate entity enhancement rule meets the ranking score upper bound pruning condition.
[0094] It should be noted that given Ranking metrics can be divided into three types: monotonically dispatching metrics, anti-monotonically dispatching metrics, and general metrics: (a) If adding conditional predicates to X can make the metric score monotonically increase, then the metric h is called a monotonically dispatching metric; then The upper bound of the h-metric score of is h(P0→e), where P0 is the total number of possible predicates. (b) In contrast, adding predicates to X in the anti-monotonous metric monotonically reduces the metric score. Here, The upper bound of the h-measure score is (c) If a metric does not possess the above properties, it is called a general metric. The ranking score upper bound UB is the weighted sum of all metric score upper bounds.
[0095] In the embodiment of the present invention, the ranking score (target ranking score) of the rule ranked k in the target rule set can be determined, and T k For all rules based on candidate entity enhancement and expansion, the upper bound of their ranking score can be calculated. If the upper bound of the ranking score is less than T k , then all based on The expanded rules cannot become top-k rules, so stop Extension.
[0096] By using the aforementioned rule minimization pruning conditions, rule anti-monotonicity pruning conditions, and ranking score upper bound pruning conditions to screen candidate entity enhancement rules, redundant, low-support, or low-ranking candidate entity enhancement rules are preemptively eliminated. Furthermore, the introduction of these pruning conditions allows for early termination of entity enhancement rule processing, enabling the algorithm to determine whether to terminate processing of a rule that does not meet the criteria.
[0097] Referring to Figure 2, a flow chart of an entity enhancement rule mining method provided by an embodiment of the present application is shown. In one example, the pruning conditions include: rule minimization pruning conditions, rule anti-monotonicity pruning conditions, and ranking score upper bound pruning conditions. This example is further described below:
[0098] First, a heap Σ with a maximum size of k is initialized to store the top-k entity enhancement rules (target rule set) discovered so far, sorted by ranking score. Given a result predicate e and all possible predicate sets P0, two predicate sets for discovering new EERs can be set: (1) P sel , that is, the set of predicates that have been selected to form X and (2)P re , which is the remaining predicate set in P0. Initially, P sel is an empty set, P re is P0.
[0099] The entity enhancement rule mining method provided by the embodiment of the present invention traverses the search space level by level by maintaining the queue Q, wherein at level i, it finds P sel The rules containing i predicates It iteratively starts from P re Add predicate to P sel , until (1)P re There are no more predicates in ; or (2) The EER is already minimized, because in this case, adding more predicates to Psel will not make The support of becomes larger. The ranking score (target ranking score) of the rule ranked k in the target rule set can be determined, and T k If The score is greater than T k Σ will be renew.
[0100] If the candidate entity enhances the rule If it is still not the minimum EER, go to P sel Continue to add predicates to expand it; before expansion, the pruning condition identifies whether it can terminate early. Specifically, if one of the following occurs, No need to be expanded:
[0101] (1) If there is a In Σ, such that X' is P sel There is no need to expand because It cannot be a rule of minimization;
[0102] (2) If If the support of is less than σ (support threshold), no further expansion is required. This is because the support has an anti-monotonic property, and the support of the rule obtained by further expansion cannot reach the support threshold σ;
[0103] (3) If UB <T k, where UB is from The upper bound of the sorting score of the extended rule is If the extended rule scores are not higher than the existing rule scores in Σ, then stop the process immediately. extension.
[0104] The following is a practical example to further illustrate the embodiment of the present application. Referring to FIG3 , a schematic diagram of an application example of an entity enhancement rule mining method provided by an embodiment of the present application is shown.
[0105] Assume k = 3, The third highest score in Σ is Its score is 10, that is: T k = 10. The current rule to be expanded is From P re China to P sel Add predicates to extend Become one of the top-3 rules.
[0106] Before performing the exact expansion, first calculate The extended sort score upper bound is UB. If UB <T k , then the sorting score upper bound pruning condition is met, due to the expansion of P sel If no top-3 rules are found, then the expansion stops. Assume that UB is 14, so UB>T k Then go to P sel Add predicates until the resulting EER is determined to be a minimum EER. The ranking score of is higher than some rules in Σ, Σ will be updated accordingly. As shown in Figure 3, Therefore, Σ is obtained by inserting the new Get updated, T k It was also updated to 12.
[0107] In addition, a comprehensive comparison of the efficiency of using the embodiment of the present invention and the traditional rule discovery algorithm was conducted in multiple public data. The results show that after the introduction of the pruning condition, the top-k rule discovery algorithm is 134 times faster than the traditional discovery algorithm on average. For example: on a large data set with 1,681,617 records, the solution provided by the embodiment of the present invention completed all rule discovery in only 183 seconds, while the traditional algorithm took 15,789 seconds. This fully proves that the top-k rule discovery technology based on the pruning condition of this solution can effectively reduce the invalid candidates that need to be traversed, thereby greatly improving the computational efficiency of top-k rule discovery.
[0108] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0109] 4 , an entity enhancement rule mining device provided by an embodiment of the present application is shown; specifically, it includes:
[0110] An acquisition module 401 is configured to acquire a data set and a target rule set; wherein the target rule set includes an expanded top K entity enhancement rule with a ranking score for the data set;
[0111] A candidate determination module 402 is configured to determine candidate entity enhancement rules in the data set; wherein the candidate entity enhancement rules are entity enhancement rules that have not yet been expanded;
[0112] The pruning judgment module 403 is used to judge whether the candidate entity enhancement rule meets at least one of the preset pruning conditions; if so, the termination module 404 is called; if not, the expansion module 405 is called.
[0113] The termination module 404 is configured to terminate the expansion of the candidate entity enhancement rule;
[0114] The expansion module 405 is used to expand the candidate entity enhancement rule.
[0115] In one embodiment of the present invention, the pruning condition includes a rule minimization pruning condition; the candidate entity enhancement rule includes a condition predicate set and a result predicate; the pruning judgment module 403 includes:
[0116] The rule minimization pruning submodule is used to determine whether there is a subset of the conditional predicate set in the candidate entity enhancement rule, and the subset matches the result predicate of the candidate entity enhancement rule; if the subset exists, it is determined that the candidate entity enhancement rule meets the rule minimization pruning condition.
[0117] In one embodiment of the present invention, the pruning condition includes a regular anti-monotonic pruning condition; the pruning judgment module 403 includes:
[0118] The rule anti-monotonicity pruning submodule is used to determine the support value of the candidate entity enhancement rule; when the support value is less than a preset support threshold, determine the rule anti-monotonicity pruning condition.
[0119] In one embodiment of the present invention, the pruning condition includes a sorting score upper bound pruning condition; the pruning judgment module 403 includes:
[0120] The ranking score upper bound pruning submodule is used to determine the ranking score upper bound of the candidate entity enhancement rule, and determine the entity enhancement rule with the smallest ranking score in the first rule set as the target ranking score; when the ranking score upper bound is less than the target ranking score, it is determined that the candidate entity enhancement rule meets the ranking score upper bound pruning condition.
[0121] In one embodiment of the present invention, the apparatus comprises:
[0122] A first ranking score module is configured to determine a first ranking score of the completed extended entity enhancement rule, and determine the entity enhancement rule in the first rule set with the smallest ranking score as a target ranking score;
[0123] The first update module of the target rule set is used to add the completed expanded candidate entity enhancement rule to the target rule set when the candidate first ranking score is greater than the target ranking score, and delete the entity enhancement rule corresponding to the target ranking score in the first rule set.
[0124] In one embodiment of the present invention, before determining whether the candidate entity enhancement rule needs to be further expanded according to the preset pruning strategy information, the apparatus further includes:
[0125] The minimization rule judgment module is used to judge whether the candidate entity enhancement rule is a minimization rule; if the candidate entity enhancement rule is not a minimization rule, the pruning judgment module 403 is called.
[0126] In one embodiment of the present invention, the apparatus further comprises:
[0127] a second ranking score determination module configured to determine a second ranking score of the candidate entity enhancement rule if the candidate entity enhancement rule is a minimization rule, and to determine the entity enhancement rule in the first rule set with the smallest ranking score as a target ranking score;
[0128] The second target rule set updating module is configured to add the candidate entity enhancement rule to the target rule set and delete the entity enhancement rule corresponding to the target ranking score in the first rule set when the candidate third ranking score is greater than the target ranking score.
[0129] 5 , a computer device for an entity enhancement rule mining method of the present invention is shown, which may specifically include the following:
[0130] The computer device 12 is a general-purpose computing device. The components of the computer device 12 may include but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
[0131] The bus 18 represents one or more of several types of bus 18 structures, including a memory bus 18 or memory controller, a peripheral bus 18, an accelerated graphics port, a processor, or a local bus 18 that utilizes any of a variety of bus 18 architectures. Examples of such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus 18, a Micro Channel Architecture (MAC) bus 18, an Enhanced ISA bus 18, an Audio Video Electronics Standards Association (VESA) local bus 18, and a Peripheral Component Interconnect (PCI) bus 18.
[0132] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0133] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be configured to read and write to non-removable, non-volatile magnetic media (commonly referred to as a "hard drive"). Although not shown in FIG. 5 , a magnetic disk drive may be provided for reading and writing to a removable non-volatile magnetic disk (e.g., a "floppy disk"), as well as an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media). In these cases, each drive may be connected to bus 18 via one or more data media interfaces. The memory may include at least one program product having a set (e.g., at least one) of program modules 42 configured to perform the functions of various embodiments of the present invention.
[0134] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in a memory. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules 42, and program data, each of which, or some combination thereof, may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0135] The computer device 12 can also communicate with one or more external devices 14 (e.g., a keyboard, pointing device, display 24, camera, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication can occur via an input / output (I / O) interface 22. Furthermore, the computer device 12 can communicate with one or more networks (e.g., a local area network (LAN)), a wide area network (WAN), and / or a public network (e.g., the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with the other modules of the computer device 12 via a bus 18. It should be understood that, although not shown in FIG. 5 , other hardware and / or software modules can be used in conjunction with the computer device 12, including but not limited to microcode, device drivers, redundant processing units 16, external disk drive arrays, RAID systems, tape drives, and data backup storage systems 34.
[0136] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the entity enhancement rule mining method provided by the embodiment of the present invention.
[0137] That is, when the processing unit 16 executes the program, it implements: obtaining a data set and a target rule set; wherein the target rule set includes the top K entity enhancement rules with the expanded ranking scores for the data set; determining the candidate entity enhancement rules in the data set; wherein the candidate entity enhancement rules are entity enhancement rules that have not been fully expanded; judging whether the candidate entity enhancement rules meet at least one of the preset pruning conditions; if so, terminating the expansion of the candidate entity enhancement rules; if not, expanding the candidate entity enhancement rules.
[0138] In an embodiment of the present invention, the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the entity enhancement rule mining method provided in all embodiments of the present application:
[0139] That is, when the program is executed by the processor, it implements: obtaining a data set and a target rule set; wherein the target rule set includes the top K entity enhancement rules with the expanded ranking scores for the data set; determining the candidate entity enhancement rules in the data set; wherein the candidate entity enhancement rules are entity enhancement rules that have not been fully expanded; judging whether the candidate entity enhancement rules meet at least one of the preset pruning conditions; if so, terminating the expansion of the candidate entity enhancement rules; if not, expanding the candidate entity enhancement rules.
[0140] Any combination of one or more computer-readable media may be used. A computer-readable medium may be a computer signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0141] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0142] The computer program code for performing the operations of the present invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referenced to each other.
[0143] Although preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they become aware of the basic inventive concepts. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present invention.
[0144] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or terminal device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or terminal device that includes the element.
[0145] The above is a detailed introduction to the entity enhancement rule mining method, device, computer equipment and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core ideas. At the same time, for general technical personnel in this field, based on the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for entity-enhanced rule mining, It is characterized in that include: Acquire a data set and a target rule set; wherein the target rule set includes the top K entities with the expanded ranking scores for the data set; Determining candidate entity enhancement rules in the data set; wherein the candidate entity enhancement rules are entity enhancement rules that have not been fully expanded; Determining whether the candidate entity enhancement rule satisfies at least one of the preset pruning conditions; If so, the expansion of the candidate entity enhancement rule is terminated; if not, the candidate entity enhancement rule is expanded.
2. The method according to claim 1, It is characterized in that The pruning condition includes a rule minimization pruning condition; the candidate entity enhancement rule includes a condition predicate set and a result predicate; and the judging whether the candidate entity enhancement rule satisfies at least one of the preset pruning conditions includes: Determine whether there is a subset of the conditional predicate set in the candidate entity enhancement rule, and the subset matches the result predicate of the candidate entity enhancement rule; If the subset exists, it is determined that the candidate entity enhancement rule satisfies the rule minimization pruning condition.
3. The method according to claim 1, It is characterized in that The pruning conditions include regular anti-monotonic pruning conditions; The determining whether the candidate entity enhancement rule satisfies at least one of the preset pruning conditions comprises: Determining the support value of the candidate entity enhancement rule; When the support value is less than a preset support threshold, the rule anti-monotonicity pruning condition is determined.
4. The method according to claim 1, It is characterized in that The pruning condition includes a ranking score upper limit pruning condition; the judging whether the candidate entity enhancement rule satisfies at least one of the preset pruning conditions includes: Determine an upper bound of the ranking scores of the candidate entity enhancement rules, and determine the entity enhancement rule in the first rule set with the smallest ranking score as a target ranking score; When the ranking score upper bound is less than the target ranking score, it is determined that the candidate entity enhancement rule satisfies the ranking score upper bound pruning condition.
5. The method according to any one of claims 1 to 4, It is characterized in that After continuing to expand the candidate entity enhancement rule, the method includes: Determine a first ranking score of the completed extended entity enhancement rule, and determine the entity enhancement rule in the first rule set with the smallest ranking score as a target ranking score; When the candidate first ranking score is greater than the target ranking score, the completed expanded candidate entity enhancement rule is added to the target rule set, and the entity enhancement rule corresponding to the target ranking score in the first rule set is deleted.
6. The method according to any one of claims 1 to 4, It is characterized in that Before determining whether it is necessary to continue to expand the candidate entity enhancement rule according to the preset pruning strategy information, the method further includes: Determining whether the candidate entity enhancement rule is a minimization rule; If the candidate entity enhancement rule is not a minimization rule, the step of determining whether the candidate entity enhancement rule needs to be further expanded according to the preset pruning strategy information is executed.
7. The method according to claim 6, It is characterized in that The method further comprises: If the candidate entity enhancement rule is a minimization rule, determining a second ranking score of the candidate entity enhancement rule, and determining the entity enhancement rule with the smallest ranking score in the first rule set as a target ranking score; When the candidate third ranking score is greater than the target ranking score, the candidate entity enhancement rule is added to the target rule set, and the entity enhancement rule corresponding to the target ranking score in the first rule set is deleted.
8. An entity enhancement rule mining device, It is characterized in that include: An acquisition module, used to acquire a data set and a target rule set; wherein the target rule set includes enhanced rules for the top K entities with the expanded ranking scores for the data set; A candidate determination module, used to determine candidate entity enhancement rules in the data set; wherein the candidate entity enhancement rules are entity enhancement rules that have not been fully expanded; The pruning judgment module is used to judge whether the candidate entity enhancement rule meets at least one of the preset pruning conditions; if so, the termination module is called, and if not, the extension module is called. The termination module is used to terminate the expansion of the candidate entity enhancement rule; The expansion module is used to expand the candidate entity enhancement rule.
9. A computer device, It is characterized in that The method comprises a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program implements the method according to any one of claims 1 to 7 when executed by the processor.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Rule dynamic expansion method and system
CN109858906A
Method for discovering association rule from time sequence diagram of event and electronic equipment
CN114330719A
Data processing method and device based on relational data
CN115033650A
Data classification method of association rule based on decision tree pruning enhancement
CN115495497A
Method and system for extracting correlation rule including negative item
JP2002278761A
Cited By
Rule mining method and device for interpretation of recommendation model, equipment and medium
CN119761494A
