News content generation method and device, equipment, medium and product

By using the news knowledge graph to align entities and construct inference paths in news content generation, the problem of time-consuming and irregular logical order of traditional news content production is solved, and efficient and logical news content generation is achieved.

CN120354937APending Publication Date: 2025-07-22XINHUA FUSION MEDIA TECH DEV (BEIJING) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510361966.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-25
Publication Date
2025-07-22

AI Technical Summary

Technical Problem

Traditional news content production takes a long time to write, which is difficult to meet the rapidly changing news needs, and existing automatic generation methods often have problems with irregular logical order.

Method used

Generate content plans by analyzing user needs, aligning entities with news knowledge graphs, building reasoning paths, and combining the generated news content to ensure that each step is closely related to the requirements and reduce irrelevant content interference.

Benefits of technology

It enhances the logic of generating news content, improves production efficiency, makes the generated content closely related to user needs, and reduces interference from irrelevant content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120354937A_ABST
    Figure CN120354937A_ABST
Patent Text Reader

Abstract

The invention discloses a news content generation method and device, equipment, a medium and a product. The method comprises the steps that under the condition that a news demand input by a user is received, the news demand is analyzed, a content generation plan is obtained, and the content generation plan comprises a plurality of plan steps and a step sequence of the plan steps; aligning entities in each planning step with entities in a preset news knowledge graph to obtain an entity set of each planning step; each entity in each entity set is taken as a seed point in the news knowledge graph, a reasoning path of each planning step is constructed, the reasoning paths are connected paths with importance meeting a preset rule in a knowledge sub-graph, and the knowledge sub-graph is obtained by combining the connected paths between every two entities in the connected entity set in the news knowledge graph; the step content of the multiple planning steps is combined according to the step sequence, news content of the news demand is generated, and the step content of each planning step is obtained by combining the reasoning path and the entity set of each planning step.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of data processing, and particularly relates to a method, apparatus, device, medium and product for generating news content. Background Art

[0002] At present, the production of traditional news content relies on manual writing, which is time-consuming and difficult to meet the rapidly changing news needs. To improve the production efficiency of news content, current methods for automatically generating news content mainly rely on deep learning and reinforcement learning technologies, that is, machines are trained with a large number of literary work samples to learn various writing styles and establish writing models. However, this often results in problems such as illogical sequence in the generated content. Summary of the Invention

[0003] Embodiments of this application provide a method, apparatus, device, medium and product for generating news content, which can enhance the logic of the generated news content.

[0004] In a first aspect, embodiments of this application provide a method for generating news content, the method comprising:

[0005] When receiving a news requirement input by a user, parsing the news requirement to obtain a content generation plan, the content generation plan including a plurality of planned steps and the step sequence of the plurality of planned steps;

[0006] Aligning the entities in each of the planned steps with the entities in a preset news knowledge graph, the news knowledge graph being constructed from a plurality of historical news articles, the entity set including at least one entity;

[0007] Taking each entity in each of the entity sets as a seed point in the news knowledge graph to construct an inference path for each of the planned steps, the inference path being a connected path in a knowledge sub-graph whose importance meets a preset rule, the knowledge sub-graph being obtained by combining the connected paths connecting pairs of entities in the entity set in the news knowledge graph;

[0008] Combining the step contents of the plurality of planned steps according to the step sequence to generate news content for the news requirement, the step content of each of the planned steps being obtained by combining the inference path and entity set of each of the planned steps.

[0009] In a second aspect, embodiments of this application provide a device for generating news content, the device comprising:

[0010] A parsing module, configured to parse the news requirement when receiving the news requirement input by the user, so as to obtain a content generation plan, where the content generation plan includes a plurality of planned steps and the step sequence of the plurality of planned steps;

[0011] An alignment module, configured to align the entities in each of the planned steps with the entities in a preset news knowledge graph to obtain an entity set for each of the planned steps, where the news knowledge graph is constructed from a plurality of historical news articles, and the entity set includes at least one entity;

[0012] A construction module, configured to construct an inference path for each of the planned steps with each entity in each entity set as a seed point in the news knowledge graph, where the inference path is a connected path in the knowledge sub-graph whose importance meets a preset rule, and the knowledge sub-graph is obtained by combining the connected paths connecting any two entities in the entity set in the news knowledge graph;

[0013] A generation module, configured to combine the step contents of the plurality of planned steps according to the step sequence to generate news content for the news requirement, where the step content of each of the planned steps is obtained by combining the inference path and the entity set of each of the planned steps.

[0014] In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the method for generating news content as described in any one of the above is implemented.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the method for generating news content as described in any one of the above is implemented.

[0016] In a fifth aspect, an embodiment of the present application provides a computer program product, and when the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the method for generating news content as described in any one of the above.

[0017] The method, apparatus, device, medium and product for generating news content according to the embodiments of the present application, when receiving the news requirements input by the user, parses the news requirements to obtain a content generation plan, where the content generation plan includes multiple plan steps and the step sequence of the multiple plan steps; aligns the entities in each plan step with the entities in a preset news knowledge graph, and obtains an entity set for each plan step, where the news knowledge graph is constructed from multiple historical news releases, and the entity set includes at least one entity; constructs an inference path for each plan step with each entity in each entity set as a seed point in the news knowledge graph, where the inference path is a connected path in the knowledge sub-graph whose importance meets a preset rule, and the knowledge sub-graph is obtained by combining the connected paths between any two entities in the connected entity set in the news knowledge graph; combines the step contents of the multiple plan steps according to the step sequence to generate the news content that meets the news requirements, and the step content of each plan step is obtained by combining the inference path and the entity set of each plan step. In this way, the embodiments of the present application can parse the news requirements of the user into a content generation plan including multiple plan steps, align the entities in each plan step with the entities in a preset news knowledge graph, obtain the entity set for each plan step related to the news requirements, reduce the interference of irrelevant content, then generate the step content of each plan step according to the inference path and the entity set of each plan step, and finally combine the step contents of the multiple plan steps according to the step sequence to generate news content, so that the step content of each plan step is closely related to the news requirements input by the user, thereby enhancing the logic of the generated news content. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required to be used in the embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0019] Figure 1 is a flowchart of the method for generating news content provided by the embodiments of the present application;

[0020] Figure 2 is a flowchart of a scenario embodiment provided by the embodiments of the present application;

[0021] Figure 3 is a structural diagram of the apparatus for generating news content provided by the embodiments of the present application;

[0022] Figure 4 is a structural diagram of the electronic device provided by the embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0023] The features and exemplary embodiments of various aspects of the present application will be described in detail below. To make the objectives, technical solutions, and advantages of the present application clearer and more understandable, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application and not to limit the present application. For those skilled in the art, the present application can be implemented without some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by showing examples of the present application.

[0024] It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising..." does not exclude the presence of additional identical elements in the process, method, article or device comprising the said element.

[0025] Currently, the production of traditional news content relies on manual writing, which is time-consuming and difficult to meet the rapidly changing news needs. To improve the production efficiency of news content, current methods for automatically generating news content mainly rely on deep learning and reinforcement learning technologies, that is, the machine is trained through a large number of literary work samples to learn various writing styles and establish a writing model. However, this often results in problems such as illogical sequence in the generated content.

[0026] To solve the problems of the prior art, the embodiments of the present application provide a method, device, equipment, medium and product for generating news content. First, the method for generating news content provided by the embodiments of the present application will be introduced below.

[0027] Figure 1 The flowchart of the method for generating news content provided by an embodiment of the present application is shown. As Figure 1 shown, a method for generating news content may include the following steps S101 to S104:

[0028] S101. When receiving the news requirements input by the user, parse the news requirements to obtain a content generation plan, where the content generation plan includes multiple plan steps and the step sequence of the multiple plan steps;

[0029] S102. Align the entities in each planned step with the entities in a preset news knowledge graph to obtain the entity set of each planned step. The news knowledge graph is constructed from multiple historical news articles, and the entity set includes at least one entity.

[0030] S103. Use each entity in each entity set as a seed point in the news knowledge graph to construct the inference path of each planned step. The inference path is a connected path in the knowledge sub-graph whose importance meets the preset rules. The knowledge sub-graph is obtained by combining the connected paths between every two entities in the connected entity set in the news knowledge graph.

[0031] S104. Combine the step contents of multiple planned steps in the order of the steps to generate the news content of the news requirement. The step content of each planned step is obtained by combining the inference path and the entity set of each planned step.

[0032] For the method for generating news content in the embodiments of the present application, when receiving the news requirement input by the user, parse the news requirement to obtain a content generation plan. The content generation plan includes multiple planned steps and the step order of the multiple planned steps; align the entities in each planned step with the entities in a preset news knowledge graph to obtain the entity set of each planned step. The news knowledge graph is constructed from multiple historical news articles, and the entity set includes at least one entity; use each entity in each entity set as a seed point in the news knowledge graph to construct the inference path of each planned step. The inference path is a connected path in the knowledge sub-graph whose importance meets the preset rules. The knowledge sub-graph is obtained by combining the connected paths between every two entities in the connected entity set in the news knowledge graph; combine the step contents of multiple planned steps in the order of the steps to generate the news content of the news requirement. The step content of each planned step is obtained by combining the inference path and the entity set of each planned step. In this way, the embodiments of the present application can parse the news requirement of the user into a content generation plan including multiple planned steps, align the entities in each planned step with the entities in a preset news knowledge graph to obtain the entity set of each planned step related to the news requirement, reduce the interference of irrelevant content, then generate the step content of each planned step according to the inference path and the entity set of each planned step, and finally combine the step contents of multiple planned steps in the order of the steps to generate news content. In this way, the step content of each planned step is closely related to the news requirement input by the user, thereby enhancing the logic of the generated news content.

[0033] In S101, the news requirements input by the user, by way of example, may be the core theme of the news specified by the user (such as "climate change") or keywords (such as "new energy vehicles") or the focus of the report (such as "the impact of environmental protection policies on the economy"); it may also be the genre (such as news briefs, in-depth reports, commentary articles) or field (finance, sports, entertainment) of the specified generated content, as well as the requirement for formality (traditional media style), colloquialism (social media style), or customization for a specific audience (such as teenagers, professionals).

[0034] The above content generation plan may be an outline of the content that meets the news requirements. The content generation plan may include multiple plan steps and the step sequence of multiple plan steps. Among them, the multiple plan steps are specific links or tasks in the content generation plan, and each step has a clear goal and implementation method, jointly promoting the completion of the content generation process. By way of example, when the news requirement is to address the challenges of global climate change, the multiple plan steps may be introduction, data analysis, event review, expert opinions, summary steps, etc.

[0035] Parsing the above news requirements to obtain a content generation plan, by way of example, may be to parse the news requirements according to a preset large language model to obtain a content generation plan. The large language model is trained by a data set, and the data set includes multiple historical news releases and the corresponding content outlines of each historical news release. Alternatively, it may also be to parse the news requirements and generate a content plan through a template that matches the news requirements among multiple predefined templates.

[0036] In S102, the above news knowledge graph, that is, the knowledge graph in the news field, is a structured knowledge representation method that can be used to describe the entities and relationships involved in the news. It transforms the news content into a graph structure, where nodes represent entities (such as people, places, organizations, events), and edges represent the relationships associated between entities. In the embodiments of the present application, the news knowledge graph can be constructed from multiple historical news releases. Specifically, it can be to obtain multiple historical news releases, extract information from each historical news release to obtain the entities and relationships of each historical news release, and then combine the entities and relationships of multiple historical news releases to obtain the news knowledge graph.

[0037] Aligning the entities in each plan step with the entities in the preset news knowledge graph to obtain the entity set of each plan step, by way of example, may be to extract entities for each generation step and align them with the pre-constructed news knowledge graph through entities to obtain the entity set after alignment of each plan step. Among them, the entity set includes at least one entity. By way of example, it may be at least one of the news occurrence time, news occurrence location, summary of the event that occurred, people included in the news, news type, etc.

[0038] In S103, the above knowledge sub-graph can be obtained by combining the connected paths between every two entities in the connected entity set of the news knowledge graph.

[0039] The above inference path can be a connected path in the knowledge sub-graph whose importance meets a preset rule. Exemplarily, it can be the top 5 connected paths when the importance in the knowledge sub-graph is sorted from large to small. The larger the value of the importance, the more important the connected path. Of course, in the embodiments of the present application, the inference path is not limited to the top 5 connected paths when the importance in the knowledge sub-graph is sorted from large to small, and can also be set according to the actual needs of the user, and no specific limitation is made here.

[0040] The above-mentioned construction of the inference path for each planning step with each entity in each entity set in the news knowledge graph can be, for example, traversing the path between the first entity and the second entity in the news knowledge graph to construct the knowledge sub-graph for each planning step. The knowledge sub-graph is composed of at least one connected path, and the connected path is a path in which the number of nodes passed between the first entity and the second entity does not exceed a preset target number. The first entity and the second entity are any two entities in each entity set; calculate the importance of each connected path in each knowledge sub-graph; among the importance of at least one connected path corresponding to each planning step, determine the connected path whose importance meets the preset rule as the inference path for each planning step.

[0041] In S104, the step content of each above-mentioned planning step can be obtained by combining the inference path of each planning step and the entity set. Exemplarily, it can be to combine the inference path and entity set of each planning step with a preset first news instruction template to generate the step content of each planning step.

[0042] The above combination of the step content of multiple planning steps in the step order to generate the news content of the news requirement can be, for example, first combining the inference path and entity set of each planning step with a preset first news instruction template to generate the step content of each planning step; then combining the step content of multiple planning steps with a preset second news instruction template to generate the news content of the news requirement. The second news instruction template includes the step order.

[0043] In some embodiments, the above S101 can specifically include:

[0044] Analyze the news requirement according to a preset large language model to obtain a content generation plan. The large language model is trained by a data set, and the data set includes multiple historical news articles and the content outlines corresponding to each historical news article.

[0045] The above large language model is trained from a dataset, which may include multiple historical press releases and the corresponding content outlines of each historical press release. Among them, the content outlines corresponding to each historical press release can be obtained by annotating the content outlines of each historical press release. Exemplarily, it can be manually reading and marking each part of the content paragraph by paragraph, or using natural language processing tools to assist in automatic annotation, and the context in the content outline is logically related.

[0046] In the embodiments of the present application, since the dataset includes multiple historical press releases and the corresponding content outlines of each historical press release, and the context in the content outline is logically related, therefore, by training the large language model with the dataset to analyze news requirements, a content generation plan with strong logicality in the context can be obtained, further enhancing the logicality of the generated news content.

[0047] As an implementation manner of the present application, since it is impossible to ensure that each retrieved reference material is relevant to the user input requirements during the generation process of news content, and there will also be some content irrelevant to the input requirements in the relevant reference materials, thus introducing a large number of "noisy" reference materials, resulting in the generated news content being unable to correctly summarize or extract the content in the reference materials and generating incorrect outputs. In order to make the generated news content accurately relevant to the news requirements, before the above S102, the above method may further include:

[0048] Obtain multiple historical press releases;

[0049] Extract information from each historical press release to obtain the entities and relationships of each historical press release;

[0050] Combine the entities and relationships of multiple historical press releases to obtain a news knowledge graph.

[0051] The above multiple historical press releases can be existing unstructured press releases.

[0052] The entities of the above historical press releases may include: news occurrence time, news occurrence location, summary of the event that occurred, people included in the news, news type. Of course, the entities extracted in the embodiments of the present application are not limited to the above content, and corresponding information can also be extracted according to actual needs.

[0053] The above combination of the entities and relationships of multiple historical press releases to obtain a news knowledge graph, exemplarily, can be to combine the entities and relationships of multiple historical press releases into a triple form to obtain a news knowledge graph.

[0054] In the embodiments of the present application, by extracting information from each historical press release, entities and relationships of each historical press release are obtained, and then the entities and relationships of multiple historical press releases are combined to obtain a graph-structured news knowledge graph. Using this news knowledge graph as a knowledge base, when aligning the entities in each planned step with the entities in the preset news knowledge graph, an entity set of each planned step related to the news requirement can be obtained. Thus, when generating the step content of each planned step, interference from irrelevant content can be reduced, making the generated news content accurately related to the news requirement.

[0055] In some embodiments, the above S103 may specifically include:

[0056] Traverse the paths between the first entity and the second entity in the news knowledge graph to construct a knowledge sub-graph for each planned step. The knowledge sub-graph is composed of at least one connected path. The connected path is a path between the first entity and the second entity with the number of nodes passed through not exceeding a preset target number. The first entity and the second entity are any two entities in each entity set;

[0057] Calculate the importance of each connected path in each knowledge sub-graph;

[0058] Among the importance degrees of at least one connected path corresponding to each planned step, determine the connected paths whose importance degrees meet the preset rules as the reasoning paths of each planned step.

[0059] The above knowledge sub-graph can be composed of at least one connected path.

[0060] The above connected path can be a path between the first entity and the second entity with the number of nodes passed through not exceeding a preset target number. Among them, the target number, by way of example, can be 3. Of course, in the embodiments of the present application, the target number can also be set according to the actual needs of the user and will not be specifically limited herein.

[0061] The above first entity and second entity can be any two entities in each entity set.

[0062] The above traversing the paths between the first entity and the second entity in the news knowledge graph to construct a knowledge sub-graph for each planned step, by way of example, can be to sequentially take out two entity nodes E i (i.e., the entity set of the i-th planned step) from the entity set E of each planned step i1 and E i2 , and traverse all connected paths within 3 hops of the two entity nodes from the news knowledge graph G (for example, a complete path can be formed with at most three nodes passed through between E i1 and E i2 ); continue to loop through E i1 and Ei 3-hop or less connected paths of other nodes in, and save the connected paths in R c Meanwhile, record all nodes that are connected to E i1 with connected paths and store them in E c Then, delete E from E i from E i1 Select nodes from E as seed points and repeat the above loop traversal operation. After traversing all nodes in E c , delete the nodes in E from E c until E is empty and then stop the operation. Perform deduplication and recombination on all connected paths saved in R c to obtain the knowledge sub-graph G of each planning step i i c Calculate the importance of all connected paths saved in R, and perform deduplication and recombination to obtain the knowledge sub-graph G of each planning step sub

[0063] Calculate the importance of each connected path in each knowledge sub-graph. Exemplarily, it can be to calculate the importance of all connected paths in each knowledge sub-graph G sub , that is, the PageRank value. The calculation method is a prior art method and will not be elaborated here

[0064] Among the importance of at least one connected path corresponding to each planning step, determine the connected paths whose importance meets the preset rules as the inference paths of each planning step. Exemplarily, it can be sorted according to the size of the PageRank value. The larger the PageRank value, the higher the importance of this connected path. Therefore, the inference paths of each planning step are the first k connected paths sorted by the size of the PageRank value, that is, R = {R k |R k ∈R c , k = 1, 2,..., N}. In the embodiments of the present application, k is a positive integer greater than or equal to 1

[0065] In the embodiments of the present application, traverse the paths between the first entity and the second entity in the news knowledge graph to construct the knowledge sub-graph of each planning step, then calculate the importance of each connected path in each knowledge sub-graph, and finally accurately determine the inference path of each planning step according to the importance of at least one connected path corresponding to each planning step

[0066] In some embodiments, the above S104 may specifically include

[0067] Combine the inference paths and entity sets of each planning step with a preset first news instruction template to generate the step content of each planning step

[0068] ​​​Combine the step content of multiple planning steps with a preset second news instruction template to generate news content that meets the news requirements. The second news instruction template includes the step sequence.

[0069] The above first news instruction template can be a general writing template.

[0070] The above combines the inference path and entity set of each planning step with a preset first news instruction template to generate the step content of each planning step. Exemplarily, the inference path and entity set of each planning step can be input into a large language model together with the preset first news instruction template to output the step content of each planning step.

[0071] The above second news instruction template can be a template with a fixed writing style.

[0072] The above combines the step content of multiple planning steps with a preset second news instruction template to generate news content that meets the news requirements. Exemplarily, the step content of multiple planning steps and the preset second news instruction template can be input into a large language model. Since the second news instruction template includes the step sequence, the step content of each planning step can be combined according to the step sequence, and finally the news content that meets the news requirements is output.

[0073] In the embodiments of the present application, first combine the inference path and entity set of each planning step with a preset first news instruction template to generate the step content of each planning step, and then combine the step content of multiple planning steps with a preset second news instruction template to combine the step content of each planning step according to the step sequence, so as to generate news content that meets the news requirements and ensure the logic in the news content.

[0074] As another implementation manner of the present application, in order to enrich the step content of each planning step, before the above combines the inference path and entity set of each planning step with a preset first news instruction template to obtain the step content of each planning step, the above method may further include:

[0075] In the case of receiving news materials input by the user, extract the step materials of each planning step from the news materials;

[0076] The above combines the inference path and entity set of each planning step with a preset first news instruction template to obtain the step content of each planning step, which may specifically include:

[0077] Combine the inference path, entity set and step materials of each planning step with a preset first news instruction template to obtain the step content of each planning step.

[0078] The above news materials are the latest background data collected by the user related to the news requirements.

[0079] The above-mentioned step materials for extracting each planned step from news materials, by way of example, may be to extract entities from news materials and align them with the entities of each planned step to obtain the step materials of each planned step.

[0080] In the embodiments of the present application, in the case of receiving news materials input by a user, step materials for extracting each planned step are extracted from the news materials, and the inference paths, entity sets, and step materials of each planned step are combined with a preset first news instruction template, so as to enrich the step content of each planned step.

[0081] As another implementation manner of the present application, in order to obtain news content that meets the writing type, style, and text structure of news requirements, before combining the step content of multiple planned steps with a preset second news instruction template to obtain the news content of news requirements, the above method may further include:

[0082] Perform intention recognition on news requirements to obtain the news type, news style, and news text structure of news requirements;

[0083] Determine a target news instruction template that matches the news type, news style, and news text structure in a preset news instruction template library, where the news instruction template library includes multiple news instruction templates, and different news instruction templates correspond to different news types, different news styles, and different news text structures;

[0084] The above-mentioned combining the step content of multiple planned steps with a preset second news instruction template to obtain the news content of news requirements may specifically include:

[0085] Combine the step content of multiple planned steps with the target news instruction template to obtain the news content of news requirements.

[0086] The above-mentioned performing intention recognition on news requirements to obtain the news type, news style, and news text structure of news requirements, by way of example, may perform intention recognition on news requirements through a large language model to obtain the news type, news style, and news text structure of news requirements.

[0087] The above-mentioned news instruction template library may include multiple news instruction templates, and different news instruction templates correspond to different news types, different news styles, and different news text structures.

[0088] The above-mentioned target news instruction template may be a news instruction template corresponding to the news type, news style, and news text structure of news requirements.

[0089] In the embodiments of the present application, by performing intent recognition on news requirements, the news type, news style, and news text structure of the news requirements are obtained. Then, a target news instruction template that matches the news type, news style, and news text structure is determined in a preset news instruction template library. Finally, the step contents of multiple planned steps are combined with the target news instruction template to obtain news content that matches the writing type, style, and text structure of the current news requirements, thereby meeting the content generation requirements of users for different news types, different news styles, and different news text structures.

[0090] To facilitate the understanding of the news content generation method in the embodiments of the present application, the actual application process of this news content generation method is described as follows:

[0091] As Figure 2 shown, the present application provides a news content generation method, including the following technical modules:

[0092] 1. Construction of news domain knowledge graph: Structuring existing historical news articles, that is, performing entity extraction on each historical news article. The entities to be extracted include: news occurrence time, news occurrence location, summary of the event that occurred, people included in the news, and news type. These entities are combined into triples through relationships to construct a knowledge graph, that is, converting unstructured historical news articles into highly structured graph structures.

[0093] 2. Content generation intent recognition: Using a large language model (LLM) to perform intent recognition on user input requirements and generate three parts of content, including: news type, news style, and news text structure. Through the Agent ability of the LLM model and based on the above three parts of generated content, the large model autonomously selects the most suitable Prompt template (equivalent to the above target news instruction template) from a pre-set Prompt library (equivalent to the above news instruction template library) to enhance the generation ability for different style contents.

[0094] 3. Planning specific steps for generating content based on the Agent ability of the large language model: Collect data required by the model (such as historical news articles) and annotate their content outlines to complete the construction of the data set required by the model.

[0095] 4. Alignment of user input with the knowledge graph: Using the large model to generate a step-by-step content generation plan P according to user input requirements. For each generation step (equivalent to the above planned steps), entities are extracted and aligned with the previously constructed news knowledge graph through entities, and the set of aligned entities for each step is E = {e1, e2,..., e n}.

[0096] 5. Path Selection on Graph: The main function of this part is to select the graph inference path corresponding to the planned steps on the graph. The entity set E generated in the previous step is required for this part. For each generated planned step P i there is a corresponding entity set E i , that is, P i and E i have a one-to-one correspondence. Using each entity e in E i as the seed point, search for the inference path R in the news knowledge graph G constructed in the first step. The specific steps are as follows:

[0097] 1) First, take out two entity nodes E i and E i1 from E i2 in sequence, and traverse all paths within 3 hops of the two entity nodes from the graph G (that is, a complete path can be formed with at most three nodes in between E i1 and E i2 ).

[0098] 2) Continue to loop through and traverse the paths within 3 hops of other nodes in E i1 and E i , and save the connected paths in R c . At the same time, record all the nodes with connected paths to E i1 and store them in E c , then delete E i from E i1 .

[0099] 3) Select nodes from E c as the seed points and continue to perform the operations in step 2. After traversing all the points in E c , delete the nodes in E c from E i , and stop the operation until E i is empty.

[0100] 4) Remove duplicates from all the paths saved in R c , and recombine these paths into a subgraph G sub (equivalent to the above knowledge subgraph).

[0101] 5) Calculate the PageRank value (i.e., the above importance) for all the paths in the subgraph G sub , and sort them according to the size of the PageRank value. The larger the PageRank value, the higher the importance of this path is considered. The final obtained inference path is R = {R k |R k ∈R c , k = 1, 2,..., N}

[0102] 6. Step - by - step content generation: It is known that after parsing the user's input requirements (equivalent to the above - mentioned news requirements) through a large - language model, a set of steps P for the content generation plan will be generated. Here, P i represents step i. According to each planning step P i extract relevant content from the background materials input by the user (equivalent to the above - mentioned news materials) and denote it as K i (equivalent to the above - mentioned step materials). Thus, we can obtain a pair of planning background materials {P i , K i}. Combine this part with a specific Prompt template (equivalent to the above - mentioned first news instruction template) and input it into the large - language model to output the generated content C i corresponding to the planning step P i . Loop through the set P until the set P is empty. Through this part of the operation, we can obtain a step - by - step content generation set C for the final result.

[0103] 7. Content integration and polishing: Through the two modules of graph - based path selection and step - by - step content generation, we can obtain the inference path R i corresponding to the planning steps and the generated content C i . Combine these two parts in one - to - one correspondence into a prompt and continue to input it into the large model for final sorting and polishing. The key point in the design of this part of the prompt template (equivalent to the above - mentioned second news instruction template) is to logically connect all the content in the order of steps and at the same time perform some polishing on the writing style.

[0104] This application provides a method for generating news content. Compared with the traditional method of large - model retrieval enhancement, the advantages of this application are mainly the following two points: 1. Using a graph - structured knowledge graph as a knowledge base can help the large model understand the logical relationship between text contents, and the reduction of irrelevant content can save the tokens of the large model and enhance its reasoning ability. 2. It fully mobilizes the Agent ability of the large model, decomposes the task into several subtasks, and ensures that the content generated at each step is closely related to the user's input requirements, fully guaranteeing the logical coherence of the generated content.

[0105] Based on the method for generating news content provided in the above - mentioned embodiments, correspondingly, this application also provides a specific implementation manner of a news content generation device. Please refer to the following embodiments.

[0106] As Figure 3 shown, the news content generation device 300 provided in the embodiments of this application may include the following modules: a parsing module 301, an alignment module 302, a construction module 303, and a generation module 304.

[0107] The parsing module 301 is configured to parse the news requirement when receiving the news requirement input by the user, and obtain a content generation plan, where the content generation plan includes multiple plan steps and the step sequence of the multiple plan steps;

[0108] The alignment module 302 is configured to align the entities in each plan step with the entities in a preset news knowledge graph to obtain an entity set for each plan step. The news knowledge graph is constructed from multiple historical news articles, and the entity set includes at least one entity;

[0109] The construction module 303 is configured to use each entity in each entity set as a seed point in the news knowledge graph to construct an inference path for each plan step. The inference path is a connected path in the knowledge sub-graph whose importance meets a preset rule. The knowledge sub-graph is obtained by combining the connected paths between any two entities in the connected entity set in the news knowledge graph;

[0110] The generation module 304 is configured to combine the step contents of the multiple plan steps according to the step sequence to generate the news content of the news requirement. The step content of each plan step is obtained by combining the inference path and the entity set of each plan step.

[0111] The news content generation device according to the embodiment of the present application, when receiving the news requirement input by the user, parses the news requirement to obtain a content generation plan, where the content generation plan includes multiple plan steps and the step sequence of the multiple plan steps; aligns the entities in each plan step with the entities in a preset news knowledge graph to obtain an entity set for each plan step. The news knowledge graph is constructed from multiple historical news articles, and the entity set includes at least one entity; uses each entity in each entity set as a seed point in the news knowledge graph to construct an inference path for each plan step. The inference path is a connected path in the knowledge sub-graph whose importance meets a preset rule. The knowledge sub-graph is obtained by combining the connected paths between any two entities in the connected entity set in the news knowledge graph; combines the step contents of the multiple plan steps according to the step sequence to generate the news content of the news requirement. The step content of each plan step is obtained by combining the inference path and the entity set of each plan step. In this way, the embodiment of the present application can parse the news requirement of the user into a content generation plan including multiple plan steps, align the entities in each plan step with the entities in a preset news knowledge graph to obtain the entity set for each plan step related to the news requirement, reduce the interference of irrelevant content, then generate the step content of each plan step according to the combination of the inference path and the entity set of each plan step, and finally combine the step contents of the multiple plan steps according to the step sequence to generate the news content. In this way, the step content of each plan step is closely related to the news requirement input by the user, thereby enhancing the logic of the generated news content.

[0112] In some embodiments, the above parsing module 301 may specifically be configured to parse news requirements according to a preset large language model to obtain a content generation plan. The large language model is trained by a data set, and the data set includes multiple historical news releases and the corresponding content outlines of each historical news release.

[0113] As an implementation manner of the present application, since it is impossible to ensure that each retrieved reference material is relevant to the user input requirements during the generation of news content in the prior art, and there will also be some content irrelevant to the input requirements in the relevant reference materials, a large number of "noisy" reference materials are introduced, resulting in the generated news content being unable to correctly summarize or refine the content in the reference materials and generating incorrect outputs. In order to make the generated news content accurately relevant to the news requirements, the above device 300 may further include:

[0114] An acquisition module, configured to acquire multiple historical news releases;

[0115] An extraction module, configured to extract information from each historical news release to obtain the entities and relationships of each historical news release;

[0116] A combination module, configured to combine the entities and relationships of multiple historical news releases to obtain a news knowledge graph.

[0117] In some embodiments, the above construction module 303 may specifically include:

[0118] A construction unit, configured to traverse the path between a first entity and a second entity in the news knowledge graph to construct a knowledge sub-graph for each planning step. The knowledge sub-graph is composed of at least one connected path, and the connected path is a path in which the number of nodes passed between the first entity and the second entity does not exceed a preset target number. The first entity and the second entity are any two entities in each entity set;

[0119] A calculation unit, configured to calculate the importance of each connected path in each knowledge sub-graph;

[0120] A determination unit, configured to determine, among the importance degrees of at least one connected path corresponding to each planning step, the connected path whose importance degree meets a preset rule as the inference path of each planning step.

[0121] In some embodiments, the above generation module 304 may specifically include:

[0122] A first generation unit, configured to combine the inference path and entity set of each planning step with a preset first news instruction template to generate the step content of each planning step;

[0123] A second generation unit, configured to combine the step contents of multiple planning steps with a preset second news instruction template to generate news content for news requirements, where the second news instruction template includes a step sequence.

[0124] As another implementation manner of the present application, in order to enrich the step contents of each planning step, the above device 300 may further include:

[0125] An extraction module, configured to extract step materials of each planning step from news materials when receiving news materials input by a user;

[0126] The above first generation unit is specifically configured to combine the inference path, entity set, and step materials of each planning step with a preset first news instruction template to obtain the step content of each planning step.

[0127] As yet another implementation manner of the present application, in order to obtain news content that meets the writing type, style, and style structure of news requirements, the above device 300 may further include:

[0128] An identification module, configured to perform intention identification on news requirements to obtain the news type, news style, and news style structure of news requirements;

[0129] A determination module, configured to determine a target news instruction template that matches the news type, news style, and news style structure in a preset news instruction template library, where the news instruction template library includes multiple news instruction templates, and different news instruction templates correspond to different news types, different news styles, and different news style structures;

[0130] The above second generation unit is specifically configured to combine the step contents of multiple planning steps with the target news instruction template to obtain news content for news requirements.

[0131] Figure 4 The hardware structure diagram of an electronic device provided by an embodiment of the present application is shown.

[0132] The electronic device may include a processor 401 and a memory 402 storing computer program instructions.

[0133] Specifically, the above processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0134] The memory 402 may include a mass storage for data or instructions. By way of example and not limitation, the memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 402 may include removable or non-removable (or fixed) media. Where appropriate, the memory 402 may be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, the memory 402 is a non-volatile solid-state memory.

[0135] In a particular embodiment, the memory 402 may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage media device, an optical storage media device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to an aspect of the present disclosure.

[0136] The processor 401 reads and executes the computer program instructions stored in the memory 402 to implement the news content generation method in any of the above embodiments.

[0137] In one example, the electronic device may further include a communication interface 403 and a bus 410. Among them, as Figure 4 shown, the processor 401, the memory 402, and the communication interface 403 are connected through the bus 410 and complete communication with each other.

[0138] The communication interface 403 is mainly used to implement communication between the modules, devices, units, and / or devices in the embodiments of the present application.

[0139] The bus 410 includes hardware, software, or both, and couples components of the electronic device to each other. By way of example and not limitation, the bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, the bus 410 may include one or more buses. Although embodiments of the present application describe and illustrate specific buses, the present application contemplates any suitable bus or interconnect.

[0140] The electronic device can execute the news content generation method in the embodiments of the present application, thereby implementing the combination of Figure 1 and Figure 3 the method and apparatus for generating news content described.

[0141] In addition, in combination with the news content generation method in the above embodiments, embodiments of the present application can provide a computer-readable storage medium to implement. Computer program instructions are stored on the computer-readable storage medium; when the computer program instructions are executed by a processor, any one of the news content generation methods in the above embodiments is implemented.

[0142] Embodiments of the present application also provide a computer program product, including a computer program, and when the computer program is executed by a processor, any one of the news content generation methods in the above embodiments is implemented.

[0143] It should be clear that the present application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps after understanding the spirit of the present application.

[0144] The functional blocks shown in the above-described structural block diagrams can be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a functional card, and so on. When implemented in software, the elements of the present application are programs or code segments for performing the required tasks. The program or code segment can be stored in a machine-readable medium or transmitted via a data signal carried in a carrier wave over a transmission medium or a communication link. "Machine-readable medium" can include any medium that can store or transmit information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical discs, hard disks, fiber optic media, radio frequency (RF) links, and so on. The code segment can be downloaded via a computer network such as the Internet, an intranet, and so on.

[0145] It should also be noted that the exemplary embodiments mentioned in the present application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above steps, that is, the steps can be executed in the order mentioned in the embodiments, or different from the order in the embodiments, or several steps can be executed simultaneously.

[0146] Aspects of the present disclosure have been described above with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present disclosure. It should be understood that each block in the flowcharts and / or block diagrams, and the combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device enable the implementation of the functions / actions specified in one or more blocks of the flowcharts and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It should also be understood that each block in the block diagrams and / or flowcharts, and the combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware for performing the specified functions or actions, or by a combination of dedicated hardware and computer instructions.

[0147] As described above, this is only the specific implementation manner of the present application. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, modules, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein. It should be understood that the protection scope of the present application is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present application can easily think of various equivalent modifications or substitutions, and these modifications or substitutions should all be covered within the protection scope of the present application.

Claims

1. A method for generating news content, characterized in that, Including: In the case of receiving a news demand input by a user, parsing the news demand to obtain a content generation plan, where the content generation plan includes a plurality of planned steps and the step sequence of the plurality of planned steps; Aligning the entities in each of the planned steps with the entities in a preset news knowledge graph to obtain an entity set for each of the planned steps, where the news knowledge graph is constructed from a plurality of historical news articles, and the entity set includes at least one entity; Taking each entity in each entity set as a seed point in the news knowledge graph to construct an inference path for each of the planned steps, where the inference path is a connected path in the knowledge sub-graph whose importance meets a preset rule, and the knowledge sub-graph is obtained by combining the connected paths connecting any two entities in the entity set in the news knowledge graph; Combining the step contents of the plurality of planned steps in accordance with the step sequence to generate news content for the news demand, where the step content of each of the planned steps is obtained by combining the inference path and entity set of each of the planned steps.

2. The method according to claim 1, characterized in that, The parsing the news demand to obtain a content generation plan includes: Parsing the news demand according to a preset large language model to obtain a content generation plan, where the large language model is trained by a data set, and the data set includes the plurality of historical news articles and the content outlines corresponding to the historical news articles.

3. The method according to claim 1, characterized in that Before the aligning the entities in each of the planned steps with the entities in a preset news knowledge graph to obtain an entity set for each of the planned steps, the method further includes: Obtaining the plurality of historical news articles; Performing information extraction on each of the historical news articles to obtain the entities and relationships of each of the historical news articles; Combining the entities and relationships of the plurality of historical news articles to obtain the news knowledge graph.

4. The method according to claim 1, wherein The taking each entity in each entity set as a seed point in the news knowledge graph to construct an inference path for each of the planned steps includes: Traversing the paths between a first entity and a second entity in the news knowledge graph to construct a knowledge sub-graph for each of the planned steps, where the knowledge sub-graph is obtained by combining at least one connected path, and the connected path is a path in which the number of nodes passed between the first entity and the second entity does not exceed a preset target number, and the first entity and the second entity are any two entities in each entity set; Calculating the importance of each connected path in each knowledge sub-graph; Among the importance of the at least one connected path corresponding to each of the planned steps, determining the connected paths whose importance meets the preset rule as the inference paths for each of the planned steps.

5. The method according to claim 1, wherein The combining the step contents of the plurality of planned steps in accordance with the step sequence to generate news content for the news demand includes: Combining the inference path and entity set of each of the planned steps with a preset first news instruction template to generate the step content of each of the planned steps; Combine the step content of the multiple planned steps with a preset second news instruction template to generate the news content of the news requirement, where the second news instruction template includes the step sequence.

6. The method according to claim 5, wherein Before combining the inference path and entity set of each of the planned steps with a preset first news instruction template to obtain the step content of each of the planned steps, the method further includes: When receiving the news material input by the user, extract the step material of each of the planned steps from the news material; The combining the inference path and entity set of each of the planned steps with a preset first news instruction template to obtain the step content of each of the planned steps includes: Combine the inference path, entity set, and step material of each of the planned steps with a preset first news instruction template to obtain the step content of each of the planned steps.

7. The method according to claim 5, characterized in that, Before combining the step content of the multiple planned steps with a preset second news instruction template to obtain the news content of the news requirement, the method further includes: Perform intent recognition on the news requirement to obtain the news type, news style, and news style structure of the news requirement; Determine a target news instruction template that matches the news type, news style, and news style structure in a preset news instruction template library, where the news instruction template library includes multiple news instruction templates, and different news instruction templates correspond to different news types, different news styles, and different news style structures; The combining the step content of the multiple planned steps with a preset second news instruction template to obtain the news content of the news requirement includes: Combine the step content of the multiple planned steps with the target news instruction template to obtain the news content of the news requirement.

8. A news content generation device, characterized in that, The device includes: A parsing module, configured to parse the news requirement to obtain a content generation plan when receiving the news requirement input by the user, where the content generation plan includes multiple planned steps and the step sequence of the multiple planned steps; An alignment module, configured to align the entities in each of the planned steps with the entities in a preset news knowledge graph to obtain the entity set of each of the planned steps, where the news knowledge graph is constructed from multiple historical news articles, and the entity set includes at least one entity; A construction module, configured to construct the inference path of each of the planned steps with each entity in the entity set as a seed point in the news knowledge graph, where the inference path is a connected path in the knowledge sub-graph whose importance meets a preset rule, and the knowledge sub-graph is obtained by combining the connected paths connecting any two entities in the entity set in the news knowledge graph; A generation module, configured to combine the step content of the multiple planned steps in the step sequence to generate the news content of the news requirement, where the step content of each of the planned steps is obtained by combining the inference path and entity set of each of the planned steps.

9. An electronic device, characterized in that, The device includes: a processor and a memory storing computer program instructions; when the processor executes the computer program instructions, the method for generating news content according to any one of claims 1-7 is implemented.

10. A computer-readable storage medium, characterized in that, Computer program instructions are stored on the computer-readable storage medium, and when the computer program instructions are executed by a processor, the method for generating news content according to any one of claims 1-7 is implemented.

11. A computer program product, characterized in that, When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is caused to execute the method for generating news content according to any one of claims 1-7.