Novel Generation Method, Device, Electronic Device and Medium Based on Reverse Prompt Words
By constructing reverse prompt words and generating relationship chains, the N-level outline and text of the novel are updated using a large language model, the problems of logical consistency and plot consistency of the whole text after the novel is modified are solved, and dynamic memory and synchronization of the modification are achieved.
Patent Information
- Application Number
- CN202510763946.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-06-10
AI Technical Summary
The prior art is difficult to ensure the logical consistency and plot consistency of the full text after the novel is modified, especially when the user revises the text of a certain chapter, it is difficult to discover conflicts in a timely and comprehensive manner and handle them simultaneously.
By constructing reverse prompt words and using large language models, the N-level outline and text of the novel are generated to form a generative relationship chain, the target object is determined step by step and the content is updated until it is traced back to the text level, ensuring that all text content does not conflict.
The dynamic memory of the novel after the modification is realized, the logical consistency and plot consistency of the whole text are ensured, and the modifications are synchronized to all relevant chapters.
Smart Images

Figure CN120277225B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a novel generation method, device, electronic device and medium based on reverse prompt words. Background Art
[0002] With the continuous development of artificial intelligence (AI), AI-based novel generation technology is gradually emerging. It can help people improve writing efficiency, and therefore the importance of this technology is becoming increasingly prominent. Current methods for using AI to generate novels mainly involve gradually generating a multi-level outline, and then generating the corresponding multiple chapters of text based on the final level of the outline. After the text is generated, users often need to modify the text to make the novel meet their personalized creative needs. The entire novel must maintain logical consistency and plot coherence. If users modify the text of one or more chapters, the plot and logic of that part may conflict with the text of other chapters.
[0003] Currently, in this situation, users often rely on memory to check other texts that may conflict, and then manually modify them. However, for longer novels with many chapters in the main text, it is often difficult to promptly and comprehensively identify which content in the main text conflicts with the modified content. In addition, there are currently algorithms for consistency. For example, if a character's attributes are modified, subsequent content involving that character will inherit the modified attributes. However, this algorithm only targets a specific part and cannot maintain consistency and coherence as a whole. Moreover, such algorithms often directly modify basic settings or outlines, and then generate new text content based on the modified outline. However, it is difficult to directly synchronize modifications made to the generated text to other texts.
[0004] Therefore, the current method of generating novels through artificial intelligence has technical problems such as difficulty in ensuring the logical consistency and plot coherence of the entire text after the main text is modified, and needs to be improved. Summary of the Invention
[0005] The embodiments of the present application provide a novel generation method, device, electronic device and medium based on reverse prompt words, which are used to alleviate the technical problem that it is difficult to ensure the logical consistency and plot coherence of the entire novel after the main text is modified.
[0006] To solve the above technical problems, the embodiments of the present application provide the following technical solutions:
[0007] The present application provides a novel generation method based on reverse prompt words, wherein the novel includes N-level outlines, each upper-level outline generates at least two lower-level outlines, and each N-level outline generates a corresponding text, where N is an integer not less than 1. The method includes:
[0008] In response to the modification operation on the first target text, the initial content of the first target text is updated to obtain the updated content of the first target text;
[0009] Constructing reverse prompt words based on the updated content of the first target text, and processing the reverse prompt words through a large language model to obtain a summary of the updated content of the first target text;
[0010] Obtaining a generative relationship chain formed by each level of outline and each body text, wherein two objects having a generative relationship in the generative relationship chain are associated with each other, determining a target object for generating the first target body text from the generative relationship chain, and updating the initial content of the target object based on the summarized content to obtain updated content of the target object;
[0011] Determining associated objects of the target object from the generated relationship chain, and determining whether initial content of the associated objects conflicts with updated content of the target object using the large language model;
[0012] If yes, updating the initial content of the associated object using the large language model to obtain updated content of the associated object, where the updated content of the associated object does not conflict with the updated content of the target object;
[0013] The associated object is updated to the target object, and the following steps are repeated: determining the associated object of the target object from the generated relationship chain; determining whether there is a conflict between the initial content of the associated object and the updated content of the target object through the large language model; updating the initial content of the associated object through the large language model to obtain the updated content of the associated object when the judgment result is yes; and updating the associated object to the target object, until the target object is the second target text.
[0014] At the same time, an embodiment of the present application also provides a novel generation device based on reverse prompt words, wherein the novel includes N-level outlines, each upper-level outline generates at least two lower-level outlines, and each N-level outline generates a corresponding text, where N is an integer not less than 1. The device includes:
[0015] a response module, configured to update the initial content of the first target text in response to the modification operation on the first target text, and obtain updated content of the first target text;
[0016] a first obtaining module, configured to construct reverse prompt words according to the updated content of the first target text, and process the reverse prompt words through a large language model to obtain a summary of the updated content of the first target text;
[0017] a second obtaining module configured to obtain a generative relationship chain formed by each level of outline and each body text, wherein two objects having a generative relationship in the generative relationship chain are associated with each other, determine a target object for generating the first target body text from the generative relationship chain, and update the initial content of the target object based on the summarized content to obtain the updated content of the target object;
[0018] a conflict judgment module, configured to determine associated objects of the target object from the generated relationship chain, and to judge whether there is a conflict between the initial content of the associated objects and the updated content of the target object using the large language model;
[0019] a third obtaining module, configured to, if yes, update the initial content of the associated object using the large language model to obtain updated content of the associated object, where the updated content of the associated object does not conflict with the updated content of the target object;
[0020] A loop module is configured to update the associated object to the target object and cyclically execute the following operations: determining the associated object of the target object from the generated relationship chain; determining whether there is a conflict between the initial content of the associated object and the updated content of the target object using the large language model; updating the initial content of the associated object using the large language model to obtain the updated content of the associated object when the judgment result is yes; and updating the associated object to the target object, until the target object is the second target text.
[0021] The present application also provides an electronic device comprising a memory and a processor; the memory stores an application, and the processor is used to run the application in the memory to execute the steps in any one of the above-described novel generation methods.
[0022] An embodiment of the present application provides a computer-readable storage medium, which stores multiple instructions, and the instructions are suitable for a processor to load to execute the steps in the above-mentioned novel generation method.
[0023] Beneficial effects: The present application provides a novel generation method, device, electronic device and medium based on reverse prompt words, wherein the novel includes N-level outlines, each upper-level outline generates at least two lower-level outlines, and each N-level outline generates a corresponding text. After modifying the first target text, the method uses the updated content of the first target text to construct reverse prompt words and inputs the reverse prompt words into a large language model to obtain the summary content of the updated content of the first target text, and then determines the target object for generating the first target text from the generation relationship chain formed by the outlines at all levels and the texts, that is, a certain N-level outline, updates the initial content of the target object based on the summary content, and obtains the updated content of the target object; then determines the associated object of the target object from the generation relationship chain, that is, a certain An N-1-level outline is provided. If the initial content of the associated object conflicts with the updated content of the target object, the initial content of the associated object is updated to obtain the updated content of the associated object so that it does not conflict with the updated content of the target object, and then the associated object is updated to the target object. Finally, the above-mentioned operations of determining the associated object, judging the conflict between the associated object and the target object, updating the associated object to obtain the updated content when the judgment result is yes, and updating the associated object to the target object are executed in a loop until the target object is the second target text, the initial content of the second target text conflicts with the updated content of the first target text, and after the above steps, the updated content of the second target text does not conflict with the updated content of the first target text. After the first target text is modified, this application can summarize the updated content of the modified first target text by constructing reverse prompt words and inputting a large language model, and use the summarized content to update the N-th level outline for generating the first target text. The updated content of the N-th level outline can then reflect the overall modification of the first target text. By generating a relationship chain, the associated objects of the N-th level outline can be determined step by step, and conflict judgment and update are performed on each associated object until it is traced back to the text level, thereby synchronizing the overall modification of the first target text to the second target text, so that all texts do not conflict with the updated content of the first target text, thereby ensuring the logical consistency and plot coherence of the entire novel text and realizing dynamic memory of the modification. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The following detailed description of the specific embodiments of the present application in conjunction with the accompanying drawings will make the technical solutions and other beneficial effects of the present application apparent.
[0025] Figure 1 A schematic diagram of a scenario of a novel generation method based on reverse prompt words provided in an embodiment of the present application.
[0026] Figure 2 This is a schematic diagram of the generation relationship of the novel in the embodiment of this application.
[0027] Figure 3This is a flow chart of the novel generation method based on reverse prompt words provided in the embodiments of the present application.
[0028] Figure 4 This is a first schematic diagram of a novel generation page in an embodiment of the present application.
[0029] Figure 5 This is a second schematic diagram of a novel generation page in an embodiment of the present application.
[0030] Figure 6 This is a third schematic diagram of a novel generation page in an embodiment of the present application.
[0031] Figure 7 This is a fourth schematic diagram of a novel generation page in an embodiment of the present application.
[0032] Figure 8 This is a structural diagram of the novel generation setting based on reverse prompt words provided in an embodiment of the present application.
[0033] Figure 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0034] Description of reference numerals:
[0035] Generating device 11; large language model 12; response module 10; first obtaining module 20; second obtaining module 30; conflict judgment module 40; third obtaining module 50; loop module 60; radio frequency circuit 101; memory 102; input unit 103; display unit 104; sensor 105; audio circuit 106; WiFi module 107; processor 108. DETAILED DESCRIPTION
[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the embodiments described are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0037] See also Figure 1 , Figure 1A schematic diagram of a scenario for applying the novel generation method based on reverse prompt words provided in an embodiment of the present application is provided. The scenario includes a generation device 11 and a large language model 12. A novel generation application / website runs in the generation device 11. The user issues instructions to generate N-level outlines and texts in the relevant interface of the novel generation application / website. The generation device 11 responds to each instruction, constructs various prompt words, and calls the large language model 12 to process the prompt words. After processing, the generated N-level outlines and texts are returned in sequence, and finally the entire novel is obtained and displayed in the generation device 11.
[0038] After the novel is generated, the user performs a modification operation on the first target text in the relevant interface of the novel generation application / website. In response to this operation, the generation device 11 updates the first target text, obtains the updated content of the first target text, and constructs a reverse prompt word based on the updated content and sends it to the large language model 12, so that the large language model 12 summarizes the updated content to generate summarized content. The summarized content is then used to update the target object that generated the first target text, obtaining the updated content. A generation relationship chain is pre-set in the novel generation application / website, which records the generation relationship between each level of outline and each text. After the target object is updated, the generation relationship chain is used to determine the associated objects with the target object. It is determined whether the initial content of the associated object conflicts with the updated content of the target object. If there is a conflict, the initial content of the associated object is updated to the updated content, and the associated object is determined as the target object. The associated objects of the target object are then determined again based on the generation relationship chain. The above steps are repeated until the target object becomes the second target text, that is, traced back to the text level, thereby synchronizing the entire modification of the first target text to the second target text.
[0039] By setting reverse prompt words and generating relationship chains, all texts are made to be consistent with the updated content, thereby ensuring the logical consistency and plot coherence of the entire novel text and achieving dynamic memory of the modifications. In the following embodiments, the above novel generation process will be described in detail.
[0040] See also Figure 2 , Figure 2This is a schematic diagram of the generation relationship of the novel in the embodiment of the present application. The novel includes N-level outlines, each upper-level outline generates at least two lower-level outlines, and each N-th-level outline generates a corresponding text, where N is an integer not less than 1. After a certain upper-level outline is generated, a prompt word is constructed based on the upper-level outline and sent to the large language model. After processing, the large language model generates and returns the specific content of the corresponding lower-level outline. After generating a certain N-th-level outline, a prompt word is also constructed based on the outline and sent to the large language model. After processing, the large language model generates and returns the specific content of the corresponding text. Since each upper-level outline generates at least two lower-level outlines, and each lowest-level outline generates a corresponding text, the same first-level outline will extend to at least two chapters of text.
[0041] Figure 2 Taking N = 2 as an example, the novel includes 2 levels of outlines, the first level outline is the part outline, and the second level outline is the chapter outline. The part outline includes 10, Figure 2 The sections are represented by Parts 1 to 10 in the novel. Part outlines are generated based on the novel's basic settings. Each part outline generates 10 chapter outlines. In the order of generation, Part 1 generates Chapter Outlines 1 to 10, Part 2 generates Chapter Outlines 11 to 20, and so on. Each chapter outline generates a corresponding chapter. In the order of generation, Chapter 1 generates Chapter 1, Chapter 2 generates Chapter 2, and so on.
[0042] According to the above generation relationship, a generation relationship chain of outlines at all levels and texts can be established. The top to the bottom in the generation relationship chain are the first-level outline, the second-level outline, ..., the Nth-level outline, and the texts of each chapter, and the levels of the first-level outline to the Nth-level outline decrease in sequence. The objects in the generation relationship chain include outlines and texts, where two objects with a generation relationship are related objects to each other. For example, the first part outline can generate the first to tenth chapter outlines, then the first part outline and any of the first to tenth chapter outlines are related objects to each other. The first chapter outline can generate the first chapter text, then the first chapter outline and the first chapter text are related objects to each other.
[0043] When establishing a generation relationship chain, you can set a specific name for each object. In this embodiment, the names of the outlines of parts 1 to 10 are set as lp1 to lp10, the names of the outlines of chapters 1 to 100 are set as sp1 to sp100, and the names of the texts of chapters 1 to 100 are set as zn1 to zn100. When new content is generated for an object, the new content is stored at the specific name of the object for easy access.
[0044] See also Figure 3 , Figure 3The flowchart of the novel generation method based on reverse prompt words provided in the embodiment of the present application specifically includes:
[0045] S1: In response to a modification operation on a first target text, the initial content of the first target text is updated to obtain updated content of the first target text.
[0046] The first target text can be any chapter of all generated texts, and the generated content of the first target text is defined as the initial content. A user performs a modification operation on the display page of the first target text, and the generating device responds to the modification operation by updating the initial content, thereby obtaining the updated content and displaying it to the user.
[0047] For example, Figure 4 As shown, the novel generation page is used to display the currently generated outlines and corresponding texts at all levels. Figure 4 Specifically shown are the outline of Part 1, the outlines of Chapters 1 to 6 associated with the outline of Part 1, and the main text of Chapter 1 generated by the outline of Chapter 1. It should be noted that the main text of Chapter 1 may include 5 large paragraphs, each of which contains several small paragraphs. When the main text of Chapter 1 is generated according to the outline of Chapter 1, 5 paragraph outlines will be generated first, and then 5 large paragraphs corresponding to each paragraph outline will be generated, that is, there is a paragraph outline between the chapter outline and the main text of the chapter. However, since the paragraph outline can only be newly generated in the actual product, it does not participate in subsequent updates after generation. Its main function is to display it to the user for viewing. Therefore, in the following embodiments of this application, the chapter outline is still the lowest-level outline, and the paragraph outline is not included in the generation relationship chain.
[0048] like Figure 5 As shown, the user modifies the initial content "Main Text Plot" of the first target text in the main text of Chapter 1 on the novel generation page. Figure 5 Specifically, the "Main Text Plot" at the end is modified to "New Plot". After the modification, the generating device responds to the operation and can update the main text of Chapter 1, displaying the other "Main Text Plot" and the "New Plot" at the end as the updated content of Chapter 1 to the user.
[0049] S2: Constructing reverse prompt words according to the updated content of the first target text, and processing the reverse prompt words through a large language model to obtain a summary of the updated content of the first target text.
[0050] The large language model is a language model with a large parameter scale, which is designed to understand and generate human language. It is trained with a large amount of text data and can perform a wide range of tasks including text summarization, translation, analysis, generation, etc. In the embodiment of the present application, the prompt words that require further refinement of a certain content are defined as positive prompt words, and the prompt words that require summary and generalization of a certain content are defined as reverse prompt words. After obtaining the updated content of the first target text, a reverse prompt word is constructed, requiring the updated content of the first target text to be summarized and generalized, and the reverse prompt word is input into the large language model. After the large language model processes it, it returns the summary content of the updated content.
[0051] S3: Obtain a generation relationship chain formed by outlines at all levels and each text, where two objects with a generation relationship in the generation relationship chain are associated with each other, determine a target object for generating the first target text from the generation relationship chain, update the initial content of the target object based on the summarized content, and obtain the updated content of the target object.
[0052] The generation relationship chain for each outline has been set up in advance. In the generation relationship chain, two outlines with a generation relationship are mutually associated objects. A certain outline and a certain text with a generation relationship are also mutually associated objects. It should be noted that the generation relationship in the embodiments of this application only includes direct generation and does not include indirect generation. For example, if A generates B, and B generates C, then A and B have a generation relationship, B and C have a generation relationship, but A and C do not have a generation relationship.
[0053] After determining the first target text, the generation relationship chain can be searched to identify an Nth-level outline that generated the first target text and use it as the target object. Because the initial content of the first target text has been updated, the initial content of the target object will not completely match the initial content of the first target text and may contain plot or logical inconsistencies. In this case, the initial content of the target object needs to be updated based on the above summary content to obtain the updated content of the target object.
[0054] There are several ways to update the initial content of the target object.
[0055] In one embodiment, S3 specifically includes: overwriting the initial content of the target object with the summarized content to obtain updated content of the target object.
[0056] Generally speaking, the summarized content can meet the user's creative needs. Therefore, after obtaining the summarized content, it can be directly returned to the specific named location of the target object to overwrite the initial content of the target object, and then form the updated content of the target object.
[0057] For this direct coverage method, steps S2 and S3 can be completed as a whole. The content of the reverse prompt word in this process is as follows:
[0058] Please summarize the following {page} clearly and concisely into a summary {newsp}. The plot should be clearly presented and any rhetoric should be removed. Pay attention to the plot's beginning, development, climax, and ending, and clearly define the relationships between the characters and the locations of the scenes.
[0059] {page1}:
[0060] Please note when making modifications:
[0061] 1. Extract the core plot and key events from the text and ensure that the introduction covers the main story line. Avoid omitting important plot points or character behaviors.
[0062] 2. Delete all rhetorical devices such as modifying language, metaphors, exaggeration, etc., and retain factual descriptions.
[0063] 3. Organize the content in chronological or logical order to ensure that the storyline is coherent and easy to understand.
[0064] 4. Avoid subjective evaluations or emotional overtones, and state only the facts. The language style should be neutral, objective, and concise.
[0065] 5. Make sure the introduction can convey the core content of the story on its own without referring to the original text.
[0066] 6. The word count should be between 50-100 words. Output should be in JSON format.
[0067] Among them, {page} is the updated content of the first target text, and {newsp} is the updated content of the target object. The process of generating summary content and the process of overwriting the initial content with the summary content are background processing and invisible to users. Only the final updated content will be displayed on the front-end page.
[0068] Of course, the above is only one way of describing the prompt word. Those skilled in the art can adaptively set and modify the description content of the prompt word according to actual needs, as long as the large language model can be summarized and updated.
[0069] For example, Figure 5 As shown, after modifying the main text of Chapter 1, if you want to leave the current page, a pop-up window will be displayed, prompting the user "You have adjusted the main text content, do you want to synchronize the changes to the corresponding chapter outline?" If the user chooses to confirm synchronization, the background will automatically execute the above steps of building reverse prompt words, inputting reverse prompt words into the large language model, obtaining the summary content returned by the large language model, and overwriting the chapter outline with the summary content. During the update process, the page will be as follows Figure 6 As shown, after the update is completed, the page will be as follows Figure 7As shown, the initial content "AAA..." of the outline of Chapter 1 is updated to the updated content "GGG...".
[0070] In one embodiment, S3 specifically includes: in response to the modification operation on the summary content, updating the summary content to obtain updated summary content; overwriting the initial content of the target object with the updated summary content to obtain updated content of the target object.
[0071] The summary content is completely generated by a large language model. In some cases, users may think that the summary content has flaws or does not meet expectations, and directly using it as updated content does not meet the creative needs. To solve this technical problem, after obtaining the summary content, it can be displayed on the relevant page so that the user can see the summary content. If the user thinks that the summary content meets the creative needs, a confirmation operation can be performed on it, and the generating device responds to the operation and overwrites the initial content of the target object with the summary content, forming the updated content of the target object after the overwriting. If the user thinks that the summary content does not meet the creative needs, a modification operation can be performed on it, and the generating device responds to the operation and updates the summary content to obtain the updated summary content. If the user thinks that the updated summary content meets the creative needs, a confirmation operation can be performed on it, and the generating device responds to the operation and overwrites the initial content of the target object with the updated summary content, forming the updated content of the target object after the overwriting.
[0072] By combining automatic generation of a large language model with user modification, the updated content can be made more accurate and serve as a better reference for subsequent steps.
[0073] In one embodiment, before the step of updating the summary content in response to the modification operation on the summary content, the method further includes: comparing and displaying the initial content and the summary content of the target object on the same page.
[0074] In the above embodiment, after the summary content is generated, the original content of the target object will no longer be displayed. Only the summary content will be displayed on the relevant page, and the user can modify the summary content and then overwrite it. However, in some cases, when modifying the summary content, the user may need to refer to the original content. For example, the user wants to know which parts of the summary content have changed compared to the original content. However, since the original content is no longer displayed, the user may not remember what information was recorded in the original content, which makes the modification more difficult.
[0075] To solve this technical problem, this embodiment can, after generating the summary content, compare and display the initial content and the summary content of the target object on the same page. For example, the summary content can be displayed below the initial content, making it convenient for users to compare the contents of the two. Based on the comparison, the user can know the difference between the summary content and the initial content, and then modify the summary content on this basis, so that the modification is smoother and more accurate, thereby improving work efficiency.
[0076] Those skilled in the art may, as needed, choose not to display the summary content, display only the summary content, or display the initial content and the summary content in comparison to meet user needs in different scenarios.
[0077] S4: Determine the associated objects of the target object from the generated relationship chain, and use the large language model to determine whether the initial content of the associated objects conflicts with the updated content of the target object.
[0078] After determining the target object, we can search the generative relationship chain to identify associated objects with a generative relationship. Associated objects also have initial content. Because the target object has been updated and the associated objects have a generative relationship with it, the updated content of the target object may conflict with the initial content of the associated objects in terms of logic or plot. To address this issue, we first construct the corresponding prompt words and input them into the large language model, which then detects and determines whether there is a conflict between the two.
[0079] S5: If yes, update the initial content of the associated object using the large language model to obtain updated content of the associated object, and the updated content of the associated object does not conflict with the updated content of the target object.
[0080] If the judgment result is yes, it means that there is a conflict between the initial content of the associated object and the updated content of the target object. In order to maintain consistency and coherence between the two outlines, the initial content of the associated object needs to be updated and updated to content that does not conflict with the updated content of the target object. This content is used as the updated content of the associated object.
[0081] If the judgment result is no, it means that the initial content of the associated object does not conflict with the updated content of the target object, and the associated object and its subordinate outlines or texts do not conflict with the updated content, so they do not need to be updated.
[0082] In actual scenarios, steps S4 and S5 can be completed as a whole. The content of the prompt words in this process is as follows:
[0083] As a novelist who values plot plausibility and logic, please examine the following two parts, sp1' and lp1, and match the plots. If you find a plot in lp1 that appears in sp1' but the ending doesn't match sp1', modify lp1 and save it as lp1'. Always pay attention to the consistency of the plot and maintain the coherence and logic of the story when making modifications. Output in JSON format.
[0084] Among them, sp1' is the updated content of the outline of Chapter 1, lp1 is the original content of the outline of Part 1, and lp1' is the updated content of the outline of Part 1.
[0085] Of course, the above is only one way of describing the prompt word. Those skilled in the art can adaptively set and modify the description content of the prompt word according to actual needs, as long as the large language model can complete conflict detection and update.
[0086] For example, suppose sp1 contains "Xiao Ming wrote a letter to Li Hua, and Li Hua received it." After the main text of Chapter 1 is revised, sp1 is updated to sp1', which contains "Xiao Ming wrote a letter to Li Hua, but Li Hua did not receive it." Suppose lp1 in the Part 1 outline contains "Li Hua received Xiao Ming's letter and left for Xiao Ming's home." If a conflict check finds that this content conflicts with sp1', lp1 is updated to lp1', which contains "Li Hua did not receive Xiao Ming's message, called Xiao Ming, and left." After the update, lp1' no longer conflicts with sp1' and can therefore remain consistent with the revised main text of Chapter 1.
[0087] S6: Update the associated object to the target object, and cyclically execute the operations of determining the associated object of the target object from the generated relationship chain, determining whether there is a conflict between the initial content of the associated object and the updated content of the target object through the large language model, updating the initial content of the associated object through the large language model when the judgment result is yes to obtain the updated content of the associated object, and updating the associated object to the target object, until the target object is the second target text.
[0088] After the associated object is updated, it is used as the new target object. Then, its associated objects are determined again from the generated relationship chain and a conflict check is performed again. If a conflict is found, the initial content of the associated object is updated again to obtain the updated content of the associated object. Finally, the associated object is used as the new target object again. The specific implementation of this process is consistent with that of the above embodiment and will not be repeated here. The above steps are repeated until the target object obtained from the last update is a certain text. This text is then defined as the second target text, and the loop ends.
[0089] After completion, the initial content of the second target text is updated with the updated content. This updated content does not conflict with the previous update of the target object (a certain level N outline) and, based on the previous conflict detection and update results, does not conflict with the updated content of the first target text. The novel generated by these steps can ensure consistency and coherence.
[0090] When the target object is a body, it is the lowest-level object, and its associated objects are only a certain Nth-level outline. When the target object is a first-level outline, since the first-level outline is the highest-level object, its associated objects are only one or more second-level outlines. When the target object is an object at any level other than the first level or a body, its associated objects include both a higher-level object and one or more lower-level objects. Because a target object may have multiple associated objects, non-conflicting associated objects are not updated. However, for one or more conflicting associated objects, each one must be updated. After the update, each associated object is used as the new target object.
[0091] In one embodiment, each step of determining whether there is a conflict between the initial content of the associated object and the updated content of the target object using the large language model includes:
[0092] S61: Determine whether a request to view the associated object is currently received.
[0093] S62: If yes, determine whether the initial content of the associated object conflicts with the updated content of the target object through the large language model.
[0094] If the initial content of an associated object has already been generated, even if it conflicts with the updated content of the target object, it will not be automatically updated without the user's knowledge, as this would cause confusion. Therefore, after determining the associated object, we first determine whether a request to view the associated object has been received. When a user wishes to view the associated object, they perform a view operation on the relevant page, which generates a corresponding view request. After receiving the view request, we then use the large language model to determine if there is a conflict.
[0095] In one embodiment, each time the initial content of the associated object is updated using the large language model, the step of obtaining the updated content of the associated object includes:
[0096] S63: Determine whether an update request for the associated object is currently received.
[0097] S64: If yes, update the initial content of the associated object using the large language model to obtain updated content of the associated object.
[0098] If a conflict is determined, it is also necessary to determine whether an update request for the associated object has been received. When a user issues an update request for an associated object, a pop-up window may be displayed on the current page to the user, asking whether an update is required. If the user confirms the need for an update, they will confirm the option to update in the pop-up window. This action is considered to have issued an update request for the associated object. The generating device responds to the request and then performs the update operation, ultimately obtaining the updated content of the associated object.
[0099] In the above manner, the update operation is performed based on the user's permission, selection and confirmation. The user can then know which outlines or texts have conflicts during the review process and perform corresponding updates as needed.
[0100] In one embodiment, after the step of determining the associated objects of the target object from the generated relationship chain, the method further includes:
[0101] S6a: Determine whether the initial content of the associated object has been generated.
[0102] S6b: If not, generate initial content of the associated object based on the updated content of the target object using the large language model.
[0103] The novel generation method provided in the embodiment of the present application is applicable to scenarios where the initial content of each object in the generation relationship chain is completely generated, and is also applicable to scenarios where the initial content of some objects has not been generated. For the former, since the initial content of the associated object has been generated, conflict detection and judgment can be performed directly each time. For the latter, for example, only the chapter outlines of chapters 1 to 3 have been generated, and the chapter outlines of subsequent chapters have not been generated. When the associated object is the chapter outline of chapters 4 to 10, its initial content has not yet been generated, and conflict detection and judgment do not need to be performed. For another example, only the main text of chapters 1 to 3 has been generated, and the main text of subsequent chapters has not been generated. When the associated object is the main text of chapters 4 to 10, its initial content has not yet been generated, and conflict detection and judgment do not need to be performed. Therefore, after determining the associated object, it is necessary to first determine whether the initial content of the associated object has been generated. If the initial content of the associated object has not yet been generated, the initial content of the associated object is directly generated based on the updated content of the target object, and the subsequent subordinate outlines or main texts of the associated object will be based on this initial content.
[0104] In the two scenarios described above, if the novel generation method provided by the embodiments of this application is not used, no matter what modifications are made to the previous text, the subsequent outlines and text will only respond to the initially set content. The user's modifications will actually have no effect on the generation of the subsequent chapter text, which will cause plot disconnection. However, after using the above method, both the newly generated chapter text and the updated chapter text will be consistent with the modified previous text content, thus ensuring plot coherence.
[0105] The following combination Figure 2 The above-mentioned embodiments are described in detail.
[0106] exist Figure 2 In the figure, the initial contents of the outlines of parts 1 to 10 are represented as lp1 to lp10, and the updated contents are represented as lp1' to lp10', respectively. The initial contents of the outlines of chapters 1 to 100 are represented as sp1 to sp100, and the updated contents are represented as sp1' to sp10', respectively. The initial contents of the main texts of chapters 1 to 100 are represented as zn1 to zn100, and the updated contents are represented as zn1' to zn10', respectively.
[0107] Assuming that the main text of Chapter 2 is the first target main text, after modifying it and generating summary content, the second chapter outline that generates the main text of Chapter 2 is determined as the target object, and its initial content sp2 is updated based on the summary content to obtain updated content sp2'.
[0108] Based on the generated relationship chain, the associated object of the second chapter outline is determined to be the first part outline, and the large language model is used to determine whether the initial content lp1 of the associated object conflicts with the updated content sp2' of the target object.
[0109] If it is determined that lp1 and sp2' conflict, lp1 is updated to obtain the updated content lp1' of the first part of the outline, and lp1' does not conflict with sp1'.
[0110] After the update, the outline of Part 1 becomes the new target object, and its associated objects include the outlines of Chapters 1 to 10. If only sp1 of the outline of Chapter 1 and sp6 of the outline of Chapter 6 conflict with lp1', then only sp1 will be updated to sp1' and sp6 to sp6'. The other eight outlines will not be updated. After the update, the outlines of Chapter 1 and Chapter 6 will become the new target objects, and their associated objects will be the main text of Chapter 1 and Chapter 6, respectively. If zn1 of the main text of Chapter 1 conflicts with sp1', and zn6 of the main text of Chapter 6 also conflicts with sp6', then both the main text of Chapter 1 and Chapter 6 will be the second target text, and zn1 will need to be updated to zn1' and zn6 will need to be updated to zn6'. After the update, the main text of Chapter 1 and Chapter 6 will not conflict with the revised main text of Chapter 2, thus achieving consistency and coherence.
[0111] It should be noted that, although in the above embodiment, the modification of the main text of Chapter 1 will only be synchronized to Chapters 2 to 10 based on the generated relationship chain, in actual scenarios, the degree of modification to the main text of a chapter will usually only affect several chapters before and after it, and will not be large enough to affect all 100 chapters. If the degree of modification is large enough to affect 100 chapters, the basic settings or the first-level outline will generally be modified directly, rather than modifying the main text of a chapter. Therefore, although the above-mentioned modification to the main text of Chapter 1 will not be synchronized to the main text of all 100 chapters, the consistency and coherence of the entire text can still be guaranteed.
[0112] It can be seen from the above embodiments that the novel generation method provided by the present application can summarize the updated content of the modified first target text by constructing reverse prompt words and inputting a large language model after the first target text is modified, and use the summarized content to update the N-th level outline for generating the first target text. The updated content of the N-th level outline can then reflect the overall modification of the first target text, and by generating a relationship chain, the associated objects of the N-th level outline can be determined step by step, and conflict judgment and update are performed on each associated object until it is traced back to the text level, thereby synchronizing the overall modification of the first target text to the second target text, so that all texts do not conflict with the updated content of the first target text, thereby ensuring the logical consistency and plot coherence of the entire novel text and realizing dynamic memory of the modification.
[0113] It should be noted that the above embodiment describes the situation where the main text is modified and finally synchronized to other main texts, but the present application is not limited to this. If the modification is not for the main text of a chapter, but for a certain outline, the principle is similar. It is also possible to find the superior and / or subordinate related objects step by step according to the generated relationship chain, perform conflict judgment and update, and trace back to the main text level, so as to achieve consistency and coherence.
[0114] Based on the method described in the above embodiment, this embodiment will further describe the novel generation device based on reverse prompt words. The novel includes N-level outlines, each upper-level outline generates at least two lower-level outlines, and each N-level outline generates corresponding text, where N is an integer not less than 1. Figure 8 , the novel generating device may include:
[0115] A response module 10 is configured to update the initial content of the first target text in response to a modification operation on the first target text, thereby obtaining updated content of the first target text;
[0116] A first obtaining module 20 is configured to construct reverse prompt words based on the updated content of the first target text, and process the reverse prompt words through a large language model to obtain a summary of the updated content of the first target text;
[0117] The second obtaining module 30 is configured to obtain a generative relationship chain formed by the outlines at all levels and the main texts, wherein two objects having a generative relationship in the generative relationship chain are associated with each other, determine a target object for generating the first target main text from the generative relationship chain, and update the initial content of the target object based on the summarized content to obtain the updated content of the target object;
[0118] a conflict determination module 40 for determining associated objects of the target object from the generated relationship chain, and determining whether initial content of the associated objects conflicts with updated content of the target object using the large language model;
[0119] A third obtaining module 50 is configured to update the initial content of the associated object using the large language model to obtain updated content of the associated object, and the updated content of the associated object does not conflict with the updated content of the target object;
[0120] A loop module 60 is configured to update the associated object to the target object and cyclically execute the following steps: determining the associated object of the target object from the generated relationship chain; determining, using the large language model, whether there is a conflict between the initial content of the associated object and the updated content of the target object; updating the initial content of the associated object using the large language model to obtain the updated content of the associated object if the conflict is positive; and updating the associated object to the target object, until the target object becomes the second target text.
[0121] In one embodiment, the second obtaining module 30 includes:
[0122] The first obtaining unit is configured to overwrite the initial content of the target object with the summarized content to obtain updated content of the target object.
[0123] In one embodiment, the second obtaining module 30 includes:
[0124] a second obtaining unit, configured to update the summary content in response to a modification operation on the summary content, and obtain updated summary content;
[0125] The third obtaining unit is configured to overwrite the original content of the target object with the updated summary content to obtain the updated content of the target object.
[0126] In one embodiment, the second obtaining module 30 further includes a comparison display unit that operates before the second obtaining unit, and the comparison display unit is used to compare and display the initial content of the target object and the summarized content on the same page.
[0127] In one embodiment, the loop module 60 includes a first judgment unit and a second judgment unit;
[0128] The first judgment unit is used to judge whether a viewing request for the associated object is currently received;
[0129] The second judgment unit is configured to, if yes, judge by the large language model whether there is a conflict between the initial content of the associated object and the updated content of the target object;
[0130] In one embodiment, the loop module 60 includes a third determination unit and a fourth obtaining unit;
[0131] The third judgment unit is used to judge whether an update request for the associated object is currently received;
[0132] The fourth obtaining unit is configured to, if yes, update the initial content of the associated object using the large language model to obtain updated content of the associated object.
[0133] In one embodiment, the novel generation device also includes a generation judgment module and a generation module; after determining the associated objects of the target object from the generation relationship chain, the generation judgment module is used to determine whether the initial content of the associated object has been generated; the generation module is used to, if not, generate the initial content of the associated object based on the updated content of the target object through the large language model.
[0134] Different from the existing technology, the novel generation device based on reverse prompt words provided by the present application can summarize the updated content of the modified first target text by constructing reverse prompt words and inputting a large language model after the first target text is modified, and use the summarized content to update the N-th level outline for generating the first target text. The updated content of the N-th level outline can then reflect the overall modification of the first target text. By generating a relationship chain, the associated objects of the N-th level outline can be determined step by step, and conflict judgment and update are performed on each associated object until it is traced back to the text level, thereby synchronizing the overall modification of the first target text to the second target text, so that all texts do not conflict with the updated content of the first target text, thereby ensuring the logical consistency and plot coherence of the entire novel text and realizing dynamic memory of the modification.
[0135] Accordingly, the embodiment of the present application further provides an electronic device, such as Figure 9As shown, the electronic device may include components such as a radio frequency (RF) circuit 101, a memory 102 including one or more computer-readable storage media, an input unit 103, a display unit 104, a sensor 105, an audio circuit 106, a WiFi module 107, a processor 108 including one or more processing cores, and a power supply 109. It will be understood by those skilled in the art that Figure 9 The electronic device structure shown in the figure does not constitute a limitation of the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.
[0136] The radio frequency circuit 101 can be used to receive and transmit signals during information transmission or calls. Specifically, it receives downlink information from the base station and transmits it to one or more processors 108 for processing. It also transmits uplink data to the base station. The memory 102 can be used to store software programs and modules. The processor 108 executes the software programs and modules stored in the memory 102 to perform various functional applications and generate novels. The input unit 103 can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical, or trackball signal input related to user settings and function control.
[0137] The display unit 104 may be used to display information input by a client or information provided to a client, as well as various graphical client interfaces of the server. These graphical client interfaces may be composed of graphics, text, icons, videos, or any combination thereof.
[0138] The electronic device may further include at least one sensor 105, such as a light sensor, a motion sensor, or other sensors. The audio circuit 106 may include a speaker, which may provide an audio interface between the user and the electronic device.
[0139] WiFi is a wireless transmission technology. Electronic devices can help customers send and receive emails, browse web pages and follow up streaming media through WiFi module 107. It provides customers with wireless broadband Internet follow-up. Figure 9 A WiFi module 107 is shown, but it is understandable that it is not an essential component of the electronic device and can be omitted as needed without changing the essence of the application.
[0140] The processor 108 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 102 and calling data stored in the memory 102, it performs various functions of the electronic device and processes data, thereby monitoring the entire mobile phone.
[0141] The electronic device also includes a power supply 109 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 108 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions.
[0142] Although not shown, the electronic device may also include a camera, a Bluetooth module, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 108 in the server will load the executable files corresponding to one or more application processes into the memory 102 according to the following instructions, and the processor 108 will run the application stored in the memory 102, thereby achieving the following functions:
[0143] In response to the modification operation on the first target text, the initial content of the first target text is updated to obtain the updated content of the first target text;
[0144] Constructing reverse prompt words based on the updated content of the first target text, and processing the reverse prompt words through a large language model to obtain a summary of the updated content of the first target text;
[0145] Obtaining a generative relationship chain formed by each level of outline and each body text, wherein two objects having a generative relationship in the generative relationship chain are associated with each other, determining a target object for generating the first target body text from the generative relationship chain, and updating the initial content of the target object based on the summarized content to obtain updated content of the target object;
[0146] Determining associated objects of the target object from the generated relationship chain, and determining whether initial content of the associated objects conflicts with updated content of the target object using the large language model;
[0147] If yes, updating the initial content of the associated object using the large language model to obtain updated content of the associated object, where the updated content of the associated object does not conflict with the updated content of the target object;
[0148] The associated object is updated to the target object, and the following steps are repeated: determining the associated object of the target object from the generated relationship chain; determining whether there is a conflict between the initial content of the associated object and the updated content of the target object through the large language model; updating the initial content of the associated object through the large language model to obtain the updated content of the associated object when the judgment result is yes; and updating the associated object to the target object, until the target object is the second target text.
[0149] The electronic device provided by the present application can summarize the updated content of the modified first target text by constructing reverse prompt words and inputting a large language model after the first target text is modified, and use the summarized content to update the N-th level outline for generating the first target text. The updated content of the N-th level outline can then reflect the overall modification of the first target text. By generating a relationship chain, the associated objects of the N-th level outline can be determined step by step, and conflict judgment and update are performed on each associated object until it is traced back to the text level, thereby synchronizing the overall modification of the first target text to the second target text, so that all texts do not conflict with the updated content of the first target text, thereby ensuring the logical consistency and plot coherence of the entire novel text and realizing dynamic memory of the modification.
[0150] In the above embodiments, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, please refer to the detailed description above and will not be repeated here.
[0151] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0152] To this end, an embodiment of the present application provides a computer-readable storage medium storing a plurality of instructions, which can be loaded by a processor to implement the following functions:
[0153] In response to the modification operation on the first target text, the initial content of the first target text is updated to obtain the updated content of the first target text;
[0154] Constructing reverse prompt words based on the updated content of the first target text, and processing the reverse prompt words through a large language model to obtain a summary of the updated content of the first target text;
[0155] Obtaining a generative relationship chain formed by each level of outline and each body text, wherein two objects having a generative relationship in the generative relationship chain are associated with each other, determining a target object for generating the first target body text from the generative relationship chain, and updating the initial content of the target object based on the summarized content to obtain updated content of the target object;
[0156] Determining associated objects of the target object from the generated relationship chain, and determining whether initial content of the associated objects conflicts with updated content of the target object using the large language model;
[0157] If yes, updating the initial content of the associated object using the large language model to obtain updated content of the associated object, where the updated content of the associated object does not conflict with the updated content of the target object;
[0158] The associated object is updated to the target object, and the following steps are repeated: determining the associated object of the target object from the generated relationship chain; determining whether there is a conflict between the initial content of the associated object and the updated content of the target object through the large language model; updating the initial content of the associated object through the large language model to obtain the updated content of the associated object when the judgment result is yes; and updating the associated object to the target object, until the target object is the second target text.
[0159] The computer-readable storage medium provided by the present application can summarize the updated content of the modified first target text by constructing reverse prompt words and inputting a large language model after the first target text is modified, and use the summarized content to update the N-th level outline for generating the first target text. The updated content of the N-th level outline can then reflect the overall modification of the first target text. By generating a relationship chain, the associated objects of the N-th level outline can be determined step by step, and conflict judgment and update are performed on each associated object until it is traced back to the text level, thereby synchronizing the overall modification of the first target text to the second target text, so that all texts do not conflict with the updated content of the first target text, thereby ensuring the logical consistency and plot coherence of the entire novel text and realizing dynamic memory of the modification.
[0160] The above is a detailed introduction to a novel generation method, device, electronic device and computer-readable storage medium based on reverse prompt words provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the technical solutions and core ideas of the present application; ordinary technicians in this field should understand that they can still modify the technical solutions recorded in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. A novel generation method based on reverse prompt words, characterized in that: The novel includes N-level outlines, each upper-level outline generates at least two lower-level outlines, and each N-level outline generates a corresponding text, where N is an integer not less than 1. The method includes: In response to the modification operation on the first target text, the initial content of the first target text is updated to obtain the updated content of the first target text; Constructing reverse prompt words based on the updated content of the first target text, and processing the reverse prompt words through a large language model to obtain a summary of the updated content of the first target text; Obtaining a generative relationship chain formed by each level of outline and each body text, wherein two objects having a generative relationship in the generative relationship chain are associated with each other, determining a target object for generating the first target body text from the generative relationship chain, and updating the initial content of the target object based on the summarized content to obtain updated content of the target object; Determining associated objects of the target object from the generated relationship chain, and determining whether initial content of the associated objects conflicts with updated content of the target object using the large language model; If yes, updating the initial content of the associated object using the large language model to obtain updated content of the associated object, where the updated content of the associated object does not conflict with the updated content of the target object; The associated object is updated to the target object, and the following steps are repeated: determining the associated object of the target object from the generated relationship chain; determining whether there is a conflict between the initial content of the associated object and the updated content of the target object through the large language model; updating the initial content of the associated object through the large language model to obtain the updated content of the associated object when the judgment result is yes; and updating the associated object to the target object, until the target object is the second target text.
2. The novel generation method according to claim 1, characterized in that: The step of updating the initial content of the target object based on the summarized content to obtain the updated content of the target object includes: The initial content of the target object is overwritten with the summarized content to obtain updated content of the target object.
3. The novel generation method according to claim 1, characterized in that: The step of updating the initial content of the target object based on the summarized content to obtain the updated content of the target object includes: In response to the modification operation on the summary content, updating the summary content to obtain updated summary content; The updated summary content is used to overwrite the original content of the target object to obtain the updated content of the target object.
4. The novel generation method according to claim 3, characterized in that: Before the step of updating the summary content in response to the modification operation on the summary content, the method further includes: The initial content of the target object and the summarized content are displayed comparatively on the same page.
5. The novel generation method according to claim 1, characterized in that: Each step of determining whether there is a conflict between the initial content of the associated object and the updated content of the target object using the large language model includes: Determining whether a request to view the associated object is currently received; If so, it is determined by the large language model whether the initial content of the associated object conflicts with the updated content of the target object.
6. The novel generation method according to claim 5, characterized in that: Each time the initial content of the associated object is updated using the large language model, the step of obtaining the updated content of the associated object includes: Determining whether an update request for the associated object is currently received; If so, the initial content of the associated object is updated using the large language model to obtain updated content of the associated object.
7. The novel generation method according to claim 1, characterized in that: After the step of determining the associated objects of the target object from the generated relationship chain, the method further includes: Determining whether the initial content of the associated object has been generated; If not, the initial content of the associated object is generated based on the updated content of the target object by using the large language model.
8. A novel generation device based on reverse prompt words, characterized in that: The novel includes N-level outlines, each upper-level outline generates at least two lower-level outlines, and each N-level outline generates a corresponding text, where N is an integer not less than 1. The device includes: a response module, configured to update the initial content of the first target text in response to the modification operation on the first target text, and obtain updated content of the first target text; a first obtaining module, configured to construct reverse prompt words according to the updated content of the first target text, and process the reverse prompt words through a large language model to obtain a summary of the updated content of the first target text; a second obtaining module configured to obtain a generative relationship chain formed by each level of outline and each body text, wherein two objects having a generative relationship in the generative relationship chain are associated with each other, determine a target object for generating the first target body text from the generative relationship chain, and update the initial content of the target object based on the summarized content to obtain the updated content of the target object; a conflict judgment module, configured to determine associated objects of the target object from the generated relationship chain, and to judge whether there is a conflict between the initial content of the associated objects and the updated content of the target object using the large language model; a third obtaining module, configured to, if yes, update the initial content of the associated object using the large language model to obtain updated content of the associated object, where the updated content of the associated object does not conflict with the updated content of the target object; A loop module is configured to update the associated object to the target object and cyclically execute the following operations: determining the associated object of the target object from the generated relationship chain; determining whether there is a conflict between the initial content of the associated object and the updated content of the target object using the large language model; updating the initial content of the associated object using the large language model to obtain the updated content of the associated object when the judgment result is yes; and updating the associated object to the target object, until the target object is the second target text.
9. An electronic device, characterized in that: It comprises a memory and a processor; the memory stores an application, and the processor is used to run the application in the memory to execute the steps in the novel generation method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, which is executed by a processor to implement the steps in the novel generation method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Document writing method, system and equipment based on large language model
CN119026576A
Method and device for generating copywriting outline, medium and program product
CN119066192A