Causal relationship strength evaluation method and device, equipment, storage medium and product
By extracting the causal entity relationship and calculating the emotional value of the target text, combined with the frequency of the causal relationship, the problem of low accuracy in the assessment of the intensity of the causal relationship in the existing technology is solved, and a more realistic assessment of the intensity of the causal relationship is achieved.
Patent Information
- Application Number
- CN202411054489.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-02
- Publication Date
- 2024-08-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing methods for assessing the strength of causal relationships only rely on the frequency of causal relationships, which leads to the neglect of important but low-frequency causal relationships, and it is easy to reverse the main and secondary causes, resulting in low accuracy in causal relationship assessment.
By extracting the causal entity relationship from the target text, calculating the emotional value based on the emotional weight coefficient and part-of-speech structure, and conducting a comprehensive evaluation with the frequency of the causal entity relationship, the causal relationship weight is determined, and the causal relationship strength is evaluated.
It achieves a more realistic reflection of the importance of different causes to the result, avoids the distortion problem in the assessment of causality, and improves the accuracy and authenticity of the assessment of the strength of causality.
Smart Images

Figure CN118569249A
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of artificial intelligence technology, and in particular to a method, device, equipment, storage medium and product for evaluating the strength of causal relationships. Background Art
[0002] A causal network is a directed graph containing nodes and edges, which is usually used to represent and analyze the causal relationship between events. In a causal network, "nodes" represent "cause / result", and "edges" represent "causal relationship" between nodes. The starting point of the edge is "cause", and the end point is "result". The direction of the arrow indicates the causal direction. The size of the node represents the node frequency. The larger the node, the more frequently the cause / result represented by the node appears, and the more attention should be paid. The thickness of the edge represents the frequency of the edge, that is, the frequency of the repeated occurrence of the causal relationship. The thicker the edge, the more frequently the causal relationship occurs, and the more attention should be paid. Evaluating the strength of the causal relationship in an event helps to obtain the context of the event and understand the cause and effect of the event. At the same time, by calculating the weights of different causes of the same result in the extracted causal relationship pairs, the main cause and the secondary cause can be distinguished, which is more conducive to the application of causal relationships.
[0003] The existing causal relationship strength assessment methods mainly use the frequency of causal relationship pairs in the corpus to characterize the causal relationship strength. However, this method often gives extremely low weights to causal relationships in the text that have a low frequency of occurrence but are relatively important or need to be paid enough attention, and gives extremely high weights to some unimportant and frequently occurring causes, which easily ignores the impact of important causes on the results, resulting in a large gap between the causal network diagram and the actual causal relationship, reversing the main cause and the secondary cause, which is not conducive to the application of causal relationships and event context analysis. Therefore, evaluating the causal relationship strength only by frequency is prone to distortion, resulting in low accuracy in the causal relationship strength assessment. Therefore, there is an urgent need for a method that can truly evaluate the relationship strength in the actual causal network. Summary of the invention
[0004] In view of the above-mentioned problems in the prior art, the purpose of the embodiments of this specification is to provide a causal relationship strength assessment method, device, equipment, storage medium and product to solve the problem that the prior art only assesses the causal relationship strength by frequency, which is prone to distortion and leads to low accuracy in causal relationship strength assessment.
[0005] In order to solve the above technical problems, the specific technical solutions of the embodiments of this specification are as follows: On the one hand, an embodiment of the present specification provides a method for evaluating the strength of causal relationships, the method comprising: Get the target text; Extracting causal entity relationships from the target text to obtain a number of causal entity relationship pairs, wherein the causal entity relationship pairs include causal entities, causal entity relationships, causal entity relationship evaluation sentences, and causal entity relationship frequencies; Matching the causal entity relationship evaluation short sentence with a pre-constructed evaluation corpus to determine the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation short sentence; Calculating the sentiment value of the causal entity relationship evaluation short sentence according to the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation short sentence using a preset sentiment value calculation rule; Calculate the causal relationship weight of the causal entity relationship pair according to the sentiment value and the causal entity relationship frequency; The causal relationship strength between the causal entities is evaluated according to the causal relationship weight.
[0006] Furthermore, the causal entity relationship extraction is performed on the target text to obtain a number of causal entity relationship pairs, including: Performing sentence processing on the target text to obtain a sentence set; Performing character segmentation on each sentence in the sentence set to obtain a character sequence of each sentence; Inputting the character sequence of each sentence into a pre-trained feature extraction model to obtain a high-dimensional feature vector representation set of each sentence; Inputting the high-dimensional feature vector representation set of each sentence into a pre-trained sequence labeling model to obtain a character label sequence of each sentence, wherein each character label in the character label sequence includes a causal entity label, a causal entity relationship label, and a causal entity relationship evaluation short sentence type label; The causal entity, causal entity relationship, causal entity relationship evaluation phrase and causal entity relationship frequency of each sentence are extracted according to the character tag sequence and the character sequence to obtain a causal entity relationship pair of each sentence.
[0007] Furthermore, matching the causal entity relationship evaluation sentence with a pre-constructed evaluation corpus to determine the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation sentence includes: Segmenting the causal entity relationship evaluation sentence to obtain a segmentation list; Matching each participle in the participle list with the evaluation corpus to obtain a part-of-speech tag for each participle, wherein the part-of-speech tag includes a degree adverb, a basic evaluation adjective, and a negative word, and the basic evaluation adjective includes a positive evaluation adjective and a negative evaluation adjective; Determining the part-of-speech structure of the causal entity relationship evaluation sentence according to the part-of-speech tag; The sentiment weight coefficient of the causal entity relationship evaluation sentence is determined according to the degree adverb.
[0008] Further, the sentiment value of the causal entity relationship evaluation sentence is calculated according to the sentiment weight coefficient and the part-of-speech structure of the causal entity relationship evaluation sentence using a preset sentiment value calculation rule, including: The sentiment value of the causal entity relationship evaluation sentence is calculated using the following formula: ; in, S ω is the sentiment value, e is the basic evaluation adjective coefficient. If the basic evaluation adjective is a positive evaluation adjective, then e Take 1, if the basic evaluation adjective is a negative evaluation adjective, then e Take -1, D ω is the sentiment weight coefficient, η is the sum of the extreme values of the range of sentiment weight coefficients, n is the frequency of occurrence of negative words.
[0009] Furthermore, the method further comprises: Determine whether there is an emotional punctuation mark at the end of the causal entity relationship evaluation sentence, wherein the emotional punctuation mark includes a question mark and an exclamation mark; If so, the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation sentence are used to calculate the sentiment value of the causal entity relationship evaluation sentence using a preset sentiment value calculation rule, which is further: The sentiment value of the causal entity relationship evaluation short sentence is calculated according to the sentiment weight coefficient, part-of-speech structure and sentiment punctuation of the causal entity relationship evaluation short sentence using a preset sentiment value calculation rule.
[0010] Further, the sentiment value of the causal entity relationship evaluation sentence is calculated according to the sentiment weight coefficient, part-of-speech structure and sentiment punctuation of the causal entity relationship evaluation sentence using a preset sentiment value calculation rule, including: The sentiment value of the causal entity relationship evaluation sentence is calculated using the following formula: ; in, S ω is the sentiment value, e is the basic evaluation adjective coefficient. If the basic evaluation adjective is a positive evaluation adjective, then e Take 1, if the basic evaluation adjective is a negative evaluation adjective, then e Take -1, Dω is the sentiment weight coefficient, η is the sum of the extreme values of the range of sentiment weight coefficients, n is the frequency of occurrence of negative words, Indicates emotional added value, α Indicates the number of question marks at the end of the causal entity relationship evaluation sentence, β Indicates the number of exclamation marks at the end of the causal entity relationship evaluation sentence, sgn( α ) is a sign function, when α >0, sgn( α )=1, when α= At 0, sgn( α )=0.
[0011] Further, the calculating the causal relationship weight of the causal entity relationship pair according to the sentiment value and the causal entity relationship frequency includes calculating the causal relationship weight of the causal entity relationship pair using the following formula: ; in, ω is the causal weight, p 1 is the frequency of causal entity relationship, p is the frequency of all causal entity relationships in the target text, S ω is the sentiment value, a is the sentiment value weight coefficient, b is the frequency weight coefficient of the causal entity relationship.
[0012] On the other hand, an embodiment of the present specification provides a causal relationship strength assessment device, the device comprising: An acquisition module is used to acquire the target text; An entity relationship extraction module is used to extract causal entity relationships from the target text to obtain a number of causal entity relationship pairs, wherein the causal entity relationship pairs include causal entities, causal entity relationships, causal entity relationship evaluation sentences, and causal entity relationship frequencies; A matching module, used to match the causal entity relationship evaluation short sentence with a pre-constructed evaluation corpus, and determine the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation short sentence; A sentiment value calculation module, used to calculate the sentiment value of the causal entity relationship evaluation short sentence according to the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation short sentence using a preset sentiment value calculation rule; A causal relationship weight calculation module, used to calculate the causal relationship weight of the causal entity relationship pair according to the sentiment value and the causal entity relationship frequency; The causal relationship strength evaluation module is used to evaluate the causal relationship strength between the causal entities according to the causal relationship weight.
[0013] On the other hand, an embodiment of the present specification further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein when the computer program is executed by the processor, the instructions of any one of the above methods are executed.
[0014] On the other hand, an embodiment of the present specification further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor of a computer device, the computer program executes instructions of any one of the above-described methods.
[0015] On the other hand, the embodiments of this specification further provide a computer program product, which, when executed by a processor of a computer device, executes instructions of any one of the above methods.
[0016] One or more technical solutions provided by some embodiments of this specification have at least the following technical effects: The embodiment of this specification extracts causal entity relationships from the target text to obtain causal entity relationships, causal entity relationship evaluation sentences and causal entity relationship frequencies in the target text, and determines the sentiment weight coefficient of the causal entity relationship evaluation sentence, thereby obtaining the sentiment value of the causal entity relationship evaluation sentence, and finally integrates the sentiment value and the causal entity relationship frequency to obtain the causal relationship weight, so as to evaluate the causal relationship strength according to the causal relationship weight. Therefore, in the causal relationship extraction link, the embodiment of this specification not only extracts causal entities and causal entity relationships, but also extracts sentiment evaluation sentences corresponding to the causal entity relationships, avoiding evaluating the causal relationship strength only based on the causal relationship frequency, but instead evaluating the causal relationship strength by combining the sentiment value and frequency in the causal relationship, which can more truly reflect the importance of different causes to the results, and thus can truly evaluate the relationship strength in the actual causal network.
[0017] The above description is only an overview of the technical solutions of some embodiments of this specification. In order to more clearly understand the technical means of some embodiments of this specification, they can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiments of this specification more obvious and easy to understand, the following specifically cites the preferred embodiments and describes them in detail in conjunction with the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A schematic diagram showing a flow chart of a causal relationship strength assessment method in some embodiments of this specification; Figure 2 A schematic diagram of a process of extracting causal entity relationships from the target text to obtain a plurality of causal entity relationship pairs is shown in some embodiments of this specification; Figure 3 A schematic diagram of a process for matching the causal entity relationship evaluation sentence with a pre-built evaluation corpus to determine the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation sentence in some embodiments of the specification is shown; Figure 4 A schematic diagram of the structure of a causal relationship strength assessment device in some embodiments of this specification is shown; Figure 5 A schematic diagram of the structure of a computer device in this specification is shown.
[0020] Description of the accompanying symbols: 401, get module; 402. Entity relationship extraction module; 403, matching module; 404, sentiment value calculation module; 405. Causality weight calculation module; 406. Causality strength assessment module; 502. Computer equipment; 504, processor; 506. Memory; 508, driving mechanism; 510, input / output module; 512. Input devices; 514. Output device; 516. Presentation equipment; 518. Graphical user interface; 520, network interface; 522, communication link; 524. Communication bus. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this specification.
[0022] In order to solve the above problems, an embodiment of this specification provides a method for evaluating the strength of causal relationships. Figure 1 It is a flow chart of a causal relationship strength assessment method provided in the embodiment of this specification. This specification provides method operation steps as described in the embodiment or flow chart, but more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the system or device product is executed in practice, it can be executed in the order of the method shown in the embodiment or the accompanying drawings or in parallel.
[0023] It should be noted that the terms "first", "second", etc. in this specification and claims and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of this specification described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, device, product or equipment that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0024] Reference Figure 1 As shown, the embodiment of this specification provides a method for evaluating the strength of causal relationship, the method comprising: S101: Obtain target text; S102: extracting causal entity relationships from the target text to obtain a number of causal entity relationship pairs, wherein the causal entity relationship pairs include causal entities, causal entity relationships, causal entity relationship evaluation sentences, and causal entity relationship frequencies; S103: matching the causal entity relationship evaluation sentence with a pre-constructed evaluation corpus to determine the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation sentence; S104: Calculating the sentiment value of the causal entity relationship evaluation sentence according to the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation sentence using a preset sentiment value calculation rule; S105: Calculating the causal relationship weight of the causal entity relationship pair according to the sentiment value and the causal entity relationship frequency; S106: Evaluate the strength of the causal relationship between the causal entities according to the causal relationship weights.
[0025] The embodiment of this specification extracts causal entity relationships from the target text to obtain causal entity relationships, causal entity relationship evaluation sentences and causal entity relationship frequencies in the target text, and determines the sentiment weight coefficient of the causal entity relationship evaluation sentence, thereby obtaining the sentiment value of the causal entity relationship evaluation sentence, and finally integrates the sentiment value and the causal entity relationship frequency to obtain the causal relationship weight, so as to evaluate the causal relationship strength according to the causal relationship weight. Therefore, in the causal relationship extraction link, the embodiment of this specification not only extracts causal entities and causal entity relationships, but also extracts sentiment evaluation sentences corresponding to the causal entity relationships, avoiding evaluating the causal relationship strength only based on the causal relationship frequency, but instead evaluating the causal relationship strength by combining the sentiment value and frequency in the causal relationship, which can more truly reflect the importance of different causes to the results, and thus can truly evaluate the relationship strength in the actual causal network.
[0026] In some embodiments of the present specification, the target text used as input data may be texts containing many causal relationships, such as legal documents, accident investigation reports, medical diagnosis certificates, audit reports, policy analysis reports, investigation reports, news reports, and commentary articles. Therefore, the embodiments of the present specification can be applied to causal relationship strength analysis in multiple fields such as law, medicine, policy, science, and news. Specific application scenarios may include causal relationship strength analysis of news reports, causal relationship strength analysis between product store reviews and ratings, causal relationship strength analysis between disease diagnosis instructions and conclusions, etc.
[0027] In the embodiments of this specification, refer to Figure 2 , the causal entity relationship extraction is performed on the target text to obtain a number of causal entity relationship pairs, including: S201: Segment processing is performed on the target text to obtain a sentence set; S202: performing character segmentation on each sentence in the sentence set to obtain a character sequence of each sentence; S203: Inputting the character sequence of each sentence into a pre-trained feature extraction model to obtain a high-dimensional feature vector representation set of each sentence; S204: Inputting the high-dimensional feature vector representation set of each sentence into a pre-trained sequence labeling model to obtain a character label sequence of each sentence, wherein each character label in the character label sequence includes a causal entity label, a causal entity relationship label, and a causal entity relationship evaluation sentence type label; S205: extracting the causal entity, causal entity relationship, causal entity relationship evaluation phrase and causal entity relationship frequency of each sentence according to the character tag sequence and the character sequence, and obtaining a causal entity relationship pair of each sentence.
[0028] In the embodiments of this specification, in order to ensure the accuracy of extracting causal entity relationship pairs, BERT and CRF (conditional random field) models are used to perform causal entity relationship extraction, wherein the BERT model is used as a feature extraction model to extract semantic information from character sequences to obtain a high-dimensional feature vector representation set, and the CRF model is used to label the character sequence according to the semantic information to obtain a character label sequence of the character sequence, thereby extracting causal entity relationship pairs based on the character label sequence.
[0029] Specifically, the sentence set of the target text is represented as: S ={ s 1, s 2,…, s i},in s i Indicates i For each sentence, after character segmentation, the character sequence is obtained as follows: s i ={ w 1, w 2,…, w N},in w N Expressive Clause s i Before inputting the character sequence into BERT, special markers need to be added to the beginning and end of the character sequence, namely [CLS] and [SEP], where [CLS] is added to the beginning of the character sequence and [SEP] is added to the end of the character sequence. After adding the markers, the characters need to be converted into an encoding form that the BERT model can understand, thus obtaining the character encoding sequence Es i =[ E CLS , E 1, E 2,…, E N , E SEP ], then add position encoding and sentence encoding information to the character encoding sequence and input it into the pre-trained BERT model to extract semantic information, and obtain a high-dimensional feature vector representation set H , H =( h [CLS] ,h 1, h 2,…, h [SEP] ). The high-dimensional feature vector representation set is then passed through a fully connected network to predict the high-dimensional feature vector of each character to calculate the predicted probability score of each character belonging to each label. P i,yi , and then the CRF model is used to perform structured prediction on the predicted label sequence, and the comprehensive score function is obtained as follows: (1) Among them, H represents the high-dimensional feature vector representation set, Y represents the character prediction label sequence, f ( H , Y ) represents the probability score function of H predicted as A, which is used to take the highest value as the predicted output in the final score probability function. A represents the transfer score matrix between output labels. A yi,yi+1 Corresponding label i To Tags i +1. For all possible output label sequences of input H, the probability of predicting H as label sequence Y is: (2) in, p ( H , Y ) represents the probability of predicting the high-dimensional feature vector set H as Y, e f(H,Y) Represents the comprehensive score index of the predicted sequence Y, is the comprehensive score index and of all prediction sequences. After decoding, we get the final character prediction label sequence Y of the sentence. Y =( Y [CLS] , Y 1, Y 2,…, Y n , Y [SEP] ). According to the character label sequence Y and the character sequence s i ={ w 1, w 2,…, w N}, based on the position correspondence between the two, the causal entities, causal entity relationships, and causal entity relationship evaluation sentences of the sentences are extracted and stored in the form of a dictionary, such as {family conflict, xx crime, 1, relatively bad consequences}, where "family conflict" is the cause entity, "xx crime" is the result entity, and "relatively bad consequences" is the causal entity relationship evaluation sentence, and "1" indicates that there is a causal relationship between family conflict and xx crime. By extracting the causal entity relationship of the target text, the frequency of each causal entity relationship can be statistically obtained.
[0030] In the embodiments of this specification, refer to Figure 3 , matching the causal entity relationship evaluation sentence with a pre-constructed evaluation corpus to determine the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation sentence, including: S301: Segmenting the causal entity relationship evaluation sentence to obtain a segmentation list; S302: Match each participle in the participle list with the evaluation corpus to obtain a part-of-speech tag of each participle, wherein the part-of-speech tag includes a degree adverb, a basic evaluation adjective, and a negative word, and the basic evaluation adjective includes a positive evaluation adjective and a negative evaluation adjective; S303: Determine the part-of-speech structure of the causal entity relationship evaluation sentence according to the part-of-speech tag; S304: Determine the sentiment weight coefficient of the causal entity relationship evaluation sentence according to the degree adverb.
[0031] Specifically, in the embodiment of this specification, the evaluation corpus is constructed based on the HowNet sentiment analysis terminology set, which contains a rich set of sentiment words, mainly used to identify and extract subjective information in the text, especially subjective information in the sentiment tendency, such as positive emotions, negative emotions or neutral attitudes, etc. These sentiment words can better understand and analyze the emotional color in the text. HowNet sentiment analysis terminology set mainly includes sentiment words, evaluation words and degree adverb words. Based on the HowNet sentiment analysis terminology set, the evaluation corpus is constructed, and the evaluation corpus includes a positive evaluation word dictionary, a negative evaluation word dictionary, a degree adverb dictionary and a negation word dictionary, wherein the words in the positive evaluation word dictionary are used to express positive and positive emotions, such as beautiful, excellent, kind, etc., the negative evaluation word dictionary is used to express negative and negative emotions, such as bad, serious, selfish, etc., the degree adverb dictionary is used to express the action, behavior or nature embodied by the predicate verb and the evaluation adjective, and the state reaches a certain level or condition, such as very, special, especially, etc., and the negation word dictionary is used to express negative meanings, such as non, not, not, etc. At the same time, according to the definition of the degree adverb's strength, the degree adverbs in the degree adverb dictionary are divided into several levels and assigned corresponding sentiment weight coefficients. In some embodiments, in order to ensure the objectivity of the sentiment weight coefficient, the sentiment weight coefficient can be defined by combining the semantic information of the degree adverb with the hierarchical analysis method. Examples of the degree adverb weight coefficients in some embodiments of this specification are shown in Table 1.
[0032] Table 1
[0033] After the causal entity relationship evaluation sentence is segmented, each segmented word in the segmented word list is matched with each dictionary in the evaluation corpus to obtain the part-of-speech tag of each segmented word. The part-of-speech structure of the causal entity relationship evaluation sentence can be determined according to the position order of each segmented word in the segmented word list and the corresponding part-of-speech tag. For example, the causal entity relationship evaluation sentence is "not too serious". After segmentation, the segmented word list ["not", "too", "serious"] is obtained. After matching each segmented word with the dictionary in the evaluation corpus, the part-of-speech tag of each segmented word is obtained, that is, [negative word, degree adverb, negative evaluation adjective]. Therefore, the part-of-speech structure of the causal entity relationship evaluation sentence is: negative word + degree adverb + negative evaluation adjective. Then, the sentiment weight coefficient corresponding to the degree adverb in the segmented word list is determined according to the degree adverb tag in the part-of-speech tag and Table 1. For example, the degree adverb level of the word "too" is level five, so the sentiment weight coefficient is 1.3.
[0034] It can be seen from the above description that the part-of-speech structure of the causal entity relationship evaluation sentence is mostly composed of negative words, degree adverbs, positive evaluation adjectives or negative evaluation adjectives. The emotions implied by different part-of-speech orders are also different, especially the emotions expressed by different positions of negative words are also different. Therefore, in order to more accurately calculate the sentiment value of the causal entity relationship evaluation sentence, it is necessary to set corresponding sentiment value calculation rules according to different part-of-speech structures. In the embodiment of this specification, the sentiment value of the causal entity relationship evaluation sentence is calculated according to the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation sentence using the pre-set sentiment value calculation rules, including: The sentiment value of the causal entity relationship evaluation sentence is calculated using the following formula: (3) in, S ω is the sentiment value, e is the basic evaluation adjective coefficient. If the basic evaluation adjective is a positive evaluation adjective, then e Take 1, if the basic evaluation adjective is a negative evaluation adjective, then e Take -1, D ω is the sentiment weight coefficient, η is the sum of the extreme values of the range of the emotion weight coefficient. As shown in Table 1, in the embodiment of this specification η The value is 2. n is the frequency of occurrence of negative words.
[0035] It can be understood that the embodiment of this specification sets the sentiment value of positive evaluation adjectives to 1, and the sentiment value of negative evaluation adjectives to -1. For causal entity relationship evaluation sentences without degree adverbs, the sentiment value is determined to be 1 or -1 according to the meaning (positive and negative) of the evaluation adjectives. For example, "serious", since it is a negative evaluation adjective, its sentiment value can be determined to be -1, while for positive evaluation adjectives such as "excellent", its sentiment value is 1. It should be noted that the symbol in the sentiment value only indicates the sentiment tendency of the corresponding evaluation sentence, not the size. If the sentiment value is negative, it indicates a negative sentiment tendency, and if the sentiment value is positive, it indicates a positive sentiment tendency. For the part-of-speech structure of "degree adverb + basic evaluation adjective", such as "very serious", the sentiment value calculation of this type of combination word can directly use the sentiment weight coefficient of the degree adverb as its sentiment value, then its sentiment value is -1.3, indicating that the sentiment intensity has been increased on the original basis. For the word structure of "negative word + basic evaluation adjective", the calculation of this type of combination word can be realized by directly negating the operation. Find all the negative words before the evaluation word. If the number is odd, multiply by -1, and if it is even, multiply by 1. For example, "not serious", the essence of this evaluation word is to negate the negative evaluation word, so its sentiment value is 1. For the word structure of "negative word + degree adverb + basic evaluation adjective", such as "not too serious", the semantics expressed by this type of combination word is not negation, but a slight weakening of the degree based on the original evaluation adjective. Therefore, the calculation rule as shown in formula (3) can be obtained. "Too" is used as a degree adverb, and its sentiment weight coefficient is 1.3. Therefore, the sentiment value of "not too serious" can be calculated to be -0.7. As for the word structure of "degree adverb + negative word + basic evaluation adjective", such as "particularly unfriendly", the semantics of this type of combination is to further strengthen the negative meaning. When the basic evaluation adjective is a positive adjective, the word structure has a negative tendency. Therefore, the calculation rule as shown in formula (3) can be obtained. According to this calculation rule, the sentiment value of "particularly unfriendly" can be obtained as -1.3. It is not difficult to see that the sentiment value obtained by the above calculation rule is consistent with the sentiment meaning expressed in the evaluation sentence.
[0036] In some embodiments, since punctuation marks in a sentence also have a certain influence on its sentiment value, such as punctuation marks with emotional connotations such as exclamation marks and question marks, it is necessary to consider the sentiment value calculation rules when emotional punctuation marks are included at the end of the sentence. In some embodiments of the present specification, the method further includes: Determine whether there is an emotional punctuation mark at the end of the causal entity relationship evaluation sentence, wherein the emotional punctuation mark includes a question mark and an exclamation mark; If so, the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation sentence are used to calculate the sentiment value of the causal entity relationship evaluation sentence using a preset sentiment value calculation rule, which is further: The sentiment value of the causal entity relationship evaluation short sentence is calculated according to the sentiment weight coefficient, part-of-speech structure and sentiment punctuation of the causal entity relationship evaluation short sentence using a preset sentiment value calculation rule.
[0037] Specifically, the sentiment value of the causal entity relationship evaluation short sentence is calculated according to the sentiment weight coefficient, part-of-speech structure and sentiment punctuation of the causal entity relationship evaluation short sentence using a preset sentiment value calculation rule, including: The sentiment value of the causal entity relationship evaluation sentence is calculated using the following formula: (4) in, S ω is the sentiment value, e is the basic evaluation adjective coefficient. If the basic evaluation adjective is a positive evaluation adjective, then e Take 1, if the basic evaluation adjective is a negative evaluation adjective, then e Take -1, D ω is the sentiment weight coefficient, η is the sum of the extreme values of the range of sentiment weight coefficients, n is the frequency of occurrence of negative words, Indicates emotional added value, α Indicates the number of question marks at the end of the causal entity relationship evaluation sentence, β Indicates the number of exclamation marks at the end of the causal entity relationship evaluation sentence, sgn( α ) is a sign function, when α >0, sgn( α )=1, when α= At 0, sgn( α )=0.
[0038] It can be understood that exclamation marks are often used to express strong emotions or tones in sentences. When they appear at the end of an evaluation sentence, they indicate a stronger degree of emotion. Question marks are often used to express doubt, uncertainty, or information seeking. When they appear at the end of an evaluation sentence, they indicate a questioning or rhetorical meaning. Therefore, they can be regarded as opposite emotional expressions. The more exclamation marks and question marks there are, the stronger the emotional level is. Therefore, by judging whether there is an exclamation mark or question mark at the end of the evaluation sentence, if there is, the corresponding emotional added value is added based on the number of exclamation marks or question marks on the basis of formula (3).
[0039] Thus, the sentiment value of the causal entity relationship short sentence can be calculated through the above steps. In the causal relationship strength assessment, the causal entity relationship frequency is an important factor in assessing the causal relationship strength. Therefore, in order to improve the accuracy and objectivity of the causal relationship assessment, in addition to assessing the causal relationship strength based on the sentiment value, the influence of the causal relationship frequency on the causal relationship strength must also be considered. In the embodiment of this specification, the causal entity relationship frequency has been obtained through step S102. Therefore, the causal relationship weight of the causal entity relationship pair can be calculated using the following formula: (5) in, ω is the causal weight, p 1 is the frequency of causal entity relationship, p is the frequency of all causal entity relationships in the target text, S ω is the sentiment value, a is the sentiment value weight coefficient, b is the frequency weight coefficient of the causal entity relationship. Due to different emphasis on frequency and sentiment value in different application scenarios, a and b The value of needs to be set according to different application scenarios and requirements. Therefore, the causal weight of each causal entity relationship pair can be obtained by weighted summation through the above formula, and the causal strength between causal entities can be evaluated based on the causal weight, that is, the larger the causal weight, the stronger the causal strength. When constructing the causal network later, the thicker the edge of the causal relationship is, the more attention should be paid. Therefore, by integrating the sentiment value and frequency to calculate the causal weight, the causal relationship can be analyzed from the perspective of semantic sentiment, so as to more truly reflect the importance of different causes to the results, and then truly evaluate the relationship strength in the actual causal network.
[0040] Based on the judgment document data, the following analyzes the multiple causal relationships formed by the many results caused by family conflicts through the study of family conflict cases, so as to verify the effectiveness, rationality and scientificity of the method proposed in the embodiment of this specification. The embodiment of this specification obtains the first-instance judgment documents of family conflict cases from 2019 to 2023 through the "Legal Research Lighthouse" empirical analysis platform, and a total of 21,161 documents are retrieved, including 20,372 civil documents and 738 criminal documents. The civil disputes mainly include xx dispute 1, xx dispute 2, xx dispute 3, xx dispute 4 and xx dispute 5, etc. The criminal charges mainly include: xx crime 1, xx crime 2, xx crime 3 and xx crime 4, etc. By studying the causal relationship between the above legal documents, the experimental results of different methods are compared as shown in Table 2.
[0041] Table 2
[0042] Among them, in this embodiment, in each causal relationship weight calculation link, the causal entity relationship frequency weight coefficient is set to 2, and the sentiment value weight coefficient is set to 1, so that each causal relationship weight is calculated according to formula (5). It can be seen from Table 2 that when the causal relationship weight is determined only by frequency, xx dispute 1 has the highest proportion, which is more than 60 times the frequency weight of xx crime 1 and xx crime 2 that have relatively serious criminal consequences. Obviously, such a causal relationship weight score ignores the result factors that need special attention and is an unreasonable value. After integrating sentiment value and frequency analysis, the causal relationship weight obtained is effectively adjusted, and the weight coefficient of the criminal consequences that cause serious impact is raised to a consistent order of magnitude, but the value is still smaller than xx dispute 1 with the highest relative incidence. Such a causal relationship weight can more truly reflect the importance of the same cause to different results, and can give corresponding weights to causal relationships that do not occur frequently but need to be paid attention to or concerned, so as to truly evaluate the relationship strength in the actual causal network.
[0043] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. And the acquisition, storage, use, and processing of data in the technical solutions described in the embodiments of this application are in compliance with relevant regulations.
[0044] Based on the above-mentioned method for evaluating the strength of causal relationships, an embodiment of this specification also provides a corresponding device for evaluating the strength of causal relationships. The device may include a system (including a distributed system), software (application), module, component, server, client, etc. that uses the method described in the embodiment of this specification and is combined with necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiment of this specification is as described in the following embodiments. Since the implementation scheme and method of the device to solve the problem are similar, the implementation of the specific device in the embodiment of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0045] Specifically, Figure 4 is a schematic diagram of a module structure of an embodiment of a causal relationship strength evaluation device provided in the embodiments of this specification, referring to Figure 4 As shown, a causal relationship strength assessment device provided in an embodiment of this specification includes: An acquisition module 401 is used to acquire a target text; An entity relationship extraction module 402 is used to extract causal entity relationships from the target text to obtain a plurality of causal entity relationship pairs, wherein the causal entity relationship pairs include causal entities, causal entity relationships, causal entity relationship evaluation sentences, and causal entity relationship frequencies; A matching module 403 is used to match the causal entity relationship evaluation sentence with a pre-built evaluation corpus to determine the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation sentence; The sentiment value calculation module 404 is used to calculate the sentiment value of the causal entity relationship evaluation sentence according to the sentiment weight coefficient and the part-of-speech structure of the causal entity relationship evaluation sentence using a preset sentiment value calculation rule; A causal relationship weight calculation module 405 is used to calculate the causal relationship weight of the causal entity relationship pair according to the sentiment value and the causal entity relationship frequency; The causal relationship strength evaluation module 406 is used to evaluate the causal relationship strength between the causal entities according to the causal relationship weights.
[0046] The beneficial effects obtained by the device provided in the embodiments of this specification are consistent with the beneficial effects obtained by the above method and will not be repeated here.
[0047] Reference Figure 5 As shown, based on the above-mentioned causal strength assessment method, a computer device 502 is also provided in an embodiment of the specification, wherein the above-mentioned method is run on the computer device 502. The computer device 502 may include one or more processors 504, such as one or more central processing units (CPUs), each of which may implement one or more hardware threads. The computer device 502 may also include any memory 506, which is used to store any kind of information such as code, settings, data, etc. Non-limitingly, for example, the memory 506 may include any one or more combinations of the following: any type of RAM, any type of ROM, flash memory device, hard disk, optical disk, etc. More generally, any memory may use any technology to store information. Further, any memory may provide volatile or non-volatile retention of information. Further, any memory may represent a fixed or removable component of the computer device 502. In one case, when the processor 504 executes an associated instruction stored in any memory or combination of memories, the computer device 502 may perform any operation of the associated instruction. The computer device 502 also includes one or more drive mechanisms 508 for interacting with any storage, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.
[0048] The computer device 502 may also include an input / output module 510 (I / O) for receiving various inputs (via input devices 512) and for providing various outputs (via output devices 514). A specific output mechanism may include a presentation device 516 and an associated graphical user interface (GUI) 518. In other embodiments, the input / output module 510 (I / O), the input device 512, and the output device 514 may not be included, and the computer device 502 may be used as a computer device in a network. The computer device 502 may also include one or more network interfaces 520 for exchanging data with other devices via one or more communication links 522. One or more communication buses 524 couple the components described above together.
[0049] The communication link 522 may be implemented in any manner, for example, through a local area network, a wide area network (e.g., the Internet), a point-to-point connection, etc., or any combination thereof. The communication link 522 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
[0050] Corresponding to Figures 1 to 3 In addition to the method shown, an embodiment of the specification also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are executed.
[0051] The embodiment of the present specification also provides a computer-readable instruction, wherein when the processor executes the instruction, the program therein causes the processor to execute the following Figures 1 to 3 The method shown.
[0052] The embodiments of the present specification also provide a computer program product, including at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the following Figures 1 to 3 The method shown.
[0053] It should be understood that in the various embodiments of this specification, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this specification.
[0054] It should also be understood that in the embodiments of this specification, the term "and / or" is only a description of the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this specification generally indicates that the associated objects before and after are in an "or" relationship.
[0055] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in this specification can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this specification.
[0056] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0057] In the several embodiments provided in this specification, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, or it can be an electrical, mechanical or other form of connection.
[0058] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the embodiments of this specification.
[0059] In addition, each functional unit in each embodiment of this specification may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0060] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this specification is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of this specification. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0061] Specific embodiments are used in this specification to illustrate the principles and implementation methods of this specification. The description of the above embodiments is only used to help understand the methods and core ideas of this specification. At the same time, for those skilled in the art, according to the ideas of this specification, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on this specification.
Claims
1. A method for evaluating the strength of causal relationships, characterized in that: The method comprises: Get the target text; Extracting causal entity relationships from the target text to obtain a number of causal entity relationship pairs, wherein the causal entity relationship pairs include causal entities, causal entity relationships, causal entity relationship evaluation sentences, and causal entity relationship frequencies; Matching the causal entity relationship evaluation short sentence with a pre-constructed evaluation corpus to determine the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation short sentence; Calculating the sentiment value of the causal entity relationship evaluation short sentence according to the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation short sentence using a preset sentiment value calculation rule; Calculate the causal relationship weight of the causal entity relationship pair according to the sentiment value and the causal entity relationship frequency; The causal relationship strength between the causal entities is evaluated according to the causal relationship weight.
2. The method according to claim 1, characterized in that The causal entity relationship extraction is performed on the target text to obtain a plurality of causal entity relationship pairs, including: Performing sentence processing on the target text to obtain a sentence set; Performing character segmentation on each sentence in the sentence set to obtain a character sequence of each sentence; Inputting the character sequence of each sentence into a pre-trained feature extraction model to obtain a high-dimensional feature vector representation set of each sentence; Inputting the high-dimensional feature vector representation set of each sentence into a pre-trained sequence labeling model to obtain a character label sequence of each sentence, wherein each character label in the character label sequence includes a causal entity label, a causal entity relationship label, and a causal entity relationship evaluation short sentence type label; The causal entity, causal entity relationship, causal entity relationship evaluation phrase and causal entity relationship frequency of each sentence are extracted according to the character tag sequence and the character sequence to obtain a causal entity relationship pair of each sentence.
3. The method according to claim 1, characterized in that The step of matching the causal entity relationship evaluation sentence with a pre-built evaluation corpus to determine the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation sentence includes: Segmenting the causal entity relationship evaluation sentence to obtain a segmentation list; Matching each participle in the participle list with the evaluation corpus to obtain a part-of-speech tag for each participle, wherein the part-of-speech tag includes a degree adverb, a basic evaluation adjective, and a negative word, and the basic evaluation adjective includes a positive evaluation adjective and a negative evaluation adjective; Determining the part-of-speech structure of the causal entity relationship evaluation sentence according to the part-of-speech tag; The sentiment weight coefficient of the causal entity relationship evaluation sentence is determined according to the degree adverb.
4. The method according to claim 1, characterized in that: The calculating the sentiment value of the causal entity relationship evaluation sentence according to the sentiment weight coefficient and the part-of-speech structure of the causal entity relationship evaluation sentence using a preset sentiment value calculation rule includes: The sentiment value of the causal entity relationship evaluation sentence is calculated using the following formula: ; in, S ω is the sentiment value, e is the basic evaluation adjective coefficient. If the basic evaluation adjective is a positive evaluation adjective, then e Take 1, if the basic evaluation adjective is a negative evaluation adjective, then e Take -1, D ω is the sentiment weight coefficient, η is the sum of the extreme values of the range of sentiment weight coefficients, n is the frequency of occurrence of negative words.
5. The method according to claim 1, characterized in that The method further comprises: Determine whether there is an emotional punctuation mark at the end of the causal entity relationship evaluation sentence, wherein the emotional punctuation mark includes a question mark and an exclamation mark; If so, the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation sentence are used to calculate the sentiment value of the causal entity relationship evaluation sentence using a preset sentiment value calculation rule, which is further: The sentiment value of the causal entity relationship evaluation short sentence is calculated according to the sentiment weight coefficient, part-of-speech structure and sentiment punctuation of the causal entity relationship evaluation short sentence using a preset sentiment value calculation rule.
6. The method according to claim 5, characterized in that The calculating the sentiment value of the causal entity relationship evaluation sentence according to the sentiment weight coefficient, part-of-speech structure and sentiment punctuation of the causal entity relationship evaluation sentence using a preset sentiment value calculation rule includes: The sentiment value of the causal entity relationship evaluation sentence is calculated using the following formula: ; in, S ω is the sentiment value, e is the basic evaluation adjective coefficient. If the basic evaluation adjective is a positive evaluation adjective, then e Take 1, if the basic evaluation adjective is a negative evaluation adjective, then e Take -1, D ω is the sentiment weight coefficient, η is the sum of the extreme values of the range of sentiment weight coefficients, n is the frequency of occurrence of negative words, Indicates emotional added value, α Indicates the number of question marks at the end of the causal entity relationship evaluation sentence, β Indicates the number of exclamation marks at the end of the causal entity relationship evaluation sentence, sgn( α ) is a sign function, when α >0, sgn( α )=1, when α= At 0, sgn( α )=0.
7. The method according to claim 1, characterized in that The calculating the causal relationship weight of the causal entity relationship pair according to the sentiment value and the causal entity relationship frequency includes calculating the causal relationship weight of the causal entity relationship pair using the following formula: ; in, ω is the causal weight, p 1 is the frequency of causal entity relationship, p is the frequency of all causal entity relationships in the target text, S ω is the sentiment value, a is the sentiment value weight coefficient, b is the frequency weight coefficient of the causal entity relationship.
8. A causal relationship strength assessment device, characterized in that: The device comprises: An acquisition module is used to acquire the target text; An entity relationship extraction module is used to extract causal entity relationships from the target text to obtain a number of causal entity relationship pairs, wherein the causal entity relationship pairs include causal entities, causal entity relationships, causal entity relationship evaluation sentences, and causal entity relationship frequencies; A matching module, used to match the causal entity relationship evaluation short sentence with a pre-constructed evaluation corpus, and determine the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation short sentence; A sentiment value calculation module, used to calculate the sentiment value of the causal entity relationship evaluation short sentence according to the sentiment weight coefficient and part-of-speech structure of the causal entity relationship evaluation short sentence using a preset sentiment value calculation rule; A causal relationship weight calculation module, used to calculate the causal relationship weight of the causal entity relationship pair according to the sentiment value and the causal entity relationship frequency; The causal relationship strength evaluation module is used to evaluate the causal relationship strength between the causal entities according to the causal relationship weight.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
11. A computer program product, characterized in that The method comprises at least one instruction or at least one program, wherein the at least one instruction or the at least one program is loaded and executed by a processor to implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Causal event map construction method, system and device and storage medium
CN109726293A
Emotion score analyzing and processing method based on emotion dictionary entity
CN112711941A
Causal relationship extraction method based on BERT semantic enhancement
CN114548117A
Multi-modal attention rumor detection method based on causal atlas
CN116501877A
Intelligent causal knowledge extraction from data sources
US20200401910A1
Cited By
Risk factor identification method and device and electronic equipment
CN120013237A
Medical first draft generation method and device based on large model and electronic equipment
CN120353848A
