A text recognition method, device and equipment

By performing clause segmentation and short sentence recognition on the text, and using the target sentence relationship recognition model to form a causal relationship chain, the problem of difficulty in identifying and labeling causal relationships in complex fault texts is solved, and fast and accurate causal relationship recognition is achieved.

CN115510871BActive Publication Date: 2026-07-03BEIJING XUEZHITU NETWORK TECH
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing technologies face challenges in identifying causal relationships in complex fault texts, particularly in terms of the difficulty in labeling event data. Rule-based template methods, in particular, have incomplete coverage, while deep learning methods require a large amount of labeled data and are difficult to transfer.

Method used

By splitting each clause, identifying causal trigger words and dividing them into short sentences, and using the target sentence relationship recognition model to determine causal relationship attributes, a causal relationship chain is formed.

Benefits of technology

It achieves accurate and rapid identification of causal relationships in text, solves the problem of numerous causal relationships and the difficulty of annotation, and improves identification efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115510871B_ABST
    Figure CN115510871B_ABST
Patent Text Reader

Abstract

The application provides a text recognition method, device and equipment, wherein the method comprises: extracting a plurality of clauses from a target text; for each clause, performing the following steps: determining a sentence splitting strategy for the clause based on a preset causal relationship trigger word, dividing the clause according to the determined sentence splitting strategy to obtain at least one short sentence; for each short sentence, performing the following steps: determining the causal relationship attribute of the short sentence by using a target sentence relationship recognition model, determining a set of associated sentences corresponding to the short sentence based on the text position of the short sentence in the target text, the set of associated sentences including a plurality of associated short sentences, and determining the construction relationship between the short sentence and each associated short sentence; and forming a causal relationship chain of the target text according to the causal relationship attribute of each short sentence and the construction relationship between each short sentence and the corresponding associated short sentence. The effect of accurately and quickly recognizing the causal relationship in the text is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of text recognition technology, and more specifically, to a text recognition method, apparatus, and device. Background Technology

[0002] Causal relationship text recognition is frequently used in industrial fault analysis to automatically extract fault causes and consequences from fault text, while also uncovering relationships between multiple fault events to construct a complete fault scenario. This helps people discover the root cause of the fault and resolve it. For complex faults, which are generally the result of multiple faults influencing each other, there will be a lot of fault description text, increasing the difficulty of text processing and making it difficult to form a complete set of causal relationships.

[0003] Currently, text recognition methods are divided into two categories: rule-based templates and deep learning-based methods. Rule-based templates define trigger word templates, match the templates from the text, and extract causal relationships from the text. Deep learning-based models, on the other hand, complete the task by labeling events and extracting them.

[0004] For rule-based template-based methods, some causal relationships not defined in the template may not be extracted, and rule-based methods are also difficult to fully cover when there are many causal relationships in the text. Deep learning-based methods, while achieving higher accuracy, involve a greater workload in labeling events, and the model is more difficult to transfer; changing the background requires relabeling the data to maintain effectiveness. Summary of the Invention

[0005] In view of this, the purpose of this application is to provide a text recognition method, apparatus and device that can identify causal relationships in text by performing causal recognition on each clause and each short sentence, and identify related short sentences in the short sentences while recognizing the causal relationships in the clauses. This solves the problems of difficulty in recognizing multiple causal relationships and difficulty in labeling event data in the prior art, and achieves the effect of accurately and quickly recognizing causal relationships in text.

[0006] In a first aspect, embodiments of this application provide a text recognition method, the method comprising: extracting multiple clauses from a target text; performing the following steps for each clause: determining a sentence segmentation strategy for the clause based on preset causal relationship trigger words, dividing the clause according to the determined sentence segmentation strategy to obtain at least one short sentence; performing the following steps for each short sentence: determining the causal relationship attribute of the short sentence using a target sentence relationship recognition model, determining a set of related sentences corresponding to the short sentence based on the text position of the short sentence in the target text, the set of related sentences including multiple related short sentences, determining the construction relationship between the short sentence and each related short sentence respectively; forming a causal relationship chain of the target text according to the causal relationship attribute of each short sentence and the construction relationship between each short sentence and the corresponding related short sentence.

[0007] Optionally, the sentence segmentation strategy for each clause is determined by: determining whether there is a causal trigger word in the clause; if so, segmenting the clause according to the position of the causal trigger word in the clause; if not, segmenting the clause based on a sentence component analysis algorithm.

[0008] Optionally, each clause can be split in the following way: determine the position of the causal trigger word in the clause; if the causal trigger word is at the beginning of the clause, then the words in the clause following the causal trigger word are defined as a short sentence; if the causal trigger word is at the end of the clause, then the words in the clause preceding the causal trigger word are defined as a short sentence; if the causal trigger word is in the middle of the clause, then the words in the clause preceding the causal trigger word are defined as a short sentence, and the words in the clause following the causal trigger word are defined as another short sentence.

[0009] Optionally, the target sentence relationship recognition model corresponding to each short sentence is determined by: extracting the association identifier of the short sentence, the association identifier being used to indicate the formation method of the short sentence; if the association identifier indicates that the formation method of the short sentence is a unique short sentence divided from the clause it belongs to, then the single sentence relationship recognition model is determined as the target sentence relationship recognition model; if the association identifier indicates that the formation method of the short sentence is one of two short sentences divided from the clause it belongs to, then the sentence pair relationship recognition model is determined as the target sentence relationship recognition model.

[0010] Optionally, the causal relationship attribute of each short sentence is determined in the following manner: if the association identifier indicates that the short sentence is formed as a unique short sentence divided from the clause it belongs to, then the short sentence is input into a single sentence relationship recognition model to obtain the causal relationship attribute of the short sentence; if the association identifier indicates that the short sentence is formed as one of two short sentences divided from the clause it belongs to, then the short sentence is paired with the other short sentence divided from the clause it belongs to, and the sentence pair is input into a sentence pair relationship recognition model to obtain the causal relationship attribute of the short sentence; wherein, the causal relationship attribute is used to indicate whether the short sentence belongs to a cause short sentence or a result short sentence.

[0011] Optionally, the set of related sentences corresponding to each short sentence is determined by: extracting a first preset number of related short sentences preceding the short sentence and a second preset number of related short sentences following the short sentence; for each related short sentence, forming a short sentence relationship detection group with the short sentence, each short sentence relationship detection group including the short sentence and a corresponding related short sentence; wherein, the construction relationship between each short sentence and each related short sentence is determined by the following steps: inputting the short sentence relationship detection group into the target sentence relationship recognition model to obtain the construction relationship between two short sentences in the short sentence relationship detection group, the construction relationship including causal construction relationship, effect-cause construction relationship, parallel construction relationship and no construction relationship.

[0012] Optionally, the step of forming a causal relationship chain of the target text based on the causal relationship attribute of each phrase and the structural relationship between each phrase and its corresponding associated phrase includes: determining multiple sets of parallel relationships based on phrase relationship detection groups with parallel structural relationships, wherein phrases in different sets of parallel relationships are not repeated, and there is at least one repeated phrase among the phrase relationship detection groups in each set of parallel relationships; for each set of parallel relationships, deleting the repeated phrases in the set of parallel relationships, and merging the parallel structural relationships between phrases to form a merged set of parallel relationships; determining the causal structural relationships between phrases in the target text based on the causal relationship attribute of each phrase, the causal structural relationships between each phrase and its corresponding associated phrase, the cause-effect structural relationships, and the multiple merged set of parallel relationships; and forming a causal relationship chain of the target text based on the causal structural relationships between phrases in the target text.

[0013] Optionally, the step of extracting multiple clauses from the target text includes: dividing the target text according to preset punctuation marks in the target text to obtain multiple candidate clauses, wherein the preset punctuation marks are punctuation marks used for sentence segmentation; for each candidate clause, performing content cleaning on the candidate clause based on the text length and / or clause function to obtain the clause.

[0014] Secondly, embodiments of this application also provide a text recognition device, the device comprising:

[0015] The clause extraction module is used to extract multiple clauses from the target text.

[0016] The clause splitting module is used to perform the following steps for each clause: based on preset causal trigger words, determine the sentence splitting strategy for the clause, and divide the clause according to the determined sentence splitting strategy to obtain at least one short sentence.

[0017] The relationship determination module is used to perform the following steps for each short sentence: using the target sentence relationship recognition model, determine the causal relationship attribute of the short sentence; based on the text position of the short sentence in the target text, determine the set of related sentences corresponding to the short sentence, the set of related sentences includes multiple related short sentences, and determine the construction relationship between the short sentence and each related short sentence respectively.

[0018] The relationship chain forming module is used to form a causal relationship chain of the target text based on the causal relationship attributes of each short sentence and the construction relationship between each short sentence and its corresponding related short sentences.

[0019] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the text recognition method described above are performed.

[0020] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the text recognition method described above.

[0021] The text recognition method, apparatus, and device provided in this application solve the problems of difficulty in recognizing numerous causal relationships and difficulty in labeling event data in the prior art by performing causal recognition on each clause and each short sentence, and recognizing related short sentences while recognizing the causal relationships in the clauses. This achieves the effect of accurately and quickly recognizing causal relationships in text.

[0022] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0023] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0024] Figure 1 A flowchart illustrating a text recognition method provided in an embodiment of this application;

[0025] Figure 2 A flowchart illustrating another text recognition method provided in this application embodiment;

[0026] Figure 3 This is a schematic diagram of the structure of a text recognition device provided in an embodiment of this application;

[0027] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0028] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. Based on the embodiments of this application, every other embodiment obtained by those skilled in the art without inventive effort falls within the scope of protection of this application.

[0029] First, the applicable application scenarios of this application will be introduced. This application can be applied to the field of text recognition technology.

[0030] Research has shown that text recognition of causal relationships is frequently used in industrial fault analysis to automatically extract fault causes and consequences from fault text, while also uncovering connections between multiple fault events to construct a complete fault scenario. This helps researchers identify the root cause of the fault and resolve it. For complex faults, which are typically the result of multiple interrelated faults, there is often a large amount of fault description text, increasing the difficulty of text processing and making it challenging to form a complete set of causal relationships.

[0031] Currently, text recognition methods are divided into two categories: rule-based templates and deep learning-based methods. Rule-based templates define trigger word templates, match the templates from the text, and extract causal relationships from the text. Deep learning-based models, on the other hand, complete the task by labeling events and extracting them.

[0032] For rule-based template-based methods, some causal relationships not defined in the template may not be extracted, and rule-based methods are also difficult to fully cover when there are many causal relationships in the text. Deep learning-based methods, while achieving higher accuracy, involve a greater workload in labeling events, and the model is more difficult to transfer; changing the background requires relabeling the data to maintain effectiveness.

[0033] When performing text recognition, long texts have two main characteristics. First, the sentences are often quite long, containing a large number of events. When input into the model, this can sometimes exceed the model's length limit, leading to text truncation and loss of some events, thus affecting the predicted causal relationships. Second, clauses and event descriptions are often lengthy. Long event descriptions are difficult for the model to understand, and when using max-pooling to extract event features at the end of the model process, a significant amount of information can be lost.

[0034] Furthermore, since long texts may contain many events and causal relationships, it is difficult to define the complex causal relationships using rule template-based methods, making it difficult to achieve good results.

[0035] Based on this, embodiments of this application provide a text recognition method, apparatus, and device to achieve accurate and rapid recognition of causal relationships in text.

[0036] Please see Figure 1 , Figure 1 This is a flowchart illustrating a text recognition method provided in an embodiment of this application. Figure 1 As shown in the embodiments of this application, the text recognition method includes:

[0037] S101. Extract multiple clauses from the target text.

[0038] Specifically, the steps for extracting multiple clauses from the target text include: dividing the target text according to preset punctuation marks to obtain multiple candidate clauses.

[0039] The preset punctuation marks are punctuation marks used for sentence segmentation. For example, the text can be divided into multiple sentences first based on symbols such as period, question mark, and exclamation mark, and then the sentences can be divided into clauses based on symbols such as colon, comma, and semicolon in the sentences.

[0040] After obtaining multiple candidate clauses, for each candidate clause, based on the text length and / or function of the clause, the content of the candidate clause is cleaned to obtain the clause.

[0041] Specifically, the steps for content cleaning include determining the length of clauses, removing clauses with fewer than 5 characters, and using the Core NLP algorithm to analyze the sentence structure of the clauses, removing modifiers, such as prepositional phrases, to shorten sentence length and make the sentence structure simpler and easier to identify.

[0042] Here, when the length of the cleaned clause exceeds the preset clause length threshold, the clause can be further divided according to the Core NLP algorithm. The clause that is too long can be further divided to obtain at least two clauses that meet the clause length threshold.

[0043] For each clause extracted from the target text, step S102 is executed: based on preset causal trigger words, a sentence splitting strategy is determined for the clause, and the clause is divided according to the determined sentence splitting strategy to obtain at least one short sentence.

[0044] For example, causal trigger words are pre-set words that can indicate the causal relationship of a sentence, such as words like cause, drum, cause, because, etc.

[0045] The sentence splitting strategy for each clause can be determined as follows: determine whether there is a causal trigger word in the clause; if so, split the clause according to the position of the causal trigger word in the clause; if not, split the clause based on the sentence component analysis algorithm.

[0046] Specifically, when a causal trigger word exists in a clause, each clause can be split as follows: determine the position of the causal trigger word in the clause; if the causal trigger word is at the beginning of the clause, then the words following the causal trigger word in the clause are defined as a short sentence; if the causal trigger word is at the end of the clause, then the words preceding the causal trigger word in the clause are defined as a short sentence; if the causal trigger word is in the middle of the clause, then the words preceding the causal trigger word in the clause are defined as a short sentence, and the words following the causal trigger word in the clause are defined as another short sentence.

[0047] When there are no causal trigger words in a clause, the clause can be input into the Core NLP algorithm for identification. First, the Core NLP algorithm identifies the length of the clause. If the length of the clause is greater than a preset clause segmentation threshold, the clause must be segmented according to the Core NLP algorithm. If the length of the clause is less than or equal to the preset clause segmentation threshold, the Core NLP algorithm determines whether the clause needs to be segmented. If the Core NLP algorithm determines that the clause needs to be segmented, it divides the clause into at least two short clauses. If the Core NLP algorithm determines that the clause does not need to be segmented, it determines that the clause is a single short clause.

[0048] For each short sentence segmented from the clause, step S103 is executed: using the target sentence relationship recognition model, the causal relationship attribute of the short sentence is determined, and based on the text position of the short sentence in the target text, the set of related sentences corresponding to the short sentence is determined.

[0049] The set of related sentences includes multiple related short sentences, and the construction relationship between the short sentence and each related short sentence is determined.

[0050] For details, please refer to Figure 2 , Figure 2 A flowchart illustrating another text recognition method provided in an embodiment of this application. Figure 2 As shown in the embodiments of this application, the text recognition method can determine the set of associated sentences corresponding to each short sentence in the following ways:

[0051] S201. Extract a first preset number of related short sentences before the short sentence, and a second preset number of related short sentences after the short sentence.

[0052] For example, when both the first preset quantity and the second preset quantity are 2, the associated phrases of phrase A1 include A2 before A1, A3 two positions before A1, A4 after A1, and A5 two positions after A1. Here, A2, A3, A4, and A5 are all associated phrases of phrase A1.

[0053] S202. For each related short phrase, form a short phrase relationship detection group with the short phrase. Each short phrase relationship detection group includes the short phrase and a corresponding related short phrase.

[0054] The construction relationship between each short phrase and its associated short phrases is determined through the following steps: the short phrase relationship detection group is input into the target sentence relationship recognition model to obtain the construction relationship between two short phrases in the short phrase relationship detection group. The construction relationship includes causal construction relationship, effect-cause construction relationship, parallel construction relationship and no construction relationship.

[0055] For example, when determining the structural relationship between short sentence A and its associated short sentence B, short sentence A and its associated short sentence B can be formed into a sequence (i.e., a relationship detection group), such as A[sep]B, where [sep] is the separator of the short sentence. Inputting A[sep]B into the sentence pair relationship recognition model, if the structural relationship between short sentence A and its associated short sentence B is a causal structural relationship, a "A→B" structural relationship is formed; if the structural relationship between short sentence A and its associated short sentence B is an effect-cause structural relationship, a "A←B" structural relationship is formed; if the structural relationship between short sentence A and its associated short sentence B is a causal structural relationship, a "A=B" structural relationship is formed; if the structural relationship between short sentence A and its associated short sentence B is no structural relationship, no structural relationship is formed.

[0056] Specifically, the target sentence relationship recognition model corresponding to each short sentence can be determined in the following way: extract the association identifier of the short sentence; if the association identifier indicates that the short sentence is formed by dividing it into a unique short sentence from the clause it belongs to, then the single sentence relationship recognition model is determined as the target sentence relationship recognition model; if the association identifier indicates that the short sentence is formed by dividing it into one of two short sentences from the clause it belongs to, then the sentence pair relationship recognition model is determined as the target sentence relationship recognition model.

[0057] The association markers of short sentences are used to indicate how the short sentences are formed.

[0058] For example, when a short sentence is formed as a unique short sentence divided from its clause, the target sentence relationship recognition model for that short sentence is determined to be a single sentence relationship recognition model; when a short sentence is formed as one of two short sentences divided from its clause, the target sentence relationship model for that short sentence is determined to be a target sentence association recognition model.

[0059] Specifically, the causal relationship attribute of each short sentence is determined in the following way: if the association identifier indicates that the short sentence is formed by dividing it from the clause it belongs to, then the short sentence is input into the single sentence relationship recognition model to obtain the causal relationship attribute of the short sentence; if the association identifier indicates that the short sentence is formed by dividing it from the clause it belongs to, then the short sentence is paired with the other short sentence divided from the clause it belongs to, and the sentence pair is input into the sentence pair relationship recognition model to obtain the causal relationship attribute of the short sentence.

[0060] The causal relationship attribute is used to indicate whether a short sentence is a causal short sentence or a result short sentence.

[0061] In this way, the relationship between each short phrase and its nearest neighboring short phrases can be determined.

[0062] S104. Based on the causal relationship attributes of each short sentence and the structural relationship between each short sentence and its corresponding related short sentence, a causal relationship chain is formed for the target text.

[0063] Specifically, the step of forming the causal relationship chain of the target text based on the causal relationship attribute of each short sentence and the construction relationship between each short sentence and its corresponding associated short sentence includes: determining multiple sets of parallel relationships based on short sentence relationship detection groups with parallel construction relationships, wherein short sentences in different sets of parallel relationships are not repeated, and there is at least one repeated short sentence among the short sentence relationship detection groups in each set of parallel relationships; for each set of parallel relationships, deleting the repeated short sentences in the set of parallel relationships, and merging the parallel construction relationships between the short sentences to form a merged set of parallel relationships.

[0064] For example, if the short sentence relationship detection group determines that the parallel set includes: short sentence A and short sentence B are parallel, short sentence B and short sentence C are parallel; short sentence D and short sentence E are parallel, and short sentence E and short sentence D are parallel, then the parallel relationships can be merged to obtain two parallel sets: one is the set where A = B = C, and the other is the set where D = E.

[0065] Specifically, based on the causal relationship attributes of each short sentence, the causal construction relationship between each short sentence and its corresponding associated short sentence, the effect-cause construction relationship, and multiple merged and parallel sets, the causal construction relationship between each short sentence in the target text is determined.

[0066] For example, if the set of parallel relationships is A=B=C, the set of causal relationships is E→A, and the set of cause-effect relationships is F←A, then the causal relationships between the texts can be determined to include E→A; E→B; E→C; F←A; F←B; F←C.

[0067] In this way, a causal relationship chain of the target text can be formed based on the causal construction relationship between each short sentence in the target text. For example, based on the above causal construction relationship, the target text relationship chains E→A→F; E→B→F; E→C→F can be obtained, that is, the causal relationship chain of E leads to A, A leads to F, B leads to B, F leads to B, C leads to C, and F leads to C.

[0068] The text recognition method provided in this application solves the problems of difficulty in recognizing numerous causal relationships and difficulty in labeling event data in the prior art by performing causal recognition on each clause and each short sentence, and recognizing related short sentences while recognizing the causal relationships in the clauses. This achieves the effect of accurately and quickly recognizing causal relationships in text.

[0069] Based on the same inventive concept, this application also provides a text recognition device corresponding to the text recognition method. Since the principle of the device in this application is similar to that of the text recognition method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0070] Please see Figure 3 , Figure 3 This is a schematic diagram of the structure of a text recognition device provided in an embodiment of this application. The text recognition device 300 includes:

[0071] Clause extraction module 301 is used to extract multiple clauses from the target text.

[0072] Clause splitting module 302 is used to perform the following steps for each clause: based on preset causal trigger words, determine the sentence splitting strategy for the clause, and divide the clause according to the determined sentence splitting strategy to obtain at least one short sentence.

[0073] The relationship determination module 303 is used to perform the following steps for each short sentence: using the target sentence relationship recognition model, determine the causal relationship attribute of the short sentence; based on the text position of the short sentence in the target text, determine the set of related sentences corresponding to the short sentence, the set of related sentences includes multiple related short sentences, and determine the construction relationship between the short sentence and each related short sentence respectively.

[0074] The relationship chain forming module 304 is used to form a causal relationship chain of the target text based on the causal relationship attributes of each short sentence and the construction relationship between each short sentence and its corresponding associated short sentence.

[0075] The text recognition device provided in this application embodiment solves the problems of difficulty in recognizing numerous causal relationships and difficulty in labeling event data in the prior art by performing causal recognition on each clause and each short sentence, and recognizing related short sentences while recognizing the causal relationships in the clauses. This achieves the effect of accurately and quickly recognizing causal relationships in text.

[0076] Please see Figure 4 , Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 4 As shown, the electronic device 400 includes a processor 410, a memory 420, and a bus 430.

[0077] The memory 420 stores machine-readable instructions executable by the processor 410. When the electronic device 400 is running, the processor 410 communicates with the memory 420 via the bus 430. When the machine-readable instructions are executed by the processor 410, they can perform the operations described above. Figure 1 as well as Figure 2 The steps of the text recognition method in the illustrated method embodiment can be found in the method embodiment for specific implementation methods, which will not be repeated here.

[0078] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can perform the above-described actions. Figure 1 as well as Figure 2 The steps of the text recognition method in the illustrated method embodiment can be found in the method embodiment for specific implementation methods, which will not be repeated here.

[0079] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0080] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the shown or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

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

[0082] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0083] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0084] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The scope of protection of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application. Such modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A text recognition method, characterized by, The method includes: Extract multiple clauses from the target text; For each clause, perform the following steps: Based on preset causal trigger words, determine the sentence splitting strategy for the clause, and divide the clause according to the determined sentence splitting strategy to obtain at least one short sentence; For each short sentence, the following steps are performed: using the target sentence relationship recognition model, the causal relationship attribute of the short sentence is determined; based on the text position of the short sentence in the target text, the set of related sentences corresponding to the short sentence is determined, the set of related sentences includes multiple related short sentences, and the construction relationship between the short sentence and each related short sentence is determined respectively; Based on the causal relationship attributes of each short sentence and the structural relationships between each short sentence and its corresponding related short sentences, a causal relationship chain is formed for the target text. The set of related sentences corresponding to each short sentence is determined in the following way: Extract a first preset number of related short sentences preceding the short sentence, and a second preset number of related short sentences following the short sentence; For each related short phrase, a short phrase relationship detection group is formed by combining the related short phrase with the short phrase. Each short phrase relationship detection group includes the short phrase and a corresponding related short phrase. The structural relationship between each short phrase and its related short phrases is determined through the following steps: The short sentence relation detection group is input into the sentence pair relation recognition model to obtain the constructed relation between two short sentences in the short sentence relation detection group. The constructed relation includes causal constructed relation, effect-cause constructed relation, parallel constructed relation, and no constructed relation. The target sentence relationship recognition model corresponding to each short sentence is determined in the following way: Extract the association identifier of the short sentence, which indicates how the short sentence was formed; If the association identifier indicates that the short sentence is formed by dividing it out from the clause it belongs to, then the single sentence relationship recognition model is determined as the target sentence relationship recognition model; If the association identifier indicates that the sentence is formed by dividing it into two sentences from its constituent clauses, then the sentence pair relationship recognition model is determined as the target sentence relationship recognition model. The causal relationship attribute of each phrase is determined in the following way: If the association identifier indicates that the short sentence is formed by dividing it from the clause it belongs to, then the short sentence is input into the single sentence relationship recognition model to obtain the causal relationship attribute of the short sentence; If the association identifier indicates that the short sentence is formed by dividing it from one of the two short sentences in the clause, then the short sentence and the other short sentence divided from the clause are used to form a sentence pair. The sentence pair is then input into the sentence pair relationship recognition model to obtain the causal relationship attribute of the short sentence. The causal relationship attribute is used to indicate whether a short sentence is a causal short sentence or a result short sentence.

2. The method of claim 1, wherein, The sentence splitting strategy for each clause is determined in the following way: Determine if there is a causal trigger word in the clause; If it exists, then the clause is split according to the position of the causal trigger word in the clause; If it does not exist, the clause is split based on the sentence component analysis algorithm.

3. The method of claim 2, wherein, Each clause is split in the following way: Determine the position of the causal trigger word in the clause; If the causal trigger word is at the beginning of the clause, then the words following the causal trigger word in the clause are determined as a short sentence; If the causal trigger word is located at the end of the clause, then the words in the clause that precede the causal trigger word are defined as a short sentence; If the causal trigger word is located in the middle of the clause, then the words in the clause that are before the causal trigger word are determined as a short sentence, and the words in the clause that are after the causal trigger word are determined as another short sentence.

4. The method of claim 1, wherein, The steps for forming the causal relationship chain of the target text based on the causal relationship attributes of each short sentence and the structural relationship between each short sentence and its corresponding related short sentences include: Based on the short sentence relationship detection group with parallel construction relationship, multiple parallel relationship sets are determined, wherein the short sentences in different parallel relationship sets are not repeated, and there is at least one repeated short sentence among the short sentence relationship detection groups in each parallel relationship set; For each set of parallel relations, duplicate phrases in the set are removed, and the parallel construction relations between the phrases are merged to form a merged set of parallel relations. Based on the causal relationship attributes of each short sentence, the causal construction relationship between each short sentence and its corresponding associated short sentence, the effect-cause construction relationship, and multiple merged and parallel sets, the causal construction relationship between each short sentence in the target text is determined; Based on the causal relationships between the short sentences in the target text, a causal relationship chain is formed in the target text.

5. The method of claim 1, wherein, The steps to extract multiple clauses from a target text include: The target text is divided into multiple candidate clauses based on preset punctuation marks in the target text. The preset punctuation marks are punctuation marks used for sentence segmentation. For each candidate clause, based on the text length and / or function of the candidate clause, the content of the candidate clause is cleaned to obtain the clause.

6. A text recognition apparatus characterized by comprising: The device includes: The clause extraction module is used to extract multiple clauses from the target text. The clause splitting module is used to perform the following steps for each clause: based on preset causal trigger words, determine the sentence splitting strategy for the clause, and divide the clause according to the determined sentence splitting strategy to obtain at least one short sentence; The relationship determination module is used to perform the following steps for each short sentence: using the target sentence relationship recognition model, determine the causal relationship attribute of the short sentence; based on the text position of the short sentence in the target text, determine the set of related sentences corresponding to the short sentence, the set of related sentences includes multiple related short sentences, and determine the construction relationship between the short sentence and each related short sentence respectively. The relationship chain formation module is used to form a causal relationship chain of the target text based on the causal relationship attributes of each short sentence and the structural relationship between each short sentence and its corresponding related short sentences. The relationship determination module is further configured to extract a first preset number of related short sentences preceding the short sentence, and a second preset number of related short sentences following the short sentence; for each related short sentence, the related short sentence is combined with the short sentence to form a short sentence relationship detection group, and each short sentence relationship detection group includes the short sentence and a corresponding related short sentence; The construction relationship determination module is also used to input the short sentence relationship detection group into the sentence pair relationship recognition model to obtain the construction relationship between two short sentences in the short sentence relationship detection group. The construction relationship includes causal construction relationship, effect-cause construction relationship, parallel construction relationship and no construction relationship. The relationship determination module is further used to extract the association identifier of the short sentence, which indicates the formation method of the short sentence; if the association identifier indicates that the short sentence is formed by dividing it into a unique short sentence from the clause it belongs to, then the single sentence relationship recognition model is determined as the target sentence relationship recognition model; if the association identifier indicates that the short sentence is formed by dividing it into one of two short sentences from the clause it belongs to, then the sentence pair relationship recognition model is determined as the target sentence relationship recognition model. The relationship determination module is further configured to: if the association identifier indicates that the short sentence is formed by dividing it from the clause it belongs to, then input the short sentence into a single sentence relationship recognition model to obtain the causal relationship attribute of the short sentence; if the association identifier indicates that the short sentence is formed by dividing it from the clause it belongs to, then form a sentence pair with the other short sentence divided from the clause it belongs to, and input the sentence pair into a sentence pair relationship recognition model to obtain the causal relationship attribute of the short sentence; wherein, the causal relationship attribute is used to indicate whether the short sentence belongs to a cause short sentence or a result short sentence.

7. An electronic device, comprising: include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is in operation, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the steps of the method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Financial field-oriented causal relationship extraction method and system

    CN113642321A

  • Causal relationship extraction method and device, electronic equipment and readable storage medium

    CN114579767A