Text recognition methods, devices, processors, and electronic devices

By performing text rewriting and probability calculation on the text to be detected, the problem of low accuracy in recognizing machine-generated text was solved, and higher accuracy in text type recognition was achieved.

CN117076670BActive Publication Date: 2025-11-14INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310969462.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-02
Publication Date
2025-11-14
Estimated Expiration
2043-08-02

AI Technical Summary

Technical Problem

Existing technologies have low accuracy in identifying machine-generated text and struggle to effectively distinguish between machine-generated and human-generated text.

Method used

By rewriting the text to be detected, 2N target text segments are generated. The text probability of each text segment and the text probability of the text to be detected are calculated. The text type is determined by the relationship between numerical values ​​and thresholds, including machine-generated and manually generated types.

Benefits of technology

It improves the accuracy of recognizing machine-generated text to be detected, ensuring the accuracy of text type determination.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117076670B_ABST
    Figure CN117076670B_ABST
Patent Text Reader

Abstract

This application discloses a text recognition method, apparatus, processor, and electronic device. Relating to the field of artificial intelligence, the method includes: acquiring a text to be detected; performing text rewriting processing on the text to be detected to obtain 2N target text segments; calculating the text probability of the 2N target text segments to obtain 2N first text probabilities, wherein the first text probability refers to the probability that a sentence in a target text segment is a machine-generated sentence; calculating the text probability of the text to be detected to obtain a second text probability; calculating a value used to characterize the relationship between the second text probability and the 2N first text probabilities, and determining the text type of the text to be detected based on the relationship between the value and the first threshold, wherein the text type includes machine-generated type and human-generated type. This application solves the problem of low accuracy in recognizing machine-generated text in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the rapid development of large-scale language models, such as PaLM (Pretraining and Lexicalization Model) and Chat GPT (Generative Pre-trained Transformer), large-scale language models (LLM) can respond quickly to queries and generate "convincing" answers to complex questions. However, answers generated by large-scale language models are prone to errors that lack scientific basis and contradict common sense. These answers containing factual errors can easily mislead readers, thus requiring the review of text information generated by large-scale language models.

[0003] In related technologies, manual review is usually conducted by examiners. However, when manually distinguishing between text generated by large language models and text written by humans, it is difficult to accurately and quickly identify these texts.

[0004] There is currently no effective solution to the problem of low accuracy in recognizing machine-generated text in related technologies. Summary of the Invention

[0005] The main objective of this application is to provide a text recognition method, apparatus, processor, and electronic device to solve the problem of low accuracy in recognizing machine-generated text in related technologies.

[0006] To achieve the above objectives, according to one aspect of this application, a text recognition method is provided. The method includes: acquiring a text to be detected; performing text rewriting processing on the text to be detected to obtain 2N target text segments, where N is a positive integer; calculating the text probability of the 2N target text segments to obtain 2N first text probabilities, where the first text probability refers to the probability that a statement in a target text segment is a machine-generated statement; calculating the text probability of the text to be detected to obtain a second text probability, where the second text probability refers to the probability that a statement in the text to be detected is a machine-generated statement; calculating a value characterizing the relationship between the second text probability and the 2N first text probabilities; and determining the text type of the text to be detected based on the relationship between the value and a first threshold, where the text type includes machine-generated type and manually generated type.

[0007] Optionally, the text rewriting process for the text to be detected, resulting in 2N target text segments, includes: obtaining a text rewriting function, wherein the text rewriting function is used to rewrite the text to be detected; performing N rewriting processes on the text to be detected using the text rewriting function to obtain N first text segments, wherein the rewriting processes include: performing synonym replacement processing on different words in the text to be detected, and performing random masking processing on characters in the text to be detected with different masking rates; randomly selecting a text segment from the N first text segments to obtain an iterative text segment, performing N rewriting processes on the iterative text segment to obtain N second text segments; and forming 2N target text segments from the N first text segments and the N second text segments.

[0008] Optionally, calculating a value representing the relationship between the second text probability and 2N first text probabilities, and determining the text type of the text to be detected based on the relationship between the value and a first threshold, includes: obtaining N first text probabilities associated with N first text segments from the 2N first text probabilities to obtain N first sub-text probabilities; calculating the ratio of the logarithm of the second text probability to the logarithm of each first sub-text probability to obtain N ratios, and determining a target ratio based on the N ratios, wherein the target ratio is determined by at least one of the following methods: calculating the average of the N ratios, determining the median of the N ratios, or determining the mode of the N ratios; determining whether the target ratio is greater than the first threshold; if the target ratio is greater than the first threshold, determining the text type of the text to be detected as machine-generated; if the target ratio is less than or equal to the first threshold, determining the text type of the text to be detected as manually generated.

[0009] Optionally, after determining the text type of the text to be detected as a manually generated type, the method further includes: obtaining the first sub-text probability of the iterative text segment from N first sub-text probabilities to obtain the iterative text probability, and calculating the product of the logarithm of the iterative text probability and the expected value of N second text segments to obtain the product value; calculating the difference between the logarithm of the second text probability and the product value to obtain the logarithmic difference; obtaining N second text probabilities associated with N second text segments from 2N first text probabilities to obtain N second sub-text probabilities; calculating the square of the difference between the logarithm of each first sub-text probability and the logarithm of each second sub-text probability to obtain N squared differences, and calculating the standard deviation of the N squared differences to obtain the logarithmic standard deviation; calculating the ratio of the logarithmic difference to the logarithmic standard deviation to obtain the logarithmic ratio, and determining whether the logarithmic ratio is greater than a second threshold; if the logarithmic ratio is greater than the second threshold, determining the text type of the text to be detected as a machine-generated type; if the logarithmic ratio is less than or equal to the second threshold, judging the text type based on the N second sub-text probabilities.

[0010] Optionally, determining the text type based on the N second sub-text probabilities includes: selecting the logarithm with the largest logarithm from the N second sub-text probabilities to obtain a reference logarithm, and determining whether the logarithm of the second text probability is greater than the reference logarithm; if the logarithm of the second text probability is greater than the reference logarithm, the text type of the text to be detected is determined to be a machine-generated type; if the logarithm of the second text probability is less than or equal to the reference logarithm, the text type of the text to be detected is determined to be a manually generated type.

[0011] Optionally, after calculating the difference between the logarithmic value of the second text probability and the logarithmic value of each first text probability to obtain the logarithmic difference, the method further includes: determining whether the difference between the logarithmic difference and zero is less than a third threshold; if the difference between the logarithmic difference and zero is less than the third threshold, determining the text type of the text to be detected as a manually generated type; if the difference between the logarithmic difference and zero is greater than or equal to the third threshold, determining the text type of the text to be detected as a machine-generated type.

[0012] Optionally, calculating the text probabilities of 2N target text segments to obtain 2N first text probabilities includes: obtaining the statement probabilities of multiple sentences contained in each target text segment, where the statement probability is used to characterize the probability that a word in the target text segment is a machine-generated word; calculating the product of the statement probabilities of multiple sentences contained in each target text segment, calculating the reciprocal of the product, obtaining the reciprocal value, and calculating the Nth root of the reciprocal value to obtain the first text probability; calculating the text probability of the text to be detected to obtain the second text probability includes: obtaining the statement probabilities of multiple sentences in the text to be detected, where the statement probability is used to characterize the probability that a word in the text to be detected is a machine-generated word; calculating the product of the statement probabilities of multiple sentences contained in the text to be detected, calculating the reciprocal of the product, obtaining the reciprocal value, and calculating the Nth root of the reciprocal value to obtain the second text probability.

[0013] To achieve the above objectives, according to another aspect of this application, a text recognition device is provided. The device includes: a first acquisition unit, configured to acquire a text to be detected, and perform text rewriting processing on the text to be detected to obtain 2N target text segments, where N is a positive integer; a first calculation unit, configured to calculate the text probabilities of the 2N target text segments to obtain 2N first text probabilities, where the first text probability refers to the probability that a statement in a target text segment is a machine-generated statement; a second calculation unit, configured to calculate the text probability of the text to be detected to obtain a second text probability, where the second text probability refers to the probability that a statement in the text to be detected is a machine-generated statement; and a third calculation unit, configured to calculate a value characterizing the relationship between the second text probability and the 2N first text probabilities, and determine the text type of the text to be detected based on the relationship between the value and a first threshold, where the text type includes machine-generated type and manually generated type.

[0014] According to another aspect of the present invention, a processor is also provided, which is used to run a program, wherein the program controls a device containing a non-volatile storage medium to perform a text recognition method during runtime.

[0015] According to another aspect of the present invention, an electronic device is also provided, comprising one or more processors and a memory; the memory stores computer-readable instructions, and the processor is configured to execute the computer-readable instructions, wherein the computer-readable instructions execute a text recognition method when they are executed.

[0016] This application employs the following steps: obtaining the text to be detected; performing text rewriting on the text to be detected to obtain 2N target text segments, where N is a positive integer; calculating the text probability of the 2N target text segments to obtain 2N first text probabilities, where the first text probability refers to the probability that a statement in a target text segment is a machine-generated statement; calculating the text probability of the text to be detected to obtain a second text probability, where the second text probability refers to the probability that a statement in the text to be detected is a machine-generated statement; calculating a value used to characterize the relationship between the second text probability and the 2N first text probabilities, and determining the text type of the text to be detected based on the relationship between the value and a first threshold, where the text type includes machine-generated type and human-generated type. This solves the problem of low accuracy in recognizing machine-generated text to be detected in related technologies. By performing text rewriting on the text to be detected, calculating the text probabilities of the rewritten text segments and the text to be detected, using the above text probabilities to calculate a value characterizing the relationship between the text to be detected and the rewritten text segments, and then using the value to determine the text type of the text to be detected, the accuracy of recognizing the text type of the text to be detected is improved. Attached Figure Description

[0017] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0018] Figure 1 This is a flowchart of a text recognition method provided according to an embodiment of this application;

[0019] Figure 2 This is a schematic diagram of an optional text recognition system provided according to an embodiment of this application;

[0020] Figure 3 This is a schematic diagram of a text recognition device provided according to an embodiment of this application;

[0021] Figure 4This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation

[0022] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0023] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0025] It should be noted that all information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are information and data authorized by the user or fully authorized by all parties.

[0026] With the development of large language processing (LLP) models, users can use machines to generate the text they need, for example, by using a large language model to generate the required text. However, due to the differences between large language processing models and human authors, machine-generated text is prone to factual errors in written expression and scientific logic. Therefore, to prevent readers from being misled by errors in text generated by large language processing models, it is necessary to review the text content. Before reviewing the text, it is necessary to judge the text and filter out machine-generated text from a large number of texts.

[0027] The present invention will now be described in conjunction with preferred implementation steps. Figure 1 This is a flowchart of a text recognition method provided according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:

[0028] Step S101: Obtain the text to be detected, perform text rewriting on the text to be detected, and obtain 2N target text segments, where N is a positive integer.

[0029] Specifically, because machine-generated text differs significantly from human-written text in terms of wording, these differences can be used to determine the text type of the text being tested. The text to be tested can be news releases, research reports, etc. When determining whether a text is machine-generated, it can be rewritten. Rewriting creates differences in wording between the rewritten and original texts, resulting in a difference in the probability of the text before and after rewriting. The text type can then be determined based on the magnitude of this difference. For example, machine-generated text shows less difference in wording after rewriting compared to the original, making it easier to predict subsequent sentences given the preceding sentence. Human-generated text, on the other hand, exhibits more varied wording changes before and after rewriting, making it difficult to predict subsequent sentences based on the preceding sentence alone.

[0030] Step S102: Calculate the text probabilities of 2N target text segments to obtain 2N first text probabilities, where the first text probability refers to the probability that the statement in the target text segment is a machine-generated statement.

[0031] Specifically, after rewriting the text to be detected, the text type can be detected by calculating the text probability of the processed target text segment. It should be noted that the essence of machine-generated text is the prediction of the text probability of each word and each sentence. When the text probability of the target text segment after text rewriting is lower than that of the text to be detected, it indicates that the text type of the text to be detected is very likely to be machine-generated, and vice versa.

[0032] Step S103: Calculate the text probability of the text to be detected to obtain the second text probability, where the second text probability refers to the probability that the statement in the text to be detected is a machine-generated statement.

[0033] Specifically, when using the text probability of the target text segment after text rewriting to determine the text type of the text to be detected, it is necessary to use a "reference value" to compare with the text probability of the target text segment, and determine the text type based on the comparison result. The text probability of the text to be detected can be used as the "reference value".

[0034] Step S104: Calculate a value to characterize the relationship between the second text probability and the 2N first text probabilities, and determine the text type of the text to be detected based on the relationship between the value and the first threshold. The text type includes machine-generated type and artificially generated type.

[0035] Specifically, after calculating the text probability of the text to be detected and the text probability of the target text segment after text rewriting, the text probability of the text to be detected and the text probability of the target text segment are compared. The text type is determined based on the comparison result. If the comparison result indicates that the text probability of the text to be detected is greater than the text probability of the target text segment, the text type is determined to be machine-generated; otherwise, the text type is determined to be manually generated.

[0036] It should be noted that, in order to reduce the range of text probabilities for the text to be detected and the target text segment, the logarithmic value of the text probability can be calculated, and then multiple values ​​can be calculated using the logarithmic value of the text probability. These values ​​can then be used to determine the text type of the text to be detected. For example, the logarithmic ratio can be calculated using the logarithmic value of the text probability, and then compared with a preset threshold to determine the text type. Alternatively, the logarithmic difference and logarithmic standard deviation can be calculated using the logarithmic value of the text probability, and the ratio of the logarithmic standard deviation and the logarithmic difference can be used to compare the text types.

[0037] The text recognition method provided in this application embodiment obtains the text to be detected, performs text rewriting processing on the text to be detected to obtain 2N target text segments, where N is a positive integer; calculates the text probability of the 2N target text segments to obtain 2N first text probabilities, where the first text probability refers to the probability that the statement in the target text segment is a machine-generated statement; calculates the text probability of the text to be detected to obtain a second text probability, where the second text probability refers to the probability that the statement in the text to be detected is a machine-generated statement; calculates a value used to characterize the relationship between the second text probability and the 2N first text probabilities, and determines the text type of the text to be detected based on the relationship between the value and a first threshold, where the text type includes machine-generated type and artificially generated type. This solves the problem of low accuracy in recognizing machine-generated text to be detected in related technologies. By performing text rewriting processing on the text to be detected, calculating the text probabilities of the text segments after text rewriting processing and the text to be detected, using the above text probabilities to calculate the value characterizing the relationship between the text to be detected and the text segments after text rewriting processing, and then using the value to determine the text type of the text to be detected, the method achieves the effect of improving the accuracy of recognizing the text type of the text to be detected.

[0038] The text rewriting process can include various methods. Optionally, in the text recognition method provided in this application embodiment, rewriting the text to be detected to obtain 2N target text segments includes: obtaining a text rewriting function, wherein the text rewriting function is used to rewrite the text to be detected; using the text rewriting function to perform N kinds of rewriting processes on the text to be detected to obtain N first text segments, wherein the rewriting processes include: performing synonym replacement processing on different words in the text to be detected, and performing random masking processing on characters in the text to be detected with different masking rates; randomly selecting a text segment from the N first text segments to obtain an iterative text segment, performing N kinds of rewriting processes on the iterative text segment to obtain N second text segments; and the N first text segments and the N second text segments constitute 2N target text segments.

[0039] Specifically, when performing text rewriting on the text to be detected, a text rewriting function can be used as an aid. By modifying the configuration parameters of the text rewriting function, various types of rewriting processing can be performed on the text to be detected. For example, without changing the original meaning of the text to be detected, the text rewriting function can perform synonym replacement on multiple types of words in the text to be detected, or rewrite words in the text to be detected; it can also randomly mask words to different degrees by modifying the mask rate, or delete characters in the text to be detected to different degrees.

[0040] Furthermore, after the first text rewriting process on the text to be detected, to prevent the scope of the text rewriting process from being too small, thus failing to clearly distinguish between the text to be detected and the rewritten text segment, and because the accuracy of determining the text type using the text probabilities of the two is low when the distinction between the text to be detected and the rewritten text segment is low, a text segment can be randomly selected from the rewritten text segments as the iterative text segment. This iterative text segment is then subjected to a second text rewriting process. The second text rewriting process must still adhere to the requirements of the first text rewriting process, that is, without changing the original meaning of the text to be detected, the iterative text segment is subjected to synonym replacement of different word classes, or random masking processing with different masking rates, to obtain the second text segment. This embodiment, by performing multiple text rewriting processes on the text to be detected, can reduce the error rate of machine-generated text that is difficult to detect due to minor modifications.

[0041] Optionally, in the text recognition method provided in this application embodiment, calculating a value used to characterize the relationship between the second text probability and 2N first text probabilities, and determining the text type of the text to be detected based on the relationship between the value and a first threshold includes: obtaining N first text probabilities associated with N first text segments from the 2N first text probabilities to obtain N first sub-text probabilities; calculating the ratio of the logarithm of the second text probability to the logarithm of each first sub-text probability to obtain N ratios, and determining a target ratio based on the N ratios, wherein the target ratio is determined by at least one of the following methods: calculating the average of the N ratios, determining the median of the N ratios, determining the mode of the N ratios; determining whether the target ratio is greater than the first threshold; if the target ratio is greater than the first threshold, determining the text type of the text to be detected as a machine-generated type; if the target ratio is less than or equal to the first threshold, determining the text type of the text to be detected as a manually generated type.

[0042] Specifically, in order to limit the calculated text probabilities to a small range as much as possible, the logarithm of each text probability can be calculated, and then the logarithm of each text probability can be compared.

[0043] Specifically, firstly, the text probability of the first text segment obtained after the first text rewriting process of the text to be detected can be obtained, and the logarithmic value of the text probability of each first text segment can be calculated. After calculating the logarithmic value of the text probability of the original text, i.e., the text to be detected, the sum of the ratios of the logarithmic value of the text probability of the text to be detected to the logarithmic value of the probability of each first sub-text segment can be obtained. ,in, This represents the text probability of the text to be detected. Let represent the text probability of the i-th first text segment.

[0044] Furthermore, the value calculated using the above formula is compared with a preset first threshold. When the average value is calculated using the above values, the average value can be: Where N is the number of the first text segments. When the average value is greater than the first threshold, it indicates that the text generated by the model has a lower probability after rewriting than the original text, and the text type of the text to be detected is determined to be machine-generated; when the average value is less than or equal to the first threshold, it indicates that the text generated by the model has a higher probability after rewriting than the original text, and the text type of the text to be detected is determined to be manually generated.

[0045] Furthermore, when analyzing a set of data using the average value in statistical numerical analysis, the mode and median values ​​can also be used to analyze the data, representing the overall level of the data set. By selecting the mode and median values ​​from the ratio of the logarithmic values ​​of multiple text probabilities, and then comparing the mode and median with a preset threshold, the text type of the text to be detected can be determined. This embodiment calculates the logarithmic value of text probabilities, uses the ratio of the logarithmic values ​​of the text to be detected and the target text segment to determine various statistical values ​​that can represent the text probability level, and uses these statistical values ​​to determine the text type, thereby improving the accuracy of text type determination.

[0046] Since machine-generated text can still be confused with human-written text after text modification, a secondary judgment can be performed on the text to be detected to more accurately determine the text type. Optionally, in the text recognition method provided in this application embodiment, after determining that the text type of the text to be detected is human-generated, the method further includes: obtaining the first sub-text probability of the iterative text segment from N first sub-text probabilities to obtain the iterative text probability, and calculating the product of the logarithm of the iterative text probability and the expected values ​​of N second text segments to obtain the product value; calculating the difference between the logarithm of the second text probability and the product value to obtain the logarithmic difference; and from 2N... From the first text probability, obtain N second text probabilities associated with N second text segments to obtain N second sub-text probabilities; calculate the square of the difference between the logarithm of each first sub-text probability and the logarithm of each second sub-text probability to obtain N squared differences, and calculate the standard deviation of the N squared differences to obtain the logarithmic standard deviation; calculate the ratio of the logarithmic difference to the logarithmic standard deviation to obtain the logarithmic ratio, and determine whether the logarithmic ratio is greater than a second threshold; if the logarithmic ratio is greater than the second threshold, determine the text type of the text to be detected as machine-generated type; if the logarithmic ratio is less than or equal to the second threshold, determine the text type based on the N second sub-text probabilities.

[0047] Specifically, after initially determining the text type of the text to be detected using statistical values, further optimization can be performed by calculating the logarithmic standard deviation and logarithmic difference to further determine whether the text type to be detected is a manually generated type.

[0048] Specifically, firstly, the logarithmic probability of each second text segment is multiplied by the probability of each second text segment, and the products are summed to obtain the expected value. Then, the expected value is multiplied by the logarithmic probability of the iterative text segments selected from multiple first text segments. Finally, the logarithmic difference is calculated by subtracting the logarithmic probability of the text to be detected from the result of the multiplication. This yields the logarithmic difference, i.e.: ,in, Represents the logarithmic difference. The text to be detected. The probability of the text to be detected. Represented as iterative text segments, This is represented as the text probability of the iterative text segment. Expressed as expected value, This refers to the result text of the text to be detected after text rewriting, that is, the set of the first or second text segments. This indicates that the iterative text segment conforms to the characteristics in this set.

[0049] Furthermore, the difference between the logarithmic value of the text probability of each first text segment and the product of the logarithmic value of the text probability of each second text segment and the expected value is calculated. The square of this difference is then calculated, and the standard deviation of the square is calculated to obtain the logarithmic standard deviation, which is obtained through the following formula:

[0050] ;

[0051] in, Represented as variance, Expressed as standard deviation, This is represented as the i-th first text segment.

[0052] Furthermore, a high-low value filter is set using the calculated logarithmic standard deviation and logarithmic difference. This involves comparing the ratio of the logarithmic difference to the logarithmic standard deviation with a preset second threshold. When the logarithmic ratio is greater than the second threshold, the text type of the text to be detected is determined to be machine-generated. When the logarithmic ratio is less than or equal to the second threshold, a secondary judgment of the text type is required based on the probability of the second sub-text. This embodiment improves the accuracy of text type determination by using the logarithmic value of the text segments of the text to be detected to perform a secondary judgment on the text type of text initially determined to be manually generated.

[0053] Optionally, in the text recognition method provided in this application embodiment, determining the text type based on N second sub-text probabilities includes: selecting the logarithm with the largest logarithm from the N second sub-text probabilities to obtain a reference logarithm, and determining whether the logarithm of the second text probability is greater than the reference logarithm; if the logarithm of the second text probability is greater than the reference logarithm, determining the text type of the text to be detected as machine-generated; if the logarithm of the second text probability is less than or equal to the reference logarithm, determining the text type of the text to be detected as manually generated.

[0054] Specifically, when the logarithmic ratio is greater than the second threshold, the text type of the text to be detected can be determined as machine-generated. When the logarithmic ratio is less than or equal to the second threshold, the text type cannot be determined, and further determination of the text type is required. When the logarithmic ratio is less than or equal to the second threshold, a secondary judgment of the text type is needed based on the probability of the second sub-text. That is, the critical reference value of the high-low value filter is set to the maximum value among the logarithmic values ​​associated with the second text segment, and then the relationship between the logarithmic value of the text probability of the text to be detected and this critical reference value is judged. When the logarithmic value of the second text probability is greater than the critical reference value, the text type of the text to be detected is determined as machine-generated; conversely, when the logarithmic value of the second text probability is less than or equal to the reference logarithmic value, the text type of the text to be detected is determined as manually generated. This embodiment, by using the high-low value filter to perform a secondary judgment of the text type of the text to be detected, can effectively avoid the situation where the text to be detected cannot be detected due to text rewriting processing.

[0055] In addition to using logarithmic difference and logarithmic standard deviation to determine text type, logarithmic difference can also be used to determine text type. Optionally, in the text recognition method provided in this application embodiment, after calculating the difference between the logarithmic value of the second text probability and the logarithmic value of each first text probability to obtain the logarithmic difference, the method further includes: determining whether the difference between the logarithmic difference and zero is less than a third threshold; if the difference between the logarithmic difference and zero is less than the third threshold, determining the text type of the text to be detected as a manually generated type; if the difference between the logarithmic difference and zero is greater than or equal to the third threshold, determining the text type of the text to be detected as a machine-generated type.

[0056] Specifically, after calculating the expected value, the logarithmic value of the text probability of the iterated text segment, and the logarithmic value of the text probability of the text to be detected, the logarithmic difference calculated from the three can be directly compared. That is, the difference between the product of the expected value and the logarithmic value of the text probability of the iterated text segment is calculated, and then the logarithmic value of the text probability of the text to be detected is subtracted from this value. After obtaining the logarithmic difference, the text type of the text to be detected is determined.

[0057] Specifically, the algorithm determines whether the calculated logarithmic difference is close to 0, or whether the difference between the logarithmic difference and 0 is less than a preset threshold. If the difference between the logarithmic difference and zero is less than the third threshold, it indicates that the probability of the text to be detected after text rewriting is close to the probability of the original text, and the text type of the text to be detected is determined to be manually generated. If the difference between the logarithmic difference and zero is greater than or equal to the third threshold, it indicates that the probability of the text to be detected after text rewriting is significantly different from the probability of the original text, and the text type of the text to be detected is determined to be machine generated.

[0058] It should be noted that, in addition to comparing logarithmic differences, logarithmic standard deviation can also be used for judgment. Specifically, when the logarithmic standard deviation is less than a preset threshold, the text type can be determined as manually generated; when the logarithmic standard deviation is greater than or equal to the preset threshold, the text type can be determined as machine-generated. This embodiment provides a new solution for determining text type by using logarithmic differences and logarithmic standard deviation.

[0059] The text probabilities of the text to be detected and the target text segment after text rewriting can be obtained by calculating perplexity data. Optionally, in the text recognition method provided in this application embodiment, calculating the text probabilities of 2N target text segments to obtain 2N first text probabilities includes: obtaining the statement probabilities of multiple sentences contained in each target text segment, wherein the statement probability is used to characterize the probability that a word in the target text segment is a machine-generated word; calculating the product of the statement probabilities of multiple sentences contained in each target text segment, calculating the reciprocal of the product, obtaining the reciprocal value, and calculating the Nth root of the reciprocal value to obtain the first text probability; calculating the text probability of the text to be detected to obtain the second text probability includes: obtaining the statement probabilities of multiple sentences in the text to be detected, wherein the statement probability is used to characterize the probability that a word in the text to be detected is a machine-generated word; calculating the product of the statement probabilities of multiple sentences contained in the text to be detected, calculating the reciprocal of the product, obtaining the reciprocal value, and calculating the Nth root of the reciprocal value to obtain the second text probability.

[0060] Specifically, the text probability of the target text segment and the text probability of the text to be detected can be obtained by calculating the perplexity data. When calculating the perplexity data, it is necessary to calculate the probability of the statements contained in the text to be detected. First, obtain the probability of each statement in the text to be detected and the target text segment. After calculating the product of the statement probabilities, determine the reciprocal of the product based on the product.

[0061] Furthermore, after obtaining the reciprocal of the product, its Nth root is calculated, which yields the perplexity data using the following formula. That is, to obtain the text probability:

[0062] ;

[0063] Where S represents the text to be detected, and N is the number of sentences in the text to be detected. This represents the probability that a word in the target text segment of the i-th sentence is a machine-generated word; the first word is... Let i represent the ranking of the word. This leads to the text probabilities of the text to be detected and the target text segment, i.e., the second text probability and multiple first text probabilities. This embodiment calculates perplexity data and determines the text type of the text to be detected based on this data. A higher perplexity data indicates a greater likelihood that the text to be detected is of a machine-generated type, thus laying the foundation for determining the text type.

[0064] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0065] This application also provides a text recognition method. Figure 2 This is a schematic diagram of an optional text recognition system provided according to an embodiment of this application, such as... Figure 2 As shown, the system includes a main line and branches. The main line includes a large language model processing unit, a variant sample rewriting unit, a calculation unit, a numerical comparison unit, and a filter threshold judgment unit. The branches include a calculation unit, a secondary rewriting unit, and a low threshold calculation unit.

[0066] Using the aforementioned text recognition system, a text recognition method can be implemented. Specifically, firstly, a large language model processing unit is used to process the original sample text segment. The text is input into a large language model, and a micro-rewrite function is set. By configuring the parameters of the micro-rewrite function, the original sample text is rewritten using a variant sample rewrite unit while preserving its original meaning, resulting in multiple variant samples. , ... Furthermore, the secondary rewriting unit randomly selects a text segment from the mutated samples for secondary mutation and rewriting, resulting in multiple secondary mutated samples. , ... .

[0067] Furthermore, the probability of mutated samples is calculated using computational units. , , ... ... And the logarithm of each probability, and use the numerical comparison unit to compare each mutated sample. The logarithmic probability of the original sample text is compared with that of the original sample text. The average value of the ratio of the original sample text to each variant sample is calculated. If the average value is greater than the first threshold, it indicates that the text generated by the model has a lower probability after rewriting than the original text, and the text type of the original sample text is determined to be machine-generated. If the average value is less than or equal to the first threshold, it indicates that the text generated by the model has a higher probability after rewriting than the original text, and the original sample text is very likely to be manually generated text.

[0068] Furthermore, in order to determine whether the original sample text segment is manually generated, the perturbation difference is normalized by using the standard deviation method. This is done by calculating the difference between the product of the logarithm of the probability of the original sample text segment, the logarithm of the iterative probability, and the expected value of the second-order mutated sample, and then using the expected value, the logarithm of the probability of the mutated sample, and the logarithm of the probability of the second-order mutated sample to calculate the logarithmic standard deviation.

[0069] Furthermore, the filter threshold determination unit sets high and low value filters based on the logarithmic standard deviation and the logarithmic difference. If the ratio of the logarithmic difference to the logarithmic standard deviation is greater than the second threshold, the text type of the original sample text is determined to be machine-generated. If the logarithmic ratio is less than or equal to the second threshold, the low threshold calculation unit selects the logarithmic value with the largest logarithmic value to obtain the reference logarithmic value, and determines whether the logarithmic value of the second probability is greater than the reference logarithmic value. When the logarithmic value of the second probability is greater than the reference logarithmic value, the text type of the original sample text is determined to be machine-generated. If the logarithmic value of the second probability is less than or equal to the reference logarithmic value, the text type of the original sample text is determined to be manually generated.

[0070] This embodiment rewrites the original sample text, calculates the probability of the variant sample and the original sample text, uses the above probability to calculate a value representing the relationship between the original sample text and the variant sample, and then uses the logarithmic value to determine the text type of the original sample text, thereby improving the accuracy of identifying the text type of the original sample text.

[0071] This application also provides a text recognition device. It should be noted that the text recognition device of this application can be used to execute the text recognition method provided in this application. The text recognition device provided in this application will be described below.

[0072] Figure 3 This is a schematic diagram of a text recognition device provided according to an embodiment of this application, such as... Figure 3 As shown, the device includes: a first acquisition unit 30, a first calculation unit 31, a second calculation unit 32, and a third calculation unit 33.

[0073] The first acquisition unit 30 is used to acquire the text to be detected, perform text rewriting processing on the text to be detected, and obtain 2N target text segments, where N is a positive integer;

[0074] The first calculation unit 31 is used to calculate the text probability of 2N target text segments to obtain 2N first text probabilities, where the first text probability refers to the probability that the statement in the target text segment is a machine-generated statement;

[0075] The second calculation unit 32 is used to calculate the text probability of the text to be detected and obtain the second text probability, wherein the second text probability refers to the probability that the statement in the text to be detected is a machine-generated statement;

[0076] The third calculation unit 33 is used to calculate a value that characterizes the relationship between the second text probability and the 2N first text probabilities, and to determine the text type of the text to be detected based on the relationship between the value and the first threshold. The text type includes machine-generated type and artificially generated type.

[0077] Optionally, in the text recognition device provided in this application embodiment, the first acquisition unit 30 includes: a first acquisition module, used to acquire a text rewriting function, wherein the text rewriting function is used to perform text rewriting processing on the text to be detected; a processing module, used to perform N kinds of rewriting processing on the text to be detected using the text rewriting function to obtain N first text segments, wherein the rewriting processing includes: performing synonym replacement processing on different words in the text to be detected, and performing random masking processing on characters in the text to be detected with different mask rates; a first selection module, used to randomly select a text segment from the N first text segments to obtain an iterative text segment, and perform N kinds of rewriting processing on the iterative text segment to obtain N second text segments; and a composition module, used to construct 2N target text segments from the N first text segments and the N second text segments.

[0078] Optionally, in the text recognition device provided in this application embodiment, the third calculation unit 33 includes: a second acquisition module, used to acquire N first text probabilities associated with N first text segments from 2N first text probabilities to obtain N first sub-text probabilities; a first calculation module, used to calculate the ratio of the logarithm of the second text probability to the logarithm of each first sub-text probability to obtain N ratios, and determine a target ratio based on the N ratios, wherein the target ratio is determined by at least one of the following methods: calculating the average of the N ratios, determining the median of the N ratios, or determining the mode of the N ratios; a judgment module, used to determine whether the target ratio is greater than a first threshold; a first determination module, used to determine the text type of the text to be detected as machine-generated type when the target ratio is greater than the first threshold; and a second determination module, used to determine the text type of the text to be detected as human-generated type when the target ratio is less than or equal to the first threshold.

[0079] Optionally, in the text recognition device provided in the embodiments of this application, the device further includes: a second acquisition unit, configured to, after determining that the text type of the text to be detected is a manually generated type, acquire the first sub-text probability of the iterative text segment from N first sub-text probabilities to obtain the iterative text probability, and calculate the product of the logarithm of the iterative text probability and the expected values ​​of N second text segments to obtain the product value; a fourth calculation unit, configured to calculate the difference between the logarithm of the second text probability and the product value to obtain the logarithmic difference; and a third acquisition unit, configured to acquire N second text probabilities associated with N second text segments from 2N first text probabilities to obtain N first sub-text probabilities. The system comprises: a fifth calculation unit, which calculates the square of the difference between the logarithmic value of each first sub-text probability and the logarithmic value of each second sub-text probability, obtaining N squared differences, and calculating the standard deviation of the N squared differences to obtain the logarithmic standard deviation; a sixth calculation unit, which calculates the ratio of the logarithmic difference to the logarithmic standard deviation, obtaining the logarithmic ratio, and determines whether the logarithmic ratio is greater than the second threshold; and a first determination unit, which determines the text type of the text to be detected as machine-generated if the logarithmic ratio is greater than the second threshold, and determines the text type based on the N second sub-text probabilities if the logarithmic ratio is less than or equal to the second threshold.

[0080] Optionally, in the text recognition device provided in this application embodiment, the third calculation unit 33 includes: a second selection module, used to select the logarithm with the largest logarithm from N second sub-text probabilities to obtain a reference logarithm, and to determine whether the logarithm of the second text probability is greater than the reference logarithm; a third determination module, used to determine the text type of the text to be detected as machine-generated type when the logarithm of the second text probability is greater than the reference logarithm; and a fourth determination module, used to determine the text type of the text to be detected as manually generated type when the logarithm of the second text probability is less than or equal to the reference logarithm.

[0081] Optionally, in the text recognition device provided in the embodiments of this application, the device further includes: a judgment unit, configured to, after calculating the difference between the logarithmic value of the second text probability and the logarithmic value of each first text probability to obtain a logarithmic difference, determine whether the difference between the logarithmic difference and zero is less than a third threshold; a second determination unit, configured to, if the difference between the logarithmic difference and zero is less than the third threshold, determine the text type of the text to be detected as a manually generated type; and a third determination unit, configured to, if the difference between the logarithmic difference and zero is greater than or equal to the third threshold, determine the text type of the text to be detected as a machine-generated type.

[0082] Optionally, in the text recognition device provided in this application embodiment, the first calculation unit 31 includes: a third acquisition module, used to acquire the statement probabilities of multiple statements contained in each target text segment, wherein the statement probability is used to characterize the probability that a word in the target text segment is a machine-generated word; a second calculation module, used to calculate the product of the statement probabilities of multiple statements contained in each target text segment, calculate the reciprocal of the product, obtain the reciprocal value, and calculate the Nth root of the reciprocal value to obtain a first text probability; the first calculation unit 31 includes: a fourth acquisition module, used to acquire the statement probabilities of multiple statements in the text to be detected, wherein the statement probability is used to characterize the probability that a word in the text to be detected is a machine-generated word; a third calculation module, used to calculate the product of the statement probabilities of multiple statements contained in the text to be detected, calculate the reciprocal of the product, obtain the reciprocal value, and calculate the Nth root of the reciprocal value to obtain a second text probability.

[0083] The text recognition device provided in this application embodiment includes a first acquisition unit 30 for acquiring the text to be detected, performing text rewriting processing on the text to be detected to obtain 2N target text segments, where N is a positive integer; a first calculation unit 31 for calculating the text probability of the 2N target text segments to obtain 2N first text probabilities, where the first text probability refers to the probability that a sentence in the target text segment is a machine-generated sentence; a second calculation unit 32 for calculating the text probability of the text to be detected to obtain a second text probability, where the second text probability refers to the probability that a sentence in the text to be detected is a machine-generated sentence; and a third calculation unit 33 for calculating the probability of the second text segment. The relationship between this probability and the 2N first text probabilities is calculated, and the text type of the text to be detected is determined based on the relationship between the value and a first threshold. The text type includes machine-generated type and artificially generated type. This solves the problem of low accuracy in recognizing machine-generated text in related technologies. By rewriting the text to be detected, the text probabilities of the rewritten text segment and the text to be detected are calculated. The above text probabilities are used to calculate the value representing the relationship between the text to be detected and the rewritten text segment. Then, the value is used to determine the text type of the text to be detected, thereby improving the accuracy of recognizing the text type of the text to be detected.

[0084] The text recognition device includes a processor and a memory. The first acquisition unit 30, the first calculation unit 31, the second calculation unit 32, the third calculation unit 33, etc. are all stored in the memory as program units. The processor executes the program units stored in the memory to realize the corresponding functions.

[0085] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can address the low accuracy issue in recognizing machine-generated text in related technologies.

[0086] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0087] This invention provides a computer-readable storage medium storing a program that, when executed by a processor, implements a text recognition method.

[0088] This invention provides a processor for running a program, wherein the program executes a text recognition method during runtime.

[0089] Figure 4 This is a schematic diagram of an electronic device provided according to an embodiment of this application, such as... Figure 4 As shown, this embodiment of the invention provides an electronic device 40, which includes a processor, a memory, and a program stored in the memory and executable on the processor. The processor is used to execute computer-readable instructions, wherein the computer-readable instructions execute a text recognition method. The device described herein may be a server, PC, PAD, mobile phone, etc.

[0090] This application also provides a computer program product that, when executed on a data processing device, is suitable for performing a text recognition method.

[0091] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0092] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0093] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0094] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0095] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0096] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0097] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0098] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0099] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0100] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A text recognition method, characterized in that, include: The process involves: acquiring a text to be detected; performing text rewriting on the text to be detected to obtain 2N target text segments; obtaining a text rewriting function; performing N rewriting processes on the text to be detected using the text rewriting function to obtain N first text segments, wherein the rewriting processes include: performing synonym replacement on different words in the text to be detected and performing random masking on characters in the text to be detected with different masking rates; randomly selecting a text segment from the N first text segments to obtain an iterative text segment; performing N rewriting processes on the iterative text segment to obtain N second text segments; and constructing the 2N target text segments from the N first text segments and the N second text segments, where N is a positive integer. Calculate the text probability of the 2N target text segments to obtain 2N first text probabilities, where the first text probability refers to the probability that the statement in the target text segment is a machine-generated statement; Calculate the text probability of the text to be detected to obtain the second text probability, wherein the second text probability refers to the probability that the statement in the text to be detected is a machine-generated statement; Calculate a value representing the relationship between the second text probability and the 2N first text probabilities, and determine the text type of the text to be detected based on the relationship between the value and a first threshold. The text type includes machine-generated type and human-generated type. If the value is greater than the first threshold, the text type of the text to be detected is determined to be machine-generated type; if the value is less than or equal to the first threshold, the text type of the text to be detected is determined to be human-generated type. After determining the text type of the text to be detected as the manually generated type, the first sub-text probability of the iterative text segment is obtained from the N first sub-text probabilities to obtain the iterative text probability, and the product of the logarithm of the iterative text probability and the expected value of the N second text segments is calculated to obtain the product value; the difference between the logarithm of the second text probability and the product value is calculated to obtain the logarithmic difference; N second text probabilities associated with the N second text segments are obtained from the 2N first text probabilities to obtain N second sub-text probabilities; the square of the difference between the logarithm of each first sub-text probability and the logarithm of each second sub-text probability is calculated to obtain N squared differences, and the standard deviation of the N squared differences is calculated to obtain the logarithmic standard deviation; the ratio of the logarithmic difference to the logarithmic standard deviation is calculated to obtain the logarithmic ratio; if the logarithmic ratio is greater than a second threshold, the text type of the text to be detected is determined to be the machine-generated type.

2. The method according to claim 1, characterized in that, The text rewriting function is used to rewrite the text to be detected.

3. The method according to claim 2, characterized in that, Calculating a numerical value characterizing the relationship between the second text probability and the 2N first text probabilities, and determining the text type of the text to be detected based on the relationship between the numerical value and a first threshold, includes: From the 2N first text probabilities, obtain the N first text probabilities associated with the N first text segments to obtain the N first sub-text probabilities; Calculate the ratio of the logarithm of the second text probability to the logarithm of the probability of each first sub-text to obtain N ratios, and determine a target ratio based on the N ratios, wherein the target ratio is determined by at least one of the following methods: calculating the average of the N ratios, determining the median of the N ratios, or determining the mode of the N ratios; Determine whether the target ratio is greater than the first threshold; If the target ratio is greater than the first threshold, the text type of the text to be detected is determined to be the machine-generated type; If the target ratio is less than or equal to the first threshold, the text type of the text to be detected is determined to be the artificially generated type.

4. The method according to claim 3, characterized in that, The method further includes: If the logarithmic ratio is less than or equal to the second threshold, the text type is determined based on the probabilities of the N second sub-texts.

5. The method according to claim 4, characterized in that, Determining the text type based on the probabilities of the N second sub-texts includes: Select the logarithm with the largest logarithm from the N second sub-text probabilities to obtain the reference logarithm, and determine whether the logarithm of the second text probability is greater than the reference logarithm. If the logarithm of the second text probability is greater than the reference logarithm, the text type of the text to be detected is determined to be the machine-generated type. If the logarithm of the second text probability is less than or equal to the reference logarithm, the text type of the text to be detected is determined to be the artificially generated type.

6. The method according to claim 4, characterized in that, After calculating the difference between the logarithmic difference of the second text probability and the logarithmic difference of each first text probability, the method further includes: Determine whether the difference between the logarithmic difference and zero is less than a third threshold; If the difference between the logarithmic difference and zero is less than the third threshold, the text type of the text to be detected is determined to be the artificially generated type. If the difference between the logarithmic difference and zero is greater than or equal to the third threshold, the text type of the text to be detected is determined to be the machine-generated type.

7. The method according to claim 1, characterized in that, Calculate the text probabilities of the 2N target text segments to obtain the 2N first text probabilities, including: Obtain the statement probabilities of multiple statements contained in each target text segment, wherein the statement probabilities are used to characterize the probability that a word in the target text segment is a machine-generated word; Calculate the product of the probabilities of multiple statements contained in each target text segment, calculate the reciprocal of the product, obtain the reciprocal value, and calculate the Nth root of the reciprocal value to obtain the first text probability. The text probability of the text to be detected is calculated to obtain the second text probability, which includes: Obtain the sentence probabilities of multiple sentences within the text to be detected, wherein the sentence probabilities are used to characterize the probability that a word in the text to be detected is a machine-generated word; Calculate the product of the probabilities of multiple statements contained in the text to be detected, calculate the reciprocal of the product, obtain the reciprocal value, and calculate the Nth root of the reciprocal value to obtain the second text probability.

8. A text recognition device, characterized in that, The text recognition method applied to any one of claims 1 to 7 includes: The first acquisition unit is used to acquire the text to be detected, perform text rewriting processing on the text to be detected, and obtain 2N target text segments, where N is a positive integer; The first calculation unit is used to calculate the text probability of the 2N target text segments to obtain 2N first text probabilities, wherein the first text probability refers to the probability that the statement in the target text segment is a machine-generated statement; The second calculation unit is used to calculate the text probability of the text to be detected and obtain the second text probability, wherein the second text probability refers to the probability that the statement in the text to be detected is a machine-generated statement; The third calculation unit is used to calculate a value that characterizes the relationship between the second text probability and the 2N first text probabilities, and to determine the text type of the text to be detected based on the relationship between the value and a first threshold, wherein the text type includes machine-generated type and human-generated type.

9. A processor, characterized in that, The processor is used to run a program, wherein the program executes the text recognition method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the text recognition method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Text classification method and device based on artificial intelligence, equipment and storage medium

    CN114416984A

  • Method and system for detecting machine to generate Chinese text, terminal and medium

    CN116468022A