Information processing method and device, electronic equipment and storage medium
By extracting entity relationships and dividing communities from the original creative text to generate a knowledge graph, the logical confusion problem of large models when creating chapters is solved, and the text logic and readability of novel creation are improved.
Patent Information
- Application Number
- CN202411521099.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-29
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-10-29
AI Technical Summary
In the existing technology, large models fail to effectively utilize the overall story outline when creating novel chapters, resulting in illogical articles and requiring authors to make extensive revisions.
By extracting entity relationships from the original creative text, a first knowledge graph is generated, and the knowledge graph is updated based on entity community division and hierarchical structure to generate a second knowledge graph, and the plot information of the chapter to be created is obtained to generate the main text.
It improves the text logic and readability of the article, helps authors clarify their creative ideas, framework and narrative rhythm, and reduces the workload of revisions.
Smart Images

Figure CN119514542B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to an information processing method, device, electronic device, and storage medium. Background Art
[0002] For article creators, the big model can be used to learn and understand the creative ideas and techniques of excellent works by disassembling popular works, providing inspiration for their own creations. At the same time, this method can also help authors sort out their own creative outlines and article ideas, and assist authors in creating subsequent chapter content.
[0003] In the existing technology, when the current chapter needs to be created, the large model will use the content of the previous chapter and information such as character introductions, without understanding the overall story outline of the novel. The logical confusion of the article may occur, and the final result is likely to deviate from the main line of the story. It cannot be used directly as the main text content and the author needs to make a lot of modifications. Summary of the Invention
[0004] The present disclosure provides an information processing method, apparatus, electronic device, and storage medium.
[0005] According to one aspect of the present disclosure, an information processing method is provided, comprising: extracting entity relationships from an original creative text to generate a first knowledge graph; dividing entity communities according to node attributes of nodes in the first knowledge graph, and updating the first knowledge graph based on the divided entity communities and the hierarchical structure of the entity communities to obtain a second knowledge graph; obtaining plot information of a chapter to be created, and generating the main text of the chapter to be created based on the plot information and the second knowledge graph.
[0006] According to another aspect of the present disclosure, an information processing device is provided, including: a first generation module for extracting entity relationships from an original creative text to generate a first knowledge graph; an update module for dividing entity communities according to node attributes of nodes in the first knowledge graph, and updating the first knowledge graph based on the divided entity communities and the hierarchical structure of the entity communities to obtain a second knowledge graph; a second generation module for obtaining plot information of a chapter to be created, and generating the main text of the chapter to be created based on the plot information and the second knowledge graph.
[0007] According to another aspect of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the information processing method described in the above-mentioned embodiment.
[0008] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, on which a computer program / instruction is stored. The computer instructions are used to enable the computer to execute the information processing method described in the embodiment of the above aspect.
[0009] According to another aspect of the present disclosure, a computer program product is provided, including a computer program / instruction, which implements the information processing method described in the embodiment of the first aspect when executed by a processor.
[0010] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings are provided to facilitate a better understanding of the present invention and do not constitute a limitation of the present disclosure.
[0012] Figure 1 A flowchart of an information processing method provided by an embodiment of the present disclosure;
[0013] Figure 2 A flowchart of another information processing method provided by an embodiment of the present disclosure;
[0014] Figure 3 A schematic diagram of the process of adding a new knowledge graph provided in an embodiment of the present disclosure;
[0015] Figure 4 A flowchart of another information processing method provided by an embodiment of the present disclosure;
[0016] Figure 5 A schematic diagram of a process for generating a second knowledge graph provided in an embodiment of the present disclosure;
[0017] Figure 6 A flowchart of another information processing method provided by an embodiment of the present disclosure;
[0018] Figure 7 A schematic diagram of a process for generating the body of a chapter to be created provided by an embodiment of the present disclosure;
[0019] Figure 8 A flowchart of a chapter splitting process in an information processing method provided in an embodiment of the present disclosure;
[0020] Figure 9 A schematic diagram of the chapter splitting process provided in an embodiment of the present disclosure;
[0021] Figure 10A schematic diagram of the structure of an information processing device provided in an embodiment of the present disclosure;
[0022] Figure 11 A block diagram of an electronic device for implementing the information processing method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0024] The information processing method, apparatus, and electronic device according to the embodiments of the present disclosure are described below with reference to the accompanying drawings.
[0025] Artificial Intelligence (AI) is the study of how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). This discipline encompasses both hardware and software technologies. AI hardware technologies generally include computer vision, speech recognition, natural language processing, as well as deep learning / learning, big data processing, and knowledge graphs.
[0026] Figure 1 A flowchart of an information processing method provided in an embodiment of the present disclosure.
[0027] like Figure 1 As shown, the information processing method may include:
[0028] S101: extract entity relationships from the original creative text to generate a first knowledge graph.
[0029] It should be noted that the execution entity of the information processing method in the embodiments of the present disclosure may be a hardware device with data processing capabilities and / or the necessary software to drive the operation of the hardware device. Optionally, the execution entity may include a server, a user terminal, and other intelligent devices. Optionally, the user terminal includes but is not limited to a mobile phone, a computer, an intelligent voice interaction device, etc. Optionally, the server includes but is not limited to a network server, an application server, a server of a distributed system, or a server integrated with a blockchain, etc. This is not specifically limited in the embodiments of the present disclosure.
[0030] In some implementations, the original creative text may be split into multiple text blocks, entities and entity relationships may be extracted from the text blocks, and a first knowledge graph may be generated based on the entities and entity relationships. Optionally, the original creative text may be split into sections.
[0031] In some implementations, the original creative text is split into text blocks equal in number to the chapter titles by identifying the chapter titles in the original creative text, that is, a text block corresponding to each chapter can be obtained.
[0032] Furthermore, key information such as chapter summaries, character introductions, and writing techniques are extracted from the text blocks, and entities are extracted from this key information. Entities can include character relationships, plot points, and story background, and the relationships between character relationships, plot points, and story background are used as entity relationships.
[0033] S102: Divide the entity communities according to the node attributes of the nodes in the first knowledge graph, and update the first knowledge graph based on the divided entity communities and the hierarchical structure of the entity communities to obtain a second knowledge graph.
[0034] In some implementations, the nodes in the first knowledge graph are entities. By obtaining node attributes of the nodes in the first knowledge graph and dividing the entities into communities based on the node attributes, multiple entity communities can be obtained. Then, based on the relationships between the entity communities, a hierarchical structure of the entity communities can be determined. The second knowledge graph can be obtained by generating a summary of each entity community and updating the summary and hierarchy in the first knowledge graph. Node attributes include, but are not limited to, characters, chapter summaries, etc.
[0035] Optionally, entities with the same node attributes may be divided into an entity community. For example, if entity A, entity B, and entity C are all person nodes, then entity A, entity B, and entity C are divided into the same entity community.
[0036] Optionally, to reduce data complexity, entity communities may be divided according to a certain number of communities. Optionally, if the number of entity communities reaches a set community threshold, community division is terminated to obtain multiple entity communities.
[0037] S103, obtaining the plot information of the chapter to be created, and generating the main text of the chapter to be created based on the plot information and the second knowledge graph.
[0038] Optionally, the plot information for the chapter to be created can be obtained from the user's input information. Alternatively, the plot information for the chapter to be created can be determined based on the original creative text. This is done by extracting the outline of the original creative text and using the large model to generate the plot information for the chapter to be created based on the outline. For example, a pre-trained plot generation model can be used to generate the plot information.
[0039] Optionally, the plot information includes information such as characters and writing techniques, and target key information related to the plot information can be retrieved from the second knowledge graph based on the plot information to generate the main text of the chapter to be created based on the target key information.
[0040] For example, assuming that the plot information includes character A, a search is performed in the second knowledge graph based on character A to retrieve character B, character C, and plot A related to character A in the second knowledge graph, and character A, character B, character C, and plot A are used as target key information to generate the main text based on the target key information.
[0041] Optionally, a pre-trained text generation model can be used to generate the text based on the target key information.
[0042] According to the information processing method provided by the embodiment of the present disclosure, by extracting entities and entity relationships from the original creative text, a first knowledge graph can be generated based on the entities and entity relationships. Furthermore, in order to improve the efficiency of information retrieval and query, the entities in the first knowledge graph can be divided into entity communities, and according to the divided entity communities and the hierarchical structure of the entity communities, the first knowledge graph can be updated to obtain a second knowledge graph. Furthermore, the main text of the chapter to be created can be generated based on the plot information of the chapter to be created and the second knowledge graph to obtain the main text of the chapter to be created. In the present disclosure, by generating a knowledge graph from the original creative text and displaying it to the user, it can be convenient for the user to sort out creative ideas, frameworks, narrative rhythms, character settings and other information, and provide inspiration for their own creation. The generation of the main text of the article based on the knowledge graph can greatly enhance the text logic of the main text and improve the readability of the text.
[0043] Figure 2 A flowchart of an information processing method provided in an embodiment of the present disclosure.
[0044] like Figure 2 As shown, the information processing method may include:
[0045] S201: extract entity relationships from the original creative text to generate a first knowledge graph.
[0046] The relevant contents of step S201 can be found in the above embodiment and will not be repeated here.
[0047] S202: Based on the hierarchical Leiden algorithm, recursively perform community clustering on the nodes in the first knowledge graph according to the node attributes.
[0048] Alternatively, nodes with the same node attributes can be recursively clustered based on the hierarchical Leiden algorithm to obtain multiple entity communities. For example, nodes with the node attribute of person can be recursively clustered to obtain entity communities containing person entities.
[0049] S203 , in response to the number of entity communities reaching a set community threshold, the community division is terminated, and a plurality of entity communities are obtained.
[0050] In some implementations, to avoid over-segmenting communities, thereby saving computing resources and time and improving computational efficiency, a threshold for the number of communities can be set to determine whether to terminate community segmentation. If the number of entity communities reaches the threshold, community segmentation is terminated, resulting in multiple entity communities that meet the threshold.
[0051] S204: Based on the divided entity communities and the hierarchical structure of the entity communities, the first knowledge graph is updated to obtain a second knowledge graph.
[0052] In some implementations, the first knowledge graph can be updated based on the summary and hierarchical structure of the entity communities, thereby ensuring that the entities and relationships in the knowledge graph are more accurate and improving the accuracy and completeness of the knowledge graph. Alternatively, the hierarchical structure of the entity communities can be determined based on the entity relationships between the communities, and a summary of each entity community can be generated based on the macro model. Furthermore, the summary and hierarchical structure of the entity communities can be updated to the first knowledge graph to obtain the second knowledge graph.
[0053] In some implementations, during the creation process, new chapters of text may need to be updated to the knowledge graph. Optionally, the local knowledge graph corresponding to the new chapters can be added to the second knowledge graph to improve the timeliness and completeness of the knowledge graph.
[0054] Optionally, by obtaining the newly added text and constructing a local knowledge graph of the newly added text, the local knowledge graph can be constructed by extracting entities and entity relationships in the newly added text.
[0055] Furthermore, a role matching is performed between the local knowledge graph and the second knowledge graph to obtain a role matching result for the local knowledge graph. The role matching result includes whether the role in the local knowledge graph is the same role in the second knowledge graph. In other words, role matching can be performed based on the character identifier. If the character identifiers are the same, it can be determined whether the role in the local knowledge graph is the same role in the second knowledge graph. Based on the role matching result, the role in the local knowledge graph can be associated with the second knowledge graph, and the chapter information of the text can be simultaneously added to the second knowledge graph.
[0056] Optionally, the relevant information of the associated roles in the second knowledge graph may be updated based on the role matching results, and / or the novel outline corresponding to the second knowledge graph may be updated.
[0057] For example, Figure 3 The flowchart for adding a new knowledge graph is shown. For the newly added text, a local knowledge graph is constructed for the newly added text. Character relationships and character information are then searched in the second knowledge graph to perform character matching between the local knowledge graph and the second knowledge graph, resulting in a character matching result. The character matching result includes information such as whether the character in the local knowledge graph is the same character in the second knowledge graph, as well as information such as the plot and writing techniques associated with the same character. Figure 3 In the example, role A and role M are the same role. Furthermore, based on the role matching results, the roles in the local knowledge graph can be associated with the second knowledge graph, and the chapter information of the text can be added to the second knowledge graph simultaneously.
[0058] S205, obtaining the plot information of the chapter to be created, and generating the main text of the chapter to be created based on the plot information and the second knowledge graph.
[0059] The relevant contents of step S205 can be found in the above embodiment and will not be repeated here.
[0060] According to the information processing method provided by the embodiment of the present disclosure, by extracting entities and entity relationships from the original creative text, a first knowledge graph can be generated based on the entities and entity relationships. Further, the hierarchical Leiden algorithm is used to divide the entities in the first knowledge graph into entity communities, and according to the divided entity communities and the hierarchical structure of the entity communities, the first knowledge graph is updated to obtain a second knowledge graph. Furthermore, the main text of the chapter to be created can be generated based on the plot information of the chapter to be created and the second knowledge graph to obtain the main text of the chapter to be created. In the present disclosure, by generating a knowledge graph from the original creative text and displaying it to the user, it can be convenient for the user to sort out information such as creative ideas, framework, narrative rhythm, character settings, etc., and provide inspiration for their own creation. The generation of the main text of the article based on the knowledge graph can greatly enhance the text logic of the main text and improve the readability of the text.
[0061] Figure 4 A flowchart of an information processing method provided in an embodiment of the present disclosure.
[0062] like Figure 4 As shown, the information processing method may include:
[0063] S401, extract key information from the chapter text of the original creative text.
[0064] In some implementations, key information can be extracted from the text blocks corresponding to the chapters of the original creative text to improve information acquisition efficiency. Optionally, the original creative text is segmented into chapters to obtain text blocks corresponding to each chapter. Key information is then extracted from the chapter body of the text blocks based on the macro model. The key information includes at least chapter summaries, character information, key plot points, writing techniques, and chapter outlines.
[0065] S402: Extract entity relationships from key information to obtain entity relationship triples.
[0066] Alternatively, by extracting entities from the key information, entity relationships can be determined. Alternatively, by extracting entities such as characters, plots, and backgrounds, entity relationships between characters, plots, and backgrounds can be determined as entity relationship triples.
[0067] S403: Generate a first knowledge graph based on the entity relationship triples.
[0068] In some implementations, an initial third knowledge graph can be generated based on entity relationship triples, and entity disambiguation can be performed on the third knowledge graph to obtain the first knowledge graph. This eliminates redundant information in the knowledge graph, making the graph more concise and clear, thereby improving the quality and accuracy of the knowledge graph. Optionally, the first knowledge graph can be obtained by identifying duplicate entities from the third knowledge graph and merging and disambiguating the duplicate entities.
[0069] S404: Divide the entity communities according to the node attributes of the nodes in the first knowledge graph, and update the first knowledge graph based on the divided entity communities and the hierarchical structure of the entity communities to obtain a second knowledge graph.
[0070] S405, obtaining the plot information of the chapter to be created, and generating the main text of the chapter to be created based on the plot information and the second knowledge graph.
[0071] The relevant contents of steps S404-S405 can be found in the above embodiment and will not be repeated here.
[0072] According to the information processing method provided by the embodiment of the present disclosure, by extracting entities from the text blocks of the original creative text, the entity relationship triplets can be determined, and the third knowledge graph can be generated according to the entity relationship triplets. Then, entity disambiguation is performed, and the first knowledge graph that is concise and clear can be obtained. Further, in order to improve the information retrieval and query efficiency, the entities in the first knowledge graph can be divided into entity communities, and the first knowledge graph can be updated to obtain the second knowledge graph according to the divided entity communities and the hierarchical structure of the entity communities. Further, the generation of the main text of the chapter to be created can be performed according to the plot information of the chapter to be created and the second knowledge graph, and the main text of the chapter to be created can be obtained. In the present disclosure, by generating the knowledge graph from the original creative text and displaying it to the user, the user can easily clarify the creative ideas, framework, narrative rhythm, character setting and other information, and provide inspiration for their own creation. The generation of the article main text based on the knowledge graph can greatly enhance the text logicality of the main text and improve the readability of the text.
[0073] The flowchart for generating the second knowledge graph is shown in FIG. 5. By disassembling and splitting the original creative text, the text blocks corresponding to each chapter can be obtained, and the chapter abstract, character information, key plot, writing method and chapter outline and other information can be extracted from the text blocks as key information. Then, entities can be extracted from the key information to constitute the third knowledge graph, and the repeated entities in the third knowledge graph can be merged and disambiguated to obtain the first knowledge graph. Figure 5 Further, the entities in the first knowledge graph can be divided into communities to obtain multiple entity communities and the hierarchical structure of the entity communities. By generating the abstract of the entity community and updating the abstract and the hierarchical structure of the entity community to the first knowledge graph, the second knowledge graph can be obtained. After obtaining the second knowledge graph, the second knowledge graph can be displayed on the user interface for the user to view, and the second knowledge graph can also be stored for subsequent use.
[0074] Figure 6 The flowchart of the information processing method provided by the embodiment of the present disclosure is shown in FIG. 6.
[0075] As shown in FIG. 6, the information processing method can include: Figure 6
[0076] S601, performing entity relationship extraction on the original creative text to generate a first knowledge graph.
[0077] S602, performing entity community division according to the node attributes of the nodes in the first knowledge graph, and updating the first knowledge graph based on the divided entity communities and the hierarchical structure of the entity communities to obtain a second knowledge graph.
[0078] The relevant contents of steps S601-S602 can be found in the above embodiment and will not be repeated here.
[0079] S603, obtaining plot information of the chapter to be created.
[0080] In some implementations, plot information for the chapter to be created can be obtained based on user input, and can also be generated based on the original creative text. Specifically, if the user enters plot points, plot information for the chapter to be created can be generated based on those points; if the user does not enter plot points, plot information for the chapter to be created can be generated based on the plot of the original creative text. Generating plot information based on user input allows for greater creativity and personalization in the creation process, while generating plot information based on the original creative text ensures plot coherence, thereby enhancing the text's readability.
[0081] Optionally, the method obtains user input information, identifies plot points from the user input information, and determines plot information for the chapter to be created based on the plot points. Optionally, the method extracts a context outline from the original creative text and invokes a pre-trained plot generation model, which generates plot information for the chapter to be created based on the context outline.
[0082] S604: Determine the ending of the previous text according to the chapter to be created, and extract relevant search information based on the ending of the previous text and plot information.
[0083] Alternatively, information extraction can be performed on the ending of the text and the plot information, and the extracted identical information can be used as relevant search information. For example, if character A is extracted from both the ending of the text and the plot information, character A can be used as relevant search information.
[0084] S605: Perform graph retrieval on the second knowledge graph based on the relevant search information to obtain target key information for creation.
[0085] In some implementations, entities and entity relationships related to the relevant search information can be retrieved from the second knowledge graph as target key information to improve the accuracy and relevance of the search results and enhance the ability to understand the information.
[0086] Optionally, the chapter number and role ID of the chapter to be created can be determined based on relevant retrieval information, and key information matching can be performed in different entity communities in the second knowledge graph based on the chapter number and role ID to obtain target key information. That is, the chapter number and role ID can be matched in the chapter community and role community in the second knowledge graph to obtain target key information that matches the chapter number and role ID.
[0087] S606, generate the text of the chapter to be created based on the target key information and the plot information.
[0088] In some implementations, in order to improve the creation efficiency and shorten the creation time, a large model can be used for text generation. By calling a pre-trained text generation model, the text generation model generates the text of the chapter to be created based on the target key information and the plot information.
[0089] As shown in the flowchart of generating the text of the chapter to be created. Figure 7 By judging whether the plot points exist in the input information of the user, if the plot points exist, the plot information of the chapter to be created is determined according to the plot points; if the plot points do not exist, the previous outline is obtained from the original creation text, and the plot information of the chapter to be created is generated by the plot generation model according to the previous outline.
[0090] Further, the relevant search information is extracted from the plot information, and the relevant search information is used for graph search in the second knowledge graph to obtain the target key information, and then the text generation model can be used to generate the text of the chapter to be created based on the target key information. The target key information includes but is not limited to: character information, outline of the original creation text, writing method, etc.
[0091] According to the information processing method provided by the embodiment of the present disclosure, by extracting entities and entity relationships from the original creation text, the first knowledge graph can be generated according to the entities and the entity relationships. Further, in order to improve the information retrieval and query efficiency, the entities in the first knowledge graph can be divided into entity communities, and the first knowledge graph can be updated to obtain the second knowledge graph according to the divided entity communities and the hierarchical structure of the entity communities. Further, the target key information can be determined by performing graph search in the second knowledge graph according to the plot information of the chapter to be created, and the text of the chapter to be created can be generated according to the target key information and the plot information. In the present disclosure, by generating a knowledge graph from the original creation text and displaying it to the user, the user can easily clarify the creation ideas, frameworks, narrative rhythm, character settings, etc., and provide inspiration for their own creation. Based on the knowledge graph, the generation of the article text can greatly enhance the text logicality of the text and improve the readability of the text.
[0092] On the basis of the above-mentioned embodiments, the embodiment of the present disclosure can explain and describe the chapter splitting process, as shown in Figure 8 The chapter splitting process can include:
[0093] S801, according to a preset first matching rule, the original creation text is split into chapters to obtain the number of split chapters.
[0094] In some implementations, the rules of coherence of content, development of plot, length of chapter, etc. can be taken as the preset first matching rule, and then the original creative text can be chapter-split based on the first matching rule to split the original creative text into chapter numbers, chapter titles, chapter texts, and the number of chapters split can be determined according to the chapter numbers.
[0095] S802, obtain the total length of the text of the original creative text, and determine a decision threshold according to the total length of the text.
[0096] S803, in response to the number of chapters being less than the decision threshold, performing chapter rule identification on the original creative text by the large model to construct a second matching rule.
[0097] In some implementations, the correctness of the split can be ensured, and it can be determined whether the first matching rule is split successfully according to the decision threshold. Optionally, the decision threshold can be determined according to the total length of the text of the original creative text. For example, 0.01% of the total length of the text is taken as the decision threshold.
[0098] Further, the number of chapters and the decision threshold are compared, if the number of chapters is less than the decision threshold, the original creative text can be re-split; if the number of chapters is greater than or equal to the decision threshold, the chapter text is determined based on the split result to obtain the text block of each chapter.
[0099] In some implementations, in order to ensure the accuracy of the split and improve the split efficiency, the second matching rule of the split can be determined by using the large model, and the original creative text can be chapter-split using the second matching rule. Optionally, the original creative text can be split from the middle position to obtain two text segments, and the text content of the target length can be extracted from the two text segments, and then the large model can be used to identify the rule of the chapter title of the text content of the target length, and the second matching rule can be generated according to the rule of the chapter title.
[0100] For example, the text content of ten thousand words in length can be extracted from the two text segments, and the large model can be used to identify the chapter title of the text content, and the rule of the chapter title can be determined to generate the second matching rule.
[0101] S804, based on the second matching rule, performing chapter split on the original creative text to obtain the chapter text corresponding to each chapter.
[0102] In some implementations, the chapter title in the original creative text can be identified according to the second matching rule, and the original creative text can be split according to the identified chapter title to obtain the chapter text corresponding to each chapter, and the text block corresponding to the chapter can be determined according to the text content.
[0103] In some implementations, after the chapter titles are split, the chapter titles split from the original creative text can be normalized and missing chapter titles can be searched to optimize the split chapter titles and obtain the final chapter titles of the original creative text.
[0104] According to the information processing method provided by the embodiment of the present disclosure, the original creative text is split into chapters by using the first matching rule, and when the splitting fails, the large model recognizes the chapter title pattern of the original creative text to generate the second matching rule, and uses the second matching rule to split the chapters to obtain the chapter text corresponding to each chapter, which can ensure the accuracy of chapter splitting and improve the efficiency of chapter title recognition.
[0105] like Figure 9 The flowchart of chapter splitting is shown in the figure. For the original creative text, the first matching rule is used to match the original creative text with rules to split the original creative text into chapters, obtain the chapter sequence number, chapter title, chapter text and other information, and determine the number of chapters based on the chapter sequence number. By judging whether the number of chapters is less than the judgment threshold, if the number of chapters is less than the judgment threshold, the large model is called to identify the chapter titles of the original creative text and extract patterns from the chapter titles to construct the second matching rule.
[0106] Furthermore, the second matching rule is used to match the original creative text to determine the chapter text corresponding to each chapter. During the splitting process, the chapter titles can also be normalized and searched for missing chapter titles to optimize the split chapter titles and obtain the final splitting result.
[0107] Corresponding to the information processing methods provided in the above-mentioned embodiments, an embodiment of the present disclosure also provides an information processing device. Since the information processing device provided in the embodiment of the present disclosure corresponds to the information processing methods provided in the above-mentioned embodiments, the implementation methods of the above-mentioned information processing methods are also applicable to the information processing device provided in the embodiment of the present disclosure and will not be described in detail in the following embodiments.
[0108] Figure 10 A schematic diagram of the structure of an information processing device provided in an embodiment of the present disclosure.
[0109] like Figure 10 As shown, the information processing device 1000 of the embodiment of the present disclosure includes a first generation module 1001 , an update module 1002 and a second generation module 1003 .
[0110] The first generation module 1001 is used to extract entity relationships from the original creative text and generate a first knowledge graph;
[0111] The updating module 1002 is configured to perform entity community division according to node attributes of nodes in the first knowledge graph, and update the first knowledge graph based on the divided entity communities and a hierarchical structure of the entity communities to obtain a second knowledge graph.
[0112] The second generation module 1003 is configured to obtain plot information of a chapter to be created, and generate a text of the chapter to be created according to the plot information and the second knowledge graph.
[0113] In an embodiment of the present disclosure, the updating module 1002 is further configured to perform recursive community clustering on nodes in the first knowledge graph according to the node attributes based on a hierarchical Leiden algorithm, and obtain a plurality of entity communities in response to the number of entity communities reaching a set community threshold to end community division.
[0114] In an embodiment of the present disclosure, the updating module 1002 is further configured to determine the hierarchical structure of the entity communities based on entity relationships between communities, generate an abstract of each entity community based on the large model, and update the first knowledge graph based on the abstract of the entity communities and the hierarchical structure to obtain a second knowledge graph.
[0115] In an embodiment of the present disclosure, the first generation module 1001 is further configured to extract key information from a chapter text of the original creative text, perform entity relationship extraction on the key information to obtain entity relationship triples, and generate the first knowledge graph according to the entity relationship triples.
[0116] In an embodiment of the present disclosure, the first generation module 1001 is further configured to generate an initial third knowledge graph according to the entity relationship triples, identify repeated entities from the third knowledge graph, and merge and disambiguate the repeated entities to obtain the first knowledge graph.
[0117] In an embodiment of the present disclosure, the first generation module 1001 is further configured to split chapters of the original creative text to obtain text blocks corresponding to each chapter, and extract the key information from chapter texts of the text blocks based on a large model, the key information at least including chapter abstracts, character information, key plots, writing techniques, and chapter outlines.
[0118] In an embodiment of the present disclosure, the second generation module 1003 is further configured to obtain user input information, identify plot highlights from the user input information, and determine plot information of the chapter to be created based on the plot highlights.
[0119] In one embodiment of the present disclosure, the second generation module 1003 is further used to: extract the above outline from the original creative text; call a pre-trained plot generation model, and the plot generation model generates the plot information of the chapter to be created according to the above outline.
[0120] In one embodiment of the present disclosure, the second generation module 1003 is further used to: determine the end of the previous text based on the chapter to be created, and extract relevant retrieval information based on the end of the previous text and the plot information; perform graph retrieval on the second knowledge graph based on the relevant retrieval information to obtain target key information for creation; and generate the main text of the chapter to be created based on the target key information and the plot information.
[0121] In one embodiment of the present disclosure, the second generation module 1003 is further used to: determine the chapter number and role identification of the chapter to be created based on the relevant search information; and perform key information matching in different entity communities of the second knowledge graph based on the chapter number and the role identification to obtain the target key information.
[0122] In one embodiment of the present disclosure, the second generation module 1003 is further used to: call a pre-trained text generation model, and the text generation model generates the text of the chapter to be created according to the target key information and the plot information.
[0123] In one embodiment of the present disclosure, the first generation module 1001 is further used to: split the original creative text into chapters according to a preset first matching rule to obtain the number of split chapters; obtain the total text length of the original creative text, and determine a judgment threshold based on the total text length; in response to the number of chapters being less than the judgment threshold, the large model identifies chapter patterns of the original creative text and constructs a second matching rule; based on the second matching rule, split the original creative text into chapters to obtain the chapter text corresponding to each chapter.
[0124] In one embodiment of the present disclosure, the first generation module 1001 is further used to: split the original creative text from the middle position to obtain two text segments, and extract the main text content of the target length from the two text segments; use the large model to identify the regularity of chapter titles on the text content of the target length, and generate the second matching rule based on the regularity of the chapter titles.
[0125] In one embodiment of the present disclosure, the device further includes: normalizing the chapter titles split from the original creative text and searching for missing chapter titles to optimize the split chapter titles and obtain the final chapter titles of the original creative text.
[0126] In one embodiment of the present disclosure, the device also includes: obtaining the newly added text and constructing a local knowledge graph of the newly added text; performing role matching on the local knowledge graph and the second knowledge graph, and obtaining the role matching result of the local knowledge graph, the role matching result including whether the role in the local knowledge graph is the same role in the second knowledge graph; according to the role matching result, associating the role of the local knowledge graph to the second knowledge graph, and synchronizing the chapter information of the newly added text to the second knowledge graph.
[0127] In one embodiment of the present disclosure, the device further includes: updating relevant information of the associated roles in the second knowledge graph based on the role matching result; and / or updating the novel outline corresponding to the second knowledge graph.
[0128] According to the information processing device provided by the embodiment of the present disclosure, by extracting entities and entity relationships from the original creative text, a first knowledge graph can be generated based on the entities and entity relationships. Furthermore, in order to improve the efficiency of information retrieval and query, the entities in the first knowledge graph can be divided into entity communities, and according to the divided entity communities and the hierarchical structure of the entity communities, the first knowledge graph can be updated to obtain a second knowledge graph. Furthermore, the main text of the chapter to be created can be generated based on the plot information of the chapter to be created and the second knowledge graph to obtain the main text of the chapter to be created. In the present disclosure, by generating a knowledge graph from the original creative text and displaying it to the user, it can be convenient for the user to sort out information such as creative ideas, framework, narrative rhythm, character settings, etc., and provide inspiration for their own creation. The generation of the main text of the article based on the knowledge graph can greatly enhance the text logic of the main text and improve the readability of the text.
[0129] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0130] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0131] Figure 11A schematic block diagram of an example electronic device 1100 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0132] like Figure 11 As shown, the device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to computer programs / instructions stored in a read-only memory (ROM) 1102 or computer programs / instructions loaded from a storage unit 1106 into a random access memory (RAM) 1103. Various programs and data required for the operation of the device 1100 can also be stored in the RAM 1103. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An input / output (I / O) interface 1105 is also connected to the bus 1104.
[0133] Various components in device 1100 are connected to I / O interface 1105, including: an input unit 1106 such as a keyboard, mouse, etc.; an output unit 1107 such as various types of displays, speakers, etc.; a storage unit 1108 such as a magnetic disk, optical disk, etc.; and a communication unit 1109 such as a network card, modem, wireless communication transceiver, etc. The communication unit 1109 allows device 1100 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0134] The computing unit 1101 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1101 performs various methods and processes described above, such as the information processing method. For example, in some embodiments, the information processing method can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 1106. In some embodiments, part or all of the computer program / instructions can be loaded and / or installed onto the device 1100 via the ROM 1102 and / or the communication unit 1109. When the computer program / instructions are loaded into the RAM 1103 and executed by the computing unit 1101, one or more steps of the information processing method described above can be performed. Alternatively, in other embodiments, the computing unit 1101 can be configured to perform the information processing method by any other suitable means, such as by means of firmware.
[0135] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (CPLD), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0136] Program code for carrying out methods of the present disclosure can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, produces a means for implementing the functions / acts specified in the flowcharts and / or block diagrams. The program code can be executed entirely on a machine, partially on a machine, partially on a machine and partially on a remote machine or entirely on a remote machine or server.
[0137] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0138] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0139] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0140] The computer system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0141] It should be understood that the various forms of flow shown above can be re-ordered, added to, or have steps deleted, using the steps disclosed in the present disclosure. For example, the steps disclosed in the present disclosure can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions disclosed in the present disclosure are achieved, and the present disclosure is not limited herein.
[0142] The above detailed description does not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. An information processing method, wherein: The method comprises: Extract entity relationships from the original creative text to generate the first knowledge graph; Dividing the entity communities according to node attributes of the nodes in the first knowledge graph, determining the hierarchical structure of the entity communities based on the entity relationships between the communities, generating a summary of each entity community based on the macro model, and updating the first knowledge graph based on the summary of the entity community and the hierarchical structure to obtain a second knowledge graph; Determine the end of the previous text according to the chapter to be created, and extract relevant search information based on the context end and the plot information of the chapter to be created; Performing a graph search on the second knowledge graph based on the relevant search information to obtain target key information for creation; Based on the target key information and the plot information, the main text of the chapter to be created is generated.
2. The method according to claim 1, wherein The dividing of entity communities according to node attributes of nodes in the first knowledge graph includes: Based on the hierarchical Leiden algorithm, recursively cluster the nodes in the first knowledge graph according to the node attributes; In response to the number of the entity communities reaching a set community threshold, the community division is ended, and a plurality of entity communities are obtained.
3. The method according to claim 1, wherein The entity relationship extraction of the original creative text to generate the first knowledge graph includes: extracting key information from the body of a chapter of said original creative text; Extracting entity relationships from the key information to obtain entity relationship triples; Generate the first knowledge graph based on the entity relationship triples.
4. The method according to claim 3, wherein: Generating the first knowledge graph according to the entity relationship triples includes: Generating an initial third knowledge graph according to the entity relationship triples; Identify duplicate entities from the third knowledge graph, and merge and disambiguate the duplicate entities to obtain the first knowledge graph.
5. The method according to claim 3, wherein The extracting of key information from the chapter text of the original creative text includes: Splitting the chapters of the original creative text to obtain text blocks corresponding to each chapter; The key information is extracted from the chapter text of the text block based on the large model, and the key information at least includes chapter summary, character information, key plot, writing techniques and chapter outline.
6. The method according to claim 1, wherein Get the plot information of the chapter to be created, including: User input information is obtained, and plot points are identified from the user input information, and based on the plot points, plot information of the chapter to be created is determined.
7. The method according to claim 1, wherein Get the plot information of the chapter to be created, including: Extract the above outline from said original creative text; A pre-trained plot generation model is called, and the plot generation model generates plot information of the chapter to be created according to the above outline.
8. The method according to any one of claims 1 to 7, wherein The performing graph search on the second knowledge graph based on the relevant search information to obtain target key information for creation includes: Determining the chapter number and role identifier of the chapter to be created based on the relevant search information; According to the chapter number and the role identifier, key information matching is performed in different entity communities of the second knowledge graph to obtain the target key information.
9. The method according to claim 8, wherein The step of generating the body of the chapter to be created based on the target key information and the plot information includes: A pre-trained text generation model is called, and the text generation model generates the text of the chapter to be created according to the target key information and the plot information.
10. The method according to claim 5, wherein The chapters of the original creative text are split to obtain text blocks corresponding to each chapter, including: According to a preset first matching rule, the original creative text is divided into chapters to obtain the number of chapters; Obtaining the total length of the original creative text, and determining a judgment threshold based on the total length of the text; In response to the number of chapters being less than the judgment threshold, the large model identifies chapter regularities of the original creative text and constructs a second matching rule; Based on the second matching rule, the original creative text is divided into chapters to obtain the chapter text corresponding to each chapter.
11. The method according to claim 10, wherein: The large model identifies chapter patterns of the original creative text and constructs a second matching rule, including: Splitting the original creative text from the middle position to obtain two text segments, and extracting text content of a target length from the two text segments; The large model identifies the regularity of chapter titles in the text content of the target length, and generates the second matching rule based on the regularity of the chapter titles.
12. The method according to claim 10 or 11, wherein: The method further comprises: The chapter titles split out of the original creative text are normalized and missing chapter titles are searched to optimize the split chapter titles and obtain the final chapter titles of the original creative text.
13. The method according to any one of claims 1 to 7, wherein: The method further comprises: Obtaining the newly added text and constructing a local knowledge graph of the newly added text; Performing role matching on the local knowledge graph and the second knowledge graph to obtain a role matching result of the local knowledge graph, wherein the role matching result includes whether the role in the local knowledge graph is the same role in the second knowledge graph; According to the role matching result, the role of the local knowledge graph is associated with the second knowledge graph, and the chapter information of the newly added text is synchronized to the second knowledge graph.
14. The method according to claim 13, wherein: The method further comprises: updating relevant information of the associated roles in the second knowledge graph according to the role matching result; and / or, Update the novel outline corresponding to the second knowledge graph.
15. An information processing device, wherein: The device comprises: A first generation module is used to extract entity relationships from the original creative text and generate a first knowledge graph; an updating module, configured to divide entity communities according to node attributes of nodes in the first knowledge graph, determine a hierarchical structure of the entity communities based on entity relationships between communities, generate a summary of each entity community based on the macro model, and update the first knowledge graph based on the summary of the entity community and the hierarchical structure to obtain a second knowledge graph; The second generation module is used to determine the end of the previous text based on the chapter to be created, and extract relevant retrieval information based on the context end and the plot information of the chapter to be created; perform graph retrieval on the second knowledge graph based on the relevant retrieval information to obtain target key information for creation; and generate the main text of the chapter to be created based on the target key information and the plot information.
16. The device according to claim 15, wherein The update module is further configured to: Based on the hierarchical Leiden algorithm, recursively cluster the nodes in the first knowledge graph according to the node attributes; In response to the number of the entity communities reaching a set community threshold, the community division is ended, and a plurality of entity communities are obtained.
17. The device according to claim 15, wherein The first generating module is further configured to: extracting key information from the body of a chapter of said original creative text; Extracting entity relationships from the key information to obtain entity relationship triples; Generate the first knowledge graph based on the entity relationship triples.
18. The device according to claim 17, wherein The first generating module is further configured to: Generating an initial third knowledge graph according to the entity relationship triples; Identify duplicate entities from the third knowledge graph, and merge and disambiguate the duplicate entities to obtain the first knowledge graph.
19. The device according to claim 18, wherein The first generating module is further configured to: Splitting the chapters of the original creative text to obtain text blocks corresponding to each chapter; The key information is extracted from the chapter text of the text block based on the large model, and the key information at least includes chapter summary, character information, key plot, writing techniques and chapter outline.
20. The apparatus according to claim 15, wherein The second generating module is further configured to: User input information is obtained, and plot points are identified from the user input information, and based on the plot points, plot information of the chapter to be created is determined.
21. The apparatus according to claim 15, wherein The second generating module is further configured to: Extract the above outline from said original creative text; A pre-trained plot generation model is called, and the plot generation model generates plot information of the chapter to be created according to the above outline.
22. The device according to any one of claims 15 to 21, wherein The second generating module is further configured to: Determining the chapter number and role identifier of the chapter to be created based on the relevant search information; According to the chapter number and the role identifier, key information matching is performed in different entity communities of the second knowledge graph to obtain the target key information.
23. The device according to claim 22, wherein The second generating module is further configured to: A pre-trained text generation model is called, and the text generation model generates the text of the chapter to be created according to the target key information and the plot information.
24. The apparatus according to claim 19, wherein The first generating module is further configured to: According to a preset first matching rule, the original creative text is divided into chapters to obtain the number of chapters; Obtaining the total length of the original creative text, and determining a judgment threshold based on the total length of the text; In response to the number of chapters being less than the judgment threshold, the large model identifies chapter regularities of the original creative text and constructs a second matching rule; Based on the second matching rule, the original creative text is divided into chapters to obtain the chapter text corresponding to each chapter.
25. The apparatus according to claim 24, wherein The first generating module is further configured to: Splitting the original creative text from the middle position to obtain two text segments, and extracting text content of a target length from the two text segments; The large model identifies the regularity of chapter titles in the text content of the target length, and generates the second matching rule based on the regularity of the chapter titles.
26. The device according to claim 24 or 25, wherein The device further comprises: The chapter titles split out of the original creative text are normalized and missing chapter titles are searched to optimize the split chapter titles and obtain the final chapter titles of the original creative text.
27. The device according to any one of claims 15 to 21, wherein The device further comprises: Obtaining the newly added text and constructing a local knowledge graph of the newly added text; Performing role matching on the local knowledge graph and the second knowledge graph to obtain a role matching result of the local knowledge graph, wherein the role matching result includes whether the role in the local knowledge graph is the same role in the second knowledge graph; According to the role matching result, the role of the local knowledge graph is associated with the second knowledge graph, and the chapter information of the newly added text is synchronized to the second knowledge graph.
28. The apparatus according to claim 27, wherein The device further comprises: updating relevant information of the associated roles in the second knowledge graph according to the role matching result; and / or, Update the novel outline corresponding to the second knowledge graph.
29. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 14.
30. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-14.
31. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 14 is implemented.
Citation Information
Patent Citations
Writing conception auxiliary system and network system based on enhanced intelligence
CN113220901A
Knowledge graph construction method, system and device based on PDF document and storage medium
CN115687655A