Text processing method and device, computer equipment and storage medium

By identifying text fragments with similar grammatical structures of pronouns in the text and conducting structural analysis, the text fragments referred to by the pronouns are screened out, which solves the problem of inaccurate pronoun recognition in the existing technology and achieves higher judgment accuracy.

CN120688507APending Publication Date: 2025-09-23MASHANG CONSUMER FINANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510614682.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-09-23

Smart Images

  • Figure CN120688507A_ABST
    Figure CN120688507A_ABST
Patent Text Reader

Abstract

The invention discloses a text processing method and device, computer equipment and a storage medium, and the method comprises the steps: determining a first text fragment associated with a preset text fragment from a text based on the similarity of the preset text fragment and a text fragment in the text in a grammatical structure; analyzing the first text fragment to obtain a first anonym; performing text structure analysis on the text, and determining a second text fragment referred to by the first referred word in the text; and based on the second text fragment, detecting the content rationality of the first text fragment, and based on a detection result of the content rationality, determining whether the use of the first anonym is correct or not. According to the method, the anonyms in the text can be accurately recognized, and the content rationality of the statement where the anonyms are located can be detected by fusing the second text segments referred to by the first anonyms in the text, so that the accuracy of judging whether the first anonyms are used correctly or not can be further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of text processing, and in particular to a text processing method, apparatus, computer device, and storage medium. Background Art

[0002] In many fields, text processing is very necessary. For example, in normal business exchanges and activities, in order to protect the interests of the relevant parties and provide legal protection, the relevant parties need to sign a large number of contracts. In order to ensure the legality of the contract and avoid risk clauses in the contract, the contract text is often required to be reviewed. However, in actual applications, in order to ensure the conciseness of the text, some pronouns with specific referential meanings are often used in the text. For example, pronouns such as "Party A", "Party B", and "Agreed Time Limit" are often used in the contract text. If the pronouns are used incorrectly, the meaning of the text will change. Therefore, it is very necessary to accurately determine whether the pronouns in the text are used correctly. However, the recognition effect of pronouns in related technologies is not ideal. Summary of the Invention

[0003] In response to the above technical problems, the embodiments of the present application provide a text processing method, apparatus, computer device and storage medium, which can perform targeted processing on the use of pronouns in the text to ensure the correct use of pronouns in the text.

[0004] In a first aspect, an embodiment of the present application provides a text processing method, comprising:

[0005] Determining, from the text, a first text segment associated with the preset text segment based on similarity in grammatical structure between the preset text segment and the text segment in the text, wherein the preset text segment includes an idiomatic text segment corresponding to a pronoun;

[0006] Parsing the first text segment to obtain a first pronoun in the first text segment;

[0007] Performing text structure analysis on the text to determine a second text segment to which the first pronoun refers in the text;

[0008] Based on the second text segment, the rationality of the content of the first text segment is detected, and based on the detection result of the rationality of the content, it is determined whether the use of the first pronoun is correct.

[0009] In a second aspect, an embodiment of the present application provides a text risk identification device, comprising:

[0010] an extraction module for determining, from the text, a first text segment associated with the preset text segment based on similarity in grammatical structure between the preset text segment and the text segment in the text, wherein the preset text segment includes an idiomatic text segment corresponding to a pronoun;

[0011] a parsing module, configured to parse the first text segment to obtain a first pronoun in the first text segment;

[0012] a prediction module, configured to perform structural processing on the text to obtain a second text segment referred to by the first pronoun in the text;

[0013] A processing module is used to detect the rationality of the content of the first text segment based on the second text segment, so as to determine the detection result of the first pronoun based on the detection result of the rationality of the content.

[0014] In a third aspect, an embodiment of the present application further provides a computer device comprising a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the text processing method as described above.

[0015] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a plurality of instructions, wherein the instructions are suitable for loading by a processor to execute the steps of the text processing method as described above.

[0016] In a fifth aspect, an embodiment of the present application further provides a computer program product, which includes a computer program, and the computer program is executed by a processor to perform the steps of the text processing method as described above.

[0017] When adopting the solution of the embodiment of the present application, the common text fragments containing pronouns are first used to accurately identify the first text fragment containing pronouns from the text, and further combine the structural analysis of the text to screen out the second text fragment referred to by the first pronoun, and then make full use of the content of the second text fragment describing the first pronoun to judge whether the content of the first text fragment is reasonable, thereby determining whether the use of the first pronoun is correct based on the rationality of the content of the first text fragment. Compared with the related text processing technology of single detection of pronouns or detection of whether the sentence in which the pronoun is located is smooth, the solution provided by the present application can integrate the second text fragment referred to by the first pronoun in the text to detect the rationality of the content of the sentence in which the pronoun is located, thereby further improving the accuracy of judging whether the use of the first pronoun is correct. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 A flowchart of the steps of a text processing method provided in an embodiment of the present application;

[0020] Figure 2 A schematic diagram of a process flow for determining a first mapping relationship provided in an embodiment of the present application;

[0021] Figure 3 A schematic diagram of a process flow for identifying a first text segment provided by this application;

[0022] Figure 4 A schematic diagram of a process flow for determining a text processing result provided in an embodiment of the present application;

[0023] Figure 5 A schematic diagram of another step flow for determining text processing results provided in an embodiment of the present application;

[0024] Figure 6 A schematic diagram of a process for identifying whether there is a reference risk in a contract text provided in an embodiment of the present application;

[0025] Figure 7 A schematic diagram of a process flow for identifying whether there is a semantic risk in a contract text provided by an embodiment of the present application;

[0026] Figure 8 A flowchart of a method for identifying element logic risks provided in an embodiment of the present application;

[0027] Figure 9 A schematic diagram of the structure of a text processing device provided in an embodiment of the present application;

[0028] Figure 10 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application. At the same time, in the description of the embodiments of the present application, the terms "first", "second", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.

[0030] In order to better understand the text processing method, device, computer equipment and storage medium provided by the present application, the relevant application background of the text processing method is first explained. The text processing method provided by the embodiment of the present application is applicable to various fields that require identification, detection and processing of texts, especially to some texts that use specific pronouns. Specifically, in some texts, in order to ensure the conciseness of the text, some pronouns with specific referential meanings are often used in the text. For example, taking the contract text as an example, the contract text often uses pronouns such as "Party A", "Party B", "Agreed Time Limit", "Article A, Clause B" and so on to refer to specific content. If the pronouns are used incorrectly, the meaning of the text will change. For example, "Party A" is mistakenly written as "Party B" in the text. Therefore, it is very necessary to accurately judge whether the pronouns in the text are used correctly.

[0031] In order to solve the above problems, the present application provides a text processing method, apparatus, computer device and storage medium. By utilizing the similarity in grammatical structure between a common text segment containing a pronoun and a text segment in a text, a first text segment containing a pronoun is determined from the text. After parsing the first text segment to obtain a first pronoun, a second text segment in the text to which the first pronoun refers is determined based on a structural analysis of the text, and the rationality of the content of the first text segment is detected based on the second text segment to determine whether the use of the first pronoun is correct.

[0032] For details, please refer to Figure 1 , Figure 1 A flowchart of a text processing method provided in an embodiment of the present application, specifically including steps S110 to S140:

[0033] S110 : Determine, from the text, a first text segment associated with the preset text segment based on similarity in grammatical structure between the preset text segment and the text segment in the text.

[0034] In the embodiment of the present application, the preset text fragments usually include customary text fragments corresponding to pronouns. The pronouns here usually refer to words with clear reference content in the text. For example, taking the contract text as an example, the more common pronouns in the contract text are Party A, Party B, agreed time limit, delivery content, delivery amount, Article AA, Clause BB of the text, etc. Further, the customary text fragments corresponding to the pronouns here refer to a type of text fragment containing pronouns, which usually limit the description content of the referent object related to the "pronoun". For example, in some embodiments, the customary text fragments can usually exist in the following form: "Party B shall deliver to Party A within the agreed time limit", "Party A needs to pay the agreed amount to Party B in accordance with Article AA, Clause cc upon meeting XXX conditions", "XX referred to in this contract refers to all contents including XXX and XXX", etc.

[0035] In the embodiments of this application, "text" generally refers to text that needs to be processed, such as for risk identification, such as pronoun risk identification. For example, a common text may include a contract. Of course, the text can also be other types of text, such as notification text, report text, news text, application text, etc. The embodiments of this application do not limit the text that needs to be processed or the specific text type.

[0036] On the basis of the above, by utilizing the idiomatic text fragments containing pronouns and the similarity in grammatical structure with each text fragment in the text, it is possible to accurately screen out the first text fragment in the text that is structurally related to the preset text fragment, that is, the first text fragment containing pronouns.

[0037] Of course, it should be noted that, based on the different text types, the specific forms of pronouns used in the text will also vary to a certain extent. For example, in some report texts, pronouns such as "we", "our company", "your company", and "official agencies" are often used. Therefore, in order to be able to extract the corresponding first text segment with pronouns from different types of texts, in some embodiments of the present application, the first text type of the text is determined based on the text content of the text, so as to determine the customary text segment associated with the first text type of the text from the mapping relationship in which multiple sets of corresponding relationships are pre-stored as the aforementioned preset text segment. That is to say, in one embodiment, the method further includes:

[0038] determining a first text type of the text based on text content of the text;

[0039] According to the first text type and the first mapping relationship, the idiomatic text segment associated with the first text type in the first mapping relationship is used as the preset text segment corresponding to the text.

[0040] Among them, in the embodiment of the present application, the first mapping relationship can be configured to exist in the form of a mapping table, which generally includes multiple groups of corresponding relationships, wherein each group of corresponding relationships includes a text type and at least one customary text segment associated with the text type. For example, taking the text type of contract text as an example, the at least one customary text segment associated with the text type includes the aforementioned "Party B shall deliver to Party A within the agreed period", "Party A shall pay the agreed amount to Party B in accordance with Article aa, Clause cc upon meeting XXX conditions", "XX referred to in this contract refers to all contents including XXX and XXX", or, taking the text type of report text as an example, the at least one customary text segment associated with the text type includes "According to the investigation of the official agency, the XXXX situation is true", "Our company's operating income in the last quarter was XX", etc.

[0041] Furthermore, the idiomatic text segments for different text types stored in the first mapping relationship can usually be collected in advance from the Internet, for example, through a web crawler or other network technologies. Of course, it is also feasible to manually identify and select idiomatic text segments for different text types based on user identification.

[0042] On this basis, in order to further improve the text processing effect of different text types, the number of idiomatic text segments corresponding to the pronouns included in the preset text segments for different text types may also be different. For example, in one embodiment, the number of idiomatic text segments may generally be related to the probability of risk of the text type. For example, for a type of text with a higher probability of risk, such as a contract text, the number of idiomatic text segments can be set to be larger, for example, more than 15 idiomatic text segments can be set, while for some text types with a lower probability of risk, the number of idiomatic text segments can be set to be lower, for example, 5 to 10 idiomatic text segments can be set. That is to say, in the multiple groups of corresponding relationships contained in the first mapping relationship, the number of each text type and its associated idiomatic text segments is determined based on the text type. For example, please refer to Figure 2 , Figure 2 A schematic flow chart of a step of determining a first mapping relationship provided in an embodiment of the present application, specifically including steps S210 to S230:

[0043] S210 , for each text type, determining a sample text corresponding to the text type, and a first sample text segment in which pronouns are used improperly and a second sample text segment in which pronouns are not used improperly in the sample text.

[0044] In an embodiment of the present application, for each text type, such as a contract text, at least one sample text of that text type can be collected in advance from the Internet, for example, multiple contract sample texts can be collected by crawling, and a first sample text segment with improper use of pronouns and a second sample text segment without improper use of pronouns can be determined from the multiple sample text segments included in the sample text through manual identification or other methods, such as text segmentation, model recognition and other technologies.

[0045] S220: Select a preset number of sample text segments from the second sample text segments according to the quantity ratio of the first sample text segments in the sample text; wherein the preset number is positively correlated with the quantity ratio.

[0046] In the embodiment of the present application, combined with the above-mentioned related description, it can be seen that the proportion of the number of first sample text segments with improper use of pronouns in the sample text can, to a certain extent, reflect the probability that the type of text is at risk. Therefore, in the embodiment of the present application, based on this proportion, a preset number of sample text segments are further selected from the second sample text segments without improper use of pronouns in the sample text. For example, the higher the proportion of first sample text segments with improper use of pronouns in the sample text, that is, the greater the proportion of the first sample text segments in the sample text, the higher the probability that the text type is at risk. Therefore, more sample text segments can be selected from the second sample text segments as customary text segments to be added to the mapping relationship with the text type, thereby facilitating subsequent more accurate risk identification processing for the text type. Conversely, the lower the proportion of first sample text segments with improper use of pronouns in the sample text, that is, the smaller the proportion of the first sample text segments in the sample text, the lower the probability that the text type is at risk. Therefore, fewer sample text segments can be selected from the second sample text segments as customary text segments to be further added to the mapping relationship with the text type. That is to say, in one embodiment, the preset number of sample text segments selected from the second sample text segments can be positively correlated with the ratio of the number of first sample text segments in the sample text, that is, the higher the ratio of the number of first sample text segments in the sample text, the more second sample text segments need to be selected as sample text segments.

[0047] S230: Use the sample text segment as a customary text segment, and add the correspondence between the customary text segment and the text type to the first mapping relationship.

[0048] In an embodiment of the present application, by selecting a certain number of sample text segments as customary text segments and adding the correspondence between the customary text segments and the text types to the first mapping relationship, it is possible to configure the number of customary text segments corresponding to different text types in the first mapping relationship. By configuring different numbers of customary text segments as preset text segments for texts of different text types, a more comprehensive comparison of texts based on more customary text segments can be performed for some text types with a higher probability of risk, while for some text types with a lower probability of risk, the workload of text processing can be reduced, thereby ensuring the text processing effect while maximizing the efficiency of text processing.

[0049] After obtaining the preset text segments of the text through any of the aforementioned embodiments, a first text segment associated with the preset text segment is determined from the text based on the similarity in grammatical structure between the preset text segments and the text segment in the text.

[0050] Specifically, since the preset text fragment is a type of idiomatic text fragment that includes pronouns, based on the grammatical structure of this type of preset text fragment, a search and match is performed in the text to determine the associated first text fragment from the text, and the determined first text fragment usually also has a high probability of containing pronouns.

[0051] Specifically, based on the similarity in grammatical structure between a preset text segment and a text segment in the text, there are many implementation schemes for determining the first text segment associated with the preset text segment from the text. For example, in one embodiment, the text segment can be matched by a model. Of course, in order to ensure the effect of the text segment screened out by this application and to ensure the effect of subsequent text processing, this application also provides an implementation scheme for introducing a reflection mechanism to improve the matching of the first text segment. For details, please refer to Figure 3 , Figure 3 A schematic flow chart of steps for identifying a first text segment provided in this application, specifically including steps S310 to S350:

[0052] S310: Encode the preset text segment to obtain a first text code, and encode each text segment in the text to obtain a second text code.

[0053] In order to accurately screen out text fragments that are similar in grammatical structure to preset text fragments, in an embodiment of the present application, the preset text fragments are encoded to obtain a first text code that can be used to describe the grammatical structure of the preset text fragment. Based on a similar processing process, by encoding each text fragment in the text, a second text code that describes the grammatical structure of each text fragment can also be obtained.

[0054] Specifically, the process of encoding the text fragments here can be implemented by relying on a pre-trained encoder or an encoding layer of a specific network model, wherein the encoder or encoding layer can be used to analyze the grammatical structure of the text fragment and encode it into a corresponding text encoding. For example, the encoder here can use a pre-trained bidirectional encoder. Of course, it is also feasible to obtain the text encoding of each text fragment by other means, and the embodiments of the present application are not limited here.

[0055] S320 : For each text segment in the text, determine the similarity between the preset text segment and the text segment in grammatical structure based on a first text code and a second text code corresponding to the text segment.

[0056] S330: Determine a fourth text segment from the text according to the similarity between the first text code and each second text code.

[0057] In this embodiment, combined with the aforementioned related description, it can be seen that since the first text encoding and the second text encoding can be used to describe the grammatical structure information of the text segment, that is, the higher the similarity between the first text encoding and the second text encoding, the more similar the grammatical structures of the two text segments are. Therefore, the similarity between the first text encoding and the second text encoding can be used to filter out multiple fourth text segments that are more similar to the preset text segment from the multiple text segments included in the text. Specifically, the similarity between the first text encoding and the second text encoding can be determined by cosine similarity between the encodings, or Euclidean distance, etc., which is not limited in this application.

[0058] Specifically, the fourth text segment here can be determined by comparing the similarity with a preset similarity threshold. For example, a text segment with a similarity higher than a certain similarity threshold is used as the fourth text segment, or by sorting the similarities between the first text code and each second text code, and taking the first several text segments with the highest sorting as the fourth text segment.

[0059] S340: Perform text similarity matching on the fourth text segment and the preset text segment to obtain a matching degree between the fourth text segment and the preset text segment.

[0060] In order to more accurately determine the final selected first text segment, in an embodiment, a reflection mechanism is further introduced, that is, the degree of match between the selected fourth text segment and the preset text segment is further determined. For example, the fourth text segment and the preset text segment can be input into a pre-trained model, and the trained model can be used to output the degree of match between the fourth text segment and the preset text segment. The degree of match here can, to a certain extent, describe whether the fourth text segment sufficiently matches the preset text segment in terms of grammatical structure.

[0061] Specifically, the model can be understood as a model with discriminative properties. For example, as a common feasible implementation scheme, the model can be a large language model, that is, the fourth text segment and the preset text segment are input into the large language model to ask questions such as "Do the fourth text segment and the preset text segment have similar grammatical structures?" or "Do the fourth text segment and the preset text segment sufficiently match in grammatical structure?", so as to output the degree of matching between the fourth text segment and the preset text segment through the large language model, for example, describing the degree of matching through a numerical percentage, or describing the degree of matching through a high match or low match level.

[0062] S350: When the matching degree satisfies a first degree threshold, determine the fourth text segment as a first text segment associated with the preset text segment.

[0063] In this embodiment, if the degree of match in the matching result satisfies a first degree threshold, for example, if it is determined that the fourth text segment output by the large language model and the preset text segment have a higher match level, or the degree of match exceeds a certain percentage threshold, the fourth text segment may be determined to be associated with the first text segment of the preset text segment. Conversely, if the degree of match between the fourth text segment output by the large language model and the preset text segment is higher, or the degree of match does not exceed the certain percentage threshold, the fourth text segment may be discarded.

[0064] Of course, in order to more accurately screen out the first text segment, when the degree of matching between the fourth text segment output by the large language model and the preset text segment does not meet the first degree threshold, the fourth text segment can be further added to the extraction error list, wherein the third text segment added to the extraction error list can be used as prior knowledge information in the subsequent text processing process to more accurately screen out the first text segment for subsequent risk identification.

[0065] The text risk identification method provided in this embodiment introduces a reflection mechanism, that is, first using the similarity of text encoding to screen out text fragments with similar encoding, and then inputting them into a large language model to use the ability of the large language model to process text to determine the degree of matching between the two. The matching results are used to add erroneous extraction information to the extraction error list as prior knowledge information, thereby improving the subsequent text extraction effect and further improving the accuracy of text risk identification.

[0066] S120: Parse the first text segment to obtain a first pronoun in the first text segment.

[0067] After filtering out a first text segment associated with a preset text segment from a text segment through any of the aforementioned embodiments, the first text segment can be parsed to extract structured information in the first text segment, such as nouns, verbs, etc., so as to filter out the reference field in the first text segment as the first pronoun. For example, the first pronoun here can be words such as "Party A", "Party B", "Article 10, Article 3", etc. Of course, it can be explained that since the grammatical structure similarity of the preset text segment is used to filter out the first text segment, the first pronoun here is not limited to the pronouns contained in the conventional text segment in the preset text segment, but can also include other pronouns.

[0068] Specifically, there are many ways to parse the first text segment to obtain the reference of the first pronoun in the first text segment. For example, as a common and feasible implementation solution, the first text segment and the demonstrative word extraction template text can be input into a large language model to extract the pronoun in the first text segment. For example, the text segment and the demonstrative word extraction template text are combined to obtain the following question: "In the following text: 'If Party B executes in accordance with the provisions of Article 3 of Section 10, then Party A needs to execute according to the agreed time limit', are there pronouns that may refer to other content?" and input it into the large language model, thereby completing the text parsing of the text segment to obtain the first pronoun contained therein.

[0069] Of course, in order to avoid the large language model extracting incorrect pronouns, the extracted pronoun segments can be further searched in the text to promptly determine the incorrectly extracted pronouns that cannot be found in the text. Similarly, the pronouns can also be added to the extraction error list as part of the prompt information to inform the large model that this text does not contain the pronouns in this list, so that it can re-extract a new first pronoun that can be found in the text segment.

[0070] S130: Perform text structure analysis on the text to determine a second text segment referred to by the first pronoun in the text.

[0071] In the embodiments of the present application, in the text, a specific structural form is usually used to record the content referred to by various pronouns. For example, at the very beginning of the text, the referential meanings of various pronouns in the text are marked, for example, at the very beginning of the contract text, "Party A: XXXXX" and "Party B: XXXX" are specifically recorded, or the referential meanings of various pronouns in the text are recorded in the form of subject paragraphs, for example, by explaining the specific time of various deadlines recorded in the text, such as "completion deadline", "payment deadline" and "exemption deadline" in a chapter with a subject name (usually in bold or capitalized form) as "About Deadline Description". Of course, the clauses in the text can also be described by setting a serial number identifier, such as "(1) Article aa, Paragraph bb" and "(2) Chapter cc, Section dd". Therefore, in some embodiments of the present application, by performing text structure analysis on the text, the second text segment referred to by the first pronoun in the text can be determined. Specifically, the text structure analysis here includes but is not limited to processing the text in the form of wildcards, and it is also feasible to determine the second text segment referred to by the first pronoun in the text by other text structure analysis methods. For example, in another embodiment, the second text segment can be screened based on a trained model. For example, the text and the first pronoun are input into a trained text processing model. The text processing model can then identify the text segment referred to by the first pronoun from the text and output it as the second text segment. Of course, the specific training process of the text processing model is not limited in this embodiment of the present application.

[0072] By further parsing the text, the text fragment referred to by the first pronoun can be extracted from the text as the second text fragment. For example, when the first pronoun is "Party A", the second text fragment usually refers to the text fragment used to define Party A in the contract text. When the first pronoun is "Article 3 of Section 10", the second text fragment usually refers to the terms and conditions related to Article 3 of Section 10 in the contract text.

[0073] S140: Based on the second text segment, detect the rationality of the content of the first text segment, and determine whether the use of the first pronoun is correct based on the detection result of the rationality of the content.

[0074] In an embodiment of the present application, after the first text segment containing a pronoun is identified in the text, by combining the second text segment corresponding to the pronoun in the first text segment, the rationality of the content of the first text segment can be detected based on the second text segment as supplementary information of the first text segment, such as the detection of the rationality of the content as a whole, so that the complete semantic information of the first text segment can be considered to determine whether the use of the first pronoun in the first text segment is correct.

[0075] Specifically, in one embodiment, when the content rationality of the first text segment is "unreasonable content", it can be considered that the use of the first pronoun in the first text segment is incorrect. In particular, if there are multiple first text segments that include the same pronoun, if the detection results of some first text segments are "unreasonable content", and the detection results of some first text segments are "reasonable content", it can be determined that the first text segment with the detection result of "unreasonable content" often may have the risk of incorrect use of the pronoun, and when there are multiple first text segments that include the same pronoun, if the detection results of all the first text segments are "unreasonable", it may be that there is an error in the definition of the first pronoun, that is, the second text segment may be unreasonable. That is, by making full use of multiple text segments associated with the first pronoun, it is possible to more accurately predict whether the use of the first pronoun in the text segment is correct.

[0076] For details, please refer to Figure 4 , Figure 4 A flowchart of steps for determining a text processing result provided in an embodiment of the present application, specifically including steps S410 to S420:

[0077] S410: Replace the first pronoun in the first text segment with the second text segment to obtain a third text segment.

[0078] In this embodiment, a third text segment with a complete description can be obtained by replacing the first pronoun in the first text segment with the second text segment as supplementary information of the first pronoun.

[0079] S420: Detect the rationality of the content of the third text segment using the first model to obtain a detection result.

[0080] In an embodiment of the present application, the third text segment of the complete description is input into the first model to perform prediction processing on the rationality of the content of the third text segment, so that the rationality of the content of the third text segment of the complete description can be predicted, thereby giving a corresponding detection result, such as "irrational content" or "rational content".

[0081] Of course, before replacing the pronoun in the first text segment with the second text segment, a semantic analysis can be performed on the first text segment and the second text segment to determine whether the semantic similarity between the two text segments is sufficiently similar or whether there is a conflict, thereby determining whether the text has a result of improper use of pronouns. In other words, the text processing method provided by this application also includes:

[0082] Performing semantic analysis on the first text segment and the second text segment to obtain semantic similarity between the second text segment and the first text segment;

[0083] In a case where the semantic similarity is greater than a similarity threshold, performing the step of replacing the first pronoun in the first text segment with the second text segment;

[0084] When the semantic similarity is less than or equal to a similarity threshold, it is determined that the use of the first pronoun is incorrect.

[0085] In an embodiment of the present application, if the semantic similarity between the first text segment and the second text segment is high, for example, greater than a similarity threshold, the step of replacing the first pronoun in the first text segment with the second text segment will be executed, thereby continuing to obtain the text processing result through the first model.

[0086] Correspondingly, if the semantic similarity between the second text segment and the first text segment is small, that is, less than or equal to the similarity threshold, for example, the first text segment refers to the pronoun "Party B" that needs to perform a certain step, and the second text segment says that the pronoun "Party B" needs to supervise others to perform a certain step. At this time, combined with the semantic similarity analysis, there is a conflict in the semantics of the first text segment and the second text segment, that is, the semantic similarity is low, and it can be directly determined that the first pronoun in the first text segment is used improperly.

[0087] Of course, in addition to the above-mentioned solutions, the preset text segments can also include more types of text segments, so as to more accurately determine whether the first text segment has the risk of improper use. For example, in another embodiment, the preset text segments also include abnormal text segments with improper use of pronouns. In other words, by comparing the semantic similarity between the first text segment and these abnormal text segments, the rationality of the content of the first text segment can also be determined. Figure 5 , Figure 5 Another flowchart of steps for determining text processing results provided in an embodiment of the present application, specifically, includes steps S510 to S540:

[0088] S510: Based on the second text segment, detect the rationality of the content of the first text segment to obtain a first detection result of the first text segment.

[0089] In the embodiment of the present application, combined with the above-mentioned related description, it can be seen that the second text segment is used as supplementary information of the first pronoun in the first text segment, so as to determine the rationality of the content of the first text segment as a whole, thereby obtaining the first detection result of the first text segment. The specific implementation scheme can be referred to the above description.

[0090] S520: Based on the semantic similarity between the abnormal text segment and the first text segment, detect the rationality of the content of the first text segment to obtain a second detection result of the first text segment.

[0091] Compared to directly using the second text segment to determine whether the use of the first pronoun is correct based on the test results of the content rationality of the first text segment, in the embodiment of the present application, the content rationality of the first text segment is also tested based on the semantic similarity between the abnormal text segment with improper use of the pronoun included in the preset text segment and the first text segment. Specifically, in the case where the semantic similarity between the abnormal text segment and the first text segment is high, it can be considered that the first text segment is similar to the abnormal text segment and has a higher possibility of having unreasonable content. Conversely, in the case where the semantic similarity between the abnormal text segment and the first text segment is low, it can be considered that the first text segment has a lower possibility of having unreasonable content.

[0092] S530: Weight the first detection result and the second detection result based on a preset weight to obtain a third detection result.

[0093] S540: Determine whether the first pronoun is used correctly according to the third detection result.

[0094] In an embodiment of the present application, based on the detection results of the rationality of the content of the first text fragment determined by different methods, by weighting these detection results, it is possible to fully consider whether the content of the first text fragment is sufficiently reasonable from multiple dimensions, thereby obtaining a more accurate detection result, and thus more accurately predicting whether the use of the first pronoun is correct.

[0095] When adopting the solution of the embodiment of the present application, the common text fragments containing pronouns are first used to accurately identify the first text fragment containing pronouns from the text, and further combine the structural analysis of the text to screen out the second text fragment referred to by the first pronoun, and then make full use of the content of the second text fragment describing the first pronoun to judge whether the content of the first text fragment is reasonable, thereby determining whether the use of the first pronoun is correct based on the rationality of the content of the first text fragment. Compared with the related text processing technology of single detection of pronouns or detection of whether the sentence in which the pronoun is located is smooth, the solution provided by the present application can integrate the second text fragment referred to by the first pronoun in the text to detect the rationality of the content of the sentence in which the pronoun is located, thereby further improving the accuracy of judging whether the use of the first pronoun is correct.

[0096] In order to more clearly understand the technical solutions provided by the embodiments of the present application, the following will be combined with the above Figures 1 to 5 The content provided provides several complete implementation solutions for processing contract texts, which are detailed below.

[0097] See also Figure 6 , Figure 6 A flowchart of steps for identifying whether there is a risk in a contract text is provided in an embodiment of the present application, specifically including the following steps:

[0098] (1) Segment the contract text to be identified according to different title levels, for example, according to the first title, to obtain several contract text fragments, and parse the document to obtain structured data of the contract text, such as identification information such as a list of reference numbers appearing in the contract text;

[0099] (2) A small amount of exemplary content (Few-shot), text fragments, and demonstrative pronoun extraction templates are input into the large language model, and the large language model is allowed to parse the text fragments in the demonstrative pronoun extraction template according to the exemplary content to obtain all the extraction results in the fragments. For example, the content input into the large language model can usually be "Please refer to the following example, "'If Party B executes in accordance with the provisions of Article 3 of Section 10, then Party A needs to execute in accordance with the agreed time limit' contains demonstrative pronouns such as 'Party A', 'Party B', 'Article 3 of Section 10', and 'Agreed time limit', and determine the possible reference fields in the following 'text fragment'";

[0100] (3) To prevent the large language model from extracting errors, it is possible to determine one by one whether the extracted referent field can be found in the text fragment. If not, the referent field is added to the extraction error list. The error list is then used as part of the demonstrative pronoun extraction template to tell the large model that this text fragment does not contain the demonstrative pronouns in this list. It is then asked to re-extract until all the extracted demonstrative pronouns can be found in the text fragment. If the number of errors is greater than the iteration threshold S (S can be 5), the demonstrative pronoun extraction result obtained last time is selected as the result, and the execution continues backwards.

[0101] (4) The obtained reference fields are further compared with the structured data obtained by parsing, such as the number list of the contract text, where the number list of the contract text can be obtained by parsing the sub-title information of each level of the contract text, so as to determine whether each reference field has corresponding reference content. If not, it can be considered that there is a reference risk in the contract text. If so, the reference field can be associated with the reference content for the purpose of identifying other risks.

[0102] See also Figure 7 , Figure 7 A flowchart of steps for identifying whether there is a semantic risk in a contract text is provided in an embodiment of the present application, specifically including the following steps:

[0103] (1) Segment the contract text in a specific manner, for example, by line break, to obtain multiple contract segments, and obtain the encoding vector of each segment using a pre-trained vector model;

[0104] (2) In addition, contextual expressions of different semantic risks are collected by preselection as preset text segments. For different types of text, such as different types of contract texts, the preset text segments collected are usually different. Specifically, the preset text segments can include descriptive texts corresponding to different risk types. For risk types that are more difficult to judge, more preset text segments can be collected, such as about 15 preset text segments. For risk types that are easier to judge, fewer preset text segments can be collected, such as about 5 preset text segments. The difficulty of judging the risk type can usually be determined by the number of texts of the corresponding risk type in the sample texts collected on the Internet. Of course, it is also feasible to determine it by other methods.

[0105] (3) The preset text segment is usually processed by a pre-trained vector model to obtain an encoding vector, and then based on the vector search, such as similarity query, the most similar context segment in the contract text is obtained, that is, the first text segment;

[0106] (4) In order to determine whether the first text segment screened out is the text segment that needs to be identified, the name of the first text segment and the corresponding risk type can also be input into the large model to let it determine whether each first text segment is the text segment corresponding to the risk type. If the judgment result is correct, proceed to the next step. If the judgment is wrong, add this text segment to the error list, tell the large model the text segment selected in this list, and let it reselect a context text segment. If the number of judgment errors is greater than the iteration number threshold S (S can be 5), the last context obtained is selected as the result, and the execution continues backward;

[0107] (5) In the case where the first text segment has a reference field, combined with the above Figure 6 The content of identifying reference risk shown can replace the reference field with the corresponding second text segment as the supplementary content of the first text segment, and input it into the semantic risk discrimination model to obtain the semantic risk review result, which is used to describe whether the text to be identified has semantic risk;

[0108] (6) The specific training process of the semantic risk discrimination model includes the following steps:

[0109] Collect descriptive data for several risky samples of each risk type under the corresponding text type, as well as descriptive data for several non-risky samples. The source of the risky sample descriptive data can be similar to that of the preset text fragment, extracted from the preset text fragment. Then, combine the sample data of multiple risk types as seed annotation data for the semantic risk judgment model of the contract type. This annotation data is divided into a training set and a validation set in an 8:2 ratio, and input into the preset model to train a binary risk judgment model. The accuracy of the validation set is then calculated. When the accuracy of the validation set is lower than the threshold P (P can be 0.95), the misclassified data of the validation set is input into the large model, and samples with similar descriptions are added to the training set. The model is retrained until the accuracy of the validation set is higher than the threshold. The resulting binary risk judgment model is used as the trained semantic risk discrimination model.

[0110] In addition to the semantic identification of the reference fields mentioned above, the review of the contract text can also include risk identification of the element information in the contract, see Figure 8 , Figure 8 A flowchart of a method for identifying element logic risk provided in an embodiment of the present application, specifically comprising the following steps:

[0111] (1) The contract text to be extracted is segmented according to line breaks to obtain several contract text segments. Then, the vectors of the corresponding text segments are obtained through the pre-trained vector model and stored in the vector database;

[0112] (2) Collect common descriptions of the context fragments corresponding to each element to be extracted as preset text fragments, wherein different numbers of preset text fragments can be collected for elements with different extraction difficulties. For example, for elements that are difficult to extract, the number of preset text fragments can be set to 15, and for elements that are easier to extract, the number of preset text fragments can be set to 5;

[0113] (3) Processing the preset text fragments through the pre-trained vector model to obtain multiple vectors, so as to obtain the most similar context text fragments in the contract text based on vector retrieval, such as similarity query;

[0114] (4) taking the text segment with the highest similarity score as the context segment corresponding to the element, and judging whether the selected context segment is reasonable when passing, so as to reselect the selected context segment;

[0115] (5) The final selected context fragments, the corresponding element information, and a small amount of exemplary content are combined and input into the large language model to obtain the final element extraction result;

[0116] (6) Match the element extraction results with the preset review rules to determine whether the extracted element information complies with the specific review rules, thereby determining the logical risk judgment result of the contract text.

[0117] In order to better implement the text processing method provided in the embodiment of the present application, the present embodiment also provides a text processing device, which can be integrated into a server. Figure 9 As shown, the text processing device may include:

[0118] An extraction module 910 is configured to determine, from the text, a first text segment associated with the preset text segment based on similarity in grammatical structure between the preset text segment and the text segment in the text, wherein the preset text segment includes an idiomatic text segment corresponding to a pronoun;

[0119] A parsing module 920 is configured to parse the first text segment to obtain a first pronoun in the first text segment;

[0120] A prediction module 930 is configured to perform structural processing on the text to obtain a second text segment referred to by the first pronoun in the text;

[0121] The processing module 940 is configured to detect the rationality of the content of the first text segment based on the second text segment, so as to determine the detection result of the first pronoun based on the detection result of the rationality of the content.

[0122] In some embodiments of the present application, the processing module 940 is also used to replace the first pronoun in the first text segment with the second text segment to obtain a third text segment; and detect the rationality of the content of the third text segment through the first model to obtain a detection result.

[0123] In some embodiments of the present application, the processing module 940 is also used to perform semantic analysis on the first text segment and the second text segment to obtain the semantic similarity between the second text segment and the first text segment; when the semantic similarity is greater than the similarity threshold, perform the step of replacing the first reference word in the first text segment with the second text segment; when the semantic similarity is less than or equal to the similarity threshold, determine that the use of the first reference word is incorrect.

[0124] In some embodiments of the present application, the extraction module 910 is also used to determine the first text type of the text based on the text content of the text; according to the first text type and the first mapping relationship, the idiomatic text segment associated with the first text type in the first mapping relationship is used as the preset text segment corresponding to the text, wherein the first mapping relationship includes multiple groups of correspondences, each group of correspondences includes a text type and at least one idiomatic text segment associated with the text type.

[0125] In some embodiments of the present application, the extraction module 910 is further used to determine, for each text type, a sample text corresponding to the text type, as well as a first sample text segment in which pronouns are used improperly and a second sample text segment in which pronouns are not used improperly in the sample text; select a preset number of sample text segments from the second sample text segments based on the quantity ratio of the first sample text segments in the sample text; wherein the preset number is positively correlated with the quantity ratio; and use the sample text segments as idiomatic text segments, and add the correspondence between the idiomatic text segments and the text type to the first mapping relationship.

[0126] In some embodiments of the present application, the extraction module 910 is further used to encode the preset text segment to obtain a first text code, and to encode each text segment in the text to obtain a second text code; for each text segment in the text, based on the first text code and the second text code corresponding to the text segment, determine the similarity in grammatical structure between the preset text segment and the text segment; based on the similarity between the first text code and each second text code, determine a fourth text segment from the text; perform text similarity matching on the fourth text segment and the preset text segment to obtain a degree of matching between the fourth text segment and the preset text segment; when the degree of matching meets a first degree threshold, determine the fourth text segment as the first text segment associated with the preset text segment.

[0127] In some embodiments of the present application, the processing module 940 is also used to detect the rationality of the content of the first text segment based on the second text segment to obtain a first detection result of the first text segment; detect the rationality of the content of the first text segment based on the semantic similarity between the abnormal text segment and the first text segment to obtain a second detection result of the first text segment; weight the first detection result and the second detection result based on a preset weight to obtain a third detection result; and determine whether the use of the first pronoun is correct based on the third detection result.

[0128] When adopting the solution of the embodiment of the present application, the common text fragments containing pronouns are first used to accurately identify the first text fragment containing pronouns from the text, and further combine the structural analysis of the text to screen out the second text fragment referred to by the first pronoun, and then make full use of the content of the second text fragment describing the first pronoun to judge whether the content of the first text fragment is reasonable, thereby determining whether the use of the first pronoun is correct based on the rationality of the content of the first text fragment. Compared with the related text processing technology of single detection of pronouns or detection of whether the sentence in which the pronoun is located is smooth, the solution provided by the present application can integrate the second text fragment referred to by the first pronoun in the text to detect the rationality of the content of the sentence in which the pronoun is located, thereby further improving the accuracy of judging whether the use of the first pronoun is correct.

[0129] Based on the same inventive concept, an embodiment of the present application further provides a computer device, which may be a server or a terminal device. The computer device includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the above-mentioned text processing method. Various functions are thereby achieved, such as executing the following steps:

[0130] Determining a preset text segment, and determining a first text segment associated with the preset text segment from the text based on similarity in grammatical structure between the preset text segment and a text segment in the text, wherein the preset text segment includes an idiomatic text segment corresponding to a pronoun;

[0131] Determining, from the text, a first text segment associated with the preset text segment based on similarity in grammatical structure between the preset text segment and the text segment in the text, wherein the preset text segment includes an idiomatic text segment corresponding to a pronoun;

[0132] Parsing the first text segment to obtain a first pronoun in the first text segment;

[0133] Performing text structure analysis on the text to determine a second text segment to which the first pronoun refers in the text;

[0134] Based on the second text segment, the rationality of the content of the first text segment is detected, and based on the detection result of the rationality of the content, it is determined whether the use of the first pronoun is correct.

[0135] In one embodiment, the computer device is a terminal device, for example, its internal structure diagram can be as follows Figure 10 As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a text processing method is implemented. The display unit of the computer device is used to form a visually visible image, and can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0136] Those skilled in the art will understand that Figure 10The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0137] Based on the same inventive concept, an embodiment of the present application also provides a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0138] Since the computer program stored in the computer-readable storage medium can execute any text risk identification method provided in the embodiments of the present application, the beneficial effects that can be achieved by any text processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0139] Based on the same inventive concept, embodiments of the present application further provide a computer program product or computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the above embodiments.

[0140] It should be noted that the object data (including but not limited to user device information, user personal information, etc.) and conversation data involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods.

[0141] Any reference to the memory, database or other media used in the various embodiments provided herein may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0142] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.

[0143] In the above-mentioned text processing apparatus, computer device, computer-readable storage medium, and computer program product embodiments, the descriptions of each embodiment have different focuses. For portions not described in detail in a particular embodiment, reference can be made to the relevant descriptions of other embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes and beneficial effects of the above-described text processing apparatus, computer-readable storage medium, computer program product, computer device, and their corresponding units can be referred to in the description of the text processing method in the above embodiments, and the details will not be repeated here.

[0144] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0145] The above is a detailed introduction to a text processing method, device, computer equipment and storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core ideas. At the same time, for those skilled in the art, based on the ideas of the present application, there may 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 the present application.

Claims

1. A text processing method, characterized in that: The method comprises: Determining, from the text, a first text segment associated with the preset text segment based on similarity in grammatical structure between the preset text segment and the text segment in the text, wherein the preset text segment includes an idiomatic text segment corresponding to a pronoun; Parsing the first text segment to obtain a first pronoun in the first text segment; Performing text structure analysis on the text to determine a second text segment to which the first pronoun refers in the text; Based on the second text segment, the rationality of the content of the first text segment is detected, and based on the detection result of the rationality of the content, it is determined whether the use of the first pronoun is correct.

2. The method according to claim 1, characterized in that The detecting the rationality of the content of the first text segment based on the second text segment includes: replacing the first pronoun in the first text segment with the second text segment to obtain a third text segment; The rationality of the content of the third text segment is detected by the first model to obtain a detection result.

3. The method according to claim 2, characterized in that The method further comprises: Performing semantic analysis on the first text segment and the second text segment to obtain semantic similarity between the second text segment and the first text segment; In a case where the semantic similarity is greater than a similarity threshold, performing the step of replacing the first pronoun in the first text segment with the second text segment; When the semantic similarity is less than or equal to a similarity threshold, it is determined that the use of the first pronoun is incorrect.

4. The method according to claim 1, wherein The method further comprises: determining a first text type of the text based on text content of the text; According to the first text type and the first mapping relationship, the idiomatic text segment associated with the first text type in the first mapping relationship is used as the preset text segment corresponding to the text, wherein the first mapping relationship includes multiple groups of correspondences, each group of correspondences includes a text type and at least one idiomatic text segment associated with the text type.

5. The method according to claim 4, characterized in that The idiomatic text segments included in the first mapping relationship include idiomatic text segments corresponding to the pronouns; the first mapping relationship is obtained by the following steps: For each text type, determining a sample text corresponding to the text type, and a first sample text segment in which pronouns are used improperly and a second sample text segment in which pronouns are not used improperly in the sample text; selecting a preset number of sample text segments from the second sample text segments according to the quantity ratio of the first sample text segments in the sample text; wherein the preset number is positively correlated with the quantity ratio; The sample text segment is used as a customary text segment, and the correspondence between the customary text segment and the text type is added to the first mapping relationship.

6. The method according to claim 1, characterized in that The step of determining, from the text, a first text segment associated with the preset text segment based on the similarity in grammatical structure between the preset text segment and the text segment in the text includes: Encoding the preset text segment to obtain a first text code, and encoding each text segment in the text to obtain a second text code; For each text segment in the text, determining, based on a first text code and a second text code corresponding to the text segment, a similarity in grammatical structure between the preset text segment and the text segment; determining a fourth text segment from the text based on similarities in grammatical structure between the first text code and each second text code; Performing text similarity matching on the fourth text segment and the preset text segment to obtain a matching degree between the fourth text segment and the preset text segment; When the matching degree satisfies a first degree threshold, the fourth text segment is determined as the first text segment associated with the preset text segment.

7. The method according to any one of claims 1 to 6, characterized in that The preset text segment also includes an abnormal text segment in which a pronoun is used improperly; the detecting the rationality of the content of the first text segment based on the second text segment, and determining whether the use of the first pronoun is correct based on the detection result of the rationality of the content, includes: Based on the second text segment, detecting rationality of content of the first text segment to obtain a first detection result of the first text segment; Based on the semantic similarity between the abnormal text segment and the first text segment, detecting the rationality of the content of the first text segment to obtain a second detection result of the first text segment; Weighting the first detection result and the second detection result based on a preset weight to obtain a third detection result; Determine whether the first pronoun is used correctly based on the third detection result.

8. A text processing device, characterized in that: include: an extraction module for determining, from the text, a first text segment associated with the preset text segment based on similarity in grammatical structure between the preset text segment and the text segment in the text, wherein the preset text segment includes an idiomatic text segment corresponding to a pronoun; a parsing module, configured to parse the first text segment to obtain a first pronoun in the first text segment; a prediction module, configured to perform structural processing on the text to obtain a second text segment referred to by the first pronoun in the text; A processing module is used to detect the rationality of the content of the first text segment based on the second text segment, so as to determine the detection result of the first pronoun based on the detection result of the rationality of the content.

9. A computer device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a plurality of instructions; the processor loads instructions from the memory to execute the steps of the text processing method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the text processing method according to any one of claims 1 to 7.