Article generation method, apparatus, device, and medium
By generating a table of contents and sequentially calling chapter content to assemble the text, the problem of limited length in existing article generation tools is solved, enabling the generation of long articles.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUNDAI TECH CO LTD
- Filing Date
- 2023-08-31
- Publication Date
- 2026-06-16
AI Technical Summary
Existing article generation tools cannot generate long articles due to limitations in the length of a single output.
By receiving the article generation instructions, a table of contents is generated, and the article generation tool is called sequentially based on the chapter titles in the table of contents to generate the content of each chapter. Finally, the chapter content is pieced together to form a long article.
It enables the generation of long articles that exceed the single output limit, satisfying users' needs for articles of any length.
Smart Images

Figure CN117093707B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a method, apparatus, device and medium for generating articles. Background Technology
[0002] With the continuous development of artificial intelligence and natural language processing technologies, articles can now be automatically generated using article generation models, chatgpt, and other article generation tools. However, these tools have a limited output length and cannot generate long articles. Summary of the Invention
[0003] This application provides a method, apparatus, device, and medium for generating articles, capable of generating long articles and effectively solving the problem of limited article length. The technical solution is as follows:
[0004] On the one hand, an article generation method is provided, the method comprising:
[0005] Receive an article generation instruction, which includes content indication information and length indication information. The content indication information is used to indicate the content of the article to be generated, and the length indication information is used to indicate the length of the article to be generated.
[0006] If the length indicated by the length indication information is greater than the maximum output length of the article generation tool in a single operation, the article generation tool is invoked to generate a table of contents, which includes multiple chapter titles.
[0007] Based on the multiple chapter titles included in the directory, the article generation tool is called sequentially to generate the chapter content corresponding to each chapter title;
[0008] Based on the directory, the chapter content corresponding to each chapter title is concatenated to obtain the article.
[0009] In one possible implementation, the length indication information includes article type, with different article types indicating different article lengths; the step of calling the article generation tool to generate a table of contents when the length indicated by the length indication information is greater than the maximum output length of the article generation tool in a single operation includes:
[0010] If the article type included in the article generation instruction belongs to the first type, the article generation tool is invoked to generate the table of contents.
[0011] In one possible implementation, the first type includes a first subtype and a second subtype, wherein the article length indicated by the first subtype is smaller than the article length indicated by the second subtype;
[0012] When the article type included in the article generation instruction belongs to the first type, the step of calling the article generation tool to generate the table of contents includes:
[0013] If the article type included in the article generation instruction belongs to the first subtype, the article generation tool is invoked to generate a first-level directory.
[0014] If the article type included in the article generation instruction belongs to the second subtype, the article generation tool is invoked to generate a multi-level directory.
[0015] In one possible implementation, when the article type included in the article generation instruction belongs to a first subtype, invoking the article generation tool to generate a first-level directory includes:
[0016] If the article type included in the article generation instruction belongs to the first subtype, a first directory generation instruction is sent to the article generation tool. The first directory generation instruction includes the content indication information and the directory type of the first-level directory, which is used to instruct the article generation tool to generate a first-level directory; the first-level directory output by the article generation tool is received.
[0017] When the article type included in the article generation instruction belongs to the second subtype, the article generation tool is invoked to generate a multi-level directory, including:
[0018] If the article type included in the article generation instruction belongs to the second subtype, a second directory generation instruction is sent to the article generation tool. The second directory generation instruction includes the content indication information and the directory type of the multi-level directory, which is used to instruct the article generation tool to generate a multi-level directory; the multi-level directory output by the article generation tool is received.
[0019] In one possible implementation, when the article type included in the article generation instruction belongs to the first type, invoking the article generation tool to generate the directory includes:
[0020] If the article type included in the article generation instruction belongs to the first type, a directory generation instruction carrying the content indication information and the article type is sent to the article generation tool. If the article type belongs to the first subtype of the first type, the article type is used to instruct the article generation tool to generate a first-level directory. If the article type belongs to the second subtype of the first type, the article type is used to instruct the article generation tool to generate a multi-level directory.
[0021] Receive the directory output by the article generation tool.
[0022] In one possible implementation, the length indication information includes the minimum word count of the article to be generated; the step of calling the article generation tool to generate a table of contents when the length indicated by the length indication information is greater than the maximum output length of the article generation tool in a single operation includes:
[0023] If the minimum number of characters in the article generation instruction is greater than the maximum number of characters that the article generation tool can output at one time, the article generation tool is invoked to generate the first table of contents.
[0024] In one possible implementation, after the article generation tool is invoked to generate the first directory, the method further includes:
[0025] Obtain the product of the number of chapters in the first directory and the reference word count for a single output of the article generation tool;
[0026] If the product is less than the minimum word count, then the article generation tool is invoked to expand the first directory into a second directory.
[0027] In one possible implementation, the number of reference words is any of the following:
[0028] The maximum number of characters in a single output of the article generation tool;
[0029] The minimum number of words per output by the article generation tool;
[0030] The average number of words output by the article generation tool.
[0031] In one possible implementation, the step of sequentially calling the article generation tool to generate chapter content corresponding to each chapter title based on the multiple chapter titles included in the directory includes:
[0032] For any chapter title in the directory, a chapter content generation instruction is sent to the article generation tool. The chapter content generation instruction is used to instruct the article generation tool to generate chapter content corresponding to the chapter title. The chapter content generation instruction carries the chapter title, the previous chapter title and the next chapter title of the chapter title, and the content instruction information.
[0033] Receive the chapter content output by the article generation tool.
[0034] In one possible implementation, when the directory is a multi-level directory, the chapter content generation instruction carries the chapter title, the previous chapter title and the next chapter title of the chapter title, the parent chapter title of the chapter title, and the content indication information.
[0035] On the other hand, an article generation apparatus is provided, the apparatus comprising:
[0036] A receiving module is used to receive an article generation instruction, which includes content indication information and length indication information. The content indication information is used to indicate the content of the article to be generated, and the length indication information is used to indicate the length of the article to be generated.
[0037] The generation module is used to call the article generation tool to generate a table of contents when the length indicated by the length indication information is greater than the maximum output length of the article generation tool in a single operation. The table of contents includes multiple chapter titles.
[0038] The generation module is also used to sequentially call the article generation tool to generate chapter content corresponding to each chapter title based on the multiple chapter titles included in the directory;
[0039] The splicing module is used to splice the chapter content corresponding to each chapter title based on the directory to obtain the article.
[0040] In one possible implementation, the length indication information includes article type, with different article types used to indicate different article lengths; the generation module is used to call the article generation tool to generate the table of contents when the article type included in the article generation instruction belongs to the first type.
[0041] In one possible implementation, the first type includes a first subtype and a second subtype, wherein the article length indicated by the first subtype is smaller than the article length indicated by the second subtype;
[0042] The generation module is used to call the article generation tool to generate a first-level directory when the article type included in the article generation instruction belongs to a first subtype; and to call the article generation tool to generate a multi-level directory when the article type included in the article generation instruction belongs to a second subtype.
[0043] In one possible implementation, the generation module is configured to send a first directory generation instruction to the article generation tool when the article type included in the article generation instruction belongs to a first subtype. The first directory generation instruction includes the content indication information and the directory type of the first-level directory, and is used to instruct the article generation tool to generate a first-level directory; and receive the first-level directory output by the article generation tool.
[0044] The generation module is configured to send a second directory generation instruction to the article generation tool when the article type included in the article generation instruction belongs to the second subtype. The second directory generation instruction includes the content indication information and the directory type of the multi-level directory, and is used to instruct the article generation tool to generate a multi-level directory; and to receive the multi-level directory output by the article generation tool.
[0045] In one possible implementation, the generation module is configured to send a directory generation instruction carrying the content indication information and the article type to the article generation tool when the article type included in the article generation instruction belongs to a first type; if the article type belongs to a first subtype of the first type, the article type is used to instruct the article generation tool to generate a first-level directory; if the article type belongs to a second subtype of the first type, the article type is used to instruct the article generation tool to generate a multi-level directory; and receive the directory output by the article generation tool.
[0046] In one possible implementation, the length indication information includes the minimum number of words in the article to be generated; the generation module is used to call the article generation tool to generate a first table of contents when the minimum number of words included in the article generation instruction is greater than the maximum number of words that the article generation tool can output at one time.
[0047] In one possible implementation, the generation module is further configured to obtain the product of the number of chapters in the first directory and the reference word count for a single output of the article generation tool; if the product is less than the minimum word count, the article generation tool is invoked to expand the first directory into a second directory.
[0048] In one possible implementation, the number of reference words is any of the following:
[0049] The maximum number of characters in a single output of the article generation tool;
[0050] The minimum number of words per output by the article generation tool;
[0051] The average number of words output by the article generation tool.
[0052] In one possible implementation, the generation module is configured to send a chapter content generation instruction to the article generation tool for any chapter title in the directory, the chapter content generation instruction being used to instruct the article generation tool to generate chapter content corresponding to the chapter title, the chapter content generation instruction carrying the chapter title, the previous chapter title and the next chapter title of the chapter title, and the content indication information; and to receive the chapter content output by the article generation tool.
[0053] In one possible implementation, when the directory is a multi-level directory, the chapter content generation instruction carries the chapter title, the previous chapter title and the next chapter title of the chapter title, the parent chapter title of the chapter title, and the content indication information.
[0054] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one piece of program code, the at least one piece of program code being loaded and executed by the processor to implement the article generation method as described in any of the above implementations.
[0055] On the other hand, a computer-readable storage medium is provided, wherein at least one piece of program code is stored in the computer-readable storage medium, the at least one piece of program code being loaded and executed by a processor to implement the article generation method as described in any of the above implementations.
[0056] On the other hand, a computer program product is provided, the computer program product comprising at least one piece of program code, the at least one piece of program code being loaded and executed by a processor to implement the article generation method as described in any of the above implementations.
[0057] The beneficial effects of the technical solutions provided in this application include at least the following:
[0058] This application provides an article generation method. When a user needs to generate a long article, they can first call an article generation tool to generate a table of contents, and then, based on the multiple chapter titles included in the table of contents, call the article generation tool in sequence to generate the chapter content corresponding to each chapter title. By splicing together the chapter content, a long article is obtained, which effectively solves the problem of limited article length. Attached Figure Description
[0059] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application;
[0061] Figure 2 This is a flowchart of an article generation method provided in an embodiment of this application;
[0062] Figure 3 This is a flowchart of an article generation method provided in an embodiment of this application;
[0063] Figure 4 This is a schematic diagram of the structure of an article generation device provided in an embodiment of this application;
[0064] Figure 5 This is a schematic diagram of the structure of a terminal provided in an embodiment of this application;
[0065] Figure 6 This is a schematic diagram of the structure of a server provided in an embodiment of this application. Detailed Implementation
[0066] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0067] The terms "first," "second," "third," and "fourth," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or apparatuses.
[0068] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the content indication information and length indication information involved in this application were obtained with full authorization.
[0069] The article generation method provided in this application is executed by a computer device. In some embodiments, the computer device may be a terminal, such as a mobile phone, tablet computer, laptop computer, desktop computer, or any other type of terminal; this application does not limit the type of terminal. In other embodiments, the computer device may be a server, such as a single server, a server cluster consisting of several servers, or a cloud computing service center. Of course, the server may also include other functional servers to provide more comprehensive and diversified services. In other embodiments, the computer device includes both a terminal and a server. It should be noted that this application is merely an illustrative description of the executing entity of the article generation method and does not limit the executing entity.
[0070] Figure 1This is a schematic diagram of an implementation environment provided in an embodiment of this application, such as... Figure 1 As shown, the implementation environment includes a terminal 101 and a server 102, which are connected via a wired or wireless network.
[0071] In some embodiments, a target application provided by server 102 is installed on terminal 101. Terminal 101 can perform functions such as data transmission and message interaction through the target application. Optionally, the target application is a target application in the operating system of terminal 101, or a target application provided by a third party. For example, the target application is an article generation application, which has the function of generating articles. Of course, the article generation application can also have other functions, such as commenting functions, shopping functions, dialogue functions, game functions, etc. Optionally, server 102 is a backend server for the target application or a cloud server that provides cloud computing and cloud storage services.
[0072] In some embodiments, a user inputs content indication information and length indication information in terminal 101, and sends an article generation instruction carrying the content indication information and length indication information to the server through terminal 101. The server 102 generates an article based on the article generation instruction and returns the article to terminal 101, which then displays the article.
[0073] It should be noted that the above process can be executed by terminal 101 and server 102 in cooperation, and there is no limitation on which specific steps terminal 101 and server 102 execute.
[0074] The following is an exemplary description of the application scenarios of the embodiments of this application:
[0075] The article generation method provided in this application can be applied to any article generation scenario. This application does not limit the article generation scenario, but only provides illustrative examples below:
[0076] Chatgpt is a chatbot that provides a series of APIs (Application Programming Interfaces) that allow developers to integrate it into their applications. Once integrated, Chatgpt can generate articles for the user. However, due to the limitation of Chatgpt's `max_token` (similar to a maximum word count), Chatgpt cannot generate articles longer than this limit, failing to meet user needs for longer articles. The article generation method provided in this application addresses this issue by first instructing Chatgpt to generate a table of contents, then instructing it to generate chapter content based on each chapter title. By concatenating these chapter contents, an article exceeding the limit can be obtained, solving the length limitation problem and satisfying users' needs for article length.
[0077] Figure 2 This is a flowchart illustrating an article generation method provided in an embodiment of this application. This embodiment uses a computer device as an example for illustrative purposes. See also... Figure 2 The method includes:
[0078] 201. The computer device receives an article generation instruction, which includes content indication information and length indication information. The content indication information is used to indicate the content of the article to be generated, and the length indication information is used to indicate the length of the article to be generated.
[0079] An article generation instruction is an instruction used to instruct a computer device to automatically generate an article. Content indication information is used to indicate the content of the article to be generated. In some embodiments, the content indication information is the title of the article to be generated. In other embodiments, the content indication information is an overview of the article to be generated. This application does not limit the content indication information. Length indication information is used to indicate the length of the article to be generated. In some embodiments, the length indication information includes the article type, such as expository, narrative, argumentative, practical, academic, novel, essay, script, poem, fairy tale, etc. Different article types correspond to different article lengths, and this application does not limit the article type. In some embodiments, the length indication information includes the minimum word count, that is, the minimum word count of the article to be generated, such as 800 words, 10,000 words, etc. This application does not limit the minimum word count.
[0080] In some embodiments, the computer device is a terminal, and the article generation instruction is generated when the user triggers an article generation operation on the terminal. After the user triggers the article generation operation, the terminal receives the article generation instruction. The article generation operation is used to instruct the computer device to generate an article. This article generation operation can be any combination of one or more operations such as clicking, swiping, double-clicking, and long-pressing. It can also be an operation to send content indication information and length indication information. This application embodiment does not limit the article generation operation.
[0081] 202. When the length indicated by the length indication information is greater than the maximum output length of the article generation tool in a single operation, the computer device calls the article generation tool to generate a table of contents, which includes multiple chapter titles.
[0082] An article generation tool is a tool used to generate articles. The article generation tool can be an article generation model, chatgpt, etc. This application embodiment does not limit the article generation tool.
[0083] In practical applications, to ensure the output stability of article generation tools and avoid excessively long single output times, a length limit is set for each output. This ensures that regardless of the type of article output, its length will not exceed this limit. For example, if the article generation tool is chatgpt, and this chatgpt is integrated into a target application on a computer device, the target application uses chatgpt's API to output articles. Limited by the API's `max_token` (maximum number of characters), the length of the output article will not exceed this limit. Therefore, this application provides a new article generation method to generate articles exceeding this limit. Specifically, it first calls the article generation tool to generate a table of contents, then calls the tool again to generate the content corresponding to each chapter title in the table of contents, and finally concatenates the content of each chapter to obtain the article exceeding the limit.
[0084] 203. Based on the multiple chapter titles included in the directory, the computer device sequentially calls the article generation tool to generate the chapter content corresponding to each chapter title.
[0085] In step 203 above, when the computer device calls the article generation tool based on the directory, it instructs the article generation tool to output the chapter content corresponding to one chapter title at a time. By calling the article generation tool multiple times, the chapter content corresponding to each chapter title is generated.
[0086] 204. Computer devices use a table of contents to concatenate the content of each chapter title to obtain the article.
[0087] Since the chapter content corresponding to each chapter title is generated by calling the article generation tool multiple times, although the content of each chapter is limited by the single output of the article generation tool, after splicing the content of each chapter title, a large article exceeding the limit can be obtained.
[0088] In this embodiment of the application, when splicing the chapter content corresponding to each chapter title to obtain an article based on the table of contents, only the chapter content can be spliced without including the chapter titles; or the chapter titles and chapter content can be spliced together; or the splicing method can be selected according to actual needs, such as the user choosing the splicing method, or the computer device automatically determining whether to include the chapter titles based on the article type, etc. This embodiment of the application does not limit this.
[0089] The article generation method provided in this application embodiment allows users to generate a table of contents by first calling an article generation tool when they need to generate a long article. Then, based on the multiple chapter titles included in the table of contents, the article generation tool is called sequentially to generate the chapter content corresponding to each chapter title. The chapter content is then spliced together to obtain a long article, thus solving the problem of limited article length.
[0090] In one possible implementation, the length indication information includes the article type, with different article types indicating different article lengths; if the length indicated by the length indication information is greater than the maximum output length of the article generation tool in a single run, the article generation tool is invoked to generate a table of contents, including:
[0091] If the article type included in the article generation instruction is of type 1, the article generation tool will be invoked to generate a table of contents.
[0092] In one possible implementation, the first type includes a first subtype and a second subtype, wherein the article length indicated by the first subtype is shorter than the article length indicated by the second subtype;
[0093] If the article type included in the article generation instruction is of type 1, the article generation tool will be invoked to generate a table of contents, including:
[0094] If the article type included in the article generation instruction belongs to the first subtype, the article generation tool is invoked to generate a first-level directory.
[0095] If the article type included in the article generation instruction belongs to the second subtype, the article generation tool will be invoked to generate a multi-level directory.
[0096] In one possible implementation, if the article type included in the article generation instruction belongs to the first subtype, the article generation tool is invoked to generate a first-level directory, including:
[0097] If the article type included in the article generation instruction belongs to the first subtype, send a first directory generation instruction to the article generation tool. The first directory generation instruction includes content indication information and the directory type of the first-level directory, which is used to instruct the article generation tool to generate the first-level directory; receive the first-level directory output by the article generation tool;
[0098] If the article type included in the article generation instruction belongs to the second subtype, the article generation tool will be invoked to generate a multi-level directory, including:
[0099] If the article type included in the article generation instruction belongs to the second subtype, a second directory generation instruction is sent to the article generation tool. The second directory generation instruction includes content indication information and the directory type of the multi-level directory, which is used to instruct the article generation tool to generate a multi-level directory; the multi-level directory output by the article generation tool is received.
[0100] In one possible implementation, if the article type included in the article generation instruction belongs to the first type, the article generation tool is invoked to generate a table of contents, including:
[0101] If the article type included in the article generation instruction belongs to the first type, a directory generation instruction carrying content indication information and article type is sent to the article generation tool. If the article type belongs to the first subtype of the first type, the article type is used to instruct the article generation tool to generate a first-level directory. If the article type belongs to the second subtype of the first type, the article type is used to instruct the article generation tool to generate a multi-level directory.
[0102] Receive the directory output by the article generation tool.
[0103] In one possible implementation, the length indication information includes the minimum word count of the article to be generated; if the length indicated by the length indication information is greater than the maximum output length of the article generation tool in a single run, the article generation tool is invoked to generate a table of contents, including:
[0104] If the minimum number of characters in the article generation command is greater than the maximum number of characters that the article generation tool can output at one time, the article generation tool will be invoked to generate the first table of contents.
[0105] In one possible implementation, after calling the article generation tool to generate the first table of contents, the method also includes:
[0106] Get the product of the number of chapters in the first directory and the reference word count for a single output from the article generation tool;
[0107] If the product is less than the minimum word count, the article generation tool will be invoked to expand the first directory into a second directory.
[0108] In one possible implementation, the reference word count is any of the following:
[0109] The maximum number of words in a single output by the article generation tool;
[0110] Minimum word count for a single output by the article generation tool;
[0111] Average word count of the article generation tool.
[0112] In one possible implementation, based on the multiple chapter titles included in the table of contents, an article generation tool is sequentially invoked to generate the chapter content corresponding to each chapter title, including:
[0113] For any chapter title in the table of contents, send a chapter content generation instruction to the article generation tool. The chapter content generation instruction is used to instruct the article generation tool to generate the chapter content corresponding to the chapter title. The chapter content generation instruction carries the chapter title, the previous chapter title and the next chapter title of the chapter title, as well as content instruction information.
[0114] Receive chapter content output by the article generation tool.
[0115] In one possible implementation, when the directory is a multi-level directory, the chapter content generation instruction carries the chapter title, the previous chapter title and the next chapter title, the parent chapter title, and content indication information.
[0116] All of the above-mentioned optional technical solutions can be combined in any way to form the optional embodiments of this application, and will not be described in detail here.
[0117] Figure 3 This is a flowchart illustrating an article generation method provided in an embodiment of this application. This embodiment uses a computer device as an example for illustrative purposes. See also... Figure 3 The method includes:
[0118] 301. The computer device displays the article generation interface.
[0119] The article generation interface is used to generate articles. It should be noted that the article generation interface in this application embodiment refers only to the interface with article generation function. Of course, the interface may also have other functions, such as dialogue function, comment function, etc. This application embodiment does not limit this.
[0120] Users can input article instruction information in the article generation interface, which will then generate a corresponding article based on this information. The article instruction information is used to indicate the article to be generated. In some embodiments, this article instruction information includes content instruction information and length instruction information. The content instruction information indicates the content of the article to be generated, and the length instruction information indicates the length of the article to be generated. Of course, the article instruction information may also include other information, which is not limited in this embodiment.
[0121] It should be noted that the embodiments of this application do not limit the display style of the article generation interface or the method of inputting article instruction information in the article generation interface, but only provide illustrative examples in the following embodiments:
[0122] In one possible implementation, the article generation interface includes an information input box and an article generation option. The information input box is used to obtain article instruction information. After the user enters the article instruction information in the information input box, they can click the article generation option to generate an article generation instruction carrying that instruction information, which is then received by the computer device.
[0123] In another possible implementation, the article generation interface is a dialogue interface between the user and the intelligent robot. After the user sends article instruction information to the intelligent robot in this dialogue interface, the user will receive an article that matches the instruction information. The computer device responds to the information sending operation in the dialogue interface and generates an article generation instruction based on the sent information.
[0124] 302. The computer device receives an article generation instruction based on the article generation interface. The article generation instruction includes content indication information and length indication information. The content indication information is used to indicate the content of the article to be generated, and the length indication information is used to indicate the length of the article to be generated.
[0125] When a user performs an article generation operation in the article generation interface, triggering an article generation command, the computer device receives the command and executes the following article generation steps.
[0126] It should be noted that step 302 is analogous to step 201 and will not be described in detail here. Another point to note is that this embodiment only uses the example of a computer device displaying an article generation interface and receiving an article generation command based on that interface for illustrative purposes. In another embodiment, the computer device does not need to display an article generation interface; the user can generate an article generation command via voice or other means, allowing the computer device to receive the command.
[0127] 303. When the length indicated by the length indication information is greater than the maximum output length of the article generation tool in a single operation, the computer device calls the article generation tool to generate a table of contents, which includes multiple chapter titles.
[0128] As described in step 201 above, the length indication information may include the article type, the minimum word count, or both.
[0129] In a first possible implementation, the length indication information includes the article type, with different article types indicating different article lengths. Some article types indicate larger article lengths, while others indicate smaller article lengths. For example, when the article type is expository, the indicated article length is smaller; when the article type is fiction, the indicated article length is larger. Therefore, this application embodiment categorizes article types into a first type and a second type based on the length indicated by different article types. Articles belonging to the first type are generally larger articles; articles belonging to the second type are generally smaller articles. Therefore, in this application embodiment, when the article type belongs to the first type, the length indicated by the length indication information is greater than the maximum single output length of the article generation tool, and steps 303 and 304 below are executed; when the article type belongs to the second type, the length indicated by the length indication information is not greater than the maximum single output length of the article generation tool, and the article generation tool is directly invoked to generate the article.
[0130] In other words, when the length indicated by the length indication information is greater than the maximum output length of the article generation tool, the computer device calls the article generation tool to generate a table of contents, including when the article type included in the article generation instruction belongs to the first type.
[0131] Optionally, the first type includes academic papers, novels, scripts, etc., and the second type includes expository texts, narrative texts, argumentative texts, essays, poems, fairy tales, etc. This application embodiment does not limit the types of articles included in the first type and the second type; in practical applications, the classification can be based on the maximum output length of the article generation tool in a single run.
[0132] In some cases, the article to be generated is quite long, and even if a table of contents is generated first, and then the content of each chapter is generated separately based on the chapter titles, it may not meet the length requirements of the article. To solve this problem, this embodiment of the application can generate not only a single-level table of contents, but also multi-level tables of contents. When the length requirement of the article to be generated is large, the method of generating multi-level tables of contents can be used to solve the problem.
[0133] In order to enable the article generation tool to generate first-level and multi-level directories more accurately, this application embodiment divides the first type into multiple subtypes according to the length indicated by the article type, and the length indicated by the article type is different under different subtypes.
[0134] Taking a first type that includes a first subtype and a second subtype as an example, where the article length indicated by the first subtype is shorter than that indicated by the second subtype, when the article type belongs to the first subtype, only a single-level directory needs to be generated to meet the length requirement; when the article type belongs to the second subtype, multiple levels of directories need to be generated to meet the length requirement. In some embodiments, when the article type included in the article generation instruction belongs to the first type, the computer device calls the article generation tool to generate a directory, including: when the article type included in the article generation instruction belongs to the first subtype, calling the article generation tool to generate a single-level directory; and when the article type included in the article generation instruction belongs to the second subtype, calling the article generation tool to generate multiple levels of directories.
[0135] It should be noted that the embodiments of this application only illustrate the process of generating a directory by taking the first type including the first subtype and the second subtype as an example. In other embodiments, the first type may also include any one or more subtypes such as the third subtype, the fourth subtype, and the fifth subtype. The embodiments of this application do not limit the number of subtypes included in the first type. The article length indicated by the first subtype, the second subtype, the third subtype, the fourth subtype, and the fifth subtype increases sequentially. When the article type belongs to the first subtype, the article generation tool is invoked to generate a first-level directory; when the article type belongs to the second subtype, the article generation tool is invoked to generate a second-level directory; when the article type belongs to the third subtype, the article generation tool is invoked to generate a third-level directory; when the article type belongs to the fourth subtype, the article generation tool is invoked to generate a fourth-level directory, and so on.
[0136] Next, this application embodiment will provide an exemplary description of how to make the article generation tool generate a single-level directory or a multi-level directory:
[0137] In some embodiments, when a computer device invokes an article generation tool to generate a table of contents, it can inform the tool whether to generate a single-level or multi-level table of contents. For example, when invoking the article generation tool, the computer device can send a table of contents type to the tool to indicate whether to generate a single-level or multi-level table of contents. Optionally, when the article type included in the article generation instruction belongs to a first subtype, invoking the article generation tool to generate a single-level table of contents includes: the computer device sending a first table of contents generation instruction to the article generation tool, which includes content indication information and a table of contents type for the single-level table of contents, to instruct the tool to generate a single-level table of contents; and receiving the single-level table of contents output by the tool. Optionally, when the article type included in the article generation instruction belongs to a second subtype, invoking the article generation tool to generate a multi-level table of contents includes: sending a second table of contents generation instruction to the tool, which includes content indication information and a table of contents type for the multi-level table of contents, to instruct the tool to generate a multi-level table of contents; and receiving the multi-level table of contents output by the tool.
[0138] In other embodiments, the article generation tool can determine whether to generate a first-level directory or a multi-level directory based on the article type; simply sending the article type to the article generation tool is sufficient. Optionally, when the article type included in the article generation instruction belongs to a first type, the computer device invokes the article generation tool to generate a directory, including: sending a directory generation instruction carrying content indication information and the article type to the article generation tool when the article type included in the article generation instruction belongs to the first type; if the article type belongs to a first subtype of the first type, the article type is used to instruct the article generation tool to generate a first-level directory; if the article type belongs to a second subtype of the first type, the article type is used to instruct the article generation tool to generate a multi-level directory; and receiving the directory output by the article generation tool.
[0139] In the second possible implementation, the length indication information includes the minimum number of words in the article to be generated. If this minimum number of words is greater than the maximum number of words that the article generation tool can output at one time, then the article output by the article generation tool cannot meet the word count requirement. In this case, the method provided in the embodiments of this application of generating a table of contents first and then generating chapter content, and then concatenating multiple chapter contents into an article, can be adopted. That is, when the length indicated by the length indication information is greater than the maximum length that the article generation tool can output at one time, the computer device calls the article generation tool to generate a table of contents, including: when the minimum number of words included in the article generation instruction is greater than the maximum number of words that the article generation tool can output at one time, the article generation tool calls the article generation tool to generate a first table of contents.
[0140] The first directory can be a single-level directory or a multi-level directory, and this application embodiment does not limit this. In some embodiments, the first directory is a single-level directory. Optionally, when the computer device calls the article generation tool to generate the first directory, it sends content indication information and a minimum word count to the article generation tool. The article generation tool generates chapter titles based on the content indication information and determines the number of chapters based on the minimum word count. In other embodiments, the first directory can be a single-level directory or a multi-level directory. When the computer device calls the article generation tool to generate the first directory, it sends content indication information and a minimum word count to the article generation tool. The article generation tool determines whether to generate a single-level directory or a multi-level directory based on the minimum word count and determines the chapter titles based on the content indication information.
[0141] To avoid situations where the minimum word count cannot be generated based on the first directory, this embodiment of the application, after generating the first directory, can further estimate the word count of the article generated based on the first directory. If the estimated word count does not reach the minimum word count, the first directory is expanded to obtain a second directory, and the article is generated based on the second directory; if the estimated word count reaches the minimum word count, the article is generated based on the first directory. In some embodiments, the method further includes: obtaining the product of the number of chapters in the first directory and the reference word count for a single output of the article generation tool; if the product is less than the minimum word count, the article generation tool is invoked to expand the first directory into a second directory. The number of chapters in the second directory is greater than the number of chapters in the first directory.
[0142] In some embodiments, the reference word count is any one of the following: the maximum number of words in a single output by the article generation tool, the minimum number of words in a single word output by the article generation tool, and the average number of words in the output of the article generation tool. This application embodiment is merely an illustrative example of the reference word count and does not limit the reference word count. In other embodiments, the reference word count may also be a pre-set word count in the computer device, an empirical value, etc.
[0143] In some embodiments, the first directory and the second directory are at the same level. For example, the first directory is a first-level directory, and the second directory is also a first-level directory; or the first directory is a second-level directory, and the second directory is also a second-level directory. In other embodiments, the first directory and the second directory are at different levels. For example, the first directory is a first-level directory, and the second directory is a second-level directory; or the first directory is a second-level directory, and the second directory is a third-level directory.
[0144] In the third possible implementation, the length indication information includes the article type and minimum word count of the article to be generated. When a computer device invokes the article generation tool, it can send the content indication information, article type, and minimum word count to the article generation tool. The article generation tool can determine whether to generate a table of contents based on the article type, and if so, whether to generate a first-level or multi-level table of contents. It can control the number of chapter titles in the table of contents based on the minimum word count and determine the specific chapter titles in the table of contents based on the content indication information.
[0145] 304. The computer device, based on the multiple chapter titles included in the catalog, sequentially calls the article generation tool to generate the chapter content corresponding to each chapter title.
[0146] In this embodiment, when the computer device sequentially calls the article generation tool to generate chapter content corresponding to each chapter title, since the article generation tool only outputs chapter content corresponding to one chapter title at a time, in order to ensure the continuity of chapter content corresponding to previous and subsequent chapter titles, this embodiment not only inputs the current chapter title, but also content indication information, the previous chapter title, and the next chapter title, so that the article generation tool can control the entire article when generating chapter content, resulting in better continuity after the chapter content is spliced together. In one possible implementation, the computer device, based on multiple chapter titles included in the directory, sequentially calls the article generation tool to generate chapter content corresponding to each chapter title, including: for any chapter title in the directory, the computer device sends a chapter content generation instruction to the article generation tool, the chapter content generation instruction carrying the chapter title, the previous chapter title, the next chapter title, and content indication information; and receives the chapter content output by the article generation tool.
[0147] In some embodiments, when the directory is multi-level, it is necessary to generate the chapter content corresponding to the lowest-level chapter title. To ensure the continuity between chapter content, the chapter content generation instruction can carry the chapter title, the previous and next chapter titles, the parent chapter title, and content indication information.
[0148] It should be noted that the embodiments in this application are only illustrative examples of using the chapter content instruction carrying the previous and next chapter titles. In another embodiment, the chapter content instruction may also carry the N previous chapter titles and M next chapter titles of the current chapter title, where N and M are any integers greater than 1, and N and M may be the same or different. This application does not limit N and M. In another embodiment, the chapter content instruction may also carry a table of contents, which is not limited in this application.
[0149] 305. Computer equipment uses a directory to concatenate the content corresponding to each chapter title to obtain the article.
[0150] Computer devices, based on a table of contents, concatenate the chapter content corresponding to each chapter title to obtain an article. Alternatively, they can either omit the chapter titles and simply concatenate the chapter content corresponding to each chapter title according to their order of arrangement. This application's embodiments do not limit this approach.
[0151] In some embodiments, the length indication information includes the article type, and the computer device determines how the chapter content is pieced together based on the article type. For example, when the article type is a thesis, the chapter titles and chapter contents are pieced together to obtain the article. Similarly, when the article type is a novel, only the chapter contents need to be pieced together.
[0152] 306. The computer device displays the article in the article generation interface.
[0153] The computer device can display the article in any format within the article generation interface. In some embodiments, the computer device directly displays the article content. In other embodiments, the computer device displays the article as a file, and the user can only view the article content after opening the file.
[0154] The article generation method provided in this application embodiment allows users to generate a table of contents by first calling an article generation tool when they need to generate a long article. Then, based on the multiple chapter titles included in the table of contents, the article generation tool is called sequentially to generate the chapter content corresponding to each chapter title. The chapter content is then spliced together to obtain a long article, thus solving the problem of limited article length.
[0155] Furthermore, when generating the table of contents, it can generate a single-level or multi-level table of contents based on the length requirements, which can more accurately generate articles that meet the user's length requirements and improve the accuracy of article generation.
[0156] Figure 4 This is a schematic diagram of the structure of an article generation device provided in an embodiment of this application, such as... Figure 4 As shown, the device includes:
[0157] The receiving module 401 is used to receive an article generation instruction. The article generation instruction includes content indication information and length indication information. The content indication information is used to indicate the content of the article to be generated, and the length indication information is used to indicate the length of the article to be generated.
[0158] The generation module 402 is used to call the article generation tool to generate a table of contents when the length indicated by the length indication information is greater than the maximum output length of the article generation tool in a single operation. The table of contents includes multiple chapter titles.
[0159] The generation module 402 is also used to sequentially call the article generation tool to generate the chapter content corresponding to each chapter title based on the multiple chapter titles included in the table of contents;
[0160] The splicing module 403 is used to splice the chapter content corresponding to each chapter title based on the table of contents to obtain the article.
[0161] In one possible implementation, the length indication information includes the article type, with different article types used to indicate different article lengths; the generation module 402 is used to call the article generation tool to generate a table of contents when the article type included in the article generation instruction belongs to the first type.
[0162] In one possible implementation, the first type includes a first subtype and a second subtype, wherein the article length indicated by the first subtype is shorter than the article length indicated by the second subtype;
[0163] The generation module 402 is used to call the article generation tool to generate a first-level directory when the article type included in the article generation instruction belongs to the first subtype; and to call the article generation tool to generate a multi-level directory when the article type included in the article generation instruction belongs to the second subtype.
[0164] In one possible implementation, the generation module 402 is used to send a first directory generation instruction to the article generation tool when the article type included in the article generation instruction belongs to a first subtype. The first directory generation instruction includes content indication information and the directory type of the first-level directory, which is used to instruct the article generation tool to generate a first-level directory; and to receive the first-level directory output by the article generation tool.
[0165] The generation module 402 is used to send a second directory generation instruction to the article generation tool when the article type included in the article generation instruction belongs to the second subtype. The second directory generation instruction includes content indication information and the directory type of the multi-level directory, which is used to instruct the article generation tool to generate a multi-level directory; and to receive the multi-level directory output by the article generation tool.
[0166] In one possible implementation, the generation module 402 is used to send a directory generation instruction carrying content indication information and article type to the article generation tool when the article type included in the article generation instruction belongs to the first type. If the article type belongs to the first subtype of the first type, the article type is used to instruct the article generation tool to generate a first-level directory. If the article type belongs to the second subtype of the first type, the article type is used to instruct the article generation tool to generate a multi-level directory. The module also receives the directory output by the article generation tool.
[0167] In one possible implementation, the length indication information includes the minimum number of words in the article to be generated; the generation module 402 is used to call the article generation tool to generate the first table of contents when the minimum number of words in the article generation instruction is greater than the maximum number of words in a single output of the article generation tool.
[0168] In one possible implementation, the generation module 402 is also used to obtain the product of the number of chapters in the first directory and the single output reference word count of the article generation tool; if the product is less than the minimum word count, the article generation tool is called to expand the first directory into a second directory.
[0169] In one possible implementation, the reference word count is any of the following:
[0170] The maximum number of words in a single output by the article generation tool;
[0171] Minimum word count for a single output by the article generation tool;
[0172] Average word count of the article generation tool.
[0173] In one possible implementation, the generation module 402 is used to send a chapter content generation instruction to the article generation tool for any chapter title in the directory. The chapter content generation instruction is used to instruct the article generation tool to generate the chapter content corresponding to the chapter title. The chapter content generation instruction carries the chapter title, the previous chapter title and the next chapter title of the chapter title, and content indication information; and receives the chapter content output by the article generation tool.
[0174] In one possible implementation, when the directory is a multi-level directory, the chapter content generation instruction carries the chapter title, the previous chapter title and the next chapter title, the parent chapter title, and content indication information.
[0175] It should be noted that the article generation device provided in the above embodiments is only illustrated by the division of the above functional modules when generating articles. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the computer device can be divided into different functional modules to complete all or part of the functions described above. In addition, the article generation device and the article generation method embodiments provided in the above embodiments belong to the same concept, and the specific implementation process can be found in the method embodiments, which will not be repeated here.
[0176] Figure 5 This diagram illustrates a structural block diagram of an electronic device 500 provided in an exemplary embodiment of this application. The electronic device 500 includes a processor 501 and a memory 502.
[0177] Processor 501 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 501 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 501 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 501 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 501 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0178] The memory 502 may include one or more computer-readable storage media, which may be non-transitory. The memory 502 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 502 are used to store at least one program code, which is executed by the processor 501 to implement the article generation method provided in the method embodiments of this application.
[0179] In some embodiments, the electronic device 500 may optionally include a peripheral device interface 503 and at least one peripheral device. The processor 501, memory 502, and peripheral device interface 503 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 503 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: a radio frequency circuit 504, a display screen 505, a camera 506, an audio circuit 507, a positioning component 508, and a power supply 509.
[0180] Peripheral device interface 503 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 501 and memory 502. In some embodiments, processor 501, memory 502 and peripheral device interface 503 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 501, memory 502 and peripheral device interface 503 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0181] Display screen 505 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 505 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 501 for processing. In this case, display screen 505 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 505, which serves as the front panel of the electronic device 500; in other embodiments, there may be at least two display screens, respectively disposed on different surfaces of the electronic device 500 or in a folded design; in still other embodiments, display screen 505 may be a flexible display screen, disposed on a curved or folded surface of the electronic device 500. Furthermore, display screen 505 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. Display screen 505 may be made of materials such as LCD (Liquid Crystal Display) or OLED (Organic Light-Emitting Diode).
[0182] Power supply 509 is used to supply power to the various components in electronic device 500. Power supply 509 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 509 includes a rechargeable battery, the rechargeable battery can support wired or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0183] Those skilled in the art will understand that Figure 5 The structure shown does not constitute a limitation on the electronic device 500, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0184] Figure 6 This is a schematic diagram of a server structure provided in an embodiment of this application. The server 600 can vary significantly due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 601 and one or more memories 602. The memory 602 stores at least one line of program code, which is loaded and executed by the processor 601 to implement the methods provided in the various method embodiments described above. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated upon here.
[0185] The server 600 is used to execute the steps performed by the server in the above method embodiments.
[0186] This application also provides a computer-readable storage medium storing at least one piece of program code, which is loaded and executed by a processor to implement the article generation method as described in any of the above implementations.
[0187] This application also provides a computer program product, which includes at least one piece of program code that is loaded and executed by a processor to implement the article generation method as described in any of the above implementations.
[0188] In some embodiments, the computer program involved in the present application embodiments may be deployed and executed on a computer device, or executed on multiple computer devices located in one location, or executed on multiple computer devices distributed in multiple locations and interconnected through a communication network. Multiple computer devices distributed in multiple locations and interconnected through a communication network may constitute a blockchain system.
[0189] The above are merely optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for generating articles, characterized in that, The method includes: Receive an article generation instruction, which includes content indication information and length indication information. The content indication information is used to indicate the content of the article to be generated, and the length indication information is used to indicate the length of the article to be generated, including the minimum number of words in the article to be generated. If the minimum word count is greater than the maximum word count of a single output by the article generation tool, the content instruction information and the minimum word count are sent to the article generation tool; the article generation tool is then invoked to generate a first directory, and whether the first directory is a first-level directory or a multi-level directory is determined by the article generation tool based on the minimum word count; Obtain the product of the number of chapters in the first directory and the reference word count for a single output of the article generation tool; If the product is less than the minimum word count, the article generation tool is invoked to expand the first directory into a second directory with a greater number of chapters than the first directory, and the second directory is used as the directory for generating the article; if the product is not less than the minimum word count, the first directory is used as the directory for generating the article; the directory includes multiple chapter titles; Based on the multiple chapter titles included in the directory, the article generation tool is called sequentially to generate the chapter content corresponding to each chapter title; Based on the directory, the chapter content corresponding to each chapter title is spliced together according to the splicing method selected from two splicing methods that corresponds to the article type, to obtain the article. The two splicing methods include: splicing each chapter title and each chapter content together, and splicing only the chapter content corresponding to each chapter title.
2. The method according to claim 1, characterized in that, The length indication information includes the article type, with different article types used to indicate different article lengths; the method further includes: If the article type included in the article generation instruction belongs to the first type, the article generation tool is invoked to generate the table of contents; when the article type belongs to the first type, the length indicated by the length indication information is greater than the maximum length of a single output by the article generation tool.
3. The method according to claim 2, characterized in that, The first type includes a first subtype and a second subtype, wherein the article length indicated by the first subtype is shorter than the article length indicated by the second subtype; When the article type included in the article generation instruction belongs to the first type, the step of calling the article generation tool to generate the table of contents includes: If the article type included in the article generation instruction belongs to the first subtype, the article generation tool is invoked to generate a first-level directory. If the article type included in the article generation instruction belongs to the second subtype, the article generation tool is invoked to generate a multi-level directory.
4. The method according to claim 3, characterized in that, When the article type included in the article generation instruction belongs to the first subtype, the step of calling the article generation tool to generate a first-level directory includes: If the article type included in the article generation instruction belongs to the first subtype, a first directory generation instruction is sent to the article generation tool. The first directory generation instruction includes the content indication information and the directory type of the first-level directory, which is used to instruct the article generation tool to generate a first-level directory; the first-level directory output by the article generation tool is received. When the article type included in the article generation instruction belongs to the second subtype, the article generation tool is invoked to generate a multi-level directory, including: If the article type included in the article generation instruction belongs to the second subtype, a second directory generation instruction is sent to the article generation tool. The second directory generation instruction includes the content indication information and the directory type of the multi-level directory, which is used to instruct the article generation tool to generate a multi-level directory; the multi-level directory output by the article generation tool is received.
5. The method according to claim 3, characterized in that, When the article type included in the article generation instruction belongs to the first type, the step of calling the article generation tool to generate the table of contents includes: If the article type included in the article generation instruction belongs to the first type, a directory generation instruction carrying the content indication information and the article type is sent to the article generation tool. If the article type belongs to the first subtype of the first type, the article type is used to instruct the article generation tool to generate a first-level directory. If the article type belongs to the second subtype of the first type, the article type is used to instruct the article generation tool to generate a multi-level directory. Receive the directory output by the article generation tool.
6. The method according to claim 1, characterized in that, The reference word count is any one of the following: The maximum number of characters in a single output of the article generation tool; The minimum number of words per output by the article generation tool; The average number of words output by the article generation tool.
7. The method according to claim 1, characterized in that, The step of sequentially calling the article generation tool to generate chapter content corresponding to each chapter title based on the multiple chapter titles included in the directory includes: For any chapter title in the directory, a chapter content generation instruction is sent to the article generation tool. The chapter content generation instruction is used to instruct the article generation tool to generate chapter content corresponding to the chapter title. The chapter content generation instruction carries the chapter title, the previous chapter title and the next chapter title of the chapter title, and the content instruction information. Receive the chapter content output by the article generation tool.
8. The method according to claim 7, characterized in that, When the directory is a multi-level directory, the chapter content generation instruction carries the chapter title, the previous chapter title and the next chapter title of the chapter title, the parent chapter title of the chapter title, and the content indication information.
9. An article generation device, characterized in that, The device includes: A receiving module is used to receive an article generation instruction, which includes content indication information and length indication information. The content indication information is used to indicate the content of the article to be generated, and the length indication information is used to indicate the length of the article to be generated, including the minimum number of words in the article to be generated. Generate modules for: If the minimum word count is greater than the maximum word count of a single output by the article generation tool, the content instruction information and the minimum word count are sent to the article generation tool; the article generation tool is then invoked to generate a first directory, and whether the first directory is a first-level directory or a multi-level directory is determined by the article generation tool based on the minimum word count; Obtain the product of the number of chapters in the first directory and the reference word count for a single output of the article generation tool; If the product is less than the minimum word count, the article generation tool is invoked to expand the first directory into a second directory with a greater number of chapters than the first directory, and the second directory is used as the directory for generating the article; if the product is not less than the minimum word count, the first directory is used as the directory for generating the article; the directory includes multiple chapter titles; The generation module is also used to sequentially call the article generation tool to generate chapter content corresponding to each chapter title based on the multiple chapter titles included in the directory; The splicing module is used to splice the chapter content corresponding to each chapter title based on the directory and according to the splicing method selected from two splicing methods corresponding to the article type, to obtain an article. The two splicing methods include: splicing each chapter title and each chapter content together, and splicing only the chapter content corresponding to each chapter title.
10. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one line of program code, which is loaded and executed by the processor to implement the article generation method as described in any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one piece of program code, which is loaded and executed by a processor to implement the article generation method as described in any one of claims 1 to 8.