Causal relation extraction method and device, electronic equipment and readable storage medium

By combining word segmentation and part-of-speech tagging with a pre-defined event rule set and rule model, causal relationships are extracted by directly matching unit words, which solves the problem of low efficiency in causal relationship extraction and achieves more efficient causal relationship extraction.

CN114579767BActive Publication Date: 2026-04-14BEIJING XUEZHITU NETWORK TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING XUEZHITU NETWORK TECH
Filing Date
2022-03-24
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

The efficiency of causal relationship extraction in existing technologies is low because the extraction of events from corpus information takes too much time.

Method used

By receiving the text to be extracted, performing word segmentation and part-of-speech tagging, and using a pre-set event rule set and a trained rule model to extract causal relationships, the analysis of dependency relationships between unit words is reduced.

Benefits of technology

It improves the efficiency of causal relationship extraction and reduces event extraction time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114579767B_ABST
    Figure CN114579767B_ABST
Patent Text Reader

Abstract

The application relates to a cause-effect relationship extraction method and device, electronic equipment and a readable storage medium. The method comprises the following steps: receiving a text to be extracted, performing a word segmentation operation on the text to be extracted to obtain a plurality of unit words, and performing part-of-speech tagging on each unit word to obtain a part-of-speech identifier corresponding to each unit word; obtaining a preset event rule set, combining unit words with event sub-rules in the preset event rule set, and obtaining a plurality of unit events; obtaining a trained rule model, inputting the unit events into the trained rule model, and obtaining a cause-effect relationship extraction result of the text to be extracted through the output of the trained rule model. By setting the event rule set, when event extraction is required for the text to be extracted, the unit words are directly matched through the preset event rule set, without the need for analysis based on the dependency relationship between the unit words, so that the event extraction time is greatly reduced, and the extraction efficiency of the cause-effect relationship is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of deep learning technology, and in particular to a causal relationship extraction method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] The construction of domain graphs for specific industries often requires the extraction of causal relationships between events. Before extracting causal relationships, events need to be extracted. Existing technologies often obtain events by performing dependency analysis on corpus information. However, this method is time-consuming and affects extraction efficiency. Summary of the Invention

[0003] This application provides a causal relationship extraction method, apparatus, electronic device, and readable storage medium, aiming to solve the technical problem in the prior art where the time spent on event extraction from corpus information is too long, affecting the efficiency of causal relationship extraction.

[0004] To solve the above-mentioned technical problems, or at least partially solve them, this application provides a causal relationship extraction method, the method comprising the steps of:

[0005] Receive the text to be extracted, perform word segmentation on the text to be extracted to obtain multiple unit words, and perform part-of-speech tagging on each unit word to obtain the part-of-speech identifier corresponding to each unit word;

[0006] Obtain a preset event rule set, and combine the part-of-speech tag with the unit words that match the event sub-rules in the preset event rule set to obtain multiple unit events;

[0007] Obtain the trained rule model, input the unit event into the trained rule model, and obtain the causal relationship extraction result of the text to be extracted through the output of the trained rule model.

[0008] Optionally, the step of obtaining the preset event rules includes the following before:

[0009] Obtain known event data, and then obtain the known unit words and known parts of speech in the known event data;

[0010] The known parts of speech are combined based on the order of the corresponding known unit words to obtain the event sub-rules;

[0011] Add the event sub-rule to the preset event rule set.

[0012] Optionally, the step of combining the part-of-speech tag with the unit words matched with the event sub-rules in the preset event rule set to obtain multiple unit events includes:

[0013] The part-of-speech tags of several adjacent unit words are combined according to the order of the corresponding unit words to obtain multiple part-of-speech combinations;

[0014] Match the event sub-rule corresponding to the part-of-speech combination in the preset event rule set;

[0015] If an event sub-rule corresponding to the part-of-speech combination is matched, the unit words corresponding to the part-of-speech combination are combined to obtain the unit event.

[0016] Optionally, the step of inputting the unit event into the trained rule model and obtaining the causal relationship extraction result of the text to be extracted through the output of the trained rule model includes:

[0017] Combine any two of the aforementioned unit events to obtain multiple judgment combinations;

[0018] Each of the aforementioned judgment combinations is input into the trained rule model to obtain the sub-relations corresponding to each of the aforementioned judgment combinations;

[0019] The causal relationship extraction result is obtained through each of the sub-relationships.

[0020] Optionally, the step of combining any two of the unit events to obtain multiple judgment combinations includes:

[0021] Obtain the event interval between any two of the aforementioned unit events;

[0022] Two unit events with an event interval less than a preset interval are combined to obtain multiple judgment combinations.

[0023] Optionally, the step of obtaining the causal relationship extraction result of the text to be extracted from the output of the trained rule model includes:

[0024] Obtain preset causal rules, and match keyword sub-rules corresponding to the text to be extracted in the preset causal rules to obtain keyword matching results;

[0025] The causal relationship extraction result is obtained by combining the output of the trained rule model with the keyword matching result.

[0026] Optionally, the step of matching the keyword sub-rules corresponding to the text to be extracted in the preset causal rules to obtain the keyword matching result includes:

[0027] Obtain multiple preset keywords, match the keywords in the text to be extracted, and obtain the key events between each keyword in the text to be extracted;

[0028] The matched keywords are combined based on their positions in the text to be extracted to obtain keyword combinations;

[0029] Match the keyword sub-rule corresponding to the keyword combination in the preset causal rules;

[0030] Obtain the event causal relationship corresponding to the keyword sub-rule, and use the event causal relationship as the causal relationship between each of the key events to obtain the keyword matching result.

[0031] To achieve the above objectives, the present invention also provides a causal relationship extraction device, the causal relationship extraction device comprising:

[0032] The first receiving module is used to receive the text to be extracted, perform word segmentation on the text to be extracted to obtain multiple unit words, and perform part-of-speech tagging on each unit word to obtain the part-of-speech identifier corresponding to each unit word.

[0033] The first acquisition module is used to acquire a preset event rule set, and combine the part-of-speech tag with the unit words that match the event sub-rules in the preset event rule set to obtain multiple unit events;

[0034] The second acquisition module is used to acquire the trained rule model, input the unit event into the trained rule model, and obtain the causal relationship extraction result of the text to be extracted through the output of the trained rule model.

[0035] To achieve the above objectives, the present invention also provides an electronic device, the electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the causal relationship extraction method as described above.

[0036] To achieve the above objectives, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the causal relationship extraction method described above.

[0037] This invention can be applied to natural language processing in the field of deep learning technology. The invention proposes a method, apparatus, electronic device, and readable storage medium for extracting causal relationships. The method involves receiving text to be extracted, performing word segmentation on the text to obtain multiple unit words, and performing part-of-speech tagging on each unit word to obtain its corresponding part-of-speech identifier. A preset event rule set is obtained, and the part-of-speech identifiers are combined with the unit words that match the event sub-rules in the preset event rule set to obtain multiple unit events. A trained rule model is obtained, and the unit events are input into the trained rule model. The causal relationship extraction result of the text to be extracted is obtained through the output of the trained rule model. By pre-setting the event rule set and directly matching unit words using the preset event rule set when event extraction is needed, without needing to analyze the dependency relationships between unit words, the event extraction time is greatly reduced, thereby improving the efficiency of causal relationship extraction. Attached Figure Description

[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0039] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is a flowchart illustrating the first embodiment of the causal relationship extraction method of the present invention;

[0041] Figure 2 This is a detailed flowchart of step S20 in the first embodiment of the causal relationship extraction method of the present invention;

[0042] Figure 3 This is a schematic diagram of the module structure of the electronic device of the present invention. Detailed Implementation

[0043] It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.

[0044] This invention provides a method for extracting causal relationships, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the causal relationship extraction method of the present invention. The method includes the following steps:

[0045] Step S10: Receive the text to be extracted, perform word segmentation on the text to be extracted to obtain multiple unit words, and perform part-of-speech tagging on each unit word to obtain the part-of-speech identifier corresponding to each unit word.

[0046] The text to be extracted refers to the text from which causal relationships need to be extracted. It should be noted that the received text to be extracted can be a single sentence or a long paragraph. If the text to be extracted is a single sentence, subsequent operations can be performed directly. If the text to be extracted is a long paragraph, it can be segmented into sentences. Specifically, sentence segmentation symbols such as ".", "?", "!", and ";" can be pre-set. These symbols are then used to find the sentence segmentation symbols in the text to be extracted, and the text is segmented into multiple single-sentence texts. Subsequent operations are then performed on each single-sentence text. All subsequent extraction texts in the solution will be described using single-sentence texts.

[0047] Word segmentation is used to divide the text to be extracted into unit words based on the relevance between characters, while part-of-speech tagging is used to confirm the part of speech of the unit words. For example, if an earthquake triggers a tsunami, word segmentation can yield three unit words: earthquake, trigger, and tsunami. Part-of-speech tagging can yield [pair(“earthquake”, n”), pair(“tsunami”, v”), pair(“tsunami”, n”)], where n represents a noun and v represents a verb. It is understood that this embodiment only illustrates word segmentation and part-of-speech tagging. The specific methods and tools used for word segmentation or part-of-speech tagging can be selected according to the actual application scenario and needs, and are not limited here.

[0048] Step S20: Obtain a preset event rule set, and combine the part-of-speech tag with the unit words that match the event sub-rules in the preset event rule set to obtain multiple unit events;

[0049] The preset time rule set contains multiple event sub-rules, which are combinations of multiple parts of speech. For example, [n, a] represents noun + adjective, and [a, n] represents adjective + noun. It should be noted that event sub-rules represent the part-of-speech relationships between consecutive unit words. Furthermore, there is no limit to the number of parts of speech contained in an event sub-rule; it can contain one or more. When matching each unit word, matching begins with event sub-rules with a larger number of parts of speech and proceeds to event sub-rules with a smaller number of parts of speech. That is, if the part-of-speech identifier corresponding to a unit word matches an event sub-rule with a larger number of parts of speech, then event sub-rules with a smaller number of parts of speech will not be matched.

[0050] See Figure 2 Step S20 includes the following steps:

[0051] Step S21: Combine the part-of-speech tags of several adjacent unit words according to the order of the corresponding unit words to obtain multiple part-of-speech combinations;

[0052] Step S22: Match the event sub-rule corresponding to the part-of-speech combination in the preset event rule set;

[0053] Step S23: If an event sub-rule corresponding to the part-of-speech combination is matched, the unit words corresponding to the part-of-speech combination are combined to obtain the unit event.

[0054] If the consecutive unit words obtained from the text to be extracted include [pair(“engine”, “n”), pair(“failure”, “a”), pair(“cause”, “v”), pair(“stop”, “n”)], then “engine” and “failure” just match the event sub-rule [n, a]. Therefore, “engine” and “failure” are combined to obtain the unit event “engine failure”, and no longer the event sub-rule of one part of speech is matched for “engine” and “failure”. “Stop” can also match the event sub-rule [n]. Therefore, “stop” is treated as a separate unit event.

[0055] Step S30: Obtain the trained rule model, input the unit event into the trained rule model, and obtain the causal relationship extraction result of the text to be extracted through the output of the trained rule model.

[0056] The rule model is a machine learning model, and the specific type of rule model can be selected based on the actual application scenario and needs, such as support vector machines, etc., without limitation here. It should be noted that the training of the rule model can be set according to actual needs. The following describes one optional method, and other methods can be set up by analogy, without further details. Training samples are obtained, which include multiple sub-samples. These sub-samples can be manually labeled or obtained from online resources. Each sub-sample contains two training events and their corresponding causal labels. For example, extracting the text "Testing RF signal, spurious signals were found in the RF signal, fault location signal processor malfunction" yields three training events: "Testing RF signal", "RF signal has spurious signals", and "Signal processor malfunction". The causal relationship between any two training events is labeled to obtain three sub-samples: ["Testing RF signal", "RF signal has spurious signals", "0"]; ["RF signal has spurious signals", "Signal processor malfunction", "1"]; ["Testing RF signal", "Signal processor malfunction", "0"]. A causal label of 1 indicates a causal relationship, and a causal label of 0 indicates no causal relationship. When training the rule model, the two training events in a sub-sample are used as input, and the rule model is optimized based on the output of the rule model and the causal labels. It should be noted that the convergence conditions, loss functions, and other settings for rule model training can be selected based on the actual application scenario and requirements, which will not be elaborated here.

[0057] This embodiment pre-sets an event rule set and, when event extraction is required from the text to be extracted, directly matches unit words using the pre-set event rule set without needing to analyze the dependency relationships between unit words. This greatly reduces the event extraction time and improves the efficiency of causal relationship extraction.

[0058] Furthermore, in the second embodiment of the causal relationship extraction method of the present invention based on the first embodiment of the present invention, the following steps are included before step S20:

[0059] Step S40: Obtain known event data, and obtain the known unit words and known parts of speech in the known event data;

[0060] Step S50: Combine the known parts of speech based on the order of the corresponding known unit words to obtain the event sub-rules;

[0061] Step S60: Add the event sub-rule to the preset event rule set.

[0062] Known event data refers to data that explicitly represents a single event. Known event data can be manually annotated or obtained from relevant online resources. Known event data includes known unit words and known parts of speech; for example, known event data could be [pair(“engine”, “n”), pair(“failure”, “a”)], where the known unit words and their corresponding known parts of speech are engine / noun and failure / adjective, respectively. After obtaining this known event data, the known parts of speech [n, a] is extracted and added as an event sub-rule to the preset event rule set. It is understood that the parts of speech in the event sub-rules have a relative order; for example, the event sub-rule of [n, a] indicates that in two consecutive unit words, the unit word preceding it has the part of speech of a noun, and the unit word following it has the part of speech of an adjective.

[0063] This embodiment can reasonably construct a preset event rule set.

[0064] Furthermore, in the third embodiment of the causal relationship extraction method of the present invention based on the first embodiment of the present invention, step S30 includes the following steps:

[0065] Step S31: Combine any two of the unit events to obtain multiple judgment combinations;

[0066] Step S32: Input each of the judgment combinations into the trained rule model to obtain the sub-relationships corresponding to each judgment combination;

[0067] Step S33: Obtain the causal relationship extraction result through each of the sub-relationships.

[0068] In this embodiment, the causal relationship between two unit events is determined separately, and a complete causal chain is obtained based on the determination result. For example, if the currently extracted unit events are ordered A, B, C, D, and E in the text to be extracted, combining any two of these unit events can yield... Ten judgment combinations are given as [AB][AC][AD][AE][BC][BD][BE][CD][CE][DE]. These ten judgment combinations are input into the trained rule model to obtain ten sub-relations. If the ten sub-relations are (1, 0, 0, 0, 1, 0, 0, 1, 0, 1), where 1 indicates a causal relationship and 0 indicates no causal relationship, then [AB][BC][CD][DE] are causal relationships. Therefore, the causal relationship extraction result is [A]→[B]→[C]→[D]→[E].

[0069] Step S31 includes the following steps:

[0070] Step S311: Obtain the event interval between any two of the unit events;

[0071] Step S312: Combine two unit events with an event interval less than a preset interval to obtain multiple judgment combinations.

[0072] The event interval refers to the difference between the positional order of two unit events in the text to be extracted. For example, if the currently extracted unit events are A, B, C, D, and E according to their order in the text to be extracted, the event intervals between [AB][AC][AD][AE] are 1, 2, 3, and 4, respectively. Since events with causal relationships are usually relatively close in position during the actual extraction process, a preset interval is set to reduce the number of judgment steps. Only two unit events with an event interval less than the preset interval are combined to obtain a judgment combination. For example, if the preset interval is set to 3, there are 7 judgment combinations obtained from A, B, C, D, and E, namely [AB][AC][BC][BD][CD][CE][DE]. Compared to combining all the events mentioned above, this reduces the number of judgment combinations by 3, thus reducing the judgment steps of the rule model by three times and improving extraction efficiency.

[0073] This embodiment can reasonably combine unit events and improve extraction efficiency.

[0074] Furthermore, in the fourth embodiment of the causal relationship extraction method of the present invention based on the first embodiment of the present invention, step S30 includes the following steps:

[0075] Step S34: Obtain a preset causal rule, and match the keyword sub-rule corresponding to the text to be extracted in the preset causal rule to obtain the keyword matching result;

[0076] Keywords are words used to indicate the causal relationship between two key events; keyword sub-rules are represented by a sequential combination of several keywords; preset causal rules are a set of multiple keyword sub-rules.

[0077] A keyword sub-rule can contain one or more causal relationships. For example, when there is only one causal relationship, the keyword sub-rule can be represented as:

[0078] Key words: (Because) A (therefore) B; Causal relationship: [A] → [B];

[0079] Keyword condition: A (is due to / is caused by) B (caused by / leads to); Causal relationship: [B] → [A];

[0080] Keyword condition: A (the reason is / the cause / because / due to) B; Causal relationship: [B] → [A];

[0081] Key words: (This leads to) A (ultimately causes) B; Causal relationship: [A] → [B];

[0082] When there are two causal relationships, the keyword sub-rule can be represented as:

[0083] Key condition: A (is caused by) B (caused by) C (leading to); Causal relationship: [B] → [C] → [A];

[0084] Keyword conditions: A (reason / due to / because) B (may lead to) C; Causal relationship: [B]→[C]→[A];

[0085] Keyword conditions: A (reason / due to / because) B (lead to / subsequently) C; Causal relationship: [B]→[C]→[A];

[0086] Key words: A (cause / lead to / cause / lead to / therefore / cause) B (cause / promote / lead to / therefore / cause / therefore / , cause) C; Causal relationship: [A]→[B]→[C];

[0087] When there are three causal relationships, the keyword sub-rule can be represented as:

[0088] Key words and conditions: A (the reason for the occurrence,) B (caused) C (caused) D (led to); Causal relationship: [B]→[C]→[D]→[A];

[0089] Key words: A (cause / due to / cause) B (cause / lead to / cause) C (cause / lead to) D; Causal relationship: [B]→[C]→[D]→[A];

[0090] Key words: A (caused) B (caused / triggered) C (led to / caused) D; Causal relationship: [A]→[B]→[C]→[D];

[0091] Key words: A (cause / lead to / cause / lead to / therefore / cause) B (cause / promote / lead to / therefore / cause / cause) C (cause) D; Causal relationship: [A]→[B]→[C]→[D];

[0092] A, B, C, and D above are key events, and the text in parentheses contains keywords. When the keywords in the text to be extracted meet the keyword conditions, the causal relationship of the key events in the text to be extracted is the causal relationship corresponding to the met keyword conditions. It should be noted that the keywords in parentheses are only illustrative examples and can be expanded based on actual statements. Also, the above is only an example; when the number of causal relationships exceeds 3, it can be set by analogy, which will not be elaborated here.

[0093] Step S34 includes the following steps:

[0094] Step S341: Obtain multiple preset keywords, match the keywords in the text to be extracted, and obtain the key events between each keyword in the text to be extracted;

[0095] Step S342: Combine the matched keywords based on their positions in the text to be extracted to obtain keyword combinations;

[0096] Step S343: Match the keyword sub-rule corresponding to the keyword combination in the preset causal rules;

[0097] Step S344: Obtain the event causal relationship corresponding to the keyword sub-rule, and use the event causal relationship as the causal relationship between each of the key events to obtain the keyword matching result.

[0098] The causal relationships between key events in the text to be extracted are determined by matching keywords in the preset causal rules. It should be noted that when matching keyword sub-rules, the matching is first performed with keyword sub-rules with more causal relationships. If no matching is found, the matching is then performed with keyword sub-rules with fewer causal relationships, until the matching keyword sub-rule is found.

[0099] Step S35: Obtain the causal relationship extraction result by combining the output of the trained rule model with the keyword matching result.

[0100] The causal relationship extraction result obtained through keyword matching is suitable for cases with obvious keywords, while the causal relationship extraction result obtained through the trained rule model is suitable for cases without obvious keywords. Therefore, both extraction methods are applicable to more application scenarios. When the results obtained by the two methods are different, the results can be prioritized, such as using the result with more events or more events with causal relationships as the final causal relationship extraction result; or the two results can be combined, for example, the output of the trained rule model yields [A]→[B]→[C]; [D]→[E], and the keyword matching result yields [B]→[C]→[D], combining the two results to obtain the causal relationship extraction result [A]→[B]→[C]→[D]→[E].

[0101] This embodiment can obtain more accurate causal relationship extraction results by combining the rule model with the preset causal rule matching.

[0102] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0103] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0104] This application also provides a causal relationship extraction apparatus for implementing the above-described causal relationship extraction method, the causal relationship extraction apparatus comprising:

[0105] The first receiving module is used to receive the text to be extracted, perform word segmentation on the text to be extracted to obtain multiple unit words, and perform part-of-speech tagging on each unit word to obtain the part-of-speech identifier corresponding to each unit word.

[0106] The first acquisition module is used to acquire a preset event rule set, and combine the part-of-speech tag with the unit words that match the event sub-rules in the preset event rule set to obtain multiple unit events;

[0107] The second acquisition module is used to acquire the trained rule model, input the unit event into the trained rule model, and obtain the causal relationship extraction result of the text to be extracted through the output of the trained rule model.

[0108] This causal relationship extraction device pre-sets an event rule set and, when event extraction is required from the text to be extracted, directly matches unit words using the pre-set event rule set without needing to analyze the dependency relationships between unit words. This greatly reduces the event extraction time and thus improves the efficiency of causal relationship extraction.

[0109] It should be noted that the first receiving module in this embodiment can be used to execute step S10 in this application embodiment, the first acquiring module in this embodiment can be used to execute step S20 in this application embodiment, and the second acquiring module in this embodiment can be used to execute step S30 in this application embodiment.

[0110] Furthermore, the causal relationship extraction device also includes:

[0111] The third acquisition module is used to acquire known event data and obtain the known unit words and known parts of speech in the known event data;

[0112] The first combination module is used to combine the known parts of speech based on the arrangement order of the corresponding known unit words to obtain the event sub-rules;

[0113] The first adding module is used to add the event sub-rule to the preset event rule set.

[0114] Further, the step of combining the part-of-speech tag with the unit words matched with the event sub-rules in the preset event rule set to obtain multiple unit events includes:

[0115] The first combination unit is used to combine the part-of-speech tags of several adjacent unit words according to the order of the corresponding unit words to obtain multiple part-of-speech combinations;

[0116] The first matching unit is used to match the event sub-rule corresponding to the part-of-speech combination in the preset event rule set;

[0117] The second combination unit is used to combine the unit words corresponding to the part-of-speech combination to obtain the unit event if an event sub-rule corresponding to the part-of-speech combination is matched.

[0118] Furthermore, the second acquisition module includes:

[0119] The third combination unit is used to combine any two of the unit events to obtain multiple judgment combinations;

[0120] The first judgment unit is used to input each of the judgment combinations into the trained rule model to obtain the sub-relationships corresponding to each judgment combination.

[0121] The first execution unit is used to obtain the causal relationship extraction result through each of the sub-relationships.

[0122] Furthermore, the third assembly unit includes:

[0123] The first acquisition subunit is used to acquire the event interval between any two unit events;

[0124] The first combination subunit is used to combine two unit events with an event interval less than a preset interval to obtain multiple judgment combinations.

[0125] Furthermore, the second acquisition module includes:

[0126] The first acquisition unit is used to acquire a preset causal rule and match the keyword sub-rule corresponding to the text to be extracted in the preset causal rule to obtain the keyword matching result.

[0127] The second execution unit is used to obtain the causal relationship extraction result through the output of the trained rule model and the keyword matching result.

[0128] Further, the first acquisition unit includes:

[0129] The second acquisition subunit is used to acquire multiple preset keywords, match the keywords in the text to be extracted, and obtain the key events between each keyword in the text to be extracted.

[0130] The second combination subunit is used to combine the matched keywords based on their positions in the text to be extracted to obtain keyword combinations;

[0131] The first matching subunit is used to match the keyword sub-rule corresponding to the keyword combination in the preset causal rule;

[0132] The third acquisition subunit is used to acquire the event causal relationship corresponding to the keyword sub-rule, and use the event causal relationship as the causal relationship between each of the key events to obtain the keyword matching result.

[0133] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the content disclosed in the above embodiments. It should also be noted that the above modules, as part of the device, can be implemented in software or hardware, wherein the hardware environment includes a network environment.

[0134] Reference Figure 3 In terms of hardware structure, the electronic device may include components such as a communication module 10, a memory 20, and a processor 30. In the electronic device, the processor 30 is connected to both the memory 20 and the communication module 10. The memory 20 stores a computer program, which is executed by the processor 30. When the computer program is executed, it implements the steps of the above-described method embodiments.

[0135] The communication module 10 can connect to external communication devices via a network. The communication module 10 can receive requests from the external communication devices and can also send requests, instructions, and information to the external communication devices. The external communication devices can be other electronic devices, servers, or IoT devices, such as televisions, etc.

[0136] The memory 20 can be used to store software programs and various data. The memory 20 may primarily include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as performing word segmentation on the text to be extracted to obtain multiple unit words), etc.; the data storage area may include a database, and may store data or information created according to system usage, etc. Furthermore, the memory 20 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.

[0137] The processor 30 is the control center of the electronic device. It connects various parts of the electronic device via various interfaces and lines. By running or executing software programs and / or modules stored in the memory 20, and by calling data stored in the memory 20, it performs various functions and processes data, thereby providing overall monitoring of the electronic device. The processor 30 may include one or more processing units; optionally, the processor 30 may integrate an application processor and a modem processor. The application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 30.

[0138] although Figure 3 Not shown, but the above-described electronic device may further include a circuit control module for connecting to a power supply to ensure the normal operation of other components. Those skilled in the art will understand that... Figure 3 The electronic device structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0139] The present invention also proposes a computer-readable storage medium having a computer program stored thereon. The computer-readable storage medium may be... Figure 3The memory 20 in the electronic device may also be at least one of ROM (Read-Only Memory) / RAM (Random Access Memory), magnetic disk, optical disk, etc. The computer-readable storage medium includes a number of instructions to cause a terminal device with a processor (which may be a television, automobile, mobile phone, computer, server, terminal, or network device, etc.) to execute the methods described in the various embodiments of the present invention.

[0140] In this invention, the terms "first," "second," "third," "fourth," and "fifth" are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0141] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0142] Although embodiments of the present invention have been shown and described above, the scope of protection of the present invention is not limited thereto. It is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, and substitutions to the above embodiments within the scope of the present invention, and such changes, modifications, and substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for extracting causal relationships, characterized in that, The method includes: Receive the text to be extracted, perform word segmentation on the text to be extracted to obtain multiple unit words, and perform part-of-speech tagging on each unit word to obtain the part-of-speech identifier corresponding to each unit word; Obtain a preset event rule set, and combine the part-of-speech identifier with the unit words that match the event sub-rules in the preset event rule set to obtain multiple unit events, wherein the event sub-rules are combinations of multiple parts of speech; Obtain the trained rule model, input the unit event into the trained rule model, and obtain the causal relationship extraction result of the text to be extracted through the output of the trained rule model; The step of combining the part-of-speech tag with the unit words matched with the event sub-rules in the preset event rule set to obtain multiple unit events includes: The part-of-speech tags of several adjacent unit words are combined according to the order of the corresponding unit words to obtain multiple part-of-speech combinations; Match the event sub-rule corresponding to the part-of-speech combination in the preset event rule set; If an event sub-rule corresponding to the part-of-speech combination is matched, the unit words corresponding to the part-of-speech combination are combined to obtain the unit event.

2. The causal relationship extraction method as described in claim 1, characterized in that, Prior to the step of obtaining the preset event rules, the following steps are included: Obtain known event data, and then obtain the known unit words and known parts of speech in the known event data; The known parts of speech are combined based on the order of the corresponding known unit words to obtain the event sub-rules; Add the event sub-rule to the preset event rule set.

3. The causal relationship extraction method as described in claim 1, characterized in that, The step of inputting the unit event into the trained rule model and obtaining the causal relationship extraction result of the text to be extracted through the output of the trained rule model includes: Combine any two of the aforementioned unit events to obtain multiple judgment combinations; Each of the aforementioned judgment combinations is input into the trained rule model to obtain the sub-relations corresponding to each of the aforementioned judgment combinations; The causal relationship extraction result is obtained through each of the sub-relationships.

4. The causal relationship extraction method as described in claim 3, characterized in that, The step of combining any two of the unit events to obtain multiple judgment combinations includes: Obtain the event interval between any two of the aforementioned unit events; Two unit events with an event interval less than a preset interval are combined to obtain multiple judgment combinations.

5. The causal relationship extraction method as described in claim 1, characterized in that, The step of obtaining the causal relationship extraction result of the text to be extracted from the output of the trained rule model includes: Obtain preset causal rules, and match keyword sub-rules corresponding to the text to be extracted in the preset causal rules to obtain keyword matching results; The causal relationship extraction result is obtained by combining the output of the trained rule model with the keyword matching result.

6. The causal relationship extraction method as described in claim 5, characterized in that, The step of matching the keyword sub-rules corresponding to the text to be extracted in the preset causal rules to obtain the keyword matching result includes: Obtain multiple preset keywords, match the keywords in the text to be extracted, and obtain the key events between each keyword in the text to be extracted; The matched keywords are combined based on their positions in the text to be extracted to obtain keyword combinations; Match the keyword sub-rule corresponding to the keyword combination in the preset causal rules; Obtain the event causal relationship corresponding to the keyword sub-rule, and use the event causal relationship as the causal relationship between each of the key events to obtain the keyword matching result.

7. A causal relationship extraction device, characterized in that, The causal relationship extraction device includes: The first receiving module is used to receive the text to be extracted, perform word segmentation on the text to be extracted to obtain multiple unit words, and perform part-of-speech tagging on each unit word to obtain the part-of-speech identifier corresponding to each unit word. The first acquisition module is used to acquire a preset event rule set, and combine the part-of-speech identifier with the unit words that match the event sub-rules in the preset event rule set to obtain multiple unit events, wherein the event sub-rules are combinations of multiple parts of speech; The second acquisition module is used to acquire the trained rule model, input the unit event into the trained rule model, and obtain the causal relationship extraction result of the text to be extracted through the output of the trained rule model. The step of combining the part-of-speech tag with the unit words matched with the event sub-rules in the preset event rule set to obtain multiple unit events includes: The first combination unit is used to combine the part-of-speech tags of several adjacent unit words according to the order of the corresponding unit words to obtain multiple part-of-speech combinations; The first matching unit is used to match the event sub-rule corresponding to the part-of-speech combination in the preset event rule set; The second combination unit is used to combine the unit words corresponding to the part-of-speech combination to obtain the unit event if an event sub-rule corresponding to the part-of-speech combination is matched.

8. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the steps of the causal relationship extraction method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the causal relationship extraction method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Causal event map construction method, system and device and storage medium

    CN109726293A

  • Information extraction method based on machine reading understanding and related equipment thereof

    CN111814466A