Mixed local text entity causal structure learning method, device and electronic device
By combining the constraint-based PC discovery method and scoring method in local text entity causal structure learning, an efficient local causal skeleton is constructed, which solves the problem in the existing technology of being unable to identify causal relationships in the case of a small number of text samples, and achieves high efficiency and Precise causal structure learning.
Patent Information
- Application Number
- CN202410767679.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-14
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2044-06-14
AI Technical Summary
Existing local text entity causal structure learning methods cannot accurately learn to identify the causal relationships between different entities in the text with a small number of text samples.
The hybrid local text entity causal structure learning method is used to determine the local causal skeleton through the constraint-based PC discovery method, and combined with the scoring method to remove redundant variables and directional causal directions, to build an efficient and accurate local causal structure.
It improves the quality of local causal structure learning, especially when the sample size is small, and accurately identifies the causal relationships between different entities in the text.
Smart Images

Figure CN118333162B
Abstract
Description
Technical Field
[0001] The present application relates to the field of data mining, and in particular to a method, device and electronic device for learning a hybrid local text entity causal structure. Background Art
[0002] Causal structure learning refers to the process of analyzing and modeling text data to identify the causal relationship and causal structure between various variables, thereby inferring the causal effects between various variables. Among them, each variable refers to an entity in the text, and the entity in the text is used to represent objective things. Text entity causal structure learning is used to discover the causal relationship between different things in the objective world. Causal structure learning not only reveals the potential causal mechanism of data generation, but also helps to solve decision-making problems in machine learning, and is widely used in fields such as data science, machine learning, and artificial intelligence. In addition, causal structure learning is also of great significance in decision analysis, medical health, social sciences, finance, and other fields. Specifically, causal relationships can not only help us make accurate business decisions to obtain the expected profits, but also assist doctors in formulating prevention strategies and treatment plans through causal relationship analysis between diseases and symptoms in the medical field. Analyzing the causal relationship between user behaviors in social networks can help Internet companies accurately evaluate user influence. Therefore, causal relationship mining is of great significance for humans to deeply understand the laws of nature and scientifically guide human activities.
[0003] Existing local text entity causal structure learning methods are all constraint-based, and their performance is relatively mediocre when faced with challenges such as text sample size, text noise, and insufficient global text information. Especially in the case of a small number of text samples, they are unable to accurately learn and identify the causal relationship between different entities in the text.
[0004] Currently, no effective solution has been proposed to the problem that existing local causal structure learning methods cannot accurately learn to identify the causal relationship between different entities in the text with a small number of text samples. Summary of the invention
[0005] The present invention provides a hybrid local text entity causal structure learning method, device and electronic device to solve the problem that the existing local causal structure learning method cannot accurately learn and identify the causal relationship between different entities in the text when there is a small amount of text samples.
[0006] The present invention provides a hybrid local text entity causal structure learning method, the method comprising:
[0007] In the variable queue Q Determine the current learning variable Z, using the constraint-based PC discovery method to determine the current learning variables Z The local causal skeleton PC Z , and the current learning variable Z Add to variable set V, variable queue Q Add target variables during initialization T , the target variable T Determined in the observation dataset D, different variables in the observation dataset D are used to represent different text entity information;
[0008] Traverse the local causal skeleton PC Z Each variable in W , calculate the variable W The first local structure score S ( W→Z , D) and the second local structure score S ( →Z , D):
[0009] ,
[0010] ,
[0011] in, i and r W Respectively represent variables W The value index and total number of values, k and r z Respectively represent variables Z The value index and total number of values, j and q z Respectively represent variables Z The value combination index and total number of value combinations of all parent nodes, N represents the total number of samples, N i Representation variables W Adopt the i The number of samples to be taken, N jk Representation variables Z Adopt the k value and variable Z All parent nodes of j The number of samples of value combinations, N k Representation variables Z Adopt the k The number of samples to be taken;
[0012] When the variable WThe first local structure score S ( W→Z , D) is less than the second local structure score S ( →Z , D), from the local causal skeleton PC Z Delete variables in W , and the local causal skeleton PC Z Add to the current causal skeleton LS;
[0013] Determine the causal direction of each variable in the current causal skeleton LS.
[0014] In some embodiments, determining the causal direction of each variable in the current causal skeleton LS includes:
[0015] Determine the local causal skeleton PC Z The V structure and equivalence class structure in;
[0016] The constraint-based Meek rule and all V structures determined in the current causal skeleton LS are adopted to orient the causal direction of each variable in the current causal skeleton LS.
[0017] In some embodiments, the determination of the local causal skeleton PC Z The V structures and equivalent class structures in include:
[0018] In the local causal skeleton PC Z In the current learning variable Z As the center, arbitrarily select the current learning variable Z Two different causal variables X and Y Constitute a triplet< X , Z , Y >
[0019] Calculate each triple < X , Z, Y First local structure score of > S ( X→Z←Y , D ) and the second local structure score S ( X→Z→Y , D ):
[0020] ,
[0021] ,
[0022] in, k and r zRespectively represent variables Z The value index and total number of values, j and q z Respectively represent variables Z The value combination index and total number of value combinations of all parent nodes, and r X Respectively represent variables X The value index and total number of values, b and r Y Respectively represent variables Y The value index and total number of values, c and q Y Respectively represent variables Y The value combination index and total number of value combinations of all parent nodes, N represents the total number of samples, N jk Representation variables Z Adopt the k value and variable Z All parent nodes of j The number of samples of value combinations, N j Indicates that all parent nodes of variable Z adopt the j The number of samples of value combinations, Representation variables X Adopt the The number of samples to be taken, N cb Representation variables Y Adopt the b value and variable Y All parent nodes of c The number of samples of value combinations, N c Representation variables Y All parent nodes of c The number of samples of value combinations;
[0023] Determine the first local structure score S ( X→Z←Y , D ) is greater than the second local structure score S ( X→Z→Y , D ), if so, the corresponding triple < X , Z, Y >Determine the V structure, otherwise the corresponding triple < X , Z, Y >Identified as an equivalence class structure.
[0024] In some embodiments, the method further comprises:
[0025] From the local causal skeleton PC Z Delete variables in W Then, the local causal skeleton PC Z All variables except those already added to the variable set V are added to the variable queue Q , as the learning variable in the next round of iterative learning;
[0026] Determine the target variable T Whether the local causal direction can be fully identified in the current causal skeleton LS, if not, the hybrid local text entity causal structure learning method is iteratively performed, and if so, the hybrid local text entity causal structure learning method is stopped.
[0027] In some embodiments, the method further comprises:
[0028] Get observation dataset D And the observational dataset D The target variable in T ;
[0029] Initialize variable set V = And based on the target variable T Constructing variable queues Q = { T}.
[0030] In some of the embodiments, different text entity information includes disease information or symptom information; or, different text entity information includes user behavior information and user interest information; or, different text entity information includes event information and financial fluctuation information.
[0031] Compared with the related art, the hybrid local text entity causal structure learning method provided by the present invention realizes hybrid local skeleton construction and local causal orientation by using constraint-based and scoring methods, and combines the advantages of the two methods in a novel way to realize efficient and accurate local causal structure learning, thereby improving the quality of local causal structure learning, especially when the sample size is small. It solves the problem that the existing local causal structure learning methods cannot accurately learn and identify the causal relationship between different entities in the text with a small number of text samples.
[0032] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1is a flow chart of a hybrid local text entity causal structure learning method provided in an embodiment of the present invention;
[0034] Figure 2 This is a comparison diagram of the local causal skeleton construction effects of the present invention and the prior art;
[0035] Figure 3 It is a schematic diagram of the orientation process of the current causal skeleton in one embodiment of the present invention. DETAILED DESCRIPTION
[0036] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0037] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0038] In an embodiment of the present invention, a hybrid local text entity causal structure learning method is provided. Figure 1 is a flow chart of a hybrid local text entity causal structure learning method provided in an embodiment of the present invention, such as Figure 1 As shown, the process includes steps S110 to S140.
[0039] Step S110, in the variable queue Q Determine the current learning variable Z, using the constraint-based PC discovery method to determine the current learning variables Z The local causal skeleton PC Z , and the current learning variable Z Add to the variable set V, add the target variable T to the variable queue Q when it is initialized, and the target variable T Determined in the observation dataset D, different variables in the observation dataset D are used to represent different text entity information.
[0040] Specifically, text entities refer to objectively existing things, and observation data sets are historical record data, which include information data such as things that have occurred and the relationships between various things. For example, when the method is applied in the medical field, different text entity information includes disease information or symptom information. When the method is applied in the field of social networks, different text entity information includes user behavior information and user interest information. When the method is applied in the financial field, different text entity information includes event information and financial fluctuation information. The hybrid local text entity causal structure learning method provided by the present invention learns the target variable T The causal relationship between the target variable and other variables is determined T It represents the causal relationship between text entities and other text entities. Among them, the constraint-based PC discovery method can be MMPC, HITONPC and FCBF.
[0041] In some of the embodiments, the process further includes step S101 and step S102 before step S110.
[0042] Step S101, obtain observation data set D And the observational dataset D The target variable in T。
[0043] Step S102, initializing variable set V = And based on the target variable T Constructing variable queues Q = { T}.
[0044] Among them, the target variable T You can choose and determine according to user needs. For example, if the user is a doctor, he is more concerned about the relationship between lung cancer and symptoms, so the variable representing lung cancer can be used as the target variable. T The initial variable set V is an empty set. , and the initial variable queue Q Include only the target variable T .
[0045] Accordingly, these initial tasks can be performed by other executors, while the executor of the present invention directly obtains the observation data set. D And the initial variable set V = and variable queue Q = { T}.
[0046] It should be noted that in the initial variable queue Q In the current learning variable Z The target variable T .
[0047] At the same time, the constraint-based PC discovery method is used to determine the current learning variables Z The local causal skeleton PC Z It is a traditional causal structure learning method. However, the local causal skeleton structure determined by the constraint-based PC discovery method has causal redundancy, that is, the local causal skeleton PC Z There may be something that actually matches the current learning variable Z Variables without causal relationship. To overcome this problem, the present invention adopts step S120 to remove possible redundant variables.
[0048] Step S120, traverse the local causal skeleton PC Z Each variable in W , calculate the variable W The first local structure score S ( W→Z , D) and the second local structure score S ( →Z , D):
[0049] ,
[0050] ,
[0051] in, i and r W Respectively represent variables W The value index and total number of values, k and r z Respectively represent variables Z The value index and total number of values, j and q z Respectively represent variables Z The value combination index and total number of value combinations of all parent nodes, N represents the total number of samples, Ni Representation variables W Adopt the i The number of samples to be taken, N jk Representation variables Z Adopt the k value and variable Z All parent nodes of j The number of samples of value combinations, N k Representation variables Z Adopt the k The number of samples to be taken.
[0052] Step S130, when the variable W The first local structure score S ( W→Z , D) is less than the second local structure score S ( →Z , D), from the local causal skeleton PC Z Delete variables in W , and the local causal skeleton PC Z Add to the current causal skeleton LS.
[0053] Specifically, by comparing the local causal skeleton PC Z Each variable in W The first local structure score S ( W→Z , D) and the second local structure score S ( →Z , D), we can judge each variable W Is it related to the variable Z Variables that have a causal relationship and will not satisfy the requirement W From the local causal skeleton PC Z Remove, so that we can get the variable Z More accurate local causal skeleton PC Z .
[0054] Figure 2 This is a comparison chart of the local causal skeleton construction effects of the present invention and the prior art. Figure 2 , part a is the causal skeleton sample to be constructed, X 1 is the target variable, X 2. X 3 and X 4 are X 1 is the causal variable, X 5 for X4; Part b is constructed by the traditional causal structure learning method (only using step S110) X 1, which mistakenly includes X 5. X 5 is not X 1, that is, X 5 constitutes a redundant variable; Part c is constructed by the causal structure learning method of the present invention (using steps S110, S120 and S130 at the same time) X 1, which accurately obtains X 1's local causal skeleton.
[0055] Step S140, determining the causal direction of each variable in the current causal skeleton LS.
[0056] In some of these embodiments, the current causal skeleton LS may be oriented directly.
[0057] Considering that equivalent class structures have the same score relationship, in order to avoid interference in orientation caused by score equivalence, in some embodiments, a scoring method is used to distinguish the V structure and the equivalent class structure in the current causal skeleton LS.
[0058] Therefore, in a more preferred embodiment, determining the causal direction of each variable in the current causal skeleton LS includes step S141 and step S142.
[0059] Step S141, determine the local causal skeleton PC Z The V structure and equivalence class structure in .
[0060] Specifically, in the local causal skeleton PC Z In the current learning variable Z As the center, arbitrarily select the current learning variable Z Two different causal variables X and Y Constitute a triplet< X , Z , Y >.
[0061] Calculate each triple < X , Z, Y First local structure score of > S ( X→Z←Y , D ) and the second local structure score S ( X→Z→Y , D ):
[0062] ,
[0063] ,
[0064] in, k and r z Respectively represent variables Z The value index and total number of values, j and q z Respectively represent variables Z The value combination index and total number of value combinations of all parent nodes, and r X Respectively represent variables X The value index and total number of values, b and r Y Respectively represent variables Y The value index and total number of values, c and q Y Respectively represent variables Y The value combination index and total number of value combinations of all parent nodes, N represents the total number of samples, N jk Representation variables Z Adopt the k value and variable Z All parent nodes of j The number of samples of value combinations, N j Indicates that all parent nodes of variable Z adopt the j The number of samples of value combinations, Representation variables X Adopt the The number of samples to be taken, N cb Representation variables Y Adopt the b value and variable Y All parent nodes of c The number of samples of value combinations, N c Representation variables Y All parent nodes of c The number of samples of the value combination.
[0065] Determine the first local structure score S ( X→Z←Y , D ) is greater than the second local structure score S ( X→Z→Y , D ), if so, the corresponding triple <X , Z, Y >Determine the V structure, otherwise the corresponding triple < X , Z, Y >Identified as an equivalence class structure.
[0066] Step S142, using the constraint-based Meek rule and all V structures determined in the current causal skeleton LS to orient the causal direction of each variable in the current causal skeleton LS.
[0067] Specifically, this step does not determine the causal relationship of variables based on all the ternary structures in the current causal skeleton LS, but excludes the equivalence class structure and uses the constraint-based Meek rule and V structure to orient the current causal skeleton LS, thereby eliminating the directional interference of the equivalence class structure, so that the causal direction of each variable in the current causal skeleton LS can be determined more accurately.
[0068] In some of the embodiments, the method further comprises: Z Delete variables in W Then, the local causal skeleton PC Z All variables except those already added to the variable set V are added to the variable queue Q As the learning variable in the next round of iterative learning; judging the target variable T Whether the local causal direction can be fully identified in the current causal skeleton LS, if not, the hybrid local text entity causal structure learning method is iteratively performed, and if so, the hybrid local text entity causal structure learning method is stopped.
[0069] It should be noted that in the first iteration of learning, the variable queue Q Usually only the target variable is included T , at this time the current learning variable Z The target variable T , local causal skeleton PC Z The target variable T The local causal skeleton PC T , local causal skeleton PC T The current causal skeleton LS is formed. The local causal skeleton PC T All variables except those added to the variable set V are target variables T Cause variables and result variables, add these variables to the variable queue Q In the target variable T When the local causal direction of cannot be fully identified in the current causal skeleton LS, continue to determine the target variable TThe local structural skeletons of the cause variables and the result variables are added to the current causal skeleton LS in parallel, which is equivalent to adding the local causal skeleton PC T Specifically, in the second iteration of learning, the current learning variable Z The target variable T One of the cause variables and result variables of . And so on, the current causal skeleton LS is continuously expanded until the target variable T The local causal direction of is fully identified in the current causal skeleton LS.
[0070] Figure 3 FIG. 1 is a schematic diagram of the orientation process of the current causal skeleton in one embodiment of the present invention. Figure 3 In the above example, part a is the causal skeleton sample to be directed. X 1 is the target variable, X 2. X 3 and X 4 are X 1; Part b is the current causal skeleton obtained by the causal structure learning method of the present invention in the second round of learning. At this time, it is not possible to fully identify the current causal skeleton. X 1, a third round of learning is required; Part c is the current causal skeleton obtained by the causal structure learning method of the present invention in the third round of learning, mainly by adding X 4, which can now be fully identified in the current causal skeleton X 1; Part d is the recognition result of the causal structure learning method of the present invention on part c, which includes X 1's entire causal direction.
[0071] In summary, the above-mentioned hybrid local text entity causal structure learning method realizes hybrid local skeleton construction and local causal orientation by using constraint-based and scoring methods, combining the advantages of the two methods in a novel way to achieve efficient and accurate local causal structure learning, and improves the quality of local causal structure learning, especially when the sample size is small. It solves the problem that the existing local causal structure learning methods cannot accurately learn to identify the causal relationship between different entities in the text with a small number of text samples.
[0072] As mentioned above, at least one embodiment of each part of the hybrid local text entity causal structure learning method provided by the present invention has been described respectively. It should be noted that the various parts of the hybrid local text entity causal structure learning method can be combined using different embodiments to form different embodiments of the hybrid local text entity causal structure learning method.
[0073] For example, in a specific overall embodiment, the hybrid local text entity causal structure learning method includes steps one to ten.
[0074] Step 1: Get the observation data set D And the observational dataset D The target variable in T。
[0075] Step 2: Initialize the variable set V = And based on the target variable T Constructing variable queues Q = { T}, different variables are used to represent different text entity information.
[0076] Text entities refer to objectively existing things, and observation data sets are historical record data, which include information data such as things that have occurred and the relationships between various things. For example, when the method is applied in the medical field, different text entity information includes disease information or symptom information. When the method is applied in the field of social networks, different text entity information includes user behavior information and user interest information. When the method is applied in the financial field, different text entity information includes event information and financial fluctuation information. The hybrid local text entity causal structure learning method provided by the present invention learns the target variable T The causal relationship between the target variable and other variables is determined T It represents the causal relationship between text entities and other text entities.
[0077] Step 3: In the variable queue Q Determine the current learning variable Z , using the constraint-based PC discovery method and OR rule to determine the current learning variable Z The local causal skeleton PC Z , and the current learning variable Z Add to the variable set V.
[0078] Determine the current learning variables using a constraint-based PC discovery method Z The local causal skeleton PC Z It is a traditional causal structure learning method. However, the local causal skeleton structure determined by the constraint-based PC discovery method has causal redundancy, that is, the local causal skeleton PC Z There may be something that actually matches the current learning variable Z Variables without causal relationship. In order to overcome this problem, the present invention adopts step 4 to remove possible redundant variables.
[0079] Step 4: Traverse the local causal skeleton PC ZEach variable in W , calculate the variable W The first local structure score S ( W→Z , D) and the second local structure score S ( →Z , D):
[0080] ,
[0081] ,
[0082] in, i and r W Respectively represent variables W The value index and total number of values, k and r z Respectively represent variables Z The value index and total number of values, j and q z Respectively represent variables Z The value combination index and total number of value combinations of all parent nodes, N represents the total number of samples, N i Representation variables W Adopt the i The number of samples to be taken, N jk Representation variables Z Adopt the k value and variable Z All parent nodes of j The number of samples of value combinations, N k Representation variables Z Adopt the k The number of samples to be taken.
[0083] Step 5: When the variable W The first local structure score S ( W→Z , D) is less than the second local structure score S ( → Z , D), from the local causal skeleton PC Z Delete variables in W , the local causal skeleton PC Z All variables except those already added to the variable set V are added to the variable queue Q, as the learning variable in the next round of iterative learning, and the local causal skeleton PC Z Add to the current causal skeleton LS.
[0084] Specifically, by comparing the local causal skeleton PC Z Each variable in W The first local structure score S ( W→Z , D) and the second local structure score S ( →Z , D), we can judge each variable W Is it related to the variable Z Variables that have a causal relationship and will not satisfy the requirement W From the local causal skeleton PC Z Remove, so that we can get the variable Z More accurate local causal skeleton PC Z .
[0085] Considering that the equivalent class structures have the same score relationship, in order to avoid interference with orientation caused by score equivalence, this embodiment uses a scoring method to distinguish the V structure and the equivalent class structure in the current causal skeleton LS.
[0086] Step 6: In the local causal skeleton PC Z In the current learning variable Z As the center, arbitrarily select the current learning variable Z Two different causal variables X and Y Constitute a triplet< X , Z , Y >.
[0087] Step 7: Calculate each triplet < X , Z, Y First local structure score of > S ( X→Z←Y , D ) and the second local structure score S ( X→Z→Y , D ):
[0088] ,
[0089] ,
[0090] in, k and r z Respectively represent variables Z The value index and total number of values,j and q z Respectively represent variables Z The value combination index and total number of value combinations of all parent nodes, and r X Respectively represent variables X The value index and total number of values, b and r Y Respectively represent variables Y The value index and total number of values, c and q Y Respectively represent variables Y The value combination index and total number of value combinations of all parent nodes, N represents the total number of samples, N jk Representation variables Z Adopt the k value and variable Z All parent nodes of j The number of samples of value combinations, N j Indicates that all parent nodes of variable Z adopt the j The number of samples of value combinations, Representation variables X Adopt the The number of samples to be taken, N cb Representation variables Y Adopt the b value and variable Y All parent nodes of c The number of samples of value combinations, N c Representation variables Y All parent nodes of c The number of samples of the value combination.
[0091] Step 8: Determine the first local structure score S ( X→Z←Y , D ) is greater than the second local structure score S ( X→ Z→Y , D ), if so, the corresponding triple < X , Z, Y >Determine the V structure, otherwise the corresponding triple < X , Z, Y >Identified as an equivalence class structure.
[0092] Step nine, the constraint-based Meek rule and all V structures determined in the current causal skeleton LS are used to orient the causal direction of each variable in the current causal skeleton LS.
[0093] Specifically, this step does not determine the causal relationship of variables based on all the ternary structures in the current causal skeleton LS, but excludes the equivalence class structure and adopts the constraint-based Meek rule and V structure part for orientation, so as to exclude the directional interference of the equivalence class structure, so as to more accurately determine the causal direction of each variable in the current causal skeleton LS.
[0094] Step 10: Determine the target variable T Whether the local causal direction can be fully identified in the current causal skeleton LS, if not, iteratively execute steps 3 to 10, and if so, stop learning.
[0095] It should be noted that in the first iteration of learning, the variable queue Q Usually only the target variable is included T , at this time the current learning variable Z The target variable T , local causal skeleton PC Z The target variable T The local causal skeleton PC T , local causal skeleton PC T The current causal skeleton LS is formed. The local causal skeleton PC T All variables except those added to the variable set V are target variables T Cause variables and result variables, add these variables to the variable queue Q In the target variable T When the local causal direction of cannot be fully identified in the current causal skeleton LS, continue to determine the target variable T The local structural skeletons of the cause variables and the result variables are added to the current causal skeleton LS in parallel, which is equivalent to adding the local causal skeleton PC T Specifically, in the second iteration of learning, the current learning variable Z The target variable T One of the cause variables and result variables of . And so on, the current causal skeleton LS is continuously expanded until the target variable T The local causal direction of is fully identified in the current causal skeleton LS.
[0096] In summary, the above embodiments use constraint-based and scoring methods to achieve hybrid local skeleton construction and local causal orientation, combining the advantages of the two methods in a novel way to achieve efficient and accurate local causal structure learning, thereby improving the quality of local causal structure learning, especially when the sample size is small.
[0097] The present invention also provides a hybrid local text entity causal structure learning device, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. The terms "module", "unit", "sub-unit", etc. used below can implement a combination of software and / or hardware for predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0098] The hybrid local text entity causal structure learning device provided by the present invention comprises a causal skeleton determination module, a structure score calculation module, a causal skeleton adjustment module and a causal variable orientation module.
[0099] The causal skeleton determination module is used to sequentially Q Determine the current learning variable Z , using the constraint-based PC discovery method to determine the current learning variables Z The local causal skeleton PC Z , and the current learning variable Z Add to variable set V, variable queue Q Add target variables during initialization T , the target variable T Determined in the observation dataset D, different variables in the observation dataset D are used to represent different text entity information.
[0100] Structural score calculation module for traversing local causal skeleton PCs Z Each variable in W , calculate the variable W The first local structure score S ( W→Z , D) and the second local structure score S ( →Z , D):
[0101] ,
[0102] ,
[0103] in, i and r W Respectively represent variables WThe value index and total number of values, k and r z Respectively represent variables Z The value index and total number of values, j and q z Respectively represent variables Z The value combination index and total number of value combinations of all parent nodes, N represents the total number of samples, N i Representation variables W Adopt the i The number of samples to be taken, N jk Representation variables Z Adopt the k value and variable Z All parent nodes of j The number of samples of value combinations, N k Representation variables Z Adopt the k The number of samples to be taken.
[0104] The causal skeleton adjustment module is used when the variables W The first local structure score S ( W→Z , D) is less than the second local structure score S ( →Z , D), from the local causal skeleton PC Z Delete variables in W , and the local causal skeleton PC Z Add to the current causal skeleton LS;
[0105] The causal variable orientation module is used to determine the causal direction of each variable in the current causal skeleton LS.
[0106] The above-mentioned hybrid local text entity causal structure learning device realizes hybrid local skeleton construction and local causal orientation by using constraint-based and scoring methods, combining the advantages of the two methods in a novel way to achieve efficient and accurate local causal structure learning, and improves the quality of local causal structure learning, especially when the sample size is small. It solves the problem that the existing local causal structure learning methods cannot accurately learn and identify the causal relationship between different entities in the text with a small number of text samples.
[0107] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0108] The present invention also provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the hybrid local text entity causal structure learning method provided by the present invention.
[0109] The present invention also provides a computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps of the hybrid local text entity causal structure learning method provided by the present invention are implemented.
[0110] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0111] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
Claims
1. A hybrid local text entity causal structure learning method, It is characterized in that The method comprises: In the variable queue Q Determine the current learning variable Z , using the constraint-based PC discovery method to determine the current learning variables Z The local causal skeleton PC Z , and the current learning variable Z Add to variable set V, variable queue Q Add target variables during initialization T , the target variable T Determining in an observation data set D, different variables in the observation data set D are used to represent different text entity information; wherein the different text entity information includes disease information or symptom information, or the different text entity information includes user behavior information and user interest information, or the different text entity information includes event information and financial fluctuation information; Traverse the local causal skeleton PC Z Each variable in W , calculate the variable W The first local structure score S ( W→Z , D) and the second local structure score S ( →Z , D): , , in, i and r W Respectively represent variables W The value index and total number of values, k and r z Respectively represent variables Z The value index and total number of values, j and q z Respectively represent variables Z The value combination index and total number of value combinations of all parent nodes, N represents the total number of samples, N i Representation variables W Adopt the i The number of samples to be taken, N jk Representation variables Z Adopt the k value and variable Z All parent nodes of j The number of samples of value combinations, N j Indicates that all parent nodes of variable Z adopt the j The number of samples of value combinations, N k Representation variables Z Adopt the k The number of samples to be taken; When the variable W The first local structure score S ( W→Z , D) is less than the second local structure score S ( →Z , D), from the local causal skeleton PC Z Delete variables in W , and the local causal skeleton PC Z Add to the current causal skeleton LS; Determine the causal direction of each variable in the current causal skeleton LS.
2. The hybrid local text entity causal structure learning method according to claim 1, It is characterized in that Determining the causal direction of each variable in the current causal skeleton LS includes: Determine the local causal skeleton PC Z The V structure and equivalence class structure in; The constraint-based Meek rule and all V structures determined in the current causal skeleton LS are adopted to orient the causal direction of each variable in the current causal skeleton LS.
3. The hybrid local text entity causal structure learning method according to claim 2, It is characterized in that Determining the local causal skeleton PC Z The V structures and equivalent class structures in include: In the local causal skeleton PC Z In the current learning variable Z As the center, arbitrarily select the current learning variable Z Two different causal variables X and Y Constitute a triplet< X , Z , Y > Calculate each triple < X , Z, Y First local structure score of > S ( X→Z←Y , D ) and the second local structure score S ( X→Z→Y , D ): , , in, k and r z Respectively represent variables Z The value index and total number of values, j and q z Respectively represent variables Z The value combination index and total number of value combinations of all parent nodes, and r X Respectively represent variables X The value index and total number of values, b and r Y Respectively represent variables Y The value index and total number of values, c and q Y Respectively represent variables Y The value combination index and total number of value combinations of all parent nodes, N represents the total number of samples, N jk Representation variables Z Adopt the k value and variable Z All parent nodes of j The number of samples of value combinations, N j Indicates that all parent nodes of variable Z adopt the j The number of samples of value combinations, Representation variables X Adopt the The number of samples to be taken, N cb Representation variables Y Adopt the b value and variable Y All parent nodes of c The number of samples of value combinations, N c Representation variables Y All parent nodes of c The number of samples of value combinations; Determine the first local structure score S ( X→Z←Y , D ) is greater than the second local structure score S ( X→Z→Y , D ), if so, the corresponding triple < X , Z, Y >Determine the V structure, otherwise the corresponding triple < X , Z, Y >Identified as an equivalence class structure.
4. The hybrid local text entity causal structure learning method according to claim 3, It is characterized in that The method further comprises: From the local causal skeleton PC Z Delete variables in W Then, the local causal skeleton PC Z All variables except those already added to the variable set V are added to the variable queue Q , as the learning variable in the next round of iterative learning; Determine the target variable T Whether the local causal direction can be fully identified in the current causal skeleton LS, if not, the hybrid local text entity causal structure learning method is iteratively performed, and if so, the hybrid local text entity causal structure learning method is stopped.
5. The hybrid local text entity causal structure learning method according to any one of claims 1 to 4, It is characterized in that The method further comprises: Get observation dataset D And the observational dataset D The target variable in T ; Initialize variable set V = And based on the target variable T Constructing variable queues Q = { T }.
6. A hybrid local text entity causal structure learning method, It is characterized in that The method comprises: Step 1: Get the observation data set D And the observational dataset D The target variable in T ; Step 2: Initialize the variable set V = And based on the target variable T Constructing variable queues Q = { T }, different variables are used to represent different text entity information; wherein the different text entity information includes disease information or symptom information, or the different text entity information includes user behavior information and user interest information, or the different text entity information includes event information and financial fluctuation information; Step 3: In the variable queue Q Determine the current learning variable Z , using the constraint-based PC discovery method to determine the current learning variables Z The local causal skeleton PC Z , and the current learning variable Z Add to variable set V; Step 4: Traverse the local causal skeleton PC Z Each variable in W , calculate the variable W The first local structure score S ( W→Z , D) and the second local structure score S ( →Z , D): , , in, i and r W Respectively represent variables W The value index and total number of values, k and r z Respectively represent variables Z The value index and total number of values, j and q z Respectively represent variables Z The value combination index and total number of value combinations of all parent nodes, N represents the total number of samples, N i Representation variables W Adopt the i The number of samples to be taken, N jk Representation variables Z Adopt the k value and variable Z All parent nodes of j The number of samples of value combinations, N j Indicates that all parent nodes of variable Z adopt the j The number of samples of value combinations, N k Representation variables Z Adopt the k The number of samples to be taken; Step 5: When the variable W The first local structure score S ( W→Z , D) is less than the second local structure score S ( →Z , D), from the local causal skeleton PC Z Delete variables in W , the local causal skeleton PC Z All variables except those already added to the variable set V are added to the variable queue Q , as the learning variable in the next round of iterative learning, and the local causal skeleton PC Z Add to the current causal skeleton LS; Step 6: In the local causal skeleton PC Z In the current learning variable Z As the center, arbitrarily select the current learning variable Z Two different causal variables X and Y Constitute a triplet< X , Z , Y > Step 7: Calculate each triplet < X , Z, Y First local structure score of > S ( X→Z←Y , D ) and the second local structure score S ( X→Z→Y , D ): , , in, k and r z Respectively represent variables Z The value index and total number of values, j and q z Respectively represent variables Z The value combination index and total number of value combinations of all parent nodes, and r X Respectively represent variables X The value index and total number of values, b and r Y Respectively represent variables Y The value index and total number of values, c and q Y Respectively represent variables Y The value combination index and total number of value combinations of all parent nodes, N represents the total number of samples, N jk Representation variables Z Adopt the k value and variable Z All parent nodes of j The number of samples of value combinations, N j Indicates that all parent nodes of variable Z adopt the j The number of samples of value combinations, Representation variables X Adopt the The number of samples to be taken, N cb Representation variables Y Adopt the b value and variable Y All parent nodes of c The number of samples of value combinations, N c Representation variables Y All parent nodes of c The number of samples of value combinations; Step 8: Determine the first local structure score S ( X→Z←Y , D ) is greater than the second local structure score S ( X→Z→ Y , D ), if so, the corresponding triple < X , Z, Y >Determine the V structure, otherwise the corresponding triple < X , Z, Y >Determined as an equivalent class structure; Step nine, using the constraint-based Meek rule and all V structures determined in the current causal skeleton LS to orient the causal direction of each variable in the current causal skeleton LS; Step 10: Determine the target variable T Whether the local causal direction can be fully identified in the current causal skeleton LS, if not, iteratively execute steps 3 to 10, and if so, stop learning.
7. A hybrid local text entity causal structure learning device, It is characterized in that The device comprises: The causal skeleton determination module is used to sequentially Q Determine the current learning variable Z , using the constraint-based PC discovery method to determine the current learning variables Z The local causal skeleton PC Z , and the current learning variable Z Add to variable set V, variable queue Q Add target variables during initialization T , the target variable T Determining in an observation data set D, different variables in the observation data set D are used to represent different text entity information; wherein the different text entity information includes disease information or symptom information, or the different text entity information includes user behavior information and user interest information, or the different text entity information includes event information and financial fluctuation information; Structural score calculation module for traversing local causal skeleton PCs Z Each variable in W , calculate the variable W The first local structure score S ( W→Z , D) and the second local structure score S ( →Z , D): , , in, i and r W Respectively represent variables W The value index and total number of values, k and r z Respectively represent variables Z The value index and total number of values, j and q z Respectively represent variables Z The value combination index and total number of value combinations of all parent nodes, N represents the total number of samples, N i Representation variables W Adopt the i The number of samples to be taken, N jk Representation variables Z Adopt the k value and variable Z All parent nodes of j The number of samples of value combinations, N j Indicates that all parent nodes of variable Z adopt the j The number of samples of value combinations, N k Representation variables Z Adopt the k The number of samples to be taken; The causal skeleton adjustment module is used when the variables W The first local structure score S ( W→Z , D) is less than the second local structure score S ( →Z , D), from the local causal skeleton PC Z Delete variables in W , and the local causal skeleton PC Z Add to the current causal skeleton LS; The causal variable orientation module is used to determine the causal direction of each variable in the current causal skeleton LS.
8. An electronic device comprising a memory and a processor, It is characterized in that A computer program is stored in the memory, and the processor is configured to run the computer program to execute the hybrid local text entity causal structure learning method described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the hybrid local text entity causal structure learning method described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Method for establishing causal relationship model based on MOOC data middle school behaviors
CN110866162A
Causal network local structure discovery system based on weak priori knowledge
CN115132280A
Time sequence causal discovery method and device for digital agricultural information, medium and equipment
CN116401291A
Causal structure learning method and system based on large language model guidance
CN117474087A
Information processing device, information processing method, and non-transitory information recording medium with computer-readable information processing program recorded thereon
US20230195097A1
