An event graph construction and reasoning method and device based on sentence similarity

By constructing event clusters and calculating the probabilities of causal events, the problem of low efficiency in converting event graphs into Bayesian network structures in bulk commodity electronic trading is solved, the network structure is simplified, and the efficiency of finding causes and results is improved.

CN115269780BActive Publication Date: 2026-02-24BEIJING INFORMATION SCI & TECH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210927689.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-03
Publication Date
2026-02-24
Estimated Expiration
2042-08-03

AI Technical Summary

Technical Problem

Existing technologies are inefficient in converting event graphs into Bayesian network structures in the field of electronic commodity trading, and existing methods for calculating sentence similarity suffer from semantic gaps and inefficiency.

Method used

By extracting causal relationships and event descriptions from the original text, an initial event graph is constructed, the similarity between event descriptions is calculated, events with similarity greater than a set threshold are merged into event clusters, the probability of event clusters is calculated, the network structure is simplified, and the probability of causal events is calculated.

Benefits of technology

A simplified network structure for event graphs was implemented, improving the efficiency of finding causes and results and simplifying the transformation process of Bayesian network structures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115269780B_ABST
    Figure CN115269780B_ABST
Patent Text Reader

Abstract

The application provides an event graph construction reasoning method and device based on sentence similarity. The method comprises the following steps: extracting a cause-effect relationship and event description from an original text, and constructing an initial event graph; calculating the similarity between nodes, i.e. event descriptions, in the initial event graph, merging events with a cause-effect relationship and a similarity greater than a set threshold into an event cluster to obtain an event cluster graph; inputting an event description into the event cluster graph, determining an event cluster in which an event with the greatest similarity to the event description is located, returning a partial event cluster graph having a direct cause-effect relationship with the event cluster, and calculating a related cause-effect event probability. The application merges events into event clusters based on similarity calculation, replaces events as nodes in a network structure, simplifies the network structure, and improves the efficiency of finding causes and results.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of natural language processing, and particularly relates to an event graph construction reasoning method and device based on sentence similarity. BACKGROUND

[0002] There are many uncertain risks in the field of electronic commodity trading, and changes in commodities or related factors will affect the trading process. The causal relationship between events is one of the key factors that affect people's logical reasoning. Accurately sorting out the causal relationship between events can to some extent avoid the risks in the field of electronic commodity trading. Using an event graph with a Bayesian network structure for causal reasoning can fully analyze the uncertainty of events. In the process of constructing an event graph based on a large amount of data, if only one event is used as a network node, the overall structure will be large, it is not convenient to calculate the probability of event occurrence, and it will affect subsequent reasoning, so a simple network structure that is convenient for reasoning is needed. In the process of converting an event graph with a large number of nodes into a Bayesian network structure, a lot of time is needed for actual operation, and if the Bayesian related theory is used to assist reasoning, a method for quickly converting an event graph into a Bayesian network structure is needed.

[0003] Sentence similarity calculation is one of the research directions in the field of natural language processing. By calculating the similarity of sentences, two similar sentences can be regarded as the same sentence under certain conditions. By combining this technology, the purpose of simplifying the network structure of the event graph can be achieved to some extent. There are many methods for calculating sentence similarity, which can be roughly divided into two categories: one is to convert the sentence into a vector representation by using TF-IDF, BERT and other methods, and then calculate the similarity between the two vectors by using cosine similarity, Euclidean distance and other methods to represent the similarity of the sentences; the other is to calculate the similarity between two sentences by using the information of the words in the sentences, such as the number of synonyms and the order of words. The existing similarity calculation methods have the problems of semantic loss and low efficiency. SUMMARY

[0004] In order to solve the above problems in the prior art, the application provides an event graph construction reasoning method and device based on sentence similarity.

[0005] In order to achieve the above purpose, the application adopts the following technical scheme.

[0006] In the first aspect, the application provides an event graph construction reasoning method based on sentence similarity, comprising the following steps:

[0007] extracting causal relationships and event descriptions from the original text to construct an initial event graph with event descriptions as nodes and corresponding causal relationships between events as edges;

[0008] Calculate the similarity between nodes in the initial event graph, i.e., event descriptions, and merge the causally related events with similarity greater than a set threshold into an event cluster, calculate the probability of the event cluster, and obtain an event cluster graph;

[0009] Input the event description into the event cluster graph, determine the event cluster where the event description has the greatest similarity, return the partial event cluster graph that has a direct causal relationship with the event cluster, and calculate the related causal event probability.

[0010] Further, the extraction method of causal relationship and event description includes:

[0011] Based on the sentences containing causal cue words in the original text in set C, an initial sentence set S is constructed, and set C is a set of causal cue words in Chinese representing causal meaning;

[0012] The sentences containing one causal cue word in set S are denoted as S1, and the sentences with the causal cue word at the beginning, middle and end of the sentence in S1 are denoted as S 1F , S 1M and S 1L , respectively.

[0013] According to the common method of cue words, the part of the sentence where the causal cue word belongs in S 1F is taken as the cause event description, the part of the sentence where the causal cue word belongs in S 1L is taken as the result event description, and the two parts of the sentence before and after the causal cue word in S 1M are taken as the cause event description and the result event description, respectively. A set S C composed of all cause events and a set S R composed of all result events are constructed, and the causal relationship between S C and S R is recorded.

[0014] Further, the calculation method of sentence similarity includes:

[0015] The sentences S1 and S2 are represented as vectors V1 and V2.

[0016] The cosine similarity Sim cos of V1 and V2 is calculated.

[0017] The nouns N1 and N2 in S1 and S2 are extracted, the number n same of the same words in N1 and N2 is counted, and the noun similarity Same of S1 and S2 is calculated according to formula (1):

[0018] Same=n same / (n1+n2-nsame (1)

[0019] In the formula, n1 and n2 are the number of words contained in N1 and N2, respectively;

[0020] Count the number of pairs n of synonyms in N1 and N2. sim Calculate the noun synonymity Sim of S1 and S2 according to formula (2). noun :

[0021] Sim noun =n sim / (n1×n2) (2)

[0022] The similarity Sim between S1 and S2 is calculated according to equation (3):

[0023] Sim = α × Sim cos +β×Same+γ×Sim noun (3)

[0024] In the formula, α, β, and γ are weighting coefficients, and α+β+γ=1; the value of Sim is between 0 and 1, where Sim=0 means that the two sentences are completely different, and Sim=1 means that they are completely the same.

[0025] Furthermore, if the returned partial event cluster map contains a ring structure, the causal relationship with the fewest occurrences in the ring structure is deleted; when the 1st, 2nd, ..., Nth event clusters have causal relationships in sequence, the N event clusters form a ring structure, and N≥3.

[0026] Furthermore, the calculation of the probability of the relevant causal event includes:

[0027] If there is a causal relationship between event clusters k and j, and k is the cause and j is the effect, calculate the posterior probability P(j|k) of event cluster j given that event cluster k has occurred, according to equation (4):

[0028] P(j|k)=P(k|j)P(j) / P(k) (4)

[0029] In the formula, P(k)=E k / E A P(j) = E j / E A P(k|j)=E kj / E j E k E j E represents the number of occurrences of event clusters k and j, respectively. A E represents the total number of events. kj Let k be the number of times event clusters k and j occur simultaneously.

[0030] When using the event cluster graph for reasoning, it is assumed that the input event t will definitely occur, i.e., P(t) = 1. The probability of the event r occurring is calculated according to equation (4) as P(r|t).

[0031] Calculate the probability P(c|t) of the causal event c based on equations (5) and (6):

[0032]

[0033]

[0034] In the formula, LS c-t Let c be a measure of the sufficiency of event c with respect to event t. This indicates that c does not occur.

[0035] Secondly, the present invention provides an event graph construction reasoning device based on statement similarity, comprising:

[0036] The first graph construction module is used to extract causal relationships and event descriptions from the original text and construct an initial event graph with event descriptions as nodes and corresponding causal relationships between events as edges.

[0037] The second graph construction module is used to calculate the similarity between nodes, i.e., event descriptions, in the initial event graph, merge causally related events with similarity greater than a set threshold into an event cluster, calculate the probability of the event cluster, and obtain the event cluster graph.

[0038] The graph reasoning module is used to input event descriptions into the event cluster graph, determine the event cluster containing the event with the highest similarity to the event description, return the partial event cluster graph that has a direct causal relationship with the event cluster, and calculate the probability of related causal events.

[0039] Furthermore, methods for extracting causal relationships and event descriptions include:

[0040] Based on sentences in the original text that contain causal cue words from set C, construct an initial sentence set S, where set C is the set of causal cue words in Chinese that represent causal meaning;

[0041] Let S1 be the set of sentences containing one causal cue word, and let S1 be the set of sentences in S1 where the causal cue word appears at the beginning, middle, and end of the sentence. 1F S 1M and S 1L ;

[0042] Following the common methods for using prompt words, S 1F The sentence containing the causal indicator is used as the description of the causal event, and S is... 1L The sentence containing the causal cue words is used as the description of the resulting event, and S is...1M The two sentences before and after the causal indicator serve as the description of the causal event and the description of the result event, respectively; a set S consisting of all causal events is constructed. C and the set S consisting of all outcome events R And record S C and S R The causal relationship between the sentences.

[0043] Furthermore, methods for calculating sentence similarity include:

[0044] Represent sentences S1 and S2 as vectors V1 and V2;

[0045] Calculate the cosine similarity Sim between V1 and V2. cos ;

[0046] Extract nouns N1 and N2 from S1 and S2, and count the number of identical words n in N1 and N2. same Calculate the noun similarity (Same) of S1 and S2 according to formula (1):

[0047] Same = n same / (n1+n2-n same (1)

[0048] In the formula, n1 and n2 are the number of words contained in N1 and N2, respectively;

[0049] Count the number of pairs n of synonyms in N1 and N2. sim Calculate the noun synonymity Sim of S1 and S2 according to formula (2). noun :

[0050] Sim noun =n sim / (n1×n2) (2)

[0051] The similarity Sim between S1 and S2 is calculated according to equation (3):

[0052] Sim = α × Sim cos +β×Same+γ×Sim noun (3)

[0053] In the formula, α, β, and γ are weighting coefficients, and α+β+γ=1; the value of Sim is between 0 and 1, where Sim=0 means that the two sentences are completely different, and Sim=1 means that they are completely the same.

[0054] Furthermore, if the returned partial event cluster map contains a ring structure, the causal relationship with the fewest occurrences in the ring structure is deleted; when the 1st, 2nd, ..., Nth event clusters have causal relationships in sequence, the N event clusters form a ring structure, and N≥3.

[0055] Furthermore, the calculation of the probability of the relevant causal event includes:

[0056] If there is a causal relationship between event clusters k and j, and k is the cause and j is the effect, calculate the posterior probability P(j|k) of event cluster j given that event cluster k has occurred, according to equation (4):

[0057] P(j|k)=P(k|j)P(j) / P(k) (4)

[0058] In the formula, P(k)=E k / E A P(j) = E j / E A P(k|j)=E kj / E j E k E j E represents the number of occurrences of event clusters k and j, respectively. A E represents the total number of events. kj Let k be the number of times event clusters k and j occur simultaneously.

[0059] When using the event cluster graph for reasoning, it is assumed that the input event t will definitely occur, i.e., P(t) = 1. The probability of the event r occurring is calculated according to equation (4) as P(r|t).

[0060] Calculate the probability P(c|t) of the causal event c based on equations (5) and (6):

[0061]

[0062]

[0063] In the formula, LS c-t Let c be a measure of the sufficiency of event c with respect to event t. This indicates that c does not occur.

[0064] Compared with the prior art, the present invention has the following beneficial effects.

[0065] This invention constructs an initial event graph by extracting causal relationships and event descriptions from the original text. It calculates the similarity between nodes (event descriptions) in the initial event graph, merges causally related events with similarity greater than a set threshold into event clusters, calculates the probability of each event cluster, and obtains an event cluster graph. By inputting event descriptions into the event cluster graph, it identifies the event cluster containing the event with the highest similarity to the described event, returns a partial event cluster graph with a direct causal relationship to the described event cluster, and calculates the probabilities of related causal events. This achieves the construction and reasoning of an event graph based on sentence similarity. This invention simplifies the network structure by merging events into event clusters instead of using events as nodes in the network structure based on similarity calculation, thus improving the efficiency of finding causes and results. Attached Figure Description

[0066] Figure 1 This is a flowchart of an event graph construction reasoning method based on statement similarity, according to an embodiment of the present invention.

[0067] Figure 2 This is a schematic diagram of the processing of ring structures contained in the event graph.

[0068] Figure 3 This is a block diagram of an event graph construction reasoning device based on statement similarity, according to an embodiment of the present invention. Detailed Implementation

[0069] To make the objectives, technical solutions, and advantages of this invention clearer and more understandable, the invention will be further described below in conjunction with the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0070] Figure 1 This is a flowchart of an event graph construction and reasoning method based on statement similarity according to an embodiment of the present invention, including the following steps:

[0071] Step 101: Extract causal relationships and event descriptions from the original text, and construct an initial event graph with event descriptions as nodes and corresponding causal relationships between events as edges;

[0072] Step 102: Calculate the similarity between nodes, i.e. event descriptions, in the initial event graph. Merge causally related events with similarity greater than a set threshold into an event cluster, calculate the probability of the event cluster, and obtain the event cluster graph.

[0073] Step 103: Input the event description into the event cluster map, determine the event cluster containing the event with the highest similarity to the event description, return the partial event cluster map that has a direct causal relationship with the event cluster, and calculate the probability of the relevant causal events.

[0074] In this embodiment, step 101 is mainly used to construct an initial event graph. This embodiment extracts causal relationships and event descriptions from the original text and marks the corresponding causal relationships between events to obtain an initial event graph with event descriptions as nodes and corresponding causal relationships between events as edges. To facilitate the extraction of causal relationships and event descriptions from the original text, a set of causal prompt words composed of commonly used Chinese words that express causal meaning can be constructed first. Then, sentences containing words from the causal prompt word set are selected from the initial corpus, such as: "Thanks to everyone's concerted efforts, our company has achieved gratifying results." Below is an example of a causal prompt word set: {"because", "therefore", "exactly", "lead to", "reason", "the reason", "for this reason", "promote", "cause", "thus", "lead to", "so", "therefore", "lead to", "result", "cause", "cause", "lead to", "influence", "make", "enable"}.

[0075] In this embodiment, step 102 is mainly used to form an event cluster graph. This embodiment calculates the similarity between events and merges causally related events with similarities greater than a set threshold into event clusters, thus obtaining the event cluster graph. This is equivalent to merging nodes in the initial event spectrum; one event cluster corresponds to one merged node. The threshold can be the average of all similarities. Of course, the probability of each event cluster node is calculated by counting the occurrences of each event and each causal relationship within the event cluster. For example, event cluster node A contains 10 events a1, a2, ..., a10, with occurrence counts of c1, c2, ..., c10 respectively. Let N be the total number of occurrences of all events. Then, the probability of event cluster node A is (c1 + c2 + ... + c10) / N.

[0076] In this embodiment, step 103 is mainly used for reasoning using an event cluster graph. The event description is input into the event cluster graph, and similarity matching is performed on the events in the graph to find the most matching event cluster. The graph then returns a partial event cluster graph consisting of this event cluster and event clusters directly causally related to it. The most matching event cluster is the event cluster containing the event with the highest similarity to the input event description. This embodiment is applied to user queries about the causes or results of events. Based on a Bayesian causal network formed from the initial corpus, the system finds the event cluster with the highest similarity to the user's input event description, and infers the probability of each cause and result based on the relevant probabilities of this event cluster. The results are then fed back to the user.

[0077] This embodiment uses similarity calculation to merge events into event clusters instead of events as nodes in the network structure, which simplifies the network structure and improves the efficiency of finding causes and results.

[0078] As an optional embodiment, the method for extracting causal relationships and event descriptions includes:

[0079] Based on sentences in the original text that contain causal cue words from set C, construct an initial sentence set S, where set C is the set of causal cue words in Chinese that represent causal meaning;

[0080] Let S1 be the set of sentences containing one causal cue word, and let S1 be the set of sentences in S1 where the causal cue word appears at the beginning, middle, and end of the sentence. 1F S 1M and S 1L ;

[0081] Following the common methods for using prompt words, S 1F The sentence containing the causal indicator is used as the description of the causal event, and S is... 1L The sentence containing the causal cue words is used as the description of the resulting event, and S is... 1M The two sentences before and after the causal indicator serve as the description of the causal event and the description of the result event, respectively; a set S consisting of all causal events is constructed. C and the set S consisting of all outcome events R And record S C and S R The causal relationship between the sentences.

[0082] This embodiment provides a technical solution for extracting causal relationships and event descriptions from text. First, all sentences containing causal cue words from the original text (see the previous example) are extracted and combined into an initial sentence set S. Then, sentences in set S containing one causal cue word are denoted as S1, and further labeled as S1 based on whether the causal cue word is at the beginning, middle, or end of S1. 1F S 1M and S 1L For example: S 1F : As African swine fever outbreak severely damaged production capacity; S 1M The rising cost of feed corn for pig farming has put some pressure on pig farmers. Thus This fostered a mentality of resisting price increases and hoarding goods; S 1L The high base of comparison from the same period last year, coupled with the shift from rising to falling food prices, led by pork, was the main reason for the 0.5% year-on-year decrease in the November CPI. Because Next, determine the causal event description and the result event description according to the common methods for using prompt words: [S...] 1F The sentence containing the causal indicator is used as the description of the causal event, and S is... 1L The sentence containing the causal cue words is used as the description of the resulting event, and S is... 1M In a causal indicator, the two sentences before and after the indicator phrase serve as the description of the causal event and the description of the result event, respectively. For example, S 1M =“The rising cost of feed corn for pig farming has put some pressure on pig farmers.” Thus In the phrase "a mentality of resisting price increases and hoarding goods has emerged," the preceding phrase "the price increase of feed corn for pig farming has put some pressure on pig farmers" describes the causal event, while the following phrase "a mentality of resisting price increases and hoarding goods has emerged" describes the consequential event. Finally, a set S consisting of all causal events is constructed. C and the set S consisting of all outcome events R And record S C and S R The causal relationship between sentences. It is worth noting that this embodiment provides a method for determining the cause and effect events when a sentence contains only one causal cue word. Based on this, it is easy to obtain a method for determining the cause and effect events when a sentence contains multiple causal cue words, which will not be elaborated in detail here.

[0083] As an optional embodiment, the set threshold is equal to the average of the similarity of all events.

[0084] This embodiment provides a technical solution for setting a similarity threshold. This embodiment uses the average similarity of all events as the similarity threshold. It is worth noting that this embodiment only provides a preferred implementation method and does not exclude or negate other feasible threshold setting methods.

[0085] As an optional embodiment, the method for calculating sentence similarity includes:

[0086] Represent sentences S1 and S2 as vectors V1 and V2;

[0087] Calculate the cosine similarity Sim between V1 and V2. cos ;

[0088] Extract nouns N1 and N2 from S1 and S2, and count the number of identical words n in N1 and N2. same Calculate the noun similarity (Same) of S1 and S2 according to formula (1):

[0089] Same = n same / (n1+n2-n same (1)

[0090] In the formula, n1 and n2 are the number of words contained in N1 and N2, respectively;

[0091] Count the number of pairs n of synonyms in N1 and N2. sim Calculate the noun synonymity Sim of S1 and S2 according to formula (2). noun :

[0092] Sim noun =n sim / (n1×n2) (2)

[0093] The similarity Sim between S1 and S2 is calculated according to equation (3):

[0094] Sim = α × Sim cos +β×Same+γ×Sim noun (3)

[0095] In the formula, α, β, and γ are weighting coefficients, and α+β+γ=1; the value of Sim is between 0 and 1, where Sim=0 means that the two sentences are completely different, and Sim=1 means that they are completely the same.

[0096] This embodiment provides a technical solution for calculating sentence similarity. Currently, the methods for calculating sentence similarity can be roughly divided into two categories: one is to convert sentences into vector representations using methods such as TF-IDF and BERT, and then use methods such as cosine similarity and Euclidean distance to calculate the similarity between two vectors, thereby representing the sentence similarity; the other is to calculate the similarity between two sentences by using information about words in the sentences, such as the number of synonyms and the order of words. Existing methods only calculate sentence similarity from one dimension, which has problems such as semantic loss and low efficiency. Therefore, this embodiment calculates similarity from three dimensions, namely: the cosine similarity of the two sentence vectors, the noun similarity of the two sentences, and the noun synonymity of the two sentences. Then, the similarity of the three dimensions is weighted and summed to obtain the final similarity, as shown in equation (3).

[0097] As an optional embodiment, if the returned partial event cluster map contains a ring structure, the causal relationship with the fewest occurrences in the ring structure is deleted; when the 1st, 2nd, ..., Nth event clusters have causal relationships in sequence, the N event clusters form a ring structure, and N≥3.

[0098] This embodiment provides a method for handling situations where the returned partial event cluster map contains a ring structure. Figure 2 A schematic diagram of a ring structure consisting of similar event clusters A, B, and C is given. Figure 2 In the equation, the causal relationships AC, CB, and BA occur 10, 8, and 15 times respectively. The causal relationship that occurs the fewest times is CB (8 times), so the causal relationship CB is deleted.

[0099] As an optional embodiment, the calculation of the probability of the relevant causal event includes:

[0100] If there is a causal relationship between event clusters k and j, and k is the cause and j is the effect, calculate the posterior probability P(j|k) of event cluster j given that event cluster k has occurred, according to equation (4):

[0101] P(j|k)=P(k|j)P(j) / P(k) (4)

[0102] In the formula, P(k)=E k / E A P(j) = E j / E A P(k|j)=E kj / E j E k E j E represents the number of occurrences of event clusters k and j, respectively. A E represents the total number of events. kjLet k be the number of times event clusters k and j occur simultaneously.

[0103] When using the event cluster graph for reasoning, it is assumed that the input event t will definitely occur, i.e., P(t) = 1. The probability of the event r occurring is calculated according to equation (4) as P(r|t).

[0104] Calculate the probability P(c|t) of the causal event c based on equations (5) and (6):

[0105]

[0106]

[0107] In the formula, LS c-t Let c be a measure of the sufficiency of event c with respect to event t. This indicates that c does not occur.

[0108] This embodiment provides a technical solution for calculating the probability of causal events. First, this embodiment gives the formula for calculating the posterior probability P(j|k) of two event clusters k and j (k is the cause and j is the result) with a causal relationship, as shown in equation (4); then, according to equation (4), the probability P(r|t) of the result event r is calculated when using the event cluster map for reasoning, assuming that the input event t will definitely occur; finally, the probability P(c|t) of the cause event c is calculated according to equations (5) and (6).

[0109] Figure 3 This is a schematic diagram illustrating the composition of an event graph construction and reasoning device based on statement similarity according to an embodiment of the present invention. The device includes:

[0110] The first graph construction module 11 is used to extract causal relationships and event descriptions from the original text and construct an initial event graph with event descriptions as nodes and corresponding causal relationships between events as edges.

[0111] The second graph construction module 12 is used to calculate the similarity between nodes, i.e. event descriptions, in the initial event graph, merge causally related events with similarity greater than a set threshold into an event cluster, calculate the probability of the event cluster, and obtain the event cluster graph.

[0112] The graph reasoning module 13 is used to input the event description into the event cluster graph, determine the event cluster where the event with the highest similarity to the event description belongs, return the partial event cluster graph that has a direct causal relationship with the event cluster, and calculate the probability of the related causal events.

[0113] The apparatus of this embodiment can be used to perform Figure 1 The technical solutions of the illustrated method embodiments are similar in principle and technical effect, and will not be described again here. The same applies to the subsequent embodiments, which will not be elaborated upon further.

[0114] As an optional embodiment, the method for extracting causal relationships and event descriptions includes:

[0115] Based on sentences in the original text that contain causal cue words from set C, construct an initial sentence set S, where set C is the set of causal cue words in Chinese that represent causal meaning;

[0116] Let S1 be the set of sentences containing one causal cue word, and let S1 be the set of sentences in S1 where the causal cue word appears at the beginning, middle, and end of the sentence. 1F S 1M and S 1L ;

[0117] Following the common methods for using prompt words, S 1F The sentence containing the causal indicator is used as the description of the causal event, and S is... 1L The sentence containing the causal cue words is used as the description of the resulting event, and S is... 1M The two sentences before and after the causal indicator serve as the description of the causal event and the description of the result event, respectively; a set S consisting of all causal events is constructed. C and the set S consisting of all outcome events R And record S C and S R The causal relationship between the sentences.

[0118] As an optional embodiment, the method for calculating sentence similarity includes:

[0119] Represent sentences S1 and S2 as vectors V1 and V2;

[0120] Calculate the cosine similarity Sim between V1 and V2. cos ;

[0121] Extract nouns N1 and N2 from S1 and S2, and count the number of identical words n in N1 and N2. same Calculate the noun similarity (Same) of S1 and S2 according to formula (1):

[0122] Same = n same / (n1+n2-n same (1)

[0123] In the formula, n1 and n2 are the number of words contained in N1 and N2, respectively;

[0124] Count the number of pairs n of synonyms in N1 and N2. sim Calculate the noun synonymity Sim of S1 and S2 according to formula (2). noun :

[0125] Simnoun =n sim / (n1×n2) (2)

[0126] The similarity Sim between S1 and S2 is calculated according to equation (3):

[0127] Sim = α × Sim cos +β×Same+γ×Sim noun (3)

[0128] In the formula, α, β, and γ are weighting coefficients, and α+β+γ=1; the value of Sim is between 0 and 1, where Sim=0 means that the two sentences are completely different, and Sim=1 means that they are completely the same.

[0129] As an optional embodiment, if the returned partial event cluster map contains a ring structure, the causal relationship with the fewest occurrences in the ring structure is deleted; when the 1st, 2nd, ..., Nth event clusters have causal relationships in sequence, the N event clusters form a ring structure, and N≥3.

[0130] As an optional embodiment, the calculation of the probability of the relevant causal event includes:

[0131] If there is a causal relationship between event clusters k and j, and k is the cause and j is the effect, calculate the posterior probability P(j|k) of event cluster j given that event cluster k has occurred, according to equation (4):

[0132] P(j|k)=P(k|j)P(j) / P(k) (4)

[0133] In the formula, P(k)=E k / E A P(j) = E j / E A P(k|j)=E kj / E j E k E j E represents the number of occurrences of event clusters k and j, respectively. A E represents the total number of events. kj Let k be the number of times event clusters k and j occur simultaneously.

[0134] When using the event cluster graph for reasoning, it is assumed that the input event t will definitely occur, i.e., P(t) = 1. The probability of the event r occurring is calculated according to equation (4) as P(r|t).

[0135] Calculate the probability P(c|t) of the causal event c based on equations (5) and (6):

[0136]

[0137]

[0138] In the formula, LS c-t Let c be a measure of the sufficiency of event c with respect to event t. This indicates that c does not occur.

[0139] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included 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 constructing and reasoning about event graphs based on statement similarity, characterized in that, Includes the following steps: Extract causal relationships and event descriptions from the original text, and construct an initial event graph with event descriptions as nodes and corresponding causal relationships between events as edges; Calculate the similarity between nodes (i.e., event descriptions) in the initial event graph, merge causally related events with similarity greater than a set threshold into an event cluster, calculate the probability of the event cluster, and obtain the event cluster graph; Input the event description into the event cluster graph, determine the event cluster containing the event with the highest similarity to the event description, return the partial event cluster graph that has a direct causal relationship with the event cluster, and calculate the probability of the relevant causal events; The methods for extracting causal relationships and event descriptions include: Based on sentences in the original text that contain causal cue words from set C, construct an initial sentence set S, where set C is the set of causal cue words in Chinese that represent causal meaning; Let S1 be the set of sentences containing one causal cue word, and let S1 be the set of sentences in S1 where the causal cue word appears at the beginning, middle, and end of the sentence. 1F S 1M and S 1L ; Following the common methods for using prompt words, S 1F The sentence containing the causal indicator is used as the description of the causal event, and S is... 1L The sentence containing the causal cue words is used as the description of the resulting event, and S is... 1M The two sentences before and after the causal indicator serve as the description of the causal event and the description of the result event, respectively; a set S consisting of all causal events is constructed. C and the set S consisting of all outcome events R And record S C and S R The causal relationship between the sentences; The calculation of the probability of the relevant causal events includes: If there is a causal relationship between event clusters k and j, and k is the cause and j is the effect, calculate the posterior probability P(j|k) of event cluster j given that event cluster k has occurred, according to equation (4): P(j|k)=P(k|j)P(j) / P(k) (4) In the formula, P(k)=E k / E A P(j) = E j / E A P(k|j)=E kj / E j E k E j E represents the number of occurrences of event clusters k and j, respectively. A E represents the total number of events. kj Let k be the number of times event clusters k and j occur simultaneously. When using the event cluster graph for reasoning, it is assumed that the input event t will definitely occur, i.e., P(t) = 1. The probability of the event r occurring is calculated according to equation (4) as P(r|t). Calculate the probability P(c|t) of the causal event c based on equations (5) and (6): In the formula, LS c-t Let c be a measure of the sufficiency of event c with respect to event t. This indicates that c does not occur.

2. The event graph construction and reasoning method based on statement similarity according to claim 1, characterized in that, Methods for calculating sentence similarity include: Represent sentences S1 and S2 as vectors V1 and V2; Calculate the cosine similarity Sim between V1 and V2. cos ; Extract nouns N1 and N2 from S1 and S2, and count the number of identical words n in N1 and N2. same Calculate the noun similarity (Same) of S1 and S2 according to formula (1): Same=n same / (n1+n2-n same ) (1) In the formula, n1 and n2 are the number of words contained in N1 and N2, respectively; Count the number of pairs n of synonyms in N1 and N2. sim Calculate the noun synonymity Sim of S1 and S2 according to formula (2). noun : Yes noun =n sim / (n1×n2) (2) The similarity Sim between S1 and S2 is calculated according to equation (3): Try=α×Try cos +β×Same+γ×Sim noun (3) In the formula, α, β, and γ are weighting coefficients, and α+β+γ=1; the value of Sim is between 0 and 1, where Sim=0 means that the two sentences are completely different, and Sim=1 means that they are completely the same.

3. The event graph construction and reasoning method based on statement similarity according to claim 1, characterized in that, If the returned partial event cluster map contains a ring structure, delete the causal relationship that occurs the least in the ring structure; when the 1st, 2nd, ..., Nth event clusters have causal relationships in sequence, the N event clusters form a ring structure, and N≥3.

4. A reasoning device for constructing an event graph based on statement similarity, characterized in that, include: The first graph construction module is used to extract causal relationships and event descriptions from the original text and construct an initial event graph with event descriptions as nodes and corresponding causal relationships between events as edges. The second graph construction module is used to calculate the similarity between nodes, i.e., event descriptions, in the initial event graph, merge causally related events with similarity greater than a set threshold into an event cluster, calculate the probability of the event cluster, and obtain the event cluster graph. The graph reasoning module is used to input event descriptions into the event cluster graph, determine the event cluster containing the event with the highest similarity to the event description, return the partial event cluster graph that has a direct causal relationship with the event cluster, and calculate the probability of related causal events. The methods for extracting causal relationships and event descriptions include: Based on sentences in the original text that contain causal cue words from set C, construct an initial sentence set S, where set C is the set of causal cue words in Chinese that represent causal meaning; Let S1 be the set of sentences containing one causal cue word, and let S1 be the set of sentences in S1 where the causal cue word appears at the beginning, middle, and end of the sentence. 1F S 1M and S 1L ; Following the common methods for using prompt words, S 1F The sentence containing the causal indicator is used as the description of the causal event, and S is... 1L The sentence containing the causal cue words is used as the description of the resulting event, and S is... 1M The two sentences before and after the causal indicator serve as the description of the causal event and the description of the result event, respectively; a set S consisting of all causal events is constructed. C and the set S consisting of all outcome events R And record S C and S R The causal relationship between the sentences; The calculation of the probability of the relevant causal events includes: If there is a causal relationship between event clusters k and j, and k is the cause and j is the effect, calculate the posterior probability P(j|k) of event cluster j given that event cluster k has occurred, according to equation (4): P(j|k)=P(k|j)P(j) / P(k) (4) In the formula, P(k)=E k / E A P(j) = E j / E A P(k|j)=E kj / E j E k E j E represents the number of occurrences of event clusters k and j, respectively. A E represents the total number of events. kj Let k be the number of times event clusters k and j occur simultaneously. When using the event cluster graph for reasoning, it is assumed that the input event t will definitely occur, i.e., P(t) = 1. The probability of the event r occurring is calculated according to equation (4) as P(r|t). Calculate the probability P(c|t) of the causal event c based on equations (5) and (6): In the formula, LS c-t Let c be a measure of the sufficiency of event c with respect to event t. This indicates that c does not occur.

5. The event graph construction reasoning device based on sentence similarity according to claim 4, wherein the method for calculating sentence similarity includes: Represent sentences S1 and S2 as vectors V1 and V2; Calculate the cosine similarity Sim between V1 and V2. cos ; Extract nouns N1 and N2 from S1 and S2, and count the number of identical words n in N1 and N2. same Calculate the noun similarity (Same) of S1 and S2 according to formula (1): Same=n same / (n1+n2-n same ) (1) In the formula, n1 and n2 are the number of words contained in N1 and N2, respectively; Count the number of pairs n of synonyms in N1 and N2. sim Calculate the noun synonymity Sim of S1 and S2 according to formula (2). noun : Yes noun =n sim / (n1×n2) (2) The similarity Sim between S1 and S2 is calculated according to equation (3): Try=α×Try cos +β×Same+γ×Sim noun (3) In the formula, α, β, and γ are weighting coefficients, and α+β+γ=1; the value of Sim is between 0 and 1, where Sim=0 means that the two sentences are completely different, and Sim=1 means that they are completely the same.

6. The event graph construction reasoning device based on statement similarity according to claim 4, if the returned partial event cluster graph contains a ring structure, delete the causal relationship with the fewest occurrences in the ring structure; when the 1st, 2nd, ..., Nth event clusters have causal relationships in sequence, the N event clusters form a ring structure, and N≥3.

Citation Information

Patent Citations

  • Event atlas construction system and method based on multi-dimensional feature fusion and dependency syntax

    CN111581396A

  • Science and technology service-oriented reason graph construction method, device and equipment and storage medium

    CN112199512A