Content rewriting method and device, electronic equipment and storage medium

By inputting the rewritten sentences in the rewriting results into the big model, combining the target position of the candidate original sentences, and utilizing the collaboration between the big model and the client, the target original sentences can be accurately determined, which solves the problem of insufficient mapping relationship accuracy in the existing technology and achieves efficient and accurate text comparison.

CN120633630APending Publication Date: 2025-09-12ZHUHAI KINGSOFT OFFICE SOFTWARE +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510784925.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-12
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

When constructing a mapping relationship between the original text and the rewritten result, the existing technology is insufficiently accurate, especially in complex rewriting scenarios, which affects the actual effectiveness of the text comparison function.

Method used

By inputting the rewritten sentences in the rewriting results into the big model, outputting the corresponding candidate original sentences, and combining the target position of the candidate original sentences in the original text, the big model and the client are used to collaborate to accurately determine the target original sentences, and introduce a bottom-line rule to form a double protection mechanism.

Benefits of technology

In complex scenarios such as word order adjustment, sentence structure transformation, and synonym replacement, the accuracy and reliability of text comparison are significantly improved, the misjudgment and omission problems of traditional methods are solved, and the accuracy of the mapping results between rewritten sentences and original sentences is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120633630A_ABST
    Figure CN120633630A_ABST
Patent Text Reader

Abstract

The invention relates to a content rewriting method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining a rewriting result of an original text; inputting the first rewritten sentence and the original text into a large model, and outputting candidate original text sentences corresponding to the first rewritten sentence in the original text; wherein the first rewriting sentence is any rewriting sentence in the rewriting result; determining a target original sentence mapped with the first rewritten sentence from the original text according to a target position of the candidate original sentence in the original text; and performing text comparison processing on the first rewritten sentence and the mapped target original sentence, and outputting a text comparison result. Therefore, the mapping relation between the rewriting result and the original text can be accurately and effectively constructed, and a reliable data basis is provided for follow-up text contrast processing.
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 content rewriting method, device, electronic device, and storage medium. Background Art

[0002] With the rapid development of artificial intelligence (AI) technology, AI (artificial intelligence) rewriting tools have gained widespread application in text processing. To help users quickly discern the differences between AI-generated rewriting and the original text, most products offer a text comparison feature. The core of this feature is establishing an accurate mapping between the original text and the rewritten text.

[0003] However, current industry products have significant limitations in constructing the mapping relationship between the original text and the rewritten results, resulting in insufficient accuracy and reliability of text comparison. For example, in structured text or complex rewriting scenarios (such as word order adjustment, sentence transformation, synonym replacement, etc.), existing mapping methods, such as when determining to rewrite a certain part of a document (such as a certain line / sentence / paragraph in the document, etc.), directly determine the overall part and the rewritten result for simple alignment. This faces the problem of excessive comparison granularity, which affects the accuracy of the comparison. For example, when the original text and the rewritten result cannot be determined in advance, a matching method based on semantic similarity can be used. Although this can improve accuracy, it is very easy to make misjudgments or omissions, which directly affects the actual effectiveness of the text comparison function.

[0004] Therefore, how to establish a more accurate mapping relationship between the rewritten sentence and the original sentence has become a key technical bottleneck for improving the performance of the text comparison function. Summary of the Invention

[0005] The present application provides a content rewriting method, device, electronic device and storage medium to solve the technical problem that the existing method of constructing a mapping relationship between the original text and the rewriting result is insufficiently accurate in complex rewriting scenarios, affecting the actual effectiveness of the text comparison function.

[0006] In a first aspect, the present application provides a content rewriting method, the method comprising:

[0007] Get the rewriting result of the original text;

[0008] Inputting the first rewritten sentence and the original text into the large model, and outputting a candidate original text sentence corresponding to the first rewritten sentence in the original text; wherein the first rewritten sentence is any rewritten sentence in the rewriting result;

[0009] determining, from the original text, a target original sentence mapped to the first rewritten sentence according to a target position of the candidate original sentence in the original text;

[0010] A text comparison process is performed on the first rewritten sentence and its mapped target original sentence, and a text comparison result is output.

[0011] In a possible implementation, determining, from the original text, a target original sentence mapped to the first rewritten sentence based on the target position of the candidate original sentence in the original text includes:

[0012] determining whether a mapping relationship between the first rewritten sentence and the candidate original sentence is accurate according to a target position of the candidate original sentence in the original text;

[0013] If the mapping relationship between the first rewritten sentence and the candidate original sentence is determined to be accurate based on the target position of the candidate original sentence in the original text, the candidate original sentence is determined to be the target original sentence for the first rewritten sentence to be mapped; if the mapping relationship between the first rewritten sentence and the candidate original sentence is determined to be abnormal based on the target position of the candidate original sentence in the original text, the target original sentence for the first rewritten sentence to be mapped is determined from the original text according to a preset fallback rule.

[0014] In one possible implementation, the target position of the candidate original sentence in the original text is determined by:

[0015] When the candidate original sentence appears only once in the original text, determining the position of the candidate original sentence in the original text as the target position of the candidate original sentence in the original text;

[0016] In the case where the candidate original sentence appears multiple times in the original text, one occurrence position of the candidate original sentence in the original text is determined as the target position of the candidate original sentence in the original text.

[0017] In a possible implementation, determining one occurrence position of the candidate original sentence from all occurrence positions of the candidate original sentence in the original text as the target position of the candidate original sentence in the original text includes:

[0018] determining a difference between a relative position parameter of the first rewritten sentence in the rewritten result and a relative position parameter of each of the occurrence positions in the original text;

[0019] The occurrence position with the smallest difference value is selected and determined as the target position of the candidate original sentence in the original text.

[0020] In a possible implementation, determining one occurrence position of the candidate original sentence from all occurrence positions of the candidate original sentence in the original text as the target position of the candidate original sentence in the original text includes:

[0021] Obtaining the original context of the candidate original sentence at each of the occurrence positions;

[0022] determining semantic similarities between a rewritten context of the first rewritten sentence in the rewritten result and each of the original contexts;

[0023] The occurrence position with the highest corresponding semantic similarity is selected and determined as the target position of the candidate original sentence in the original text.

[0024] In a possible implementation, determining whether the mapping relationship between the first rewritten sentence and the candidate original sentence is accurate based on the target position of the candidate original sentence in the original text includes:

[0025] If any of the following conditions is determined to be satisfied based on the target position of the candidate original sentence in the original text, the mapping relationship between the first rewritten sentence and the candidate original sentence is determined to be abnormal; otherwise, the mapping relationship between the first rewritten sentence and the candidate original sentence is determined to be correct:

[0026] The candidate original sentence corresponding to the first rewritten sentence is located before the candidate original sentence corresponding to the second rewritten sentence; wherein the second rewritten sentence is the previous rewritten sentence of the first rewritten sentence in the rewriting result;

[0027] The candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence are not continuous in the original text;

[0028] The first rewritten sentence is the first rewritten sentence in the rewriting result, and the candidate original sentence corresponding to the first rewritten sentence is not the first original sentence in the original text.

[0029] In a possible implementation, determining the target original sentence for the first rewritten sentence mapping from the original text according to a preset catch-all rule includes:

[0030] If it is determined according to the target position that the candidate original sentence corresponding to the first rewritten sentence is located before the candidate original sentence corresponding to the second rewritten sentence, determining the candidate original sentence corresponding to the second rewritten sentence as the target original sentence for mapping the first rewritten sentence;

[0031] Alternatively, when it is determined based on the target position that the candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence are not continuous in the original text, the original sentence between the candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence is determined as the target original sentence for the first rewritten sentence mapping;

[0032] Alternatively, when the first rewritten sentence is the first rewritten sentence in the rewriting result, and it is determined based on the target position that the candidate original sentence corresponding to the first rewritten sentence is not the first original sentence in the original text, the candidate original sentence corresponding to the first rewritten sentence and the original sentence before it are determined as the target original sentences for mapping the first rewritten sentence.

[0033] In a possible implementation, inputting the first rewritten sentence and the original text into the large model and outputting a candidate original text sentence corresponding to the first rewritten sentence in the original text includes:

[0034] Inputting the first rewritten sentence, context information of the first rewritten sentence, and the original text into the large model, and outputting a candidate original text sentence corresponding to the first rewritten sentence in the original text;

[0035] The context information of the first rewritten sentence includes at least: a second rewritten sentence and a target original sentence mapped by the second rewritten sentence, and the position of the candidate original sentence in the original text is constrained to be after the target original sentence mapped by the second rewritten sentence, and the second rewritten sentence is the previous rewritten sentence of the first rewritten sentence in the rewriting result.

[0036] In a possible implementation, inputting the first rewritten sentence and the original text into the large model and outputting a candidate original text sentence corresponding to the first rewritten sentence in the original text includes:

[0037] Inputting the first rewritten sentence, the original text, a preset multi-level decision rule, and corresponding examples into the macro model; wherein the multi-level decision rule defines the priority determination logic of the candidate original text sentences;

[0038] Based on the multi-level decision rules and corresponding examples, the large model outputs a candidate original sentence corresponding to the first rewritten sentence in the original text.

[0039] In a possible implementation, before inputting the first rewritten sentence and the original text into the large model, the method further includes:

[0040] determining a search range corresponding to the first rewritten sentence in the original text according to a relative position parameter of the first rewritten sentence in the rewritten result;

[0041] The search range is used as the original text corresponding to the first rewritten sentence, and the steps of inputting the first rewritten sentence and the original text into the large model and subsequent steps are performed.

[0042] In a possible implementation, determining the search range corresponding to the first rewritten sentence in the original text according to the relative position parameter of the first rewritten sentence in the rewritten result includes:

[0043] determining a reference position in the original text according to a relative position parameter of the first rewritten sentence in the rewritten result;

[0044] In the original text, a character interval of a preset length is cut off with the reference position as the center as a search range corresponding to the first rewritten sentence in the original text.

[0045] In one possible implementation, the method further includes:

[0046] If a candidate original sentence corresponding to the first rewritten sentence is not located within the search scope, the search scope corresponding to the first rewritten sentence is gradually expanded until the search scope corresponding to the first rewritten sentence covers the entire text of the original text, or a candidate original sentence corresponding to the first rewritten sentence is located within the search scope.

[0047] In a second aspect, the present application provides a content rewriting device, the device comprising:

[0048] Rewriting module, used to obtain the rewriting results of the original text;

[0049] a model processing module, configured to input the first rewritten sentence and the original text into a large model, and output a candidate original text sentence corresponding to the first rewritten sentence in the original text; wherein the first rewritten sentence is any rewritten sentence in the rewriting result;

[0050] a mapping module, configured to determine, from the original text, a target original sentence to be mapped to the first rewritten sentence based on a target position of the candidate original sentence in the original text;

[0051] The comparison module is configured to perform text comparison processing on the first rewritten sentence and its mapped target original sentence, and output a text comparison result.

[0052] In a possible implementation, the mapping module includes:

[0053] a mapping relationship determination unit, configured to determine whether a mapping relationship between the first rewritten sentence and the candidate original sentence is accurate based on a target position of the candidate original sentence in the original text;

[0054] The target original sentence determining unit is configured to determine the candidate original sentence as the target original sentence for mapping the first rewritten sentence if, based on the target position of the candidate original sentence in the original text, the mapping relationship between the first rewritten sentence and the candidate original sentence is accurate; and to determine the target original sentence for mapping the first rewritten sentence from the original text according to a preset fallback rule if, based on the target position of the candidate original sentence in the original text, the mapping relationship between the first rewritten sentence and the candidate original sentence is abnormal.

[0055] In a possible implementation, the device further includes:

[0056] The target position determination module is configured to determine the target position of the candidate original sentence in the original text by:

[0057] When the candidate original sentence appears only once in the original text, determining the position of the candidate original sentence in the original text as the target position of the candidate original sentence in the original text;

[0058] In the case where the candidate original sentence appears multiple times in the original text, one occurrence position of the candidate original sentence in the original text is determined as the target position of the candidate original sentence in the original text.

[0059] In a possible implementation, the target location determination module includes:

[0060] a position difference determining unit, configured to determine a difference value between a relative position parameter of the first rewritten sentence in the rewritten result and a relative position parameter of each of the occurrence positions in the original text;

[0061] The first position selection unit is configured to select the occurrence position with the smallest difference value and determine it as the target position of the candidate original sentence in the original text.

[0062] In a possible implementation, the target location determination module includes:

[0063] A context acquisition unit, configured to acquire the original context of the candidate original sentence at each of the occurrence positions;

[0064] a semantic similarity determination unit, configured to determine a semantic similarity between a rewritten context of the first rewritten sentence in the rewritten result and each of the original text contexts;

[0065] The second position selection unit is configured to select the corresponding occurrence position with the highest semantic similarity and determine it as the target position of the candidate original sentence in the original text.

[0066] In a possible implementation, the mapping relationship determination unit is specifically configured to:

[0067] If any of the following conditions is determined to be satisfied based on the target position of the candidate original sentence in the original text, the mapping relationship between the first rewritten sentence and the candidate original sentence is determined to be abnormal; otherwise, the mapping relationship between the first rewritten sentence and the candidate original sentence is determined to be correct:

[0068] The candidate original sentence corresponding to the first rewritten sentence is located before the candidate original sentence corresponding to the second rewritten sentence; wherein the second rewritten sentence is the previous rewritten sentence of the first rewritten sentence in the rewriting result;

[0069] The candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence are not continuous in the original text;

[0070] The first rewritten sentence is the first rewritten sentence in the rewriting result, and the candidate original sentence corresponding to the first rewritten sentence is not the first original sentence in the original text.

[0071] In one possible implementation, the target original sentence determination unit is specifically configured to:

[0072] If it is determined according to the target position that the candidate original sentence corresponding to the first rewritten sentence is located before the candidate original sentence corresponding to the second rewritten sentence, determining the candidate original sentence corresponding to the second rewritten sentence as the target original sentence for mapping the first rewritten sentence;

[0073] Alternatively, when it is determined based on the target position that the candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence are not continuous in the original text, the original sentence between the candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence is determined as the target original sentence for the first rewritten sentence mapping;

[0074] Alternatively, when the first rewritten sentence is the first rewritten sentence in the rewriting result, and it is determined based on the target position that the candidate original sentence corresponding to the first rewritten sentence is not the first original sentence in the original text, the candidate original sentence corresponding to the first rewritten sentence and the original sentence before it are determined as the target original sentences for mapping the first rewritten sentence.

[0075] In a possible implementation, the model processing module is specifically configured to:

[0076] Inputting the first rewritten sentence, context information of the first rewritten sentence, and the original text into the large model, and outputting a candidate original text sentence corresponding to the first rewritten sentence in the original text;

[0077] The context information of the first rewritten sentence includes at least: a second rewritten sentence and a target original sentence mapped by the second rewritten sentence, and the position of the candidate original sentence in the original text is constrained to be after the target original sentence mapped by the second rewritten sentence, and the second rewritten sentence is the previous rewritten sentence of the first rewritten sentence in the rewriting result.

[0078] In a possible implementation, the device further includes:

[0079] A search range determination module is configured to determine a search range corresponding to the first rewritten sentence in the original text according to a relative position parameter of the first rewritten sentence in the rewritten result before inputting the first rewritten sentence and the original text into the large model;

[0080] The model processing module is configured to use the search range as the original text corresponding to the first rewritten sentence and execute the step of inputting the first rewritten sentence and the original text into the large model.

[0081] In a possible implementation, the search range determination module includes:

[0082] a positioning unit, configured to determine a reference position in the original text according to a relative position parameter of the first rewritten sentence in the rewritten result;

[0083] The range defining unit is configured to intercept a character interval of a preset length in the original text with the reference position as the center as a search range corresponding to the first rewritten sentence in the original text.

[0084] In a possible implementation, the search range determination module is further configured to:

[0085] If a candidate original sentence corresponding to the first rewritten sentence is not located within the search scope, the search scope corresponding to the first rewritten sentence is gradually expanded until the search scope corresponding to the first rewritten sentence covers the entire text of the original text, or a candidate original sentence corresponding to the first rewritten sentence is located within the search scope.

[0086] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory, wherein the processor is configured to execute a content rewriting program stored in the memory to implement the content rewriting method described in any one of the first aspects.

[0087] In a fourth aspect, the present application further provides a computer storage medium storing computer executable instructions, wherein the computer executable instructions are used to execute the content rewriting method described in any one of the above items of the present application.

[0088] The above-mentioned technical solution provided by the embodiment of the present application has the following advantages over the prior art: the method provided by the embodiment of the present application, by inputting any rewritten sentence and the original text in the rewriting result into the big model, outputs the candidate original sentence corresponding to the rewritten sentence in the original text, and then determines the target original sentence mapped to the rewritten sentence from the original text according to the target position of the candidate original sentence in the original text. It can realize the feature of using the big model to break through the literal matching limitation, accurately capture the deep semantic and logical connection between the rewritten sentence and the original text, and even in complex rewriting scenarios such as word order adjustment, sentence structure transformation, synonym replacement, etc., it can still efficiently output the candidate original sentence corresponding to the rewritten sentence in the original text, and further accurately locate the target original sentence mapped to the rewritten sentence from the original text based on the candidate original sentence, rather than simply mapping the original text as a whole to the rewriting result. This technical approach not only significantly improves the accuracy and reliability of text difference comparison, effectively solves the problems of misjudgment and omission of traditional literal matching methods in complex rewriting scenarios, but also forms a double protection mechanism by introducing a bottom-line rule, compensating for the misjudgment risk of large models under specific boundary conditions, ensuring the accuracy of the mapping results between the rewritten sentences and the original sentences, and providing a reliable data foundation for subsequent text comparison processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0089] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0090] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0091] One or more embodiments are exemplarily illustrated by pictures in the corresponding drawings. These exemplifications do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are represented as similar elements. Unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0092] Figure 1 A flowchart of an embodiment of a content rewriting method provided in an embodiment of the present application;

[0093] Figure 2 This is an example of the text comparison result;

[0094] Figure 3 A flowchart of another content rewriting method provided in an embodiment of the present application;

[0095] Figure 4A flowchart of another content rewriting method provided in an embodiment of the present application;

[0096] Figure 5 A block diagram of an embodiment of a content rewriting device provided in an embodiment of the present application;

[0097] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0098] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0099] The disclosure below provides many different embodiments or examples for implementing different structures of the present application. In order to simplify the disclosure of the present application, the components and settings of specific examples are described below. Of course, these are merely examples and are not intended to limit the present application. In addition, the present application may repeat reference numbers and / or letters in different examples. Such repetition is for the purpose of simplicity and clarity and does not in itself indicate the relationship between the various embodiments and / or settings discussed.

[0100] In order to solve the technical problem that the existing method of constructing the mapping relationship between the original text and the rewriting result is insufficiently accurate in complex rewriting scenarios, affecting the actual effectiveness of the text comparison function, the present application provides a content rewriting method, device, electronic device and storage medium, which can accurately and effectively construct the mapping relationship between the rewriting result and the original text, providing a reliable data basis for subsequent text comparison processing.

[0101] Figure 1 This is a flow chart of an embodiment of a content rewriting method provided in an embodiment of the present application.

[0102] like Figure 1 As shown, the method includes the following steps:

[0103] Step 101: Obtain the rewriting result of the original text.

[0104] In step 101, the purpose is to perform content rewriting on the original text (i.e., the original text) to obtain a rewriting result. Among them, content rewriting refers to: optimizing and adjusting the expression form of the text without changing the basic meaning of the original text. This includes but is not limited to eliminating redundant expressions, splitting long sentences into clearer and more concise short sentences, terminology standardization and replacing non-standard technical terms, adding modifiers, synonym replacement, modifying ill-formed sentences, modifying typos, etc. The purpose of content rewriting is to make the text expression accurate, easier to understand, and improve readability. For example, the original text is: The profound theme and wonderful plot left a deep impression on me. The original text is subjected to content rewriting, and the rewriting result obtained is, for example: The profound theme and fascinating plot left a deep impression on me.

[0105] The original text in the above example is only a sentence. In actual application, the original text can be a document, or one or more chapters, paragraphs, etc. in the document. The embodiment of the present application does not limit this.

[0106] In one embodiment, an original text is input into a content rewriting model, which then performs content rewriting on the original text and generates a corresponding rewritten result. The content rewriting model is an intelligent tool based on natural language processing technology that deeply understands and analyzes the input original text and then rewrites it according to preset rules and strategies. The rewritten text not only retains the core meaning of the original content but also optimizes and innovates the expression and language style, making the content more vivid, interesting, and easy to understand. For example, the working principle of the content rewriting model generally includes the following steps: text processing: preprocessing the input original text, including word segmentation, removing invalid words and stop words, etc., to enable effective text recognition and convert it into a format that can be processed by machines; semantic analysis: in-depth analysis of the preprocessed text to understand its meaning and context, ensuring that the semantic consistency of the original text is maintained during the rewriting process; and rewriting strategy application: rewriting the text according to preset rewriting rules and strategies. This may include synonym replacement, sentence adjustment, paragraph reorganization and other operations to optimize the expression and language style of the text; Quality check: Perform quality check on the rewritten text to ensure the accuracy and fluency of the rewritten results.

[0107] In another embodiment, a non-AI rewriting tool can be used to rewrite the original text to generate a corresponding rewriting result. Exemplarily, the non-AI rewriting tool uses the following technical solution to rewrite the original text: First, a mapping table is constructed, which may include synonym / synonymous mapping relationships, such as "fast → rapid", "advantage → advantage" and other mapping relationships; field-specific term mapping relationships, such as in the medical field: "tumor → neoplasm", and so on. Afterwards, the original text is traversed to identify the replaceable words therein, and then the words are replaced according to the mapping table. Afterwards, the sentence structure is adjusted, such as active to passive, conjunction adjustment, word order reorganization and other adjustment operations. Finally, grammatical correction and polishing are performed to obtain the corresponding rewriting result.

[0108] It should be noted that the above is merely an exemplary description. In actual applications, there may be other specific implementation methods for rewriting the content of the original text, and the embodiments of the present application do not limit this.

[0109] Step 102: Input the first rewritten sentence and the original text into the large model, and output a candidate original text sentence corresponding to the first rewritten sentence in the original text; wherein the first rewritten sentence is any rewritten sentence in the rewriting result.

[0110] In the task of text rewriting and comparative analysis, clarifying the mapping relationship between sentences in the rewritten results (for ease of description, called rewritten sentences) and corresponding sentences in the original text (for ease of description, called original sentences) is the basis for accurately demonstrating the rewriting effect and comparative analysis. Typically, when the original text contains multiple sentences, the rewriting operation of the original text is not to rewrite each sentence independently, but to rewrite the content of the original text as a coherent whole. This holistic rewriting strategy ensures that the rewritten text is logically consistent and semantically more coherent, effectively maintaining the overall information structure and expression intent of the original text.

[0111] In view of the above-mentioned overall rewriting strategy, in the task of text rewriting and comparative analysis, it is particularly important to accurately identify the mapping relationship between the rewritten sentence and the original sentence. To this end, in step 102, the large model technology is used to determine the mapping relationship between the rewritten sentence and the original sentence. Specifically, the first rewritten sentence (any rewritten sentence in the rewriting result) and the original text are submitted as input to a large model with deep semantic understanding capabilities. The large model uses its powerful natural language processing capabilities and deep learning algorithms to perform a deep comparison and precise matching of the first rewritten sentence with the original text at the semantic level, aiming to identify the original sentence in the original text that is closest in semantics to the first rewritten sentence. This process makes full use of the large model's ability to capture complex semantic relationships in natural language, and effectively overcomes the limitations of traditional line / sentence mapping or similarity calculation methods when dealing with complex scenarios such as word order adjustment and sentence transformation. Exemplarily, the following prompt words can be input to the large model to guide the large model to complete the above tasks:

[0112] Original content: XXXXXX; XXXXXX. XXXXX.

[0113] Rewrite content: XXX;

[0114] Please determine which sentences in the [original content] the [rewritten content] is rewritten from, and output these sentences directly.

[0115] Output requirements: The output sentences are the sentences in the [original content] and must not be modified.

[0116] It should be noted that, considering that the output results of the large model are not necessarily accurate and there is a risk of misjudgment under certain boundary conditions, the original sentence found by the large model is used as a candidate original sentence, that is, a possible original sentence, rather than being directly determined as the target original sentence.

[0117] Step 103: Determine a target original sentence mapped to the first rewritten sentence from the original text according to the target position of the candidate original sentence in the original text.

[0118] As can be seen from the description of step 102 above, the output of the large model (i.e., the candidate original sentence) is uncertain and serves only as a possible original sentence, rather than a directly determined target original sentence. Therefore, step 103 aims to further accurately identify the target original sentence from the original text, based on the positioning results of the large model, that forms a valid mapping relationship with the first rewritten sentence.

[0119] Specifically, step 103 locates the target original sentence that is most consistent with the semantics of the first rewritten sentence and has the clearest mapping relationship from the original text through a systematic analysis method based on the target position of the candidate original sentence in the original text. Among them, the target position of the candidate original sentence in the original text can be defined by position parameters such as outline level, paragraph ID, sentence order ID, etc. These position parameters not only provide clear coordinates for the positioning of the candidate original sentence, but also provide important references for subsequent mapping relationship verification and correction. The specific implementation of step 103 involves the cooperation and collaboration of the big model and the client. Among them, in step 102, the big model compares and matches the first rewritten sentence with the original text at the semantic level, and identifies the original sentence in the original text that is closest to the semantics of the first rewritten sentence. At this time, the big model provides the original text-related content with semantic matching, but it cannot obtain the original text structure information and cannot directly determine the target position. The client is responsible for further locating the target original sentence from the original text that best matches the semantics of the first rewritten sentence and has the clearest mapping relationship, based on the candidate original sentence's positional parameters in the original text, such as the outline level, paragraph ID, and sentence order ID. This collaboration between the big model and the client leverages the big model's strengths in semantic understanding and the client's understanding of the original text structure to accurately locate the target original sentence.

[0120] Through the processing of step 103, a dual protection mechanism is formed, which can not only compensate for the risk of misjudgment of the large model under specific boundary conditions, but also ensure that the target original sentence that forms an effective mapping relationship with the first rewritten sentence is accurately locked from the original text, avoiding the definition error of the mapping relationship due to the limitations of a single technical path.

[0121] As for how to determine the target original sentence mapped to the first rewritten sentence from the original text according to the target position of the candidate original sentence in the original text, the following will be described. Figure 3 The embodiments of the present invention are explained in detail and will not be described in detail here.

[0122] Step 104 : Perform text comparison processing on the first rewritten sentence and its mapped target original sentence, and output the text comparison result.

[0123] In step 104, a detailed text comparison process is performed on the first rewritten sentence determined in step 103 and its mapped target original sentence. This process aims to visually demonstrate the effect of the rewriting and the specific changes between the original text by comparing the differences between the two texts (the first rewritten sentence and the target original sentence).

[0124] In one embodiment, text diff technology (full name Difference algorithm) is used to compare and analyze two texts character by character, marking the differences before and after rewriting, including but not limited to vocabulary replacement, sentence structure adjustment, content addition and deletion, etc.

[0125] By performing a text comparison process on the first rewritten sentence and its mapped target original sentence and outputting the text comparison results, it can not only intuitively display the specific changes of the rewrite, but also provide users with detailed rewrite feedback, helping them better understand the rewrite effect and providing strong support for subsequent text editing and optimization. Moreover, if the first rewritten sentence and its mapped target original sentence are correctly mapped, the comparison results can be more concise and accurate, making it easier for users to read and understand, and quickly locate the differences between the original text and the rewritten result. For example, see Figure 2 , which is an example of text comparison results.

[0126] The technical solution provided in the embodiment of the present application, by inputting any rewritten sentence in the rewriting result and the original text into the big model, outputting the candidate original sentence corresponding to the rewritten sentence in the original text, and then determining the target original sentence mapped to the rewritten sentence from the original text according to the target position of the candidate original sentence in the original text, can achieve the feature of breaking through the literal matching limitation by utilizing the big model, accurately capture the deep semantic and logical connection between the rewritten sentence and the original text, and even in complex rewriting scenarios such as word order adjustment, sentence structure transformation, and synonym replacement, it can still efficiently output the candidate original sentence corresponding to the rewritten sentence in the original text, and further accurately locate the target original sentence mapped to the rewritten sentence from the original text based on the candidate original sentence, rather than simply mapping the original text as a whole to the rewriting result. This technical approach not only significantly improves the accuracy and reliability of text difference comparison, effectively solves the problems of misjudgment and omission of traditional literal matching methods in complex rewriting scenarios, but also forms a double protection mechanism by introducing a bottom-line rule, compensating for the misjudgment risk of large models under specific boundary conditions, ensuring the accuracy of the mapping results between the rewritten sentences and the original sentences, and providing a reliable data foundation for subsequent text comparison processing.

[0127] Figure 3 A flowchart of another content rewriting method provided in an embodiment of the present application. Figure 3 The process shown in Figure 1 Based on the process shown in FIG, an exemplary implementation of determining a target original sentence mapped to the first rewritten sentence from the original text according to the target position of the candidate original sentence in the original text is described. Figure 3 As shown, the following steps are included:

[0128] Step 301: Determine the target position of the candidate original sentence in the original text.

[0129] In one embodiment, the target position of the candidate original sentence in the original text is determined in the following manner: if the candidate original sentence appears only once in the original text, the position where the candidate original sentence appears in the original text is determined as the target position of the candidate original sentence in the original text. If the candidate original sentence appears multiple times in the original text, one position is determined from all positions where the candidate original sentence appears in the original text as the target position of the candidate original sentence in the original text.

[0130] In this embodiment, considering that the same sentence may appear multiple times in the original text due to factors such as repetition of paragraph structure, theme emphasis or rhetorical needs, resulting in multi-valued mapping positions, and actual application scenarios usually require a unique target position, therefore, when the candidate original sentence appears multiple times in the original text, one occurrence position is determined from all occurrence positions of the candidate original sentence in the original text as the target position of the candidate original sentence in the original text.

[0131] Furthermore, in one embodiment, determining an occurrence position from all occurrence positions of the candidate original sentence in the original text as the target position of the candidate original sentence in the original text includes: determining a difference value between a relative position parameter of the first rewritten sentence in the rewritten result and a relative position parameter of each occurrence position in the original text; and selecting the occurrence position with the smallest difference value to determine as the target position of the candidate original sentence in the original text.

[0132] The core logic of this embodiment is: by quantifying the spatial distance between the first rewritten sentence and each candidate original sentence in the chapter structure, the original sentence closest to the first rewritten sentence in the chapter structure of the rewritten result is selected as the target mapping result, thereby ensuring the semantic relevance while taking into account the local stability of the chapter structure. Specifically, the relative position parameters of the first rewritten sentence in the rewriting result are first extracted, such as the outline level, paragraph ID, and sentence order ID. At the same time, the parameters of the same dimension are extracted for all occurrence positions of the candidate original sentence in the original text. For example, if the first rewritten sentence is located in the fifth sentence of the second section of the third chapter of the rewriting result, its relative position parameter can be expressed as (chapter = 3, paragraph = 2, or sentence order = 5). Then, a parameter vector is constructed based on the relative position parameter to achieve a structured representation of the positional features of the first rewritten sentence and the candidate original sentence. Further, based on the aforementioned parameter vector, the difference value in relative position between the first rewritten sentence and each candidate original sentence can be calculated. For example, it can be measured by quantitative methods such as Euclidean distance and Manhattan distance. Finally, the occurrence position with the smallest difference value is selected and determined as the target position of the candidate original sentence in the original text.

[0133] In another embodiment, an occurrence position of the candidate original sentence in the original text is determined as a target position of the candidate original sentence in the original text, including: obtaining the original text context of each occurrence position of the candidate original sentence; determining the semantic similarity between the rewritten context of the first rewritten sentence in the rewriting result and each original text context; and selecting the occurrence position with the highest corresponding semantic similarity to determine it as the target position of the candidate original sentence in the original text.

[0134] The core logic of this embodiment is: by quantifying the semantic similarity between the rewriting context of the first rewritten sentence and the original context of each candidate original sentence, the candidate original sentence position with the highest semantic similarity is selected as the target mapping result, thereby improving the accuracy and rationality of target position positioning. Specifically, first, for each occurrence position of the candidate original sentence in the original text, its context window (for example, n sentences or characters before and after) is extracted as the original context; at the same time, the context of the first rewritten sentence in the rewriting result (for example, m sentences or characters before and after) is extracted as the rewriting context. Here, the extraction of context information needs to ensure that the window length is moderate, which can cover enough semantic information and avoid introducing too much noise. Subsequently, a pre-trained language model (such as a BERT model) is used to encode the context into a vector representation to capture the deep semantic features of the context. Then, based on the context vector representation, the semantic similarity between the rewriting context and each original context is calculated. Semantic similarity calculation can adopt cosine similarity, Euclidean distance or a similarity measurement method based on deep learning. Finally, the candidate original sentence position with the highest similarity score is selected as the target position. This logic is based on the following assumption: rewriting operations typically make local adjustments while maintaining the core semantics of the original sentence. Therefore, the context of the rewritten sentence should be highly semantically consistent with the original sentence. By selecting the position with the greatest similarity, we can ensure the best semantic match between the target original sentence and the rewritten sentence.

[0135] In another embodiment, for complex scenarios where there are multiple candidate original sentences distributed in the original text, a two-stage target position decision mechanism that integrates position constraints and contextual semantic similarity constraints is proposed. The core logic of this embodiment is: first, based on the relative position parameters, the position of the candidate original sentence that is spatially adjacent to the first rewritten sentence is located to narrow the search range; then, the contextual semantic similarity measurement is introduced into the narrowed set of candidate original sentences to further select the position of the candidate original sentence with the highest semantic fit as the target position. This method takes into account both computational efficiency and positioning accuracy through a staged decision-making process of structure first and semantics later, and is also well applicable to complex task scenarios such as long documents and cross-chapter comparisons.

[0136] Step 302: Determine whether the mapping relationship between the first rewritten sentence and the candidate original sentence is accurate based on the target position of the candidate original sentence in the original text. If the mapping relationship between the first rewritten sentence and the candidate original sentence is accurate based on the target position of the candidate original sentence in the original text, execute step 303. If the mapping relationship between the first rewritten sentence and the candidate original sentence is abnormal based on the target position of the candidate original sentence in the original text, execute step 304.

[0137] Step 303: Determine the candidate original sentence as the target original sentence for the first rewritten sentence mapping.

[0138] Step 304: Determine the target original sentence for the first rewritten sentence mapping from the original text according to a preset catch-all rule.

[0139] For ease of understanding, a unified explanation of steps 302 to 304 is provided below:

[0140] First, it can be seen from the description of steps 302 to 304 that the embodiment of the present application aims to ensure that the mapping relationship between the rewritten sentence and the original sentence complies with the chapter structure and logical consistency constraints by establishing a mapping relationship verification and a fallback correction mechanism. Specifically, step 302 verifies the mapping relationship output by the large model through preset abnormal conditions. If it is determined to be abnormal, it is corrected through the fallback rule of step 304; if the verification passes, the mapping relationship is directly confirmed through step 303. Among them, the fallback rule is a rule system for correcting the mapping relationship to ensure that the mapping between the rewritten sentence and the original sentence complies with the chapter structure and logical consistency constraints. The fallback rule will provide corresponding correction strategies based on the specific type of abnormality (such as the latter sentence is mapped to the former sentence, the mapping targets of the two rewritten sentences are not continuous in the original text, the first sentence is mapped to the non-first sentence, etc.), and adjust the mapping relationship to comply with the requirements of logical order, local semantic coherence and consistency of the starting position of the chapter. The core of this method is to improve the accuracy and robustness of the mapping results by combining structured constraints with dynamic correction rules.

[0141] In one embodiment, determining whether the mapping relationship between the first rewritten sentence and the candidate original sentence is accurate based on the target position of the candidate original sentence in the original text includes: if any of the following conditions is determined to be satisfied based on the target position of the candidate original sentence in the original text, determining that the mapping relationship between the first rewritten sentence and the candidate original sentence is abnormal; otherwise, determining that the mapping relationship between the first rewritten sentence and the candidate original sentence is accurate:

[0142] Condition 1: The candidate original sentence corresponding to the first rewritten sentence is located before the candidate original sentence corresponding to the second rewritten sentence; wherein the second rewritten sentence is the rewritten sentence preceding the first rewritten sentence in the rewriting result:

[0143] Condition 2: The candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence are not continuous in the original text;

[0144] Condition 3: The first rewritten sentence is the first rewritten sentence in the rewriting result, and the candidate original sentence corresponding to the first rewritten sentence is not the first original sentence in the original text.

[0145] Accordingly, in one embodiment, determining the target original sentence for the first rewritten sentence mapping from the original text according to a preset catch-all rule includes: when the candidate original sentence corresponding to the first rewritten sentence is determined according to the target position to be located before the candidate original sentence corresponding to the second rewritten sentence, determining the candidate original sentence corresponding to the second rewritten sentence as the target original sentence for the first rewritten sentence mapping; or, when the candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence are determined according to the target position to be discontinuous in the original text, determining the candidate original sentence corresponding to the first rewritten sentence and the original sentences between the candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence (excluding the candidate original sentence corresponding to the second rewritten sentence) as the target original sentence for the first rewritten sentence mapping; or, when the first rewritten sentence is the first rewritten sentence in the rewriting result and the candidate original sentence corresponding to the first rewritten sentence is determined according to the target position to be not the first original sentence in the original text, determining the candidate original sentence corresponding to the first rewritten sentence and the original sentence located before the candidate original sentence as the target original sentence for the first rewritten sentence mapping.

[0146] The following examples illustrate the above conditions and the fallback rules when the conditions are met:

[0147] For condition 1, if the candidate original sentence corresponding to the first rewritten sentence comes before the candidate original sentence corresponding to the second rewritten sentence (i.e., the latter sentence is mapped to the former sentence), then the mapping relationship between the first rewritten sentence and the candidate original sentence is considered abnormal. The essence of this abnormality is that it destroys the logical sequence consistency between the rewritten result and the original text.

[0148] For example, the mapping result returned by the large model is:

[0149] Rewrite sentence 1' to map the original sentence 1;

[0150] Rewrite sentence 2' to map to original sentence 2;

[0151] Rewrite sentence 3' to reflect the original sentence 1.

[0152] Among them, for the rewritten sentence 3', the candidate original sentence it maps to is located before the candidate original sentence mapped to the rewritten sentence 2', resulting in confusion in the logical order.

[0153] To maintain the consistency of the logical order, the candidate original sentence corresponding to the second rewritten sentence is determined as the target original sentence for the first rewritten sentence according to the corresponding fallback rule. For example, the target original sentence for the final mapping of rewritten sentence 3' is changed from original sentence 1 to original sentence 2. At this time, the target mapping result is:

[0154] Rewrite sentence 1' to map the original sentence 1;

[0155] Rewrite sentence 2' to map to original sentence 2;

[0156] Rewrite sentence 3' to reflect the original sentence 2.

[0157] From the above examples, we can see that using the corresponding fallback rules to correct the mapping relationship can eliminate logical inversion and ensure the consistency of information flow.

[0158] For condition 2, if the candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence are not continuous in the original text (i.e., there is a gap in the mapping targets of the two rewritten sentences in the original text), then the mapping relationship between the first rewritten sentence and the candidate original sentence is considered abnormal. The essence of this abnormality is that it destroys the local semantic coherence between the rewritten result and the original text, resulting in a break in information flow or a semantic jump.

[0159] For example, the mapping result returned by the large model is:

[0160] Rewrite sentence 1' to map the original sentence 1;

[0161] Rewrite sentence 2' to map to original sentence 2;

[0162] Rewrite sentence 3' to reflect original sentence 4.

[0163] Among them, for the rewritten sentence 3', the candidate original sentence it maps to and the candidate original sentence mapped to the rewritten sentence 2' are not continuous in the original text, resulting in a local semantic gap.

[0164] To maintain local semantic coherence, the candidate original sentence corresponding to the first rewritten sentence and the original sentence between it and the candidate original sentence corresponding to the second rewritten sentence are determined as the target original sentence for the first rewritten sentence mapping according to the corresponding fallback rule. For example, the target original sentence for the final mapping of rewritten sentence 3' is revised from original sentence 4 to original sentence 3 and original sentence 4. The target mapping result is:

[0165] Rewrite sentence 1' to map the original sentence 1;

[0166] Rewrite sentence 2' to map to original sentence 2;

[0167] The rewritten sentence 3' maps the original sentence 3 and the original sentence 4.

[0168] From the above examples, we can see that using the corresponding catch-all rules to correct the mapping relationship can fill the semantic gaps and ensure that the logical connections between the rewritten sentences are complete.

[0169] For condition 3, if the first rewritten sentence is the first rewritten sentence in the rewritten result, and the candidate original sentence corresponding to the first rewritten sentence is not the first original sentence in the original text (i.e., the first sentence is mapped to a non-first sentence), then the mapping relationship between the first rewritten sentence and the candidate original sentence is considered abnormal. The essence of this abnormality is that the consistency of the starting position of the paragraph between the rewritten result and the original text is destroyed.

[0170] For example, the mapping result returned by the large model is:

[0171] Rewrite sentence 1' to map the original sentence 2.

[0172] In this mapping, the rewritten sentence 1', as the first sentence of the rewritten result, is mapped to the original sentence 2 of the original text, skipping the original sentence 1, resulting in a shift in the logical starting point.

[0173] In this regard, according to the corresponding fallback rule, the candidate original sentence corresponding to the first rewritten sentence and the original sentence before it are determined as the target original sentence for the first rewritten sentence mapping. For example, the revised mapping result is:

[0174] Rewritten sentence 1' maps original sentence 1 and original sentence 2.

[0175] From the above examples, we can see that using the corresponding fallback rules to correct the mapping relationship can fill the missing logical starting point and ensure that the rewritten result is consistent with the logical starting point of the original text.

[0176] Figure 3 The illustrated embodiment, through the mapping relationship verification and bottom-up correction mechanism, can ensure that the mapping relationship between the rewritten sentence and the original sentence complies with the text structure and logical consistency constraints, thereby improving the accuracy and robustness of the mapping relationship between the rewritten result and the original text.

[0177] In one embodiment, an exemplary implementation of inputting a first rewritten sentence and an original text into a large model and outputting a candidate original text sentence corresponding to the first rewritten sentence in the original text includes: inputting the first rewritten sentence, context information of the first rewritten sentence, and the original text into the large model, and outputting a candidate original text sentence corresponding to the first rewritten sentence in the original text. The context information of the first rewritten sentence includes at least the second rewritten sentence and the target original text sentence mapped to the second rewritten sentence, and the candidate original text sentence is constrained to be located after the target original text sentence mapped to the second rewritten sentence in the original text, and the second rewritten sentence is the previous rewritten sentence of the first rewritten sentence in the rewritten result.

[0178] In the above embodiment, to improve the accuracy and reliability of the large model in determining the mapping relationship between the first rewritten sentence and the original sentence, the contextual information of the first rewritten sentence is introduced as auxiliary input. Specifically, the first rewritten sentence, its contextual information, and the complete original text are input into the large model, and the candidate original text corresponding to the first rewritten sentence in the original text is output.

[0179] As an optional implementation, the context information of the first rewritten sentence includes at least the following two parts:

[0180] Second rewritten sentence: As the direct predecessor of the first rewritten sentence in the rewritten result, the second rewritten sentence is typically closely connected to the first rewritten sentence in terms of semantic association and sentence structure. When processing input, the large model comprehensively considers the semantic association and sentence structure between the first and second rewritten sentences, as well as their logical connection with the corresponding parts of the original text, to ensure that the output candidate original sentence is highly semantically matched with the first rewritten sentence and that its position meets the requirements of contextual logical coherence.

[0181] The target original sentence mapped to the second rewritten sentence: As the direct predecessor of the first rewritten sentence in the rewritten result, the second rewritten sentence's mapped target original sentence provides important clues for understanding the potential position of the first rewritten sentence in the original text. By constraining the candidate original sentence's position in the original text to only be after the target original sentence mapped to the second rewritten sentence, the search scope is effectively limited, avoiding blind comparisons across the entire text. This strategy not only significantly improves positioning accuracy but also greatly enhances processing efficiency, enabling large models to more quickly and accurately find original sentences that match the first rewritten sentence.

[0182] It can be seen that the above embodiment integrates the logical coherence requirement of the entire text into the processing mechanism of the large model by introducing the context information of the first rewritten sentence, so that when the large model processes the input, it will comprehensively consider the logical connection relationship between the rewritten sentence and the original text, ensuring that the output candidate original sentence is semantically closely connected with the first rewritten sentence, and at the same time logically consistent with the entire text, thereby significantly improving the accuracy and reliability of the mapping relationship between the rewritten sentence and the original sentence determined by the large model, and reducing the situation where the large model outputs multiple candidate original sentences, saving the device resources consumed by selecting one from multiple candidate original sentences.

[0183] This implementation uses a streaming processing strategy to accurately map rewritten sentences to their original counterparts. Specifically, for each sentence in the rewritten result, the original sentence to which it maps is determined sequentially, from front to back. This strategy ensures a consistent processing flow.

[0184] As another optional implementation method, the context information of the first rewritten sentence may also include a third rewritten sentence and the target original sentence mapped by the third rewritten sentence. The third rewritten sentence is the sentence after the first rewritten sentence in the rewritten result. This method can realize the construction of a "bidirectional constraint", for example, the candidate original sentence of the first rewritten sentence must not only be located after the mapped original sentence of the second rewritten sentence, but also must satisfy the logical timing or semantic connection relationship with the mapped original sentence of the third rewritten sentence. This constraint can further improve the accuracy of the mapping.

[0185] Specifically, as an optional implementation method, when streaming each rewritten sentence, a preliminary check and judgment is first performed based only on the mapping relationship between the first rewritten sentence and the second rewritten sentence (if any). That is, preliminary processing is performed according to the original rule that only considers the forward constraint (the candidate original sentence of the first rewritten sentence must be located after the mapped original sentence of the second rewritten sentence). For the first rewritten sentence, if it passes the check based on the forward constraint, its mapping relationship is temporarily determined; if the check fails, it is first preliminarily corrected according to the original fallback rule (for example, the candidate original sentence corresponding to the second rewritten sentence is determined as the target original sentence mapped by the first rewritten sentence, etc.). When the entire rewriting result is processed and the mapping relationships of all rewritten sentences have been preliminarily determined, a global check is performed on the entire rewriting result. During the global check process, for each rewritten sentence, its mapping relationship with the third rewritten sentence (if any) is reconsidered to determine whether the bidirectional constraint is satisfied (i.e., the candidate original sentence of the first rewritten sentence must not only be located after the mapped original sentence of the second rewritten sentence, but also must satisfy the logical temporal or semantic cohesion relationship with the mapped original sentence of the third rewritten sentence).

[0186] If the bidirectional constraint is found to be violated, the mapping relationship of the relevant rewritten sentences will be revised again according to the new constraint conditions. For example, if there are problems with the logical timing or semantic connection between the first and third rewritten sentences, the target original sentence mapped to the first rewritten sentence can be re-determined to make it more consistent with the bidirectional constraint requirements.

[0187] In the above embodiment, by introducing the context information of the first rewritten sentence as auxiliary input, the accuracy and reliability of the large model in determining the mapping relationship between the first rewritten sentence and the original sentence can be improved.

[0188] In one embodiment, in order to effectively constrain abnormal outputs of the large model during the recognition process and ensure that the large model can return the optimal solution when faced with multiple candidate original sentences, a multi-level decision rule system, namely priority judgment logic, is introduced to guide the large model to make accurate selections among multiple candidate original sentences.

[0189] Specifically, the first rewritten sentence, the original text, the preset multi-level decision rules and the corresponding examples are input into the big model; based on the multi-level decision rules and the corresponding examples, the big model outputs the candidate original sentence corresponding to the first rewritten sentence in the original text.

[0190] Among them, the multi-level decision rule defines the priority judgment logic of the candidate original sentences. For example, the multi-level priority decision rule defines the priority judgment logic that "minimum sentence structure change" takes precedence over "maximum keyword matches", and "maximum keyword matches" takes precedence over "most natural logical connection". Based on this judgment logic, the large model will give priority to outputting the candidate original sentences with the smallest sentence structure change compared to the first rewritten sentence. This strategy aims to maintain the original grammatical structure and expression habits of the text and reduce semantic deviations caused by sentence adjustments. When the sentence structure change cannot clearly distinguish the priority of the candidate original sentences, the large model further examines the number of keyword matches and gives priority to outputting the candidate original sentences with the largest number of keyword matches with the first rewritten sentence. This strategy aims to evaluate semantic similarity by quantifying the degree of keyword sharing between the candidate original sentences and the first rewritten sentence, and gives priority to outputting candidate original sentences with more similar semantics. When neither sentence structure changes nor keyword matching can provide a clear basis for selection, the large model will use "the most natural logical connection" as the ultimate judgment strategy. This strategy aims to determine the semantic rationality by evaluating the logical coherence and causal relationship between the candidate original sentence and the first rewritten sentence, and give priority to outputting the candidate original sentence with more reasonable semantics.

[0191] Furthermore, to enhance the large-scale model's ability to understand and apply multi-level decision-making rules, a few-shot learning mechanism is employed to provide specific examples for each level of decision-making criteria. Through these examples, the large-scale model can intuitively understand and grasp the connotations and application scenarios of each level of decision-making criteria, enabling it to make more accurate and reasonable decisions when faced with real-world tasks.

[0192] For example, the example corresponding to the decision rule of "minimum change in sentence structure" is:

[0193] If the first rewritten sentence is "If it doesn't rain tomorrow, we'll go hiking," and the three candidate original sentences are "If it doesn't rain tomorrow, we'll go hiking," "We'll go hiking tomorrow, if it doesn't rain," and "If it rains, we won't go hiking, except tomorrow," then based on the principle of minimal structural change, the first sentence, "If it doesn't rain tomorrow, we'll go hiking," should be selected first because it maintains a high degree of consistency in sentence structure with the first rewritten sentence.

[0194] An example of a decision rule for "most matched keywords" is:

[0195] For example, if the first rewritten sentence is "After the heavy rain, the lotus flowers in the pond were swaying in the wind," and the three candidate original sentences are "After the heavy rain, the lotus flowers in the pond were gently swaying in the wind," "After the typhoon, the willow trees in the park were bent," and "In the early morning, the lotus flowers in the pond were in full bloom," the first sentence "After the heavy rain, the lotus flowers in the pond were gently swaying in the wind" should be selected first based on the principle of the most keyword matches because it shares more keywords with the first rewritten sentence (such as "after the heavy rain," "lotus flowers in the pond," and "blown in the wind").

[0196] An example of a decision rule with the most natural logical connection is:

[0197] If the first rewritten sentence is "He often stayed up late studying, but his final exam results were unsatisfactory," and the two candidate original sentences A are "Staying up late caused him to lose focus on the exam, which affected his performance," and "He didn't get the material he reviewed before the exam; he was just unlucky." According to the principle of the most natural logical connection, the first sentence, "Staying up late caused him to lose focus on the exam, which affected his performance," should be selected first because it more directly reveals the causal relationship between staying up late and unsatisfactory exam results and has a tighter and more natural logical connection.

[0198] In summary, by introducing a multi-level decision rule system and combining it with a few-shot learning mechanism (specifically, a technology that allows the model to learn and generalize with only a small number of labeled samples. Traditional machine learning models usually require a large amount of labeled data to train, while few-shot learning aims to address the problem of data scarcity, enabling the model to quickly learn new knowledge from a small number of examples and make accurate predictions and classifications), it is possible to effectively constrain the abnormal output of large models in text mapping tasks and ensure that they can accurately return the optimal solution when faced with multiple candidate original sentences, thereby improving the decision accuracy and stability of the large model.

[0199] In practical applications, other constraints can be set for large models, such as limiting them to outputting only one original sentence, and requiring them to output the original sentence directly without any guiding language. This can further reduce the computational time of large models and improve performance.

[0200] Figure 4 This is a flow chart of another embodiment of a content rewriting method provided in an embodiment of the present application. Figure 4 The process shown in Figure 1 Based on the process shown, the following steps are included:

[0201] Step 401: Obtain the rewriting result of the original text.

[0202] For a detailed description of step 401, please refer to the relevant description in the above embodiment, which will not be repeated here.

[0203] Step 402: Determine the search range corresponding to the first rewritten sentence in the original text according to the relative position parameter of the first rewritten sentence in the rewritten result.

[0204] Step 403: Input the first rewritten sentence and its corresponding search range in the original text into the large model; if the large model does not locate a candidate original sentence corresponding to the first rewritten sentence within the search range, execute step 404; if the large model locates a candidate original sentence corresponding to the first rewritten sentence within the search range, execute step 405.

[0205] Step 404 : Expand the search range corresponding to the first rewritten sentence, and return to step 403 .

[0206] For ease of understanding, a unified explanation of steps 402 to 404 is provided below:

[0207] First, in one embodiment, steps 402 to 404 propose a candidate original sentence positioning mechanism based on a dynamic search range to optimize the computational efficiency and resource consumption of the large model when processing long texts. Specifically, under this mechanism, the complete original text is not directly input into the large model for global matching, but first, the target rewritten sentence (i.e., the first rewritten sentence) is combined with its relative position information in the rewriting result (such as outline level, paragraph ID, sentence order ID, etc.) to determine its initial search range in the original text. Subsequently, the initial search range and the target rewritten sentence are input into the large model together to achieve accurate positioning of the candidate original sentences within a local range. It should be noted that the search range input into the large model here refers to the original text content corresponding to the search range.

[0208] This mechanism was designed to improve the efficiency of processing long texts: if a global search is performed directly on the entire original document (such as a 50-page document uploaded by a user), the localization process will face significant time overhead and performance bottlenecks due to the input length constraints and computational complexity of large models. By introducing a dynamic search range mechanism, the global search problem can be transformed into a local search problem, significantly reducing computing resource consumption while maintaining localization accuracy.

[0209] Furthermore, in the case where the candidate original sentence is not located within the initial search range, a progressive search range expansion mechanism is proposed. Specifically, with the initial search range as the center, the boundaries of the search range are gradually expanded toward the context of the original text (e.g., by paragraph, chapter, or fixed number of characters). That is, the search range corresponding to the first rewritten sentence is gradually expanded until any of the following termination conditions are met: (1) the search range is expanded to cover the entire original text; (2) the candidate original sentence corresponding to the target rewritten sentence is successfully located within the expanded search range. This mechanism ensures the completeness and robustness of the candidate original sentence location task by balancing search accuracy and computational efficiency.

[0210] In one embodiment, a search range corresponding to the first rewritten sentence in the original text is determined based on relative position parameters of the first rewritten sentence in the rewriting result, including: determining a reference position in the original text based on the relative position parameters of the first rewritten sentence in the rewriting result; and intercepting a character interval of a preset length in the original text with the reference position as the center as the search range corresponding to the first rewritten sentence in the original text.

[0211] Generally speaking, rewriting operations do not change the macro-organizational logic between paragraphs. For example, if a rewritten sentence is located at the end of the rewritten result, there is no need to search for its corresponding original sentence at the beginning of the original text. Based on this, the above embodiment proposes a mechanism that estimates the potential distribution area of ​​the corresponding original sentence in the original text based on the relative position of the first rewritten sentence in the rewritten result, and then searches for the original sentence in this potential distribution area to improve the computational efficiency and positioning accuracy of the large model.

[0212] Specifically, the relative position of the first rewritten sentence in the rewritten result can be defined by the following three relative position parameters:

[0213] Outline level: If the original text contains a hierarchical structure of chapters and sub-chapter sections, the rewritten sentence will most likely be placed in the same outline level as the original sentence. For example, if the rewritten sentence is in Chapter 3, Section 2 of the rewritten text, then the corresponding original sentence will most likely be placed in Chapter 3, Section 2 of the original text.

[0214] Paragraph ID: As the basic organizational unit of a text, a paragraph's ID directly reflects the vertical distribution of rewritten sentences and original sentences within the text. Mapping paragraph IDs helps locate the paragraph-level correspondence between rewritten and original sentences.

[0215] Sentence ID: Within a paragraph, the Sentence ID further refines the local positional differences between the rewritten sentence and the original sentence by marking it with a sequence number. For example, if the rewritten sentence is the fifth sentence in a paragraph, the original sentence will usually be positioned close to the fifth sentence in the corresponding paragraph.

[0216] Based on the relative position parameters above, the search range can be determined by following the steps below:

[0217] First, perform benchmark positioning based on the outline level: if there is a chapter correspondence between the original text and the rewritten result, the chapter level is prioritized as the benchmark, and the paragraph range that is consistent with the chapter where the rewritten sentence is located is searched in the original text. For example, if the rewritten sentence is located in the second section of the third chapter of the rewritten result, the paragraph range of the second section of the third chapter is prioritized in the original text. Then, perform local position refinement positioning: within the chapter, combine the paragraph ID and sentence sequence ID to further narrow the range of the reference position to the paragraph level or sentence level. For example, if the rewritten sentence is the fifth sentence of the second section of the third chapter of the rewritten result, the second section of the third chapter is prioritized in the original text, and the reference position is positioned to the fifth sentence therein. Finally, with the reference position as the center, a character interval of a preset length (such as 250 words before and after) is intercepted as the search range.

[0218] Step 405: Determine a target original sentence mapped to the first rewritten sentence from the original text according to the target position of the candidate original sentence in the original text.

[0219] Step 406: Perform text comparison processing on the first rewritten sentence and its mapped target original sentence, and output the text comparison result.

[0220] For detailed descriptions of step 405 and step 406, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.

[0221] Figure 4 The process shown in the figure proposes a candidate original sentence positioning mechanism based on dynamic search range, which can optimize the computational efficiency and resource consumption of large models when processing long texts, and achieve accurate and rapid positioning of candidate original sentences.

[0222] Figure 5 This is a block diagram of an embodiment of a content rewriting device provided in an embodiment of the present application. Figure 5 As shown, the device includes:

[0223] A rewriting module 51 is used to obtain the rewriting result of the original text;

[0224] A model processing module 52 is configured to input the first rewritten sentence and the original text into a large model, and output a candidate original text sentence corresponding to the first rewritten sentence in the original text; wherein the first rewritten sentence is any rewritten sentence in the rewriting result;

[0225] A mapping module 53 is configured to determine a target original sentence to be mapped to the first rewritten sentence from the original text according to a target position of the candidate original sentence in the original text;

[0226] The comparison module 54 is configured to perform text comparison processing on the first rewritten sentence and its mapped target original sentence, and output a text comparison result.

[0227] In a possible implementation, the mapping module 53 includes:

[0228] a mapping relationship determination unit, configured to determine whether a mapping relationship between the first rewritten sentence and the candidate original sentence is accurate based on a target position of the candidate original sentence in the original text;

[0229] The target original sentence determining unit is configured to determine the candidate original sentence as the target original sentence for mapping the first rewritten sentence if, based on the target position of the candidate original sentence in the original text, the mapping relationship between the first rewritten sentence and the candidate original sentence is accurate; and to determine the target original sentence for mapping the first rewritten sentence from the original text according to a preset fallback rule if, based on the target position of the candidate original sentence in the original text, the mapping relationship between the first rewritten sentence and the candidate original sentence is abnormal.

[0230] In a possible implementation, the device further includes:

[0231] The target position determination module is configured to determine the target position of the candidate original sentence in the original text by:

[0232] When the candidate original sentence appears only once in the original text, determining the position of the candidate original sentence in the original text as the target position of the candidate original sentence in the original text;

[0233] In the case where the candidate original sentence appears multiple times in the original text, one occurrence position of the candidate original sentence in the original text is determined as the target position of the candidate original sentence in the original text.

[0234] In a possible implementation, the target location determination module includes:

[0235] a position difference determining unit, configured to determine a difference value between a relative position parameter of the first rewritten sentence in the rewritten result and a relative position parameter of each of the occurrence positions in the original text;

[0236] The first position selection unit is configured to select the occurrence position with the smallest difference value and determine it as the target position of the candidate original sentence in the original text.

[0237] In a possible implementation, the target location determination module includes:

[0238] A context acquisition unit, configured to acquire the original context of the candidate original sentence at each of the occurrence positions;

[0239] a semantic similarity determination unit, configured to determine a semantic similarity between a rewritten context of the first rewritten sentence in the rewritten result and each of the original text contexts;

[0240] The second position selection unit is configured to select the corresponding occurrence position with the highest semantic similarity and determine it as the target position of the candidate original sentence in the original text.

[0241] In a possible implementation, the mapping relationship determination unit is specifically configured to:

[0242] If any of the following conditions is determined to be satisfied based on the target position of the candidate original sentence in the original text, the mapping relationship between the first rewritten sentence and the candidate original sentence is determined to be abnormal; otherwise, the mapping relationship between the first rewritten sentence and the candidate original sentence is determined to be correct:

[0243] The candidate original sentence corresponding to the first rewritten sentence is located before the candidate original sentence corresponding to the second rewritten sentence; wherein the second rewritten sentence is the previous rewritten sentence of the first rewritten sentence in the rewriting result;

[0244] The candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence are not continuous in the original text;

[0245] The first rewritten sentence is the first rewritten sentence in the rewriting result, and the candidate original sentence corresponding to the first rewritten sentence is not the first original sentence in the original text.

[0246] In one possible implementation, the target original sentence determination unit is specifically configured to:

[0247] If it is determined according to the target position that the candidate original sentence corresponding to the first rewritten sentence is located before the candidate original sentence corresponding to the second rewritten sentence, determining the candidate original sentence corresponding to the second rewritten sentence as the target original sentence for mapping the first rewritten sentence;

[0248] Alternatively, when it is determined based on the target position that the candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence are not continuous in the original text, the original sentence between the candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence is determined as the target original sentence for the first rewritten sentence mapping;

[0249] Alternatively, when the first rewritten sentence is the first rewritten sentence in the rewriting result, and it is determined based on the target position that the candidate original sentence corresponding to the first rewritten sentence is not the first original sentence in the original text, the candidate original sentence corresponding to the first rewritten sentence and the original sentence before it are determined as the target original sentences for mapping the first rewritten sentence.

[0250] In a possible implementation, the model processing module 52 is specifically configured to:

[0251] Inputting the first rewritten sentence, context information of the first rewritten sentence, and the original text into the large model, and outputting a candidate original text sentence corresponding to the first rewritten sentence in the original text;

[0252] The context information of the first rewritten sentence includes at least: a second rewritten sentence and a target original sentence mapped by the second rewritten sentence, and the position of the candidate original sentence in the original text is constrained to be after the target original sentence mapped by the second rewritten sentence, and the second rewritten sentence is the previous rewritten sentence of the first rewritten sentence in the rewriting result.

[0253] In a possible implementation, the device further includes:

[0254] A search range determination module is configured to determine a search range corresponding to the first rewritten sentence in the original text according to a relative position parameter of the first rewritten sentence in the rewritten result before inputting the first rewritten sentence and the original text into the large model;

[0255] The model processing module is configured to use the search range as the original text corresponding to the first rewritten sentence and execute the step of inputting the first rewritten sentence and the original text into the large model.

[0256] In a possible implementation, the search range determination module includes:

[0257] a positioning unit, configured to determine a reference position in the original text according to a relative position parameter of the first rewritten sentence in the rewritten result;

[0258] The range defining unit is configured to intercept a character interval of a preset length in the original text with the reference position as the center as a search range corresponding to the first rewritten sentence in the original text.

[0259] In a possible implementation, the search range determination module is further configured to:

[0260] If a candidate original sentence corresponding to the first rewritten sentence is not located within the search scope, the search scope corresponding to the first rewritten sentence is gradually expanded until the search scope corresponding to the first rewritten sentence covers the entire text of the original text, or a candidate original sentence corresponding to the first rewritten sentence is located within the search scope.

[0261] like Figure 6As shown, an embodiment of the present application provides an electronic device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0262] Memory 113, for storing computer programs;

[0263] In one embodiment of the present application, the processor 111 is configured to implement the content rewriting method provided by any of the aforementioned method embodiments when executing a program stored in the memory 113, including:

[0264] Get the rewriting result of the original text;

[0265] Inputting the first rewritten sentence and the original text into the large model, and outputting a candidate original text sentence corresponding to the first rewritten sentence in the original text; wherein the first rewritten sentence is any rewritten sentence in the rewriting result;

[0266] determining, from the original text, a target original sentence mapped to the first rewritten sentence according to a target position of the candidate original sentence in the original text;

[0267] A text comparison process is performed on the first rewritten sentence and its mapped target original sentence, and a text comparison result is output.

[0268] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the content rewriting method provided in any of the aforementioned method embodiments are implemented.

[0269] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0270] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a general hardware platform, or of course, by hardware. Based on this understanding, the above technical solution, in essence, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiment.

[0271] It should be understood that the terms used herein are for the purpose of describing specific example embodiments only and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "comprise", "include", "contain" and "have" are inclusive and therefore specify the presence of stated features, steps, operations, elements and / or parts, but do not exclude the presence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not to be construed as necessarily requiring them to be performed in the specific order described or illustrated, unless the order of execution is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0272] The foregoing is merely a list of specific embodiments of the present application, intended to enable those skilled in the art to understand or implement the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the broadest scope consistent with the principles and novel features of the present application.

Claims

1. A content rewriting method, characterized in that: The method comprises: Get the rewriting result of the original text; Inputting the first rewritten sentence and the original text into the large model, and outputting a candidate original text sentence corresponding to the first rewritten sentence in the original text; wherein the first rewritten sentence is any rewritten sentence in the rewriting result; determining, from the original text, a target original sentence mapped to the first rewritten sentence according to a target position of the candidate original sentence in the original text; A text comparison process is performed on the first rewritten sentence and its mapped target original sentence, and a text comparison result is output.

2. The method according to claim 1, characterized in that The step of determining, from the original text, a target original sentence mapped to the first rewritten sentence based on the target position of the candidate original sentence in the original text includes: determining whether a mapping relationship between the first rewritten sentence and the candidate original sentence is accurate according to a target position of the candidate original sentence in the original text; If the mapping relationship between the first rewritten sentence and the candidate original sentence is determined to be accurate based on the target position of the candidate original sentence in the original text, the candidate original sentence is determined to be the target original sentence for the first rewritten sentence to be mapped; if the mapping relationship between the first rewritten sentence and the candidate original sentence is determined to be abnormal based on the target position of the candidate original sentence in the original text, the target original sentence for the first rewritten sentence to be mapped is determined from the original text according to a preset fallback rule.

3. The method according to claim 1 or 2, characterized in that The target position of the candidate original sentence in the original text is determined by: When the candidate original sentence appears only once in the original text, determining the position of the candidate original sentence in the original text as the target position of the candidate original sentence in the original text; In the case where the candidate original sentence appears multiple times in the original text, one occurrence position of the candidate original sentence in the original text is determined as the target position of the candidate original sentence in the original text.

4. The method according to claim 3, characterized in that The step of determining one occurrence position of the candidate original sentence from all occurrence positions of the candidate original sentence in the original text as a target position of the candidate original sentence in the original text includes: determining a difference between a relative position parameter of the first rewritten sentence in the rewritten result and a relative position parameter of each of the occurrence positions in the original text; The occurrence position with the smallest difference value is selected and determined as the target position of the candidate original sentence in the original text.

5. The method according to claim 3, characterized in that The step of determining one occurrence position of the candidate original sentence from all occurrence positions of the candidate original sentence in the original text as a target position of the candidate original sentence in the original text includes: Obtaining the original context of the candidate original sentence at each of the occurrence positions; determining semantic similarities between a rewritten context of the first rewritten sentence in the rewritten result and each of the original contexts; The occurrence position with the highest corresponding semantic similarity is selected and determined as the target position of the candidate original sentence in the original text.

6. The method according to claim 2, characterized in that The determining, based on the target position of the candidate original sentence in the original text, whether the mapping relationship between the first rewritten sentence and the candidate original sentence is accurate includes: If any of the following conditions is determined to be satisfied based on the target position of the candidate original sentence in the original text, the mapping relationship between the first rewritten sentence and the candidate original sentence is determined to be abnormal; otherwise, the mapping relationship between the first rewritten sentence and the candidate original sentence is determined to be correct: The candidate original sentence corresponding to the first rewritten sentence is located before the candidate original sentence corresponding to the second rewritten sentence; wherein the second rewritten sentence is the previous rewritten sentence of the first rewritten sentence in the rewriting result; The candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence are not continuous in the original text; The first rewritten sentence is the first rewritten sentence in the rewriting result, and the candidate original sentence corresponding to the first rewritten sentence is not the first original sentence in the original text.

7. The method according to claim 6, characterized in that The determining the target original sentence for the first rewritten sentence mapping from the original text according to a preset catch-all rule includes: If it is determined according to the target position that the candidate original sentence corresponding to the first rewritten sentence is located before the candidate original sentence corresponding to the second rewritten sentence, determining the candidate original sentence corresponding to the second rewritten sentence as the target original sentence for mapping the first rewritten sentence; Alternatively, when it is determined based on the target position that the candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence are not continuous in the original text, the original sentence between the candidate original sentence corresponding to the first rewritten sentence and the candidate original sentence corresponding to the second rewritten sentence is determined as the target original sentence for the first rewritten sentence mapping; Alternatively, when the first rewritten sentence is the first rewritten sentence in the rewriting result, and it is determined based on the target position that the candidate original sentence corresponding to the first rewritten sentence is not the first original sentence in the original text, the candidate original sentence corresponding to the first rewritten sentence and the original sentence before it are determined as the target original sentences for mapping the first rewritten sentence.

8. The method according to claim 1, characterized in that Inputting the first rewritten sentence and the original text into the large model and outputting candidate original text sentences corresponding to the first rewritten sentence in the original text includes: Inputting the first rewritten sentence, context information of the first rewritten sentence, and the original text into the large model, and outputting a candidate original text sentence corresponding to the first rewritten sentence in the original text; The context information of the first rewritten sentence includes at least: a second rewritten sentence and a target original sentence mapped by the second rewritten sentence, and the position of the candidate original sentence in the original text is constrained to be after the target original sentence mapped by the second rewritten sentence, and the second rewritten sentence is the previous rewritten sentence of the first rewritten sentence in the rewriting result.

9. The method according to claim 1, characterized in that Inputting the first rewritten sentence and the original text into the large model and outputting candidate original text sentences corresponding to the first rewritten sentence in the original text includes: Inputting the first rewritten sentence, the original text, a preset multi-level decision rule, and corresponding examples into the macro model; wherein the multi-level decision rule defines the priority determination logic of the candidate original text sentences; Based on the multi-level decision rules and corresponding examples, the large model outputs a candidate original sentence corresponding to the first rewritten sentence in the original text.

10. The method according to claim 1, characterized in that Before inputting the first rewritten sentence and the original text into the large model, the method further includes: determining a search range corresponding to the first rewritten sentence in the original text according to a relative position parameter of the first rewritten sentence in the rewritten result; The search range is used as the original text corresponding to the first rewritten sentence, and the steps of inputting the first rewritten sentence and the original text into the large model and subsequent steps are performed.

11. The method according to claim 10, characterized in that The determining, based on the relative position parameter of the first rewritten sentence in the rewritten result, a search range corresponding to the first rewritten sentence in the original text includes: determining a reference position in the original text according to a relative position parameter of the first rewritten sentence in the rewritten result; In the original text, a character interval of a preset length is cut off with the reference position as the center as a search range corresponding to the first rewritten sentence in the original text.

12. The method according to claim 11, characterized in that The method further comprises: If a candidate original sentence corresponding to the first rewritten sentence is not located within the search scope, the search scope corresponding to the first rewritten sentence is gradually expanded until the search scope corresponding to the first rewritten sentence covers the entire text of the original text, or a candidate original sentence corresponding to the first rewritten sentence is located within the search scope.

13. A content rewriting device, characterized in that: The device comprises: Rewriting module, used to obtain the rewriting results of the original text; a model processing module, configured to input the first rewritten sentence and the original text into a large model, and output a candidate original text sentence corresponding to the first rewritten sentence in the original text; wherein the first rewritten sentence is any rewritten sentence in the rewriting result; a mapping module, configured to determine, from the original text, a target original sentence to be mapped to the first rewritten sentence based on a target position of the candidate original sentence in the original text; The comparison module is configured to perform text comparison processing on the first rewritten sentence and its mapped target original sentence, and output a text comparison result.

14. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is configured to execute a content rewriting program stored in the memory to implement the content rewriting method according to any one of claims 1 to 12.

15. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the content rewriting method according to any one of claims 1 to 12.