# US 2025/0053725 A1 · Method and apparatus for rewriting narrative text, device, and medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0053725 A1
- Document ID: US20250053725A1
- Status: Published application
- Kind: A1
- Application number: 18/711,768
- Filed: 2022-11-16
- Published: 2025-02-13
- Earliest claimed: 2021-11-19
- Assignees: Beijing Youzhuju Network Technology Co., Ltd.; Fudan University
- Applicants: Beijing Youzhuju Network Technology Co., Ltd.; Fudan University
- Inventors: Hao Zhou; Jiangjie Chen; Chun Gan; Sijie Cheng; Yanghua Xiao; Lei Li
- Web page: https://patentgrep.com/patent/US20250053725A1

## CPC

- G06F 40/166: Editing, e.g. inserting or deleting
- G06F 40/197: Version control (for software G06F8/71)
- G06F 40/253: Grammatical analysis; Style critique
- G06F 40/30: Semantic analysis
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

According to embodiments of the present disclosure, a method and apparatus for rewriting a narrative text, a device, and a medium are provided. The method includes determining a change to a sentence in a narrative text. An initial context of the sentence before the change is different from a target context of a changed sentence. The method further includes performing, based on inconsistency between a text part after the sentence in the narrative text and the target context, at least one edit operation on the text part to generate at least one edited version of the text part. The method further includes replacing the text part with an edited version in the at least one edited version to obtain a rewritten narrative text. In this way, the narrative text can be rewritten with a small number of edits while ensuring contextual coherence.

## Claims

### Claim 1

A method for rewriting a narrative text, the method comprising:
determining a change to a sentence in the narrative text, wherein an initial context of the sentence before the change is different from a target context of a changed sentence;
performing, based on inconsistency between a text part after the sentence in the narrative text and the target context, at least one edit operation on the text part to generate at least one edited version of the text part; and
replacing the text part with an edited version in the at least one edited version to obtain a rewritten narrative text.

### Claim 2 (depends on 1)

The method according to claim 1, wherein performing the at least one edit operation on the text part to generate the at least one edited version comprises iteratively performing the following operations:
determining a causal conflict degree between each of a plurality of text elements in the text part and the target context;
selecting a target text element from the plurality of text elements based on the conflict degree of each of the plurality of text elements, the conflict degree of the target text element being higher than that of a text element not selected from the plurality of text elements; and
performing a candidate edit operation on the target text element to generate one of the at least one edited version.

### Claim 3 (depends on 2)

The method according to claim 2, wherein determining the conflict degree of each of the plurality of text elements comprises:
for a corresponding text element in the plurality of text elements,
determining a first correlation between the corresponding text element and the target context and a second correlation between the corresponding text element and the initial context using a language model; and
determining the conflict degree of the corresponding text element based on the first correlation and the second correlation.

### Claim 4 (depends on 2)

The method according to claim 2, wherein generating one of the at least one edited version comprises:
determining, based on a correlation between a candidate edited version of the text part and the target context and a correlation between the candidate edited version and the initial context, a causal contextual coherence score of the candidate edited version, the candidate edited version being generated by performing the candidate edit operation on the target text element;
determining an acceptance rate of the candidate edited version at least based on the contextual coherence score, the acceptance rate indicating a probability that the candidate edited version is accepted; and
if the acceptance rate exceeds a threshold acceptance rate, determining the candidate edited version as one of the at least one edited version.

### Claim 5 (depends on 4)

The method according to claim 4, wherein determining the acceptance rate of the candidate edited version comprises:
determining a language fluency score of the candidate edited version based on a probability of occurrence of each text element in the candidate edited version in the target context;
determining a transformation probability of generating the candidate edited version based on the text part; and
determining the acceptance rate based on the contextual coherence score, the language fluency score, and the transformation probability.

### Claim 6 (depends on 1)

The method according to claim 1, wherein replacing the text part with the edited version in the at least one edited version to obtain the rewritten narrative text comprises:
determining a causal contextual coherence score of each of the at least one edited version based on a correlation between each of the at least one edited version and the target context and a correlation between each of the at least one edited version and the initial context;
determining an attribute of each of the at least one edited version that is proportional to the contextual coherence score;
selecting a target version from the at least one edited version based on the attribute of each of the at least one edited version, the attribute of the target version being better than that of a version not selected from the at least one edited version; and
replacing the text part with the target version to obtain the rewritten narrative text.

### Claim 7 (depends on 6)

The method according to claim 6, further comprising:
determining a language fluency score of each of the at least one edited version based on a probability of occurrence of each text element in the at least one edited version in the target context,
wherein the attribute of each of the at least one edited version is also proportional to the language fluency score.

### Claim 8

An electronic device, comprising:
at least one processing unit; and
at least one memory, wherein the at least one memory is coupled to the at least one processing unit, and stores instructions executable by the at least one processing unit, and the instructions, when executed by the at least one processing unit, cause the electronic device to perform the following actions:
determining a change to a sentence in a narrative text, wherein an initial context of the sentence before the change is different from a target context of a changed sentence;
performing, based on inconsistency between a text part after the sentence in the narrative text and the target context, at least one edit operation on the text part to generate at least one edited version of the text part; and
replacing the text part with an edited version in the at least one edited version to obtain a rewritten narrative text.

### Claim 9 (depends on 8)

The electronic device according to claim 8, wherein performing the at least one edit operation on the text part to generate the at least one edited version comprises iteratively performing the following operations:
determining a causal conflict degree between each of a plurality of text elements in the text part and the target context;
selecting a target text element from the plurality of text elements based on the conflict degree of each of the plurality of text elements, the conflict degree of the target text element being higher than that of a text element not selected from the plurality of text elements; and
performing a candidate edit operation on the target text element to generate one of the at least one edited version.

### Claim 10 (depends on 9)

The electronic device according to claim 9, wherein determining the conflict degree of each of the plurality of text elements comprises:
for a corresponding text element in the plurality of text elements,
determining a first correlation between the corresponding text element and the target context and a second correlation between the corresponding text element and the initial context using a language model; and
determining the conflict degree of the corresponding text element based on the first correlation and the second correlation.

### Claim 11 (depends on 9)

The electronic device according to claim 9, wherein generating one of the at least one edited version comprises:
determining, based on a correlation between a candidate edited version of the text part and the target context and a correlation between the candidate edited version and the initial context, a causal contextual coherence score of the candidate edited version, the candidate edited version being generated by performing the candidate edit operation on the target text element;
determining an acceptance rate of the candidate edited version at least based on the contextual coherence score, the acceptance rate indicating a probability that the candidate edited version is accepted; and
if the acceptance rate exceeds a threshold acceptance rate, determining the candidate edited version as one of the at least one edited version.

### Claim 12 (depends on 11)

The electronic device according to claim 11, wherein determining the acceptance rate of the candidate edited version comprises:
determining a language fluency score of the candidate edited version based on a probability of occurrence of each text element in the candidate edited version in the target context;
determining a transformation probability of generating the candidate edited version based on the text part; and
determining the acceptance rate based on the contextual coherence score, the language fluency score, and the transformation probability.

### Claim 13 (depends on 8)

The electronic device according to claim 8, wherein replacing the text part with the edited version in the at least one edited version to obtain the rewritten narrative text comprises:
determining a causal contextual coherence score of each of the at least one edited version based on a correlation between each of the at least one edited version and the target context and a correlation between each of the at least one edited version and the initial context;
determining an attribute of each of the at least one edited version that is proportional to the contextual coherence score;
selecting a target version from the at least one edited version based on the attribute of each of the at least one edited version, the attribute of the target version being better than that of a version not selected from the at least one edited version; and
replacing the text part with the target version to obtain the rewritten narrative text.

### Claim 14 (depends on 13)

The electronic device according to claim 13, wherein the actions further comprise:
determining a language fluency score of each of the at least one edited version based on a probability of occurrence of each text element in the at least one edited version in the target context,
wherein the attribute of each of the at least one edited version is also proportional to the language fluency score.

### Claim 15

(canceled)

### Claim 16

A non-transitory computer-readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, causes a method for rewriting a narrative text to be implemented, the method comprising:
determining a change to a sentence in the narrative text, wherein an initial context of the sentence before the change is different from a target context of a changed sentence:
performing, based on inconsistency between a text part after the sentence in the narrative text and the target context, at least one edit operation on the text part to generate at least one edited version of the text part; and
replacing the text part with an edited version in the at least one edited version to obtain a rewritten narrative text.

### Claim 17 (depends on 16)

The non-transitory computer-readable storage medium according to claim 16, wherein performing the at least one edit operation on the text part to generate the at least one edited version comprises iteratively performing the following operations:
determining a causal conflict degree between each of a plurality of text elements in the text part and the target context;
selecting a target text element from the plurality of text elements based on the conflict degree of each of the plurality of text elements, the conflict degree of the target text element being higher than that of a text element not selected from the plurality of text elements; and
performing a candidate edit operation on the target text element to generate one of the at least one edited version.

### Claim 18 (depends on 17)

The non-transitory computer-readable storage medium according to claim 17, wherein determining the conflict degree of each of the plurality of text elements comprises:
for a corresponding text element in the plurality of text elements,
determining a first correlation between the corresponding text element and the target context and a second correlation between the corresponding text element and the initial context using a language model; and
determining the conflict degree of the corresponding text element based on the first correlation and the second correlation.

### Claim 19 (depends on 17)

The non-transitory computer-readable storage medium according to claim 17, wherein generating one of the at least one edited version comprises:
determining, based on a correlation between a candidate edited version of the text part and the target context and a correlation between the candidate edited version and the initial context, a causal contextual coherence score of the candidate edited version, the candidate edited version being generated by performing the candidate edit operation on the target text element;
determining an acceptance rate of the candidate edited version at least based on the contextual coherence score, the acceptance rate indicating a probability that the candidate edited version is accepted; and
if the acceptance rate exceeds a threshold acceptance rate, determining the candidate edited version as one of the at least one edited version.

### Claim 20 (depends on 19)

The non-transitory computer-readable storage medium according to claim 19, wherein determining the acceptance rate of the candidate edited version comprises:
determining a language fluency score of the candidate edited version based on a probability of occurrence of each text element in the candidate edited version in the target context;
determining a transformation probability of generating the candidate edited version based on the text part; and
determining the acceptance rate based on the contextual coherence score, the language fluency score, and the transformation probability.

### Claim 21 (depends on 16)

The non-transitory computer-readable storage medium according to claim 16, wherein replacing the text part with the edited version in the at least one edited version to obtain the rewritten narrative text comprises:
determining a causal contextual coherence score of each of the at least one edited version based on a correlation between each of the at least one edited version and the target context and a correlation between each of the at least one edited version and the initial context;
determining an attribute of each of the at least one edited version that is proportional to the contextual coherence score;
selecting a target version from the at least one edited version based on the attribute of each of the at least one edited version, the attribute of the target version being better than that of a version not selected from the at least one edited version; and
replacing the text part with the target version to obtain the rewritten narrative text.
