Sample labeling method, rule correlation measurement method, device, equipment and medium

By using the detection results of rule pairs in the rule correlation measurement to form rule samples, and processing the association relationship data through predicate vectorization, the problem of user labeling is solved, and the problem of ignoring associations is improved. accuracy.

CN118779659BActive Publication Date: 2025-02-07SHENZHEN INST OF COMPUTING SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410999366.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2025-02-07
Estimated Expiration
2044-07-24

AI Technical Summary

Technical Problem

In the prior art, in the rule correlation measurement, the user annotation process is time-consuming and labor-intensive, and the model ignores the correlation between the relational data and the rules during the vector initialization stage, resulting in inaccurate correlation scores.

Method used

By obtaining the rule set of relational data and cleaning relational data, the rules extract the rules to detect the cleaning data, determine the correlation of the rule pair based on the detection results to form a rule sample, and consider the relationship data and rules in model training through predicate vectorization processing. Related.

Benefits of technology

It reduces the participation cost of user data annotation and improves the quality of labeling, and enhances the accuracy of the rule correlation measurement model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779659B_ABST
    Figure CN118779659B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of big data technology, and in particular, relates to a sample annotation method, a rule relevance measurement method, an apparatus, a device and a medium. The sample annotation method obtains a rule set and cleaned relational data, extracts rule pairs from the rule set, uses the rule pairs to detect the cleaned relational data, obtains the detection results, determines the relevance of the rule pairs based on the detection results, and associates the relevance with the rule pairs as a label to form a rule sample. The rule relevance measurement method obtains a predicate vector set obtained by graph vectorizing the relational graph data constructed by all predicates in the relational data, obtains a vectorized rule sample based on the predicate vector set, trains a preset measurement model based on the vectorized rule sample, obtains a trained target measurement model, obtains a target rule, and obtains a relevance score value of the target rule based on the target measurement model. The accuracy of the rule relevance measurement is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application is applicable to the field of big data technology, and in particular relates to a sample annotation method, a rule correlation measurement method, an apparatus, a device and a medium. Background Art

[0002] In the field of data mining, traditional rule discovery methods often generate a large number of rules, which requires users to spend extra effort to filter out the rules they are interested in. Therefore, in order to improve the user experience, the relevance of rules is measured according to certain strategies, and the k rules with the highest relevance are widely studied. One method designs a model to measure the relevance of rules. The model collects users' preference annotations for each pair of rules through user interaction, and uses this as training data to train the model. However, this method has some limitations. First, the process of users directly labeling each pair of rules is not only time-consuming and labor-intensive, but also costly. In addition, when faced with rules with high similarity, users often find it difficult to make a clear choice, which affects the efficiency and accuracy of user interaction. Secondly, in the model training process, in the vector initialization stage of converting rule text into feature vectors, existing methods often directly use natural language processing models for vectorization processing, ignoring the potential impact of vector initialization on the performance of machine learning models, which may lead to inaccurate relevance scores predicted by the model. Therefore, how to improve the accuracy of rule relevance measurement has become an urgent problem to be solved. Summary of the invention

[0003] In view of this, embodiments of the present application provide a sample labeling method, a rule relevance measurement method, an apparatus, a device and a medium to solve the problem of how to improve the accuracy of rule relevance measurement.

[0004] In a first aspect, an embodiment of the present application provides a sample labeling method of a rule correlation measurement model, the sample labeling method comprising:

[0005] Acquire a rule set obtained by performing rule discovery on the relational data and cleansed relational data obtained by a user by cleaning the relational data;

[0006] Extracting a rule pair from the rule set, and using the rule pair to detect the cleaning relationship data to obtain a detection result;

[0007] According to the detection result, the correlation of the rule pair is determined, and the correlation is used as a label to associate with the rule pair to form a rule sample, and the rule sample is used to train the rule correlation measurement model.

[0008] In a second aspect, an embodiment of the present application provides a rule relevance measurement method. After obtaining a rule sample by adopting the sample labeling method of the rule relevance measurement model of the first aspect, the rule relevance measurement method includes:

[0009] Obtaining a predicate vector set obtained by graph vectorizing the relational graph data constructed by all predicates in the relational data;

[0010] According to the predicate vector set, the predicates in the rule sample are vectorized to obtain a vectorized rule sample;

[0011] According to the vectorized rule samples, a preset measurement model is trained to obtain a trained target measurement model;

[0012] A target rule whose relevance is to be measured is obtained, and the target rule is input into the target measurement model to obtain a relevance score value of the target rule.

[0013] In a third aspect, an embodiment of the present application provides a sample labeling device for a rule correlation measurement model, the sample labeling device comprising:

[0014] A first acquisition module is used to acquire a rule set obtained by performing rule discovery on the relationship data and cleansed relationship data obtained by a user by cleaning the relationship data;

[0015] A detection module, used to extract a rule pair from the rule set, and use the rule pair to detect the cleaning relationship data to obtain a detection result;

[0016] The association module is used to determine the correlation of the rule pair according to the detection result, and associate the correlation with the rule pair as a label to form a rule sample, and the rule sample is used to train the rule correlation measurement model.

[0017] In a fourth aspect, an embodiment of the present application provides a rule relevance measurement device. After obtaining a rule sample by adopting the sample labeling method of the rule relevance measurement model of the first aspect, the rule relevance measurement device includes:

[0018] A second acquisition module is used to acquire a predicate vector set obtained by graph vectorizing the relationship graph data constructed by all predicates in the relationship data;

[0019] A vectorization module, used for vectorizing the predicates in the rule sample according to the predicate vector set to obtain a vectorized rule sample;

[0020] A training module, used to train a preset measurement model according to the vectorized rule samples to obtain a trained target measurement model;

[0021] The measurement module is used to obtain the target rule whose relevance is to be measured, input the target rule into the target measurement model, and obtain the relevance score value of the target rule.

[0022] In a fifth aspect, an embodiment of the present application provides a computer device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the sample labeling method of the rule relevance measurement model as described in the first aspect, or the rule relevance measurement method as described in the second aspect is implemented.

[0023] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the sample labeling method of the rule relevance measurement model as described in the first aspect, or the rule relevance measurement method as described in the second aspect is implemented.

[0024] Compared with the prior art, the beneficial effects of the embodiments of the present application are as follows: the sample annotation method of the present application obtains a rule set obtained by rule discovery of relational data and cleaned relational data obtained by the user through cleaning of relational data, extracts rule pairs from the rule set, uses the rule pairs to detect the cleaned relational data, determines the relevance of the rule pairs based on the detection results, and associates the relevance with the rule pairs as a label to form a rule sample, which is used to train the rule relevance measurement model. Among them, by annotating the rule pairs to obtain rule samples based on the cleaned relational data obtained by the user through cleaning of relational data, it helps the model learn the user's prior knowledge, and the user only needs to participate in the annotation process through preliminary data cleaning, and the remaining annotation work is automatically completed according to the detection results, which reduces the user's participation cost in data annotation while also improving the quality of data annotation, so that the model is trained with the annotated rule samples, and the accuracy of the model's measurement of rule relevance is also improved.

[0025] In addition, the rule relevance measurement method of the present application obtains a predicate vector set obtained by graph vectorization of the relational graph data constructed by all predicates in the relational data, and vectorizes the predicates in the rule sample according to the predicate vector set to obtain a vectorized rule sample, and trains the preset measurement model according to the vectorized rule sample to obtain a target measurement model, obtains the target rule whose relevance is to be measured, and inputs the target rule into the target measurement model to obtain the relevance score value of the target rule. Among them, by vectorizing the predicates in the rule sample according to the predicate vector set to obtain a vectorized rule sample, the association between the relational data and the rules is considered in the vector initialization stage of the rule sample, and a vectorized rule sample closely related to the relational data is obtained. On the basis of incorporating the user's prior knowledge, the relevance between the vectorized rule sample and the relational data is increased, so that the model training is performed with the vectorized rule sample, and the accuracy of the model in measuring the relevance of the rules is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0027] Figure 1 It is a schematic diagram of an application environment of a sample labeling method of a rule correlation measurement model and a rule correlation measurement method provided in the first embodiment of the present application;

[0028] Figure 2 It is a flow chart of a sample labeling method of a rule correlation measurement model provided in the second embodiment of the present application;

[0029] Figure 3 It is an overall schematic diagram of a sample labeling method and a rule relevance measurement method of a rule relevance measurement model provided in the second embodiment of the present application;

[0030] Figure 4 It is a flowchart of a sample labeling method of a rule correlation measurement model provided in Example 3 of the present application;

[0031] Figure 5 It is a flowchart of a sample labeling method of a rule correlation measurement model provided in Embodiment 4 of the present application;

[0032] Figure 6 This is a flowchart of a rule correlation measurement method provided in Example 5 of the present application;

[0033] Figure 7 This is a flowchart of a rule correlation measurement method provided in Example 6 of the present application;

[0034] Figure 8 This is a flow chart of a rule correlation measurement method provided in Embodiment 7 of the present application;

[0035] Fig. 9 It is a structural schematic diagram of a sample labeling device of a rule correlation measurement model provided in Embodiment 8 of the present application;

[0036] Fig.10 It is a structural diagram of a rule correlation measurement device provided in Embodiment 9 of the present application;

[0037] Fig.11 It is a structural diagram of a computer device provided in Example 10 of the present application. DETAILED DESCRIPTION

[0038] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0039] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0040] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0041] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0042] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0043] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0044] The embodiments of the present 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 knowledge to obtain the best results.

[0045] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0046] It should be understood that the size of the serial numbers of the steps in the following embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0047] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.

[0048] A sample labeling method and a rule relevance measurement method of a rule relevance measurement model provided in the first embodiment of the present application can be applied in the following aspects: Figure 1In the application environment, the server communicates with the client, the server provides sample annotation services and rule relevance measurement services, and the client triggers sample annotation tasks and rule relevance measurement tasks to the server. The client includes but is not limited to PDAs, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, personal digital assistants (PDAs), and other devices. The computer device corresponding to the server can be implemented with an independent server or a server cluster consisting of multiple servers.

[0049] See also Figure 2 , is a flow chart of a sample labeling method of a rule correlation measurement model provided in Example 2 of the present application. The sample labeling method is applied to Figure 1 The server in the example connects to the client to obtain the rule set and cleansing relationship data sent by the client. Figure 2 As shown, the sample labeling method may include the following steps:

[0050] Step S201 , obtaining a rule set obtained by performing rule discovery on relationship data and cleansed relationship data obtained by a user by cleaning the relationship data.

[0051] In the embodiments of the present application, traditional rule discovery methods often generate a large number of rules, so that users need to spend extra effort to filter out the rules they are interested in. Therefore, it has been widely studied to measure the relevance of rules according to certain strategies and filter out the k rules with the highest relevance to user needs. Among them, the k rules with the highest relevance to user needs can be filtered out by training a machine learning model. The rule relevance measurement model is a machine learning model that can filter out the k rules with the highest relevance to user needs.

[0052] Relational data may refer to text-type data in a table structure. Relational data includes tuples of multiple record data information. Each tuple consists of a single or multiple attributes and corresponding attribute values. Attributes may refer to variables or fields that describe the characteristics of the tuple. Attribute values ​​may refer to specific numerical values ​​of the corresponding attributes. Cleaned relational data may refer to relational data obtained by cleaning relational data based on the user's prior knowledge. For example, the cleaning operation may include redundant deletion, modification and correction, and null value filling. Rule discovery may refer to a process for discovering associations between tuples in relational data. A rule set may refer to a collection of rules obtained by performing rule discovery on relational data.

[0053] For example, the rules obtained by rule discovery for relational data can be recorded as: in, is the rule, X is the condition of the rule, p 0 is the result of a rule. For example, the rule could be, Person(t)∧Person(s)∧t.zipcode=s.zipcode→t.province=s.province, where the condition of the rule is Person(t)∧Person(s)∧t.zipcode=s.zipcode, one of the variable predicates in the condition of the rule is t.zipcode=s.zipcode, the result of the rule is t.province=s.province, and one of the variable predicates in the result of the rule is t.province=s.province. This rule can be expressed in a data set (Person). If the zip codes (zipcode) of two people t and s are equal, it can be inferred that their provinces (province) are the same.

[0054] Step S202: extract a rule pair from the rule set, use the rule pair to detect the cleansing relationship data, and obtain a detection result.

[0055] In the embodiment of the present application, a rule pair may refer to a combination of any two rules extracted from a rule set, and the rule pair may be recorded as in, and For any two rules in the rule set, the detection result may refer to the result obtained by using the rule pair to detect the cleansing relational data.

[0056] Specifically, a preset number of rule pairs may be extracted from the rule set, and for any rule pair, the rule pair may be applied to the cleaning relationship data, and error detection may be performed on the cleaning relationship data to obtain an error detection result of the rule pair.

[0057] Step S203: determine the correlation of the rule pair according to the detection result, and associate the correlation with the rule pair as a label to form a rule sample.

[0058] In the embodiment of the present application, the correlation may refer to a value reflecting the correlation between the two rules in the rule pair and the user needs, the label may refer to the correlation between the two rules in the rule pair and the user needs, and the rule sample may refer to a training sample for training the rule correlation measurement model, including the rule pair and the associated correlation label. The rule sample can be recorded as Represents a rule pair and binary classification relevance label l.

[0059] Specifically, the numerical value of the correlation between the two rules in the rule pair and the user demand can be determined according to the error detection result of the rule pair, and the numerical value is used as the correlation of the rule pair. The correlation is used as a label to associate with the rule pair to form a rule sample.

[0060] See also Figure 3 , is a schematic diagram of a sample labeling method and a rule relevance measurement method of a rule relevance measurement model provided in the second embodiment of the present application. Figure 3 As shown, the overall process of the sample labeling method and the rule correlation measurement method can be: 1) randomly sampling the initial data to obtain relational data with a small amount of data, performing rule discovery on the relational data to obtain a rule set, and the user cleans the relational data to obtain cleaned relational data; 2) extracting a preset number of rule pairs from the rule set, and for any extracted rule pair, applying each rule in the rule pair to the cleaned relational data, performing error detection on the cleaned relational data to obtain the number of errors detected by each rule, determining the correlation of the rule pair based on the number of errors detected by each rule, and labeling the rule pairs with the correlation as a label. Note, to obtain rule samples; 3) According to the tuples in the relational data, attribute values ​​and the predicates satisfied between any two tuples, the relational graph data is constructed, and the relational graph data is graph-vectorized to obtain the predicate vector set; 4) In the preprocessing process of the preset measurement model vector initialization, for any rule sample, according to the predicate vector set, the predicates in the rule sample are vectorized to obtain the vectorized rule sample, and according to the vectorized rule sample, the preset measurement model is trained to obtain the trained target measurement model; 5) The target rule whose correlation is to be measured is input into the target measurement model, and the correlation score value of the target rule is output.

[0061] In the embodiment of the present application, rule pairs are labeled to obtain rule samples based on cleaned relational data obtained by cleaning relational data by the user, which helps the model learn the user's prior knowledge, and the user only needs to participate in the labeling process through preliminary data cleaning. The remaining labeling work is automatically completed according to the detection results. While reducing the user's participation cost in data labeling, the quality of data labeling is also improved, so that the model is trained with the labeled rule samples, which also improves the accuracy of the model's measurement of rule relevance.

[0062] See also Figure 4 , is a flow chart of a sample labeling method of a rule correlation measurement model provided in Example 3 of the present application. Figure 4 As shown, in the above step S202, the rule pair is used to detect the cleansing relationship data to obtain the detection result, which may include the following steps:

[0063] Step S401 : for any rule in the rule pair, use the rule to perform error detection on the cleansed relational data to obtain the number of errors detected by the rule.

[0064] Step S402, obtaining a detection result according to the number of errors detected by each rule in the rule pair.

[0065] For example, for the rule Use respectively and Perform error detection on the cleansed relational data and obtain The number of errors detected and The number of errors detected, based on The number of errors detected and The number of errors detected, and the detection results are obtained.

[0066] In the embodiment of the present application, by using each rule in the rule pair, error detection is performed on the cleansing relation data, the number of errors detected by each rule is obtained, and the detection result is obtained according to the number of errors detected by each rule. The detection of the error detection ability of the rule is automatically realized, the user's participation cost is reduced, and it is more user-friendly.

[0067] See 5, which is a flow chart of a sample labeling method of a rule correlation measurement model provided in the fourth embodiment of the present application. Figure 5 As shown, in the above step S203, the correlation of the rule pair is determined according to the detection result, and the correlation is used as a label to associate with the rule pair to form a rule sample, which may include the following steps:

[0068] Step S501, compare the first error number detected by the first rule in the rule pair with the second error number detected by the second rule in the rule pair. If the first error number is greater than the second error number, determine that the correlation of the rule pair is a first value, and associate the first value with the rule pair as a label to form a rule sample.

[0069] Step S502: If the first error number is less than the second error number, determine that the correlation of the rule pair is a second value, and associate the second value with the rule pair as a label to form a rule sample.

[0070] In the embodiment of the present application, the first rule may refer to any rule in the rule pair, the second rule may refer to another rule in the rule pair except the first rule, the first error number may refer to the error number detected by the first rule, and the second error number may refer to the error number detected by the second rule, wherein the rule with a larger number of detected errors is more valuable to the user, that is, the rule with a larger number of detected errors is more relevant to the user's needs. The first value may refer to the correlation value of the rule pair determined based on the first error number being greater than the second error number, for example, the first value may be 1, and the second value may refer to the correlation value of the rule pair determined based on the first error number being less than the second error number, for example, the second value may be 0.

[0071] For example, for the rule The first rule is The second rule is like The number of errors detected is greater than The number of errors detected, describing The relevance to user needs is higher than The degree of relevance to user needs determines the The relevance is the first value 1, which is the value of The label is marked as 1, and the label 1 is matched with the rule Association, forming a rule sample like The number of errors detected is less than The number of errors detected indicates The relevance to user needs is higher than The degree of relevance to user needs determines the The relevance is the second value 0, which is the value of the rule The label is marked as 0, and the label 0 is matched with the rule Association, forming a rule sample

[0072] The embodiment of the present application automatically realizes the comparison of the error-checking capabilities of two rules in a rule pair, determines the relevance of the rule pair based on the comparison result, and associates the rule pair with the relevance as a label to form a rule sample, thereby reducing the user's participation cost, improving the efficiency of data labeling, and ensuring the quality of data labeling, so as to train the model with the labeled rule sample, and also improve the accuracy of the model's measurement of rule relevance.

[0073] See also Figure 6 , is a flow chart of a rule relevance measurement method provided in Example 5 of the present application. The rule relevance measurement method is applied to Figure 1The server in the example connects to the client to obtain the predicate vector set and target rule pair sent by the client. Figure 6 As shown, after obtaining the rule sample by adopting the sample labeling method of the rule relevance measurement model, the rule relevance measurement method may include the following steps:

[0074] Step S601, obtaining a predicate vector set obtained by graph vectorizing the relationship graph data constructed by all predicates in the relationship data.

[0075] Step S602: vectorize the predicates in the rule sample according to the predicate vector set to obtain a vectorized rule sample.

[0076] In an embodiment of the present application, a predicate may refer to a relationship satisfied between tuples in relational data, relational graph data may refer to relational data of a graph structure, a predicate vector may refer to a vector representation of a predicate in relational graph data obtained by vectorizing the relational graph data, wherein the predicate vector integrates features of nodes and edges in the relational graph data, and a predicate vector set may refer to a set of predicate vectors.

[0077] Specifically, in the preprocessing process of initializing the preset metric model vector, a predicate vector set is obtained by graph vectorizing the relational graph data constructed by all predicates in the relational data. For any rule in the rule sample, each predicate in the rule is vectorized according to the predicate vector set to obtain a vectorized rule. Based on the vectorized rules in the rule sample, a vectorized rule sample is obtained.

[0078] Step S603: training a preset measurement model according to the vectorized regular samples to obtain a trained target measurement model.

[0079] In the embodiment of the present application, the preset measurement model may refer to a pre-set lightweight model, and the target measurement model may refer to a model that has been trained for rule relevance measurement based on rule samples.

[0080] The specific form of the target measurement model completed by the training can be:

[0081]

[0082] in, is the target measurement model, b light and UB L are variables that can be learned during model training. For rules The vector representation of .

[0083] Specifically, the training of the target measurement model adopts the idea of ​​pairwise sorting, and the format of the training rule sample is Represents a rule pair And the binary correlation label l, if l is the first value 1, it means The relevance to user needs is higher than The degree of relevance to user needs. If l is the second value 0, it means The relevance to user needs is higher than The degree of relevance to user needs is calculated for each rule pair in the rule sample. During the training process, the rules are calculated separately using twin neural networks with shared parameters. and rules The score is calculated, and the calculated score difference and label l are used as the input of the cross entropy loss function to train the preset measurement model to obtain the trained target measurement model.

[0084] Step S604, obtaining a target rule whose relevance is to be measured, inputting the target rule into a target measurement model, and obtaining a relevance score value of the target rule.

[0085] In the embodiment of the present application, the target rule may refer to the rule whose correlation with the user demand is to be measured, and the correlation score value may refer to the value of the target measurement model prediction output that characterizes the correlation between the target rule and the user demand.

[0086] Specifically, a target rule is obtained, and the predicates in the target rule are vectorized according to the predicate vector set to obtain a vectorized target rule. The vectorized target rule is input into a target measurement model, and a relevance score value of the target rule is output.

[0087] Optionally, a natural language processing model may be used, for example, a bidirectional encoder based on Transformer (Bidirectional Encoder Representations from Transformers, Bert) to vectorize the target rules to obtain vectorized target rules, which are then input into a target measurement model to output a relevance score value of the target rules.

[0088] For example, if the target rule is The target rule The target measurement model is input, and the relevance score value of the obtained target rule may be 85%.

[0089] In the embodiment of the present application, predicates in a rule sample are vectorized according to a predicate vector set to obtain a vectorized rule sample, so that in the vector initialization stage of the rule sample, the association between the relational data and the rules is taken into account, and a vectorized rule sample closely related to the relational data is obtained. On the basis of incorporating the user's prior knowledge, the correlation between the vectorized rule sample and the relational data is increased, so that the model is trained with the vectorized rule sample, thereby improving the accuracy of the model's measurement of rule correlation.

[0090] See also Figure 7 , is a flow chart of a rule relevance measurement method provided in Example 6 of the present application. Figure 7 As shown, in the above step S602, according to the predicate vector set, the predicates in the rule sample are vectorized to obtain the vectorized rule sample, which may include the following steps:

[0091] Step S701 : for any rule in the rule sample, vectorize each target predicate in the rule according to the predicate vector set to obtain a target predicate vector of each target predicate in the rule.

[0092] Step S702: determine the target predicate vector corresponding to the rule condition in the rule, perform linear transformation on the target predicate vector corresponding to the rule condition, and obtain the condition vector of the rule condition.

[0093] Step S703: Taking the target predicate vector corresponding to the rule result in the rule as the result vector of the rule result, the condition vector and the result vector are concatenated to obtain the rule vector of the rule.

[0094] Step S704: obtaining a vectorized rule sample according to the rule vector of each rule in the rule sample.

[0095] In an embodiment of the present application, the target predicate may refer to the predicate in each rule in the rule sample, the target predicate vector may refer to the vector form of the target predicate, the condition vector may refer to the vector form of the rule condition, the result vector may refer to the vector form of the rule result, and the rule vector may refer to the vector form of the rule.

[0096] Specifically, for each rule in the rule sample According to the predicate vector set, each target predicate in the rule is vectorized to obtain the target predicate vector of each target predicate, thereby obtaining the target predicate vector E of all target predicates in the rule. p =p∈X∪{p 0}, determine the target predicate vector corresponding to the rule condition in the rule, perform linear transformation on the target predicate vector corresponding to the rule condition, and the condition vector of the obtained rule condition can be expressed as E X =ρ(∑p∈X φ(Ep)), where ρ and φ are two linear layers without activation functions. The result vector of the rule result can be expressed as E p0 , then concatenate the condition vector and the result vector to obtain the rule vector, which can be expressed as Thus, according to the rule vector of each rule in the rule sample, a vectorized rule sample is obtained.

[0097] In the embodiment of the present application, the rules in the rule sample are vectorized according to the predicate vector set, so that in the vector initialization stage of the rule sample, the association between the relational data and the rules is taken into account, and a vectorized rule sample closely related to the relational data is obtained. On the basis of incorporating the user's prior knowledge, the correlation between the vectorized rule sample and the relational data is increased, so that the model is trained with the vectorized rule sample, thereby improving the accuracy of the model's measurement of rule correlation.

[0098] See also Figure 8 , is a flow chart of a rule relevance measurement method provided in Example 7 of the present application. Figure 8 As shown, the rule relevance measurement method may also include the following steps:

[0099] Step S801, determining tuples in the relational data and corresponding attribute values, and determining predicates satisfied by any two tuples in the relational data.

[0100] Step S802, constructing relationship graph data according to tuples, attribute values ​​and predicates satisfied by any two tuples.

[0101] Step S803: input the relationship graph data into a preset graph vectorization model to obtain a predicate vector set.

[0102] In an embodiment of the present application, the preset graph vector model may refer to a pre-set model for graph vectorizing relationship graph data.

[0103] Specifically, the tuples and corresponding attribute values ​​in the relational data are determined, as well as the predicates satisfied by any two tuples in the relational data. The tuples and attribute values ​​in the relational data are used as nodes, and the relationships between tuples and attribute values ​​and the relationships satisfied between tuples are used as edges. The relational graph data is constructed, and the constructed relational graph data is input into a preset graph quantization model. After being processed by the model, a predicate vector set is output, in which each predicate vector in the predicate vector set integrates the features of the nodes and edges in the relational graph data.

[0104] Optionally, the relational data may be input into a graph vectorization tool to obtain a predicate vector set. For example, the graph vectorization tool may be PyTorch-BigGraph.

[0105] The constructed relationship graph data can be recorded as G = (V, E, L), where V represents a node set, including tuples and corresponding attribute values. Represents a set of edges. The edge form can be e=(v,l,v'), which means that there is an edge of type l between node v and node v' in graph G. The relationship graph data includes two types of edges: 1) The first type of edge can be represented as (t,A,c), which means that the attribute value of attribute A of tuple t is c, that is, the attribute edge of the tuple; 2) The second type of edge can be represented as (t,p,s), which means that tuple t and tuple s satisfy the predicate p, that is, the predicate edge satisfied between tuples.

[0106] The embodiment of the present application constructs relational graph data according to tuples, attribute values ​​and predicates satisfied by any two tuples in relational data, which not only clearly represents the relationship between tuples and predicates, but also provides structured input for the vectorization of rule samples, so that the vectorization of rule samples can accurately capture and utilize the intrinsic connection of relational data, increase the correlation between the vectorized rule samples and the relational data, and thus perform model training with the vectorized rule samples, thereby improving the accuracy of the model's measurement of rule correlation.

[0107] Corresponding to the sample labeling method of the rule relevance measurement model in the above embodiment, Fig. 9 The structural block diagram of the sample labeling device of the rule correlation measurement model provided in the eighth embodiment of the present application is shown. The sample labeling device of the rule correlation measurement model is applied to Figure 1 The server in the embodiment of the present invention is connected to the client to obtain the rule set and cleaning relationship data sent by the client. For the convenience of explanation, only the part related to the embodiment of the present application is shown.

[0108] See also Fig. 9 , the sample annotation device comprises:

[0109] A first acquisition module 91 is used to acquire a rule set obtained by performing rule discovery on the relationship data and cleansed relationship data obtained by a user by cleaning the relationship data;

[0110] A detection module 92, configured to extract a rule pair from the rule set, and use the rule pair to detect the cleaning relationship data to obtain a detection result;

[0111] The association module 93 is used to determine the correlation of the rule pair according to the detection result, and associate the correlation with the rule pair as a label to form a rule sample, and the rule sample is used to train the rule correlation measurement model.

[0112] Optionally, the detection module 92 includes:

[0113] an error detection unit, configured to perform error detection on the cleaning relationship data using any rule in the rule pair, and obtain the number of errors detected by the rule;

[0114] The first determining unit is used to obtain the detection result according to the number of errors detected by each rule in the rule pair.

[0115] Optionally, the association module 93 includes:

[0116] a second determining unit, configured to compare the number of first errors detected by the first rule in the rule pair with the number of second errors detected by the second rule in the rule pair, and if the first number of errors is greater than the second number of errors, determine that the correlation of the rule pair is a first value, and associate the first value as a label with the rule pair to form the rule sample;

[0117] The third determining unit is configured to determine that the correlation of the rule pair is a second value if the first error number is smaller than the second error number, and associate the second value as a label with the rule pair to form the rule sample.

[0118] It should be noted that the information interaction, execution process and other contents between the above-mentioned modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0119] Corresponding to the rule relevance measurement method in the above embodiment, Fig.10 The structure block diagram of the rule correlation measurement device provided in the ninth embodiment of the present application is shown. The rule correlation measurement device is applied to Figure 1 The server in the embodiment of the present invention is connected to the client to obtain the predicate vector set and the target rule pair sent by the client. For the convenience of explanation, only the part related to the embodiment of the present application is shown.

[0120] See also Fig.10 , the rule relevance measurement device comprises:

[0121] The second acquisition module 1001 is used to obtain a predicate vector set obtained by graph vectorizing the relationship graph data constructed by all predicates in the relationship data;

[0122] A vectorization module 1002, configured to vectorize the predicates in the rule sample according to the predicate vector set to obtain a vectorized rule sample;

[0123] A training module 1003 is used to train a preset measurement model according to the vectorized rule samples to obtain a trained target measurement model;

[0124] The measurement module 1004 is used to obtain the target rule whose relevance is to be measured, input the target rule into the target measurement model, and obtain the relevance score value of the target rule.

[0125] Optionally, the vectorization module 1002 includes:

[0126] a predicate vectorization unit, configured to vectorize each target predicate in any rule in the rule sample according to the predicate vector set, so as to obtain a target predicate vector for each target predicate in the rule;

[0127] A condition vectorization unit, used for determining a target predicate vector corresponding to a rule condition in the rule, performing a linear transformation on the target predicate vector corresponding to the rule condition, and obtaining a condition vector of the rule condition;

[0128] a concatenation unit, configured to concatenate the condition vector and the result vector by taking the target predicate vector corresponding to the rule result in the rule as the result vector of the rule result, so as to obtain a rule vector of the rule;

[0129] The fourth determining unit is used to obtain the vectorized rule sample according to the rule vector of each rule in the rule sample.

[0130] Optionally, the rule relevance measurement device further includes:

[0131] a fifth determination module, configured to determine tuples in the relational data and corresponding attribute values, and to determine predicates satisfied by any two tuples in the relational data;

[0132] A construction module, used for constructing the relationship graph data according to the tuples, the attribute values ​​and the predicates satisfied by any two tuples;

[0133] The sixth determination module is used to input the relationship graph data into a preset graph vectorization model to obtain the predicate vector set.

[0134] It should be noted that the information interaction, execution process and other contents between the above-mentioned modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0135] Fig.11 This is a schematic diagram of the structure of a computer device provided in Example 10 of the present application. Fig.11 As shown, the computer device of this embodiment includes: at least one processor ( Fig.11Only one is shown), a memory, and a computer program stored in the memory and executable on at least one processor, which, when executing the computer program, implements the steps in any of the above-mentioned sample labeling method embodiments of the rule relevance measurement model, or implements the steps in any of the above-mentioned rule relevance measurement method embodiments.

[0136] The computer device may include, but is not limited to, a processor and a memory. Those skilled in the art will appreciate that Fig.11 These are merely examples of computer devices and do not constitute limitations on the computer devices. The computer devices may include more or fewer components than those shown in the figure, or a combination of certain components, or different components. For example, they may also include a network interface, a display screen, and an input device.

[0137] The processor may be a CPU, or other general-purpose processors, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc.

[0138] The memory includes a readable storage medium, an internal memory, etc., wherein the internal memory may be the memory of a computer device, and the internal memory provides an environment for the operation of an operating system and computer-readable instructions in the readable storage medium. The readable storage medium may be a hard disk of a computer device, and in other embodiments may also be an external storage device of a computer device, for example, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on a computer device. Further, the memory may also include both an internal storage unit of a computer device and an external storage device. The memory is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of computer programs, etc. The memory may also be used to temporarily store data that has been output or is to be output.

[0139] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned device can refer to the corresponding process in the above-mentioned method embodiment, which will not be repeated here. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned method embodiment when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, USB flash drive, mobile hard disk, magnetic disk or optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0140] The present application implements all or part of the processes in the above-mentioned embodiment method, and may also be completed through a computer program product. When the computer program product runs on a computer device, the computer device can implement the steps in the above-mentioned method embodiment when executing the computer program product.

[0141] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0142] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0143] In the embodiments provided in the present application, it should be understood that the disclosed devices / computer equipment and methods can be implemented in other ways. For example, the device / computer equipment embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0144] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0145] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A sample labeling method for a rule correlation measurement model, characterized in that: The sample annotation method comprises: Acquire a rule set obtained by performing rule discovery on relational data and cleansed relational data obtained by a user cleaning the relational data, wherein the relational data refers to text-type data of a table structure; Extracting a rule pair from the rule set, and using the rule pair to detect the cleaning relationship data to obtain a detection result; Determine the correlation of the rule pair according to the detection result, and use the correlation as a label to associate with the rule pair to form a rule sample, wherein the rule sample is used to train the rule correlation measurement model, wherein the correlation refers to a numerical value reflecting the degree of correlation between two rules in the rule pair and user requirements; The using the rule pair to detect the cleansing relationship data to obtain a detection result includes: For any rule in the rule pair, use the rule to perform error detection on the cleansing relationship data to obtain the number of errors detected by the rule; Obtaining the detection result according to the number of errors detected by each rule in the rule pair; The step of determining the correlation of the rule pair according to the detection result, and using the correlation as a label and associating it with the rule pair to form a rule sample includes: Compare the number of first errors detected by the first rule in the rule pair with the number of second errors detected by the second rule in the rule pair, and if the first number of errors is greater than the second number of errors, determine that the correlation of the rule pair is a first value, and associate the first value as a label with the rule pair to form the rule sample; If the first error number is less than the second error number, the correlation of the rule pair is determined to be a second value, and the second value is used as a label to be associated with the rule pair to form the rule sample.

2. A rule relevance measurement method, characterized in that: After obtaining a rule sample by adopting the sample labeling method of the rule relevance measurement model as claimed in claim 1, the rule relevance measurement method includes: Obtaining a predicate vector set obtained by graph vectorizing the relational graph data constructed by all predicates in the relational data; According to the predicate vector set, the predicates in the rule sample are vectorized to obtain a vectorized rule sample; According to the vectorized rule samples, a preset measurement model is trained to obtain a trained target measurement model; A target rule whose relevance is to be measured is obtained, and the target rule is input into the target measurement model to obtain a relevance score value of the target rule.

3. The rule relevance measurement method according to claim 2, characterized in that: The step of vectorizing the predicates in the rule sample according to the predicate vector set to obtain the vectorized rule sample includes: For any rule in the rule sample, vectorize each target predicate in the rule according to the predicate vector set to obtain a target predicate vector for each target predicate in the rule; Determine a target predicate vector corresponding to a rule condition in the rule, perform a linear transformation on the target predicate vector corresponding to the rule condition, and obtain a condition vector of the rule condition; Taking the target predicate vector corresponding to the rule result in the rule as the result vector of the rule result, concatenating the condition vector and the result vector to obtain the rule vector of the rule; The vectorized rule sample is obtained according to the rule vector of each rule in the rule sample.

4. The rule relevance measurement method according to claim 2, characterized in that: The rule relevance measurement method further includes: Determine tuples and corresponding attribute values ​​in the relational data, and determine predicates satisfied by any two tuples in the relational data; constructing the relationship graph data according to the tuples, the attribute values ​​and the predicates satisfied by any two tuples; The relationship graph data is input into a preset graph vectorization model to obtain the predicate vector set.

5. A sample labeling device for a rule correlation measurement model, characterized in that: The sample marking device comprises: A first acquisition module is used to acquire a rule set obtained by performing rule discovery on relational data and cleaned relational data obtained by a user cleaning the relational data, wherein the relational data refers to text-type data of a table structure; A detection module, used to extract a rule pair from the rule set, and use the rule pair to detect the cleaning relationship data to obtain a detection result; an association module, used to determine the relevance of the rule pair according to the detection result, and associate the relevance with the rule pair as a label to form a rule sample, wherein the rule sample is used to train the rule relevance measurement model, wherein the relevance refers to a numerical value reflecting the relevance degree between the two rules in the rule pair and the user demand; The detection module comprises: an error detection unit, configured to perform error detection on the cleaning relationship data using any rule in the rule pair, and obtain the number of errors detected by the rule; A first determining unit, configured to obtain the detection result according to the number of errors detected by each rule in the rule pair; The association module comprises: a second determining unit, configured to compare the number of first errors detected by the first rule in the rule pair with the number of second errors detected by the second rule in the rule pair, and if the first number of errors is greater than the second number of errors, determine that the correlation of the rule pair is a first value, and associate the first value as a label with the rule pair to form the rule sample; The third determining unit is configured to determine that the correlation of the rule pair is a second value if the first error number is smaller than the second error number, and associate the second value as a label with the rule pair to form the rule sample.

6. A rule relevance measurement device, characterized in that: After obtaining a rule sample by adopting the sample labeling method of the rule relevance measurement model as claimed in claim 1, the rule relevance measurement device comprises: A second acquisition module is used to acquire a predicate vector set obtained by graph vectorizing the relationship graph data constructed by all predicates in the relationship data; A vectorization module, used for vectorizing the predicates in the rule sample according to the predicate vector set to obtain a vectorized rule sample; A training module, used to train a preset measurement model according to the vectorized rule samples to obtain a trained target measurement model; The measurement module is used to obtain the target rule whose relevance is to be measured, input the target rule into the target measurement model, and obtain the relevance score value of the target rule.

7. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the sample labeling method of the rule relevance measurement model as described in claim 1 or the rule relevance measurement method as described in any one of claims 2 to 4 is implemented.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the sample labeling method of the rule relevance measurement model according to claim 1 or the rule relevance measurement method according to any one of claims 2 to 4 is implemented.

Citation Information

Patent Citations

  • Program synthesis using annotations based on enumeration patterns

    US20200272935A1

  • Detecting Misconfiguration and / or Bug(s) in Large Service(s) Using Correlated Change Analysis

    US20210019142A1