Article generation method and device based on generative model, equipment and medium
By generating article structure description information and using search engines to obtain text material, the problem of lack of structure and content richness of articles generated by generative large language models is solved, and the generation of articles with clear structure and rich content is achieved.
Patent Information
- Application Number
- CN202510410784.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-02
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, when using a generative large language model to generate articles, the document generation results lack structural hierarchy, the content richness is poor, and the article content needs cannot be described in detail.
The first generative model generates article structure description information, determines multiple search terms, uses the search engine to obtain text materials, enters the second generative model to generate target articles, and combines the capabilities of the search engine and the generative model to improve the quality of content generation.
It achieves clear structural hierarchy and high content richness of article generation, which can better meet users' information query needs and improve user experience.
Smart Images

Figure CN120256618A_ABST
Abstract
Description
Technical Field
[0001] It relates to the field of artificial intelligence technology, particularly to the fields of natural language understanding and artificial intelligence-generated content technology, and specifically to an article generation method, device, electronic device, computer-readable storage medium, and computer program product based on a generative model. Background Art
[0002] Artificial intelligence is a discipline that studies the use of computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), including both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include several major directions such as computer vision technology, speech recognition technology, natural language processing technology, and machine learning / deep learning, big data processing technology, and knowledge graph technology.
[0003] With the development of content generation technology based on artificial intelligence, generative large language models (LLMs) trained using large-scale corpora can be used to generate articles to efficiently obtain rich document content.
[0004] The methods described in this section are not necessarily methods that have been previously envisioned or adopted. Unless otherwise specified, no method described in this section should be considered prior art solely because it is included in this section. Similarly, unless otherwise specified, the problems mentioned in this section should not be considered to have been recognized in any prior art. Summary of the Invention
[0005] The present disclosure provides an article generation method, device, electronic device, computer-readable storage medium, and computer program product based on a generative model.
[0006] According to one aspect of the present disclosure, there is provided an article generation method based on a generative model, including: inputting an article generation request into a first generative model to obtain article structure description information generated by the first generative model, where the article structure description information includes information on multiple text content modules; determining multiple search terms based on the information on the multiple text content modules; using a search engine to search based on each of the multiple search terms; determining multiple text materials based on the search results corresponding to each of the multiple search terms; inputting the article generation request and the multiple text materials into a second generative model; and determining a target article based on the output result of the second generative model.
[0007] According to another aspect of the present disclosure, there is provided an article generation device based on a generative model, including: an acquisition unit configured to obtain article structure description information generated by the first generative model by inputting an article generation request into the first generative model, wherein the article structure description information includes information of a plurality of text content modules; a first determination unit configured to determine a plurality of search terms based on the information of the plurality of text content modules; a search unit configured to perform a search using a search engine based on each of the plurality of search terms; a second determination unit configured to determine a plurality of text materials based on the search results corresponding to each of the plurality of search terms; an input unit configured to input the article generation request and the plurality of text materials into the second generative model; and a third determination unit configured to determine a target article based on the output result of the second generative model.
[0008] According to another aspect of the present disclosure, there is provided an electronic device, including: 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 to enable the at least one processor to execute the above-mentioned article generation method based on a generative model.
[0009] According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the above-mentioned article generation method based on a generative model.
[0010] According to another aspect of the present disclosure, there is provided a computer program product, including a computer program, wherein the computer program can implement the above-mentioned article generation method based on a generative model when executed by a processor.
[0011] According to one or more embodiments of the present disclosure, the content richness and generation efficiency of generating articles using a generative model can be improved.
[0012] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it used to limit the scope of the present disclosure. Other features of the present disclosure will become easily understandable through the following description. Description of the Drawings
[0013] The drawings exemplarily show embodiments and form a part of the specification, and are used together with the written description of the specification to explain the exemplary implementation manners of the embodiments. The shown embodiments are only for illustrative purposes and do not limit the scope of the claims. In all the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0014] Figure 1 FIG. 1 shows a schematic diagram of an exemplary system in which various methods described herein can be implemented according to an exemplary embodiment of the present disclosure;
[0015] Figure 2 FIG. 2 shows a flowchart of a method for generating an article based on a generative model according to an exemplary embodiment of the present disclosure;
[0016] Figure 3 FIG. 3 shows a schematic diagram of an article generation process according to an exemplary embodiment of the present disclosure;
[0017] Figure 4 FIG. 4 shows a structural block diagram of an apparatus for generating an article based on a generative model according to an exemplary embodiment of the present disclosure;
[0018] Figure 5 FIG. 5 shows a structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0019] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to assist in understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, descriptions of well-known functions and structures are omitted below for clarity and conciseness.
[0020] In the present disclosure, unless otherwise specified, the terms "first", "second", etc. are used to describe various elements and are not intended to limit the positional relationship, timing relationship, or importance relationship of these elements. Such terms are only used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of the element, and in certain cases, based on the context description, they may also refer to different instances.
[0021] In the description of various examples in the present disclosure, the terms used are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically defined, the element may be one or more. In addition, the term "and / or" used in the present disclosure covers any one of the listed items and all possible combinations.
[0022] Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0023] Figure 1 FIG. 1 shows a schematic diagram of an exemplary system 100 in which various methods and apparatuses described herein can be implemented according to an embodiment of the present disclosure. Refer to Figure 1, the system 100 includes one or more client devices 101, 102, 103, 104, 105, and 106, a server 120, and one or more communication networks 110 that couple the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105, and 106 can be configured to execute one or more applications.
[0024] In an embodiment of the present disclosure, the server 120 can run one or more services or software applications that enable an article generation method based on a generative model to be executed.
[0025] In certain embodiments, the server 120 can also provide other services or software applications, which can include non-virtual environments and virtual environments. In certain embodiments, these services can be provided as web-based services or cloud services, such as provided to users of the client devices 101, 102, 103, 104, 105, and / or 106 under a software as a service (SaaS) model.
[0026] In Figure 1 In the configuration shown, the server 120 can include one or more components that implement the functions performed by the server 120. These components can include software components, hardware components, or a combination thereof that can be executed by one or more processors. Users operating the client devices 101, 102, 103, 104, 105, and / or 106 can in turn utilize one or more client applications to interact with the server 120 to utilize the services provided by these components. It should be understood that various different system configurations are possible, which can be different from the system 100. Therefore, Figure 1 is an example of a system for implementing the various methods described herein and is not intended to be limiting.
[0027] Users can use the client devices 101, 102, 103, 104, 105, and / or 106 to send article generation requests. The client device can provide an interface that enables a user of the client device to interact with the client device. The client device can also output information to the user via the interface. Although Figure 1 only six client devices are depicted, those skilled in the art will be able to understand that the present disclosure can support any number of client devices.
[0028] Client devices 101, 102, 103, 104, 105, and / or 106 can include various categories of computing devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors, or other sensing devices, etc. These computing devices can run various categories and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT WindowsMobile OS, iOS, Windows Phone, Android. Portable handheld devices can include cellular phones, smartphones, tablets, personal digital assistants (PDAs), etc. Wearable devices can include head-mounted displays (such as smart glasses) and other devices. Gaming systems can include various handheld gaming devices, Internet-enabled gaming devices, etc. Client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and can use various communication protocols.
[0029] Network 110 can be any category of network known to those skilled in the art, which can support data communication using any one of a variety of available protocols (including but not limited to TCP / IP, SNA, IPX, etc.). By way of example only, one or more networks 110 can be a local area network (LAN), an Ethernet-based network, token ring, wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (such as Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0030] Server 120 can include one or more general-purpose computers, dedicated server computers (such as PC (personal computer) servers, UNIX servers, midrange servers), blade servers, mainframes, server clusters, or any other suitable arrangement and / or combination. Server 120 can include one or more virtual machines running a virtual operating system, or other computing architectures involving virtualization (such as one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for the server). In various embodiments, server 120 can run one or more services or software applications that provide the functions described below.
[0031] The computing units in server 120 can run one or more operating systems including any of the above-mentioned operating systems and any commercially available server operating systems. Server 120 can also run any one of a variety of additional server applications and / or middleware applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0032] In some embodiments, server 120 can include one or more applications to analyze and merge data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 can also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
[0033] In some embodiments, server 120 can be a server of a distributed system, or a server incorporating a blockchain. Server 120 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in the cloud computing service system to address the defects of difficult management and weak business scalability existing in traditional physical hosts and virtual private server (VPS) services.
[0034] System 100 can also include one or more databases 130. In certain embodiments, these databases can be used to store data and other information. For example, one or more of databases 130 can be used to store information such as audio files and video files. Databases 130 can reside in various locations. For example, the databases used by server 120 can be local to server 120, or can be remote from server 120 and can communicate with server 120 via a network-based or dedicated connection. Databases 130 can be of different categories. In certain embodiments, the databases used by server 120 can be relational databases, for example. One or more of these databases can store, update, and retrieve data to and from the databases in response to commands.
[0035] In certain embodiments, one or more of databases 130 can also be used by applications to store application data. The databases used by applications can be databases of different categories, such as key-value repositories, object repositories, or conventional repositories supported by a file system.
[0036] Figure 1The system 100 can be configured and operated in various ways to enable the application of various methods and devices described in this disclosure.
[0037] In the related art, when using a generative large language model to generate text documents, usually an article generation request is directly sent to the model to obtain the generation result returned by the model. However, the document generation result obtained in this way depends on the performance of the model, and the requirements for the article content cannot be described in detail. The document generation result output by the model usually lacks a structural hierarchy and has poor content richness.
[0038] Based on this, the present disclosure provides an article generation method based on a generative model. First, use a first generative model to generate article structure description information to indicate the content outline of the article, and then determine the information to be searched according to the information of the text content modules in the outline, that is, obtain multiple search terms. On this basis, by searching based on multiple search terms, the ability of the search engine can be used to accurately and efficiently obtain the text content materials corresponding to each content module, and then use the rich content materials related to each module in the article content outline to improve the quality of the content generated by the model.
[0039] Figure 2 The flowchart of an article generation method 200 based on a generative model according to an exemplary embodiment of the present disclosure is shown. As Figure 2 shown, the method 200 includes:
[0040] Step S201, by inputting an article generation request into a first generative model, obtaining the article structure description information generated by the first generative model, wherein the article structure description information includes information of multiple text content modules;
[0041] Step S202, based on the information of the multiple text content modules, determining multiple search terms;
[0042] Step S203, using a search engine to search based on each search term in the multiple search terms;
[0043] Step S204, based on the search results corresponding to each search term in the multiple search terms, determining multiple text materials;
[0044] Step S205, inputting the article generation request and the multiple text materials into a second generative model; and
[0045] Step S206, determining a target article based on the output result of the second generative model.
[0046] By applying the above-mentioned method 200, it is possible to first use the first generative model to generate article structure description information to indicate the content outline of the article, determine the information to be searched according to the information of the text content modules in the outline, that is, obtain multiple search terms. By searching based on multiple search terms, the capabilities of the search engine can be utilized to accurately and efficiently obtain the text content materials corresponding to each content module, and then use the rich content materials related to each module in the article content outline to improve the quality of the content generated by the model.
[0047] In some examples, the first generative model and the second generative model can be generative large language models (GLLMs) trained using a large-scale corpus. Generative large language models are usually built based on deep learning frameworks, have the ability to understand and generate human language, and can capture the statistical laws and semantic logics of language through self-supervised learning, so as to achieve complex tasks such as text generation, dialogue interaction, and knowledge reasoning.
[0048] In some examples, the first generative model and the second generative model can be the same model to improve the convenience of content generation. In some examples, the first generative model and the second generative model can also be different models. For example, the number of parameters and the inference complexity of the second generative model can be greater than those of the first generative model, so that a more lightweight first generative model can be used to generate the article outline more efficiently, and then a second generative model with higher complexity and stronger natural language processing performance can be used to generate the text content of the target article, improving the content generation efficiency while ensuring the content generation quality.
[0049] In some examples, the article generation request can be determined based on the query text entered by the user in the search engine, and the article generation request can be used to describe the content requirements for the target article. In some examples, it can be filtered based on the search history data of multiple users in the search engine. For example, it can be filtered based on the search volume and the feedback information of the user on the search results in the search engine to obtain a target query text that can indicate the needs of the search engine users and whose current search results cannot fully meet the user's needs. By using the generative model to generate the target article corresponding to the target query text, the information query needs of the user can be met using the target article, improving the user experience.
[0050] In some examples, the input information of the first generative model in step S201 may further include a prompt word, which can be used to more accurately describe the content generation task to the generative model. For example, the prompt word can be used to instruct the model to generate the context idea of the target article by simulating the human thinking process, and then generate the structured article structure description information. The article structure description information may include information on multiple text content modules. For example, it may be the titles of multiple chapters that the target article needs to include, the content descriptions of multiple chapters, the text length ratios of multiple chapters, and other information.
[0051] In some examples, the large model Chain-of-Thought (CoT) technology can be used to instruct the first generative model to generate the article structure description information. The Chain-of-Thought technology aims to guide the generative model to gradually display the anthropomorphic thinking process, transforming the implicit black-box reasoning process of the model into an explicit logical chain to improve the language processing performance of the model.
[0052] In some examples, step S202 can also be implemented using the first generative model. For example, task description information indicating that the model generates multiple search terms can be further added to the input information of the first generative model to obtain multiple text content modules and multiple search terms output by the model.
[0053] In some examples, step S202 can also be implemented in other ways. For example, keywords can be extracted for the information of multiple content modules, and multiple search terms can be determined based on the keyword extraction results. In some examples, one article content module can correspond to one or more search terms. In some examples, there may also be article content modules that do not correspond to any search terms (for example, the introduction or conclusion part of the article indicated by the article structure description information may not correspond to any search terms). As long as multiple search terms can be used to represent the knowledge information required to generate the target article, the present disclosure does not limit the method for determining the multiple search terms.
[0054] In some examples, in step S203, multiple search terms can be respectively input into a search engine to obtain the search results corresponding to each search term returned by the search engine. The search engine can perform resource search on the open Internet platform based on the search terms, or can also search in a preset content library. The present disclosure does not limit this.
[0055] According to some embodiments, determining the multiple text materials based on the search results corresponding to each of the multiple search terms in step S204 includes: determining multiple target result items from the search results corresponding to each of the multiple search terms, where each of the multiple target result items includes text content; and determining the multiple text materials based on the multiple target result items. Thus, by first selecting result items containing text content from the search results and then determining the text materials for input into the model from them, it is possible to perform a preliminary screening of the resource types of the search results, facilitating a more efficient determination of the text materials.
[0056] In some examples, when the search engine returns search results, it can mark the resource type corresponding to each search result item. In this case, it is possible to conveniently determine multiple target result items based on the resource types marked by the search engine. For example, the web page or document results marked by the search engine can be determined as target result items to improve the efficiency of screening target result items.
[0057] According to some embodiments, determining the multiple target result items from the search results corresponding to each of the multiple search terms includes: determining the multiple target result items based on the resource location information of the search results corresponding to each of the multiple search terms. Thus, it is possible to perform a preliminary screening based on the resource location information of the search results and use the resource location information of Internet content to filter out graphic and video resources, improving the efficiency of screening target result items.
[0058] In some examples, the resource location information of the search results can be the Uniform Resource Locator (URL) corresponding to the search results. The Uniform Resource Locator corresponds to a standardized naming system for locating resources in the Internet platform and can specify the specific location of resources such as web pages, files, pictures, videos, etc. in the Internet. The Uniform Resource Locator can include information such as the protocol header, domain name, path, query conditions, anchor points, etc. In this case, screening conditions can be set for the Uniform Resource Locator to achieve a preliminary screening of the search results. For example, screening conditions can be set based on the file extension information to filter out search results including extensions of types such as videos and audios, improving the efficiency of screening target result items.
[0059] According to some embodiments, determining a plurality of target result items from the search results corresponding to each of the plurality of search terms includes: for each of the plurality of search terms, determining at least one target result item from the search results corresponding to that search term, and wherein, based on the plurality of target result items, determining the plurality of text materials includes: for each of the plurality of search terms, based on the at least one target result item corresponding to that search term, determining at least one text material corresponding to that search term. Thus, it is possible to separately screen the materials of the search results corresponding to each search term, ensure that the input information of the model can include the materials corresponding to each search term, so that the model can generate a target article text with richer content, and avoid missing the text content modules included in the article structure description information.
[0060] According to some embodiments, based on the plurality of target result items, determining the plurality of text materials includes: determining a plurality of text paragraphs included in the plurality of target result items; and based on the paragraph lengths of the plurality of text paragraphs, determining the plurality of text materials from the plurality of text paragraphs. By screening materials based on the paragraph lengths of text paragraphs, it is possible to ensure that the text materials input into the model contain richer content, thereby improving the quality of article generation.
[0061] In some examples, a paragraph length threshold may be preset in advance, and based on this, the plurality of text paragraphs included in the plurality of target result items are filtered to improve the filtering efficiency.
[0062] According to some embodiments, based on the paragraph lengths of the plurality of text paragraphs, determining the plurality of text materials from the plurality of text paragraphs includes: for each of the plurality of text paragraphs, based on the paragraph length of this text paragraph and the paragraph lengths of one or more adjacent text paragraphs in the target result item where this text paragraph is located, determining whether to filter this text paragraph; in response to determining that this text paragraph needs to be filtered, performing a filtering operation on this text paragraph; and based on the filtered results of the plurality of text paragraphs, determining the plurality of text materials. Thus, when screening materials based on paragraph lengths, it is possible to consider the lengths of adjacent paragraphs in the original search results, avoid the typesetting differences of different search result items from affecting the screening results, and avoid information loss.
[0063] In some examples, it may be to check the plurality of text paragraphs after determining the paragraph lengths of the plurality of text paragraphs. When the paragraph length of a certain text paragraph is too small compared to the paragraph lengths of the adjacent text paragraphs in the target result item where this text paragraph is located (for example: the difference between the paragraph length of this text paragraph and the average paragraph length of the adjacent text paragraphs exceeds a preset threshold), a filtering operation can be performed on this text paragraph to filter out text paragraphs with too little valid content, thereby improving the quality of article generation.
[0064] In some examples, the text content of each original search result can be segmented based on a sliding window, and paragraph filtering is determined by detecting the paragraph length in the sliding window. For example, when the sliding window size is 5, 5 adjacent paragraphs can be scrolled and selected in the text content of the original search result. When the average paragraph length of the 5 paragraphs in the window does not exceed a preset paragraph length threshold, paragraph filtering is performed on the paragraphs in the current window.
[0065] By performing the text paragraph filtering process, redundant information in the original search result can be filtered out, the text that can represent the effective knowledge content can be retained, the redundancy of the model input information can be reduced, and the content generation efficiency and quality can be improved.
[0066] According to some embodiments, method 200 further includes: for each text paragraph among the multiple text paragraphs, in response to determining that the repetition rate of the text paragraph and a preset paragraph exceeds a repetition rate threshold, filtering the text paragraph. Thus, regular matching filtering can be performed based on the preset paragraph to filter out magazine text in the text paragraph, so as to improve the effective information volume of the model input content and improve the content generation quality.
[0067] In some examples, the preset paragraph can be pre-configured manually. For example, regular matching detection can be performed based on content such as "Copywriting: xxx; Editor: xxx", "Welcome to follow the official account below: xxx", "Published on xx / xx at xx:xx", etc. When the paragraph text of the original search result meets a certain repetition condition with the above preset paragraph content, the paragraph is filtered out from the original search result to improve the effective information volume of the model input content and improve the content generation quality.
[0068] After obtaining multiple text materials based on steps S201 - S204, step S205 can be executed to input the article generation request and multiple text materials into the second generative model to obtain the article text generation result output by the model.
[0069] As described above, in some examples, material screening can be performed separately on the search results corresponding to each search term to ensure that the input information of the model can include materials corresponding to each search term. In this case, the multiple text materials can be sequentially spliced based on the order of the multiple text content modules in the article structure description information and the corresponding relationship between each text material and the search term. For example, when the article structure description information includes content module A, content module B, and content module C, and correspondingly search terms a, b, and c, the text materials corresponding to each search term can be sequentially spliced based on the arrangement order of a, b, and c, so that the model can generate a target article based on the article context corresponding to the article structure description information to obtain a more structurally hierarchical target article.
[0070] In some examples, the article structure description information can also be input into the second generative model simultaneously to further improve the generation quality of the target article.
[0071] According to some embodiments, method 200 further includes: determining a plurality of candidate images based on the search results corresponding to each of the plurality of search terms; determining target image description text based on the article generation request and at least one of the plurality of search terms; and determining a target number of image materials from the plurality of candidate images based on the relevance between the plurality of candidate images and the target image description text, wherein determining the target article based on the output result of the second generative model includes: determining the target article by splicing the output result of the second generative model and the target number of image materials. Thus, by screening image resources from the search results and then screening image materials related to the article generation request or search terms from the image resources for splicing into the target article, a target article containing text and image content can be obtained, improving the richness of the article content.
[0072] In some examples, the relevance between the plurality of candidate images and the target image description text can be determined using a relevance evaluation model. For example, a text encoder based on a neural network can be used to encode the target image description text to obtain a text feature vector, and then an image encoder based on a neural network can be used to encode each of the plurality of candidate images to obtain image feature vectors. By calculating the similarity between the text feature vector and the image feature vectors corresponding to each candidate image, the relevance between each candidate image and the target image description text can be determined. In one example, the text encoder based on a neural network can be obtained based on various types of pre-trained language models, and the image encoder based on a neural network can be obtained based on various types of vision-language models. As long as the above two types of encoders can map the target image description text and candidate images to the semantic vector space respectively, the specific structure and training method of the encoder are not limited in the present disclosure.
[0073] In some examples, the screening of image materials can further include more steps. For example, the quality or aesthetics of the candidate images can be detected and scored, and the image materials can be determined based on the scoring results. In one example, the quality detection can be implemented based on an image detection model, such as the GroundingDINO model or the CogVLM model, so as to be able to detect elements such as image watermarks and black edges. By performing image quality detection to ensure the quality of the image materials, the quality of the text and image content in the target article can be further improved.
[0074] According to some embodiments, method 200 further includes: determining the text length of the output result of the second generative model; and determining the target quantity based on the text length. Thereby, the target quantity of picture materials to be spliced can be determined based on the text length of the model output, so that the proportion of text content and pictures in the target article is adapted, improving the quality of the article.
[0075] In some examples, a target ratio of text length to target quantity can be preset in advance, and then the target quantity can be determined based on the target ratio and the text length, so that the proportion of text content and pictures in the target article is adapted. In some examples, the target quantity can also be a preset fixed quantity to simplify the article generation process and reduce resource consumption.
[0076] According to some embodiments, determining the target quantity of picture materials from the multiple candidate pictures based on the relevance between the multiple candidate pictures and the target picture description text includes: sorting the multiple candidate pictures based on the relevance between the multiple candidate pictures and the target picture description text; sequentially detecting the multiple candidate pictures based on the sorting result until the number of candidate pictures passing the detection exceeds the quantity threshold, where the detection conditions for the candidate pictures include at least one of a size condition and a picture quality condition. Thereby, the candidate pictures can be scored and sorted, and the picture materials that meet the requirements can be sequentially selected starting from the picture with the highest score. The detection step for the candidate pictures can, for example, include a picture quality detection step or a step of performing a cropping test on the picture size to obtain a cropped picture that meets the requirements.
[0077] In some examples, the pictures embedded in the target article need to meet certain size requirements. For example, a picture with a fixed size may be required as the cover picture to meet the requirements of the target article's publishing platform. By applying the above steps, picture materials that can meet the detection conditions can be obtained through traversal detection, improving the convenience and efficiency of target article generation.
[0078] In some examples, in step S205, the text generation result of the second generative model can be further detected or processed. For example, typesetting operations can be performed on the text generation result to obtain a more beautiful target article.
[0079] In some examples, the target article obtained by applying the above method 200 can be used for publication on a specific web platform. In this case, a content category judgment model can be used to further determine content tags for the target article to more accurately indicate the content category of the target article, facilitating the search engine to retrieve the target article in the Internet platform or content library and return it to the user to meet the user's content query needs and improve the user experience.
[0080] Figure 3 A schematic diagram of an article generation process according to an exemplary embodiment of the present disclosure is shown. As Figure 3 shown, when an article generation request is needed, the article generation request can be input into the first generative model 301. In this step, the input information of the first generative model 301 can further include task description information to indicate the article structure description information of the target article to be generated by the model and multiple search terms for inputting into a search engine.
[0081] For example, when the article generation request is the user query text "Is the periosteum the meniscus?", the first generative model 301 can determine multiple content modules of the target article based on this, and then determine search term 1 (What is the periosteum), search term 2 (What is the meniscus), and search term 3 (The difference between the periosteum and the meniscus). By using the first generative model 301 to generate the context structure information of the target article and determine multiple search terms, search input information with richer content and hierarchy can be obtained, facilitating the retrieval of more comprehensive and accurate content resources.
[0082] By inputting search term 1, search term 2, and search term 3 into the search engine 302 respectively, the search results corresponding to each search term can be obtained. By using the resource screening module 303 for resource type screening, text resources and picture resources that can be used to generate the target article can be obtained.
[0083] The text filtering module 304 can be used to filter the text resources. For example, it can be based on the text paragraph filtering method described above to obtain text materials with higher effective information content. By splicing the filtered multiple text materials and inputting them into the second generative model 305, the text content generation result output by the model can be obtained.
[0084] The picture filtering module 306 can be used to filter the picture resources. For example, it can be based on the picture detection and picture relevance ranking steps described above to obtain high-quality picture materials related to the article generation request or search terms. By inputting the picture materials and the text content generation result into the layout module 307 for splicing and layout, the target article with rich graphic and text content can be obtained, realizing high-quality article generation.
[0085] According to one aspect of the present disclosure, an article generation device based on a generative model is further provided. Figure 4 A structural block diagram of an article generation device 400 based on a generative model according to an exemplary embodiment of the present disclosure is shown. As Figure 4 shown, the device 400 includes:
[0086] An acquisition unit 401, configured to obtain article structure description information generated by the first generative model by inputting an article generation request into the first generative model, where the article structure description information includes information on a plurality of text content modules;
[0087] A first determination unit 402, configured to determine a plurality of search terms based on the information on the plurality of text content modules;
[0088] A search unit 403, configured to use a search engine to perform a search based on each of the plurality of search terms;
[0089] A second determination unit 404, configured to determine a plurality of text materials based on the search results corresponding to each of the plurality of search terms;
[0090] An input unit 405, configured to input the article generation request and the plurality of text materials into a second generative model; and
[0091] A third determination unit 406, configured to determine a target article based on the output result of the second generative model.
[0092] According to some embodiments, the search unit 403 includes: a first determination subunit, configured to determine a plurality of target result items from the search results corresponding to each of the plurality of search terms, where each of the plurality of target result items includes text content; and a second determination subunit, configured to determine the plurality of text materials based on the plurality of target result items.
[0093] According to some embodiments, the first determination subunit is configured to determine the plurality of target result items based on the resource location information of the search results corresponding to each of the plurality of search terms.
[0094] According to some embodiments, the first determination subunit is configured to, for each of the plurality of search terms, determine at least one target result item from the search results corresponding to the search term, and wherein the second determination subunit is configured to, for each of the plurality of search terms, determine at least one text material corresponding to the search term based on the at least one target result item corresponding to the search term.
[0095] According to some embodiments, the second determination subunit includes: a first determination module, configured to determine a plurality of text paragraphs included in the plurality of target result items; and a second determination module, configured to determine the plurality of text materials from the plurality of text paragraphs based on the paragraph lengths of the plurality of text paragraphs.
[0096] According to some embodiments, the second determination module is configured to: for each of the multiple text paragraphs, determine whether to filter the text paragraph based on the length of the text paragraph and the lengths of one or more adjacent text paragraphs in the target result item where the text paragraph is located; in response to determining that the text paragraph needs to be filtered, perform a filtering operation on the text paragraph; and determine the multiple text materials based on the filtered results of the multiple text paragraphs.
[0097] According to some embodiments, the second determination module is further configured to: for each of the multiple text paragraphs, filter the text paragraph in response to determining that the repetition rate of the text paragraph and a preset paragraph exceeds a repetition rate threshold.
[0098] According to some embodiments, the apparatus 400 further includes: a fourth determination unit configured to determine multiple candidate pictures based on the search results corresponding to each of the multiple search terms; a fifth determination unit configured to determine a target picture description text based on the article generation request and at least one of the multiple search terms; and a sixth determination unit configured to determine a target number of picture materials from the multiple candidate pictures based on the relevance between the multiple candidate pictures and the target picture description text, wherein the third determination unit 406 is further configured to determine the target article by splicing the output result of the second generative model and the target number of picture materials.
[0099] According to some embodiments, the apparatus 400 further includes: a seventh determination unit configured to determine the text length of the output result of the second generative model; and determine the target number based on the text length.
[0100] According to some embodiments, the sixth determination unit is configured to: rank the multiple candidate pictures based on the relevance between the multiple candidate pictures and the target picture description text; sequentially detect the multiple candidate pictures based on the ranking result until the number of candidate pictures that pass the detection exceeds a number threshold, where the detection conditions for the candidate pictures include at least one of a size condition and a picture quality condition.
[0101] According to another aspect of the present disclosure, there is also provided an electronic device, including: 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 to enable the at least one processor to execute the above-mentioned article generation method based on a generative model.
[0102] According to another aspect of the present disclosure, there is also provided a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the above-mentioned article generation method based on a generative model.
[0103] According to another aspect of the present disclosure, there is also provided a computer program product including a computer program, wherein the computer program, when executed by a processor, implements the above-mentioned article generation method based on a generative model.
[0104] Reference Figure 5 , a block diagram of an electronic device 500 that can be a server or a client of the present disclosure will now be described. It is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0105] As Figure 5 shown, the device 500 includes a computing unit 501, which can execute various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 502 or a computer program loaded from a storage unit 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The computing unit 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0106] Multiple components in device 500 are connected to I / O interface 505, including: input unit 506, output unit 507, storage unit 508, and communication unit 509. The input unit 506 can be any type of device capable of inputting information into device 500. The input unit 506 can receive input digital or character information, and generate key signal inputs related to the user settings and / or function controls of the electronic device, and can include but are not limited to a mouse, keyboard, touch screen, trackpad, trackball, joystick, microphone, and / or remote control. The output unit 507 can be any type of device capable of presenting information, and can include but are not limited to a display, speaker, video / audio output terminal, vibrator, and / or printer. The storage unit 508 can include but are not limited to magnetic disks and optical discs. The communication unit 509 allows device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but are not limited to a modem, network card, infrared communication device, wireless communication transceiver, and / or chipset, such as a BluetoothTM device, 802.11 device, WiFi device, WiMax device, cellular communication device, and / or the like.
[0107] The computing unit 501 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 501 include but are not limited to a central processing unit (CPU), a graphics processing unit (GPU), various dedicated 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 501 executes the various methods and processes described above, such as the article generation method based on a generative model. For example, in some embodiments, the article generation method based on a generative model can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 508. In some embodiments, part or all of the computer program can be loaded and / or installed onto device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the computing unit 501, one or more steps of the article generation method based on a generative model described above can be executed. Alternatively, in other embodiments, the computing unit 501 can be configured to execute the article generation method based on a generative model in any other suitable manner (e.g., by means of firmware).
[0108] The various embodiments of the systems and techniques described above in this specification can be implemented in digital electronic circuitry, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on a chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which may be a special-purpose or general-purpose programmable processor that receives data and instructions from, and transmits data and instructions to, a storage system, at least one input device, and at least one output device.
[0109] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions / operations specified in the flowchart and / or block diagram to be implemented. The program code can be executed entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine, or entirely on the remote machine or server.
[0110] 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 connection with an instruction execution system, apparatus, or device. 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, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0111] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the computer. Other kinds 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, speech input, or tactile input).
[0112] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which the user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), the Internet, and blockchain networks.
[0113] A computer system can include a client and a server. The client and the server are generally far from each other and usually interact through a communication network. The client - server relationship is created by computer programs running on the respective computers and having a client - server relationship with each other. The server can be a cloud server, can also be a server of a distributed system, or a server incorporating blockchain.
[0114] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitation is imposed herein.
[0115] Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above methods, systems, and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but is only defined by the authorized claims and their equivalent scope. Various elements in the embodiments or examples may be omitted or replaced by their equivalent elements. In addition, the steps may be executed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples may be combined in various ways. Importantly, with the evolution of technology, many of the elements described herein may be replaced by equivalent elements that emerge after the present disclosure.
Claims
1. An article generation method based on a generative model, comprising: Inputting an article generation request into a first generative model to obtain article structure description information generated by the first generative model, wherein the article structure description information includes information of multiple text content modules; Determining multiple search terms based on the information of the multiple text content modules; Using a search engine to search based on each of the multiple search terms; Determining multiple text materials based on the search results corresponding to each of the multiple search terms; Inputting the article generation request and the multiple text materials into a second generative model; and Determining a target article based on the output result of the second generative model.
2. The method according to claim 1, wherein, The determining multiple text materials based on the search results corresponding to each of the multiple search terms includes: Determining multiple target result items from the search results corresponding to each of the multiple search terms, wherein each of the multiple target result items contains text content; and Determining the multiple text materials based on the multiple target result items.
3. The method according to claim 2, wherein, The determining multiple target result items from the search results corresponding to each of the multiple search terms includes: Determining the multiple target result items based on the resource location information of the search results corresponding to each of the multiple search terms.
4. The method according to claim 2 or 3, wherein, The determining multiple target result items from the search results corresponding to each of the multiple search terms includes: For each of the multiple search terms, determining at least one target result item from the search results corresponding to the search term, And wherein, the determining the multiple text materials based on the multiple target result items includes: For each of the multiple search terms, determining at least one text material corresponding to the search term based on the at least one target result item corresponding to the search term.
5. The method according to any one of claims 2-4, wherein, The determining the multiple text materials based on the multiple target result items includes: Determining multiple text paragraphs included in the multiple target result items; and Determining the multiple text materials from the multiple text paragraphs based on the paragraph lengths of the multiple text paragraphs.
6. The method according to claim 5, wherein, The determining the multiple text materials from the multiple text paragraphs based on the paragraph lengths of the multiple text paragraphs includes: For each of the multiple text paragraphs, Determining whether to filter the text paragraph based on the paragraph length of the text paragraph and the paragraph lengths of one or more adjacent text paragraphs in the target result item where the text paragraph is located; In response to determining that the text paragraph needs to be filtered, performing a filtering operation on the text paragraph; and Determining the multiple text materials based on the filtered results of the multiple text paragraphs.
7. The method according to claim 5 or 6, further comprising: For each of the multiple text paragraphs, in response to determining that the repetition rate of the text paragraph with a preset paragraph exceeds a repetition rate threshold, filtering the text paragraph.
8. The method according to any one of claims 1-7, further comprising: Determining multiple candidate pictures based on the search results corresponding to each of the multiple search terms; Determine target picture description text based on the article generation request and at least one of the multiple search terms; And Determine a target number of picture materials from the multiple candidate pictures based on the relevance between the multiple candidate pictures and the target picture description text, wherein, determining the target article based on the output result of the second generative model includes: Determine the target article by splicing the output result of the second generative model and the target number of picture materials.
9. The method according to claim 8, further comprising: Determine the text length of the output result of the second generative model; And Determine the target number based on the text length.
10. The method according to claim 8 or 9, wherein, The determining a target number of picture materials from the multiple candidate pictures based on the relevance between the multiple candidate pictures and the target picture description text includes: Sort the multiple candidate pictures based on the relevance between the multiple candidate pictures and the target picture description text; Detect the multiple candidate pictures in sequence based on the sorting result until the number of candidate pictures that pass the detection exceeds a quantity threshold, wherein the detection condition for a candidate picture includes at least one of a size condition and a picture quality condition.
11. An article generation device based on a generative model, comprising: An acquisition unit configured to obtain article structure description information generated by the first generative model by inputting an article generation request into the first generative model, wherein the article structure description information includes information on multiple text content modules; A first determination unit configured to determine multiple search terms based on the information on the multiple text content modules; A search unit configured to perform a search using a search engine based on each of the multiple search terms; A second determination unit configured to determine multiple text materials based on the search results corresponding to each of the multiple search terms; An input unit configured to input the article generation request and the multiple text materials into the second generative model; and A third determination unit configured to determine a target article based on the output result of the second generative model.
12. An electronic device, 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 method according to any one of claims 1-10.
13. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause a computer to execute the method according to any one of claims 1-10.
14. A computer program product, comprising a computer program, wherein, The computer program, when executed by a processor, implements the method according to any one of claims 1-10.
Citation Information
Cited By
Content generation method and device based on agent, medium, equipment and product
CN122293952A