CN117093707A - Article generation method, device, equipment and medium - Google Patents
Article generation method, device, equipment and medium Download PDFInfo
- Publication number
- CN117093707A CN117093707A CN202311113911.0A CN202311113911A CN117093707A CN 117093707 A CN117093707 A CN 117093707A CN 202311113911 A CN202311113911 A CN 202311113911A CN 117093707 A CN117093707 A CN 117093707A
- Authority
- CN
- China
- Prior art keywords
- article
- chapter
- catalog
- tool
- generating
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 74
- 230000015654 memory Effects 0.000 claims description 15
- 230000006870 function Effects 0.000 description 13
- 230000002093 peripheral effect Effects 0.000 description 10
- 238000012545 processing Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 7
- 230000008569 process Effects 0.000 description 5
- 238000004590 computer program Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 238000013473 artificial intelligence Methods 0.000 description 3
- 230000005540 biological transmission Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 238000013515 script Methods 0.000 description 2
- 238000013475 authorization Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/338—Presentation of query results
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/3331—Query processing
- G06F16/334—Query execution
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The application provides an article generation method, device, equipment and medium, and belongs to the technical field of computers. The method comprises the following steps: receiving an article generation instruction, wherein the article generation instruction comprises content indication information and space indication information, the content indication information is used for indicating the content of an article to be generated, and the space indication information is used for indicating the space size of the article to be generated; invoking the article generating tool to generate a catalog including a plurality of chapter titles under the condition that the space indicated by the space indicating information is larger than the single output maximum space of the article generating tool; sequentially calling the article generating tool to generate chapter contents corresponding to each chapter title based on a plurality of chapter titles included in the catalog; and splicing the chapter contents corresponding to the chapter titles based on the catalogue to obtain articles. The method and the device can generate long-range articles, and effectively solve the problem of limited article space.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for generating an article.
Background
With the continuous development of artificial intelligence technology and natural language processing technology, an article can be automatically generated by an article generating tool such as an article generating model and chatgpt, but single output of the article generating tool has a space limitation, and a long-space article cannot be generated.
Disclosure of Invention
The embodiment of the application provides an article generating method, device, equipment and medium, which can generate a long article and effectively solve the problem of limited article space. The technical scheme is as follows:
in one aspect, there is provided an article generating method, the method comprising:
receiving an article generation instruction, wherein the article generation instruction comprises content indication information and space indication information, the content indication information is used for indicating the content of an article to be generated, and the space indication information is used for indicating the space size of the article to be generated;
invoking the article generating tool to generate a catalog including a plurality of chapter titles under the condition that the space indicated by the space indicating information is larger than the single output maximum space of the article generating tool;
sequentially calling the article generating tool to generate chapter contents corresponding to each chapter title based on a plurality of chapter titles included in the catalog;
And splicing the chapter contents corresponding to the chapter titles based on the catalogue to obtain articles.
In a possible implementation manner, the text instruction information includes article types, and different article types are used for indicating different text; and when the space indicated by the space indication information is larger than the maximum space of single output of the article generating tool, invoking the article generating tool to generate a catalogue, wherein the method comprises the following steps:
and calling the article generating tool to generate the catalogue under the condition that the article type included in the article generating instruction belongs to the first type.
In one possible implementation, the first type includes a first subtype and a second subtype, the first subtype indicating a smaller article space than the second subtype;
and under the condition that the article type included in the article generating instruction belongs to a first type, invoking the article generating tool to generate the catalogue, wherein the method comprises the following steps:
under the condition that the article type included in the article generating instruction belongs to a first subtype, invoking the article generating tool to generate a first-level catalogue;
and calling the article generating tool to generate a multi-level catalogue under the condition that the article type included in the article generating instruction belongs to the second subtype.
In one possible implementation manner, the invoking the article generating tool to generate the first-level catalog in the case that the article type included in the article generating instruction belongs to the first subtype includes:
if the article type included in the article generating instruction belongs to a first sub-type, a first catalog generating instruction is sent to the article generating tool, wherein the first catalog generating instruction comprises the content indicating information and the catalog type of the first grade catalog and is used for indicating the article generating tool to generate the first grade catalog; receiving a first-level catalog output by the article generating tool;
and under the condition that the article type included in the article generating instruction belongs to a second subtype, invoking the article generating tool to generate a multi-level catalogue, wherein the method comprises the following steps of:
if the article type included in the article generating instruction belongs to a second sub-type, sending a second catalog generating instruction to the article generating tool, wherein the second catalog generating instruction comprises the content indicating information and the catalog type of the multi-stage catalog and is used for indicating the article generating tool to generate the multi-stage catalog; and receiving the multi-level catalogue output by the article generating tool.
In one possible implementation manner, the invoking the article generating tool to generate the catalog in the case that the article type included in the article generating instruction belongs to the first type includes:
if the article type included in the article generation instruction belongs to a first type, sending a catalog generation instruction carrying the content indication information and the article type to the article generation tool, if the article type belongs to a first subtype in the first type, the article type is used for indicating the article generation tool to generate a first-level catalog, and if the article type belongs to a second subtype in the first type, the article type is used for indicating the article generation tool to generate a multi-level catalog;
and receiving the catalogue output by the article generating tool.
In one possible implementation, the spread indication information includes a minimum number of words of the article to be generated; and when the space indicated by the space indication information is larger than the maximum space of single output of the article generating tool, invoking the article generating tool to generate a catalogue, wherein the method comprises the following steps:
and calling the article generating tool to generate a first catalogue under the condition that the minimum word number included in the article generating instruction is larger than the single-output maximum word number of the article generating tool.
In one possible implementation, after the invoking the article generating tool to generate the first catalog, the method further includes:
obtaining the product of the chapter number of the first catalog and the single output reference word number of the article generating tool;
and if the product is smaller than the minimum word number, calling the article generating tool to expand the first catalogue into a second catalogue.
In one possible implementation, the reference word number is any one of the following:
the article generating tool outputs a maximum number of words for a single time;
a single output minimum word number of the article generating tool;
the article generates an average number of output words for the tool.
In one possible implementation manner, the sequentially calling the article generating tool to generate chapter contents corresponding to each chapter title based on the plurality of chapter titles included in the catalog includes:
for any chapter title in the catalog, sending a chapter content generating instruction to the article generating tool, wherein the chapter content generating instruction is used for instructing the article generating tool to generate chapter content corresponding to the chapter title, and the chapter content generating instruction carries the chapter title, a previous chapter title and a next chapter title of the chapter title and the content indicating information;
And receiving the chapter content output by the article generating tool.
In one possible implementation manner, when the directory is a multi-level directory, the chapter content generating instruction carries the chapter title, a previous chapter title and a next chapter title of the chapter title, a previous chapter title of the chapter title, and the content indicating information.
In another aspect, there is provided an article generating apparatus, the apparatus comprising:
the receiving module is used for receiving an article generation instruction, wherein the article generation instruction comprises content indication information and space indication information, the content indication information is used for indicating the content of an article to be generated, and the space indication information is used for indicating the space size of the article to be generated;
the generation module is used for calling the article generation tool to generate a catalog when the space indicated by the space indication information is larger than the maximum space of single output of the article generation tool, and the catalog comprises a plurality of chapter titles;
the generation module is further used for sequentially calling the article generation tool to generate chapter contents corresponding to each chapter title based on the chapter titles included in the catalog;
And the splicing module is used for splicing the chapter contents corresponding to the chapter titles based on the catalogue to obtain articles.
In a possible implementation manner, the text instruction information includes article types, and different article types are used for indicating different text; and the generating module is used for calling the article generating tool to generate the catalogue under the condition that the article type included in the article generating instruction belongs to the first type.
In one possible implementation, the first type includes a first subtype and a second subtype, the first subtype indicating a smaller article space than the second subtype;
the generating module is used for calling the article generating tool to generate a first-level catalogue under the condition that the article type included in the article generating instruction belongs to a first subtype; and calling the article generating tool to generate a multi-level catalogue under the condition that the article type included in the article generating instruction belongs to the second subtype.
In a possible implementation manner, the generating module is configured to send a first catalog generating instruction to the article generating tool when an article type included in the article generating instruction belongs to a first subtype, where the first catalog generating instruction includes the content indicating information and a catalog type of a primary catalog, and is configured to instruct the article generating tool to generate the primary catalog; receiving a first-level catalog output by the article generating tool;
The generating module is configured to send a second catalog generating instruction to the article generating tool when the article type included in the article generating instruction belongs to a second subtype, where the second catalog generating instruction includes the content indicating information and a catalog type of the multi-level catalog, and is configured to instruct the article generating tool to generate the multi-level catalog; and receiving the multi-level catalogue output by the article generating tool.
In a possible implementation manner, the generating module is configured to send, to the article generating tool, a catalog generating instruction carrying the content indication information and the article type if an article type included in the article generating instruction belongs to a first type, where the article type is used to instruct the article generating tool to generate a first-level catalog if the article type belongs to a first subtype in the first type, and the article type is used to instruct the article generating tool to generate a multi-level catalog if the article type belongs to a second subtype in the first type; and receiving the catalogue output by the article generating tool.
In one possible implementation, the spread indication information includes a minimum number of words of the article to be generated; and the generating module is used for calling the article generating tool to generate a first catalogue under the condition that the minimum word number included in the article generating instruction is larger than the single-output maximum word number of the article generating tool.
In one possible implementation, the generating module is further configured to obtain a product of the number of chapters of the first catalog and the number of single-output reference words of the article generating tool; and if the product is smaller than the minimum word number, calling the article generating tool to expand the first catalogue into a second catalogue.
In one possible implementation, the reference word number is any one of the following:
the article generating tool outputs a maximum number of words for a single time;
a single output minimum word number of the article generating tool;
the article generates an average number of output words for the tool.
In one possible implementation manner, the generating module is configured to send, to the article generating tool, a chapter content generating instruction for instructing the article generating tool to generate chapter content corresponding to the chapter title, where the chapter content generating instruction carries the chapter title, a previous chapter title and a next chapter title of the chapter title, and the content indicating information; and receiving the chapter content output by the article generating tool.
In one possible implementation manner, when the directory is a multi-level directory, the chapter content generating instruction carries the chapter title, a previous chapter title and a next chapter title of the chapter title, a previous chapter title of the chapter title, and the content indicating information.
In another aspect, a computer device is provided, the computer device including a processor and a memory, the memory storing at least one program code, the at least one program code loaded and executed by the processor to implement the article generating method according to any of the above-described implementations.
In another aspect, a computer readable storage medium is provided, in which at least one program code is stored, the at least one program code being loaded and executed by a processor to implement an article generating method according to any one of the above-mentioned implementations.
In another aspect, 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 generating method as described in any one of the implementations above.
The technical scheme provided by the embodiment of the application has the beneficial effects that at least:
the embodiment of the application provides an article generating method, when a user needs to generate an article with long space, an article generating tool can be called to generate a catalog, then the article generating tool is called to generate chapter contents corresponding to each chapter title in sequence based on a plurality of chapter titles included in the catalog, and the chapter contents are spliced to obtain the article with long space, so that the problem of limited article space is effectively solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic illustration of an implementation environment provided by an embodiment of the present application;
FIG. 2 is a flowchart of an article generating method according to an embodiment of the present application;
FIG. 3 is a flowchart of an article generating method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an article generating device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a server according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail with reference to the accompanying drawings.
The terms "first," "second," "third," and "fourth" and the like in the description and in the claims and drawings are used for distinguishing between different objects and not necessarily for describing a particular sequential or chronological order. Furthermore, the terms "comprising," "including," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those listed steps or elements but may include other steps or elements not listed or inherent to such process, method, article, or apparatus.
It should be noted that, the information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals related to the present application are all authorized by the user or are fully authorized by the parties, and the collection, use, and processing of the related data is required to comply with the relevant laws and regulations and standards of the relevant countries and regions. For example, the content indication information, the space indication information, etc. referred to in the present application are obtained under the condition of sufficient authorization.
The article generating method provided by the embodiment of the application is executed by computer equipment. In some embodiments, the computer device may be a terminal, where the terminal may be any type of terminal such as a mobile phone, a tablet computer, a notebook computer, a desktop computer, and the type of the terminal is not limited in the embodiments of the present application. In other embodiments, the computer device may be a server, which may be a server, or a server cluster composed of several servers, or a cloud computing service center. Of course, the server may also include other functional servers in order to provide more comprehensive and diverse services. In other embodiments, the computer device includes a terminal and a server. It should be noted that, the embodiment of the present application only exemplifies the execution subject of the article generating method, and does not limit the execution subject.
Fig. 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application, and as shown in fig. 1, the implementation environment includes a terminal 101 and a server 102, where the terminal 101 and the server 102 are connected through a wired or wireless network.
In some embodiments, the terminal 101 has installed thereon a target application served by the server 102. The terminal 101 can implement functions such as data transmission, message interaction, etc. through the target application. Alternatively, the target application is a target application in the operating system of the terminal 101 or a target application provided for a third party. For example, the target application is an article generation application having a function of generating an article, but of course, the article generation application can also have other functions such as a comment function, a shopping function, a dialogue function, a game function, and the like. Optionally, the server 102 is a background server of the target application or a cloud server providing services such as cloud computing and cloud storage.
In some embodiments, the user inputs the content indication information and the space indication information in the terminal 101, sends an article generation instruction carrying the content indication information and the space indication information to the server through the terminal 101, generates an article based on the article generation instruction by the server 102, returns the article to the terminal 101, and displays the article by the terminal 101.
It should be noted that the above-mentioned process may be performed by the terminal 101 and the server 102 in cooperation, and the specific steps performed by the terminal 101 and the server 102 are not limited.
The following describes an application scenario of the embodiment of the present application in an exemplary manner:
the article generating method provided by the embodiment of the application can be applied to any article generating scene, the article generating scene is not limited by the embodiment of the application, and the following embodiments are only used for illustrative explanation:
chatgpt is a chat robot that provides a series of API (Application Programming Interface, application program interface) interfaces so that developers can integrate Chatgpt into their own applications. After Chatgpt is integrated into the target application, the target application can generate the article that the user wants through Chatgpt. However, the Chatgpt cannot generate a long article larger than the limit by the limit of the interface max_token (similar to the maximum generated word number) of the Chatgpt, and when the user needs a long article larger than the limit, the user's requirement cannot be satisfied. If the article generating method provided by the embodiment of the application is adopted, the Chatgpt can be indicated to generate the catalog firstly, then the Chatgpt is indicated to generate the chapter content based on each chapter title in the catalog, and the long article exceeding the limit can be obtained by splicing the chapter contents, so that the problem of limited space when the article is generated is solved, and the random space requirement of a user on the article can be met.
Fig. 2 is a flowchart of an article generating method according to an embodiment of the present application, where an execution body is exemplified as a computer device. Referring to fig. 2, the method includes:
201. the computer device receives an article generation instruction, wherein the article generation instruction comprises content indication information and space indication information, the content indication information is used for indicating the content of an article to be generated, and the space indication information is used for indicating the space size of the article to be generated.
The article generation instruction is an instruction for instructing the computer device to automatically generate an article. The content indication information is used for indicating the content of the article to be generated. In some embodiments, the content indication information is an article title of the article to be generated. In other embodiments, the content indication information is an article summary of the article to be generated. The embodiment of the application does not limit the content indication information. The space indication information is used for indicating the space size of the article to be generated. In some embodiments, the text instruction information includes text types, such as, for example, a description text, a narrative, an treatise, an application text, an treatise, a novel, a prose, a script, a poetry, a fairy tale, etc., and the text types correspond to different text types. In some embodiments, the space indication information includes a minimum word number, that is, a minimum word number of the article to be generated, for example, 800 words, 1 ten thousand words, etc., which is not limited in the embodiments of the present application.
In some embodiments, the computer device is a terminal, and the article generating instruction is generated by triggering an article generating operation on the terminal by a user, and after triggering the article generating operation by the user, the terminal receives the article generating instruction. The article generating operation may be any one or more of clicking operation, sliding operation, double clicking operation, long pressing operation, and the like, and may also be a sending operation of content indication information and space indication information.
202. The computer device invokes the article generation tool to generate a catalog that includes a plurality of section titles if the space indicated by the space indication information is greater than a single output maximum space of the article generation tool.
The article generating tool is a tool for generating an article, and the article generating tool may be an article generating model, chatgpt, or the like, and the embodiment of the present application does not limit the article generating tool.
In practical application, in order to ensure the output stability of the article generating tool and avoid various reasons such as long single output time of the article generating tool, a space limit is set for the single output of the article generating tool, so that the space of the article cannot exceed the limit no matter what article is output by the article generating tool. For example, the article generating tool is chatgpt, and the chatgpt is integrated in a target application program of the computer device, the target application program makes the chatgpt output articles by calling an API interface of the chatgpt, and the articles output by the chatgpt are limited by max_token (maximum generated word number) of the API interface, so that the length of the articles output by the chatgpt does not exceed the limit. Therefore, in order to generate a large-space article exceeding the limit, the embodiment of the application provides a new article generating method, that is, the article generating tool is called to generate the catalog, then the article generating tool is called to generate the chapter content corresponding to each chapter title in the catalog, and the chapter contents are spliced to obtain the large-space article exceeding the limit.
203. The computer device sequentially calls the article generating tool to generate chapter contents corresponding to the chapter titles based on the chapter titles included in the catalog.
In step 203, when the computer device calls the article generating tool based on the catalog, only instructs the article generating tool to output the chapter content corresponding to one chapter title at a time, and generates the chapter content corresponding to each chapter title by calling the article generating tool multiple times.
204. And the computer equipment splices the chapter contents corresponding to the chapter titles based on the catalogues to obtain articles.
Since the chapter contents corresponding to the chapter titles are generated by calling the article generating tool a plurality of times, although each chapter content is limited by a single output of the article generating tool, a large-sized article exceeding the limit can be obtained after the chapter contents corresponding to the chapter titles are spliced.
In the embodiment of the application, when the chapter contents corresponding to each chapter title are spliced based on the catalogue to obtain the article, only the chapter contents can be spliced, and the chapter titles are not spliced; the chapter title and the chapter content can be spliced together; the splicing mode can also be selected according to actual requirements, for example, a user can select the splicing mode independently, the computer equipment can automatically determine whether to splice the chapter titles into the chapter titles according to the article types, and the like, and the embodiment of the application is not limited to the method.
According to the method for generating the article, when a user needs to generate the long-space article, the article generating tool can be called to generate the catalog, then the article generating tool is called to generate the chapter content corresponding to each chapter title in sequence based on the chapter titles included in the catalog, and the chapter content is spliced to obtain the long-space article, so that the problem of limited article space is solved.
In one possible implementation, the article-related information includes article types, and different article types are used to indicate different article-related information; in the case that the space indicated by the space indication information is larger than the maximum space of single output of the article generating tool, invoking the article generating tool to generate a catalog, including:
and calling an article generating tool to generate a catalogue under the condition that the article type included in the article generating instruction belongs to the first type.
In one possible implementation, the first type includes a first subtype and a second subtype, the first subtype indicating a smaller article space than the second subtype;
and in the case that the article type included in the article generating instruction belongs to the first type, invoking an article generating tool to generate a catalogue, wherein the method comprises the following steps of:
Under the condition that the article type included in the article generating instruction belongs to a first subtype, invoking an article generating tool to generate a first-level catalogue;
and calling an article generating tool to generate a multi-level catalogue under the condition that the article type included in the article generating instruction belongs to the second subtype.
In one possible implementation, in a case where an article type included in the article generation instruction belongs to a first subtype, invoking an article generation tool to generate a first-level catalog includes:
when the article type included in the article generating instruction belongs to a first sub type, sending a first catalog generating instruction to an article generating tool, wherein the first catalog generating instruction comprises content indicating information and a catalog type of a first grade catalog and is used for indicating the article generating tool to generate the first grade catalog; receiving a first-level catalog output by an article generating tool;
and in the case that the article type included in the article generating instruction belongs to the second subtype, invoking an article generating tool to generate a multi-level catalogue, wherein the method comprises the following steps of:
when the article type included in the article generating instruction belongs to a second sub type, sending a second catalog generating instruction to the article generating tool, wherein the second catalog generating instruction comprises content indicating information and catalog types of the multi-level catalog and is used for indicating the article generating tool to generate the multi-level catalog; a multi-level catalog output by the article generation tool is received.
In one possible implementation, in a case where an article type included in the article generation instruction belongs to a first type, invoking the article generation tool to generate a catalog includes:
if the article type included in the article generation instruction belongs to a first type, transmitting a catalog generation instruction carrying content indication information and the article type to an article generation tool, wherein if the article type belongs to a first subtype in the first type, the article type is used for indicating the article generation tool to generate a first-level catalog, and if the article type belongs to a second subtype in the first type, the article type is used for indicating the article generation tool to generate a multi-level catalog;
a catalog of article generation tool outputs is received.
In one possible implementation, the spread indication information includes a minimum number of words of the article to be generated; in the case that the space indicated by the space indication information is larger than the maximum space of single output of the article generating tool, invoking the article generating tool to generate a catalog, including:
and calling the article generating tool to generate a first catalogue under the condition that the minimum word number included in the article generating instruction is larger than the maximum word number of single output of the article generating tool.
In one possible implementation, after the article generating tool is invoked to generate the first catalog, the method further includes:
Obtaining the product of the chapter number of the first catalog and the single-output reference word number of the article generating tool;
if the product is less than the minimum word number, the article generation tool is invoked to expand the first catalog into a second catalog.
In one possible implementation, the reference number is any one of the following:
the maximum number of words of a single output of the article generating tool;
the minimum number of words is output by the article generating tool once;
the average number of words output by the article generation tool.
In one possible implementation, based on a plurality of chapter titles included in the catalog, sequentially invoking an article generating tool to generate chapter contents corresponding to the chapter titles, including:
for any chapter title in the catalog, sending a chapter content generating instruction to the article generating tool, wherein the chapter content generating instruction is used for instructing the article generating tool to generate chapter content corresponding to the chapter title, and the chapter content generating instruction carries the chapter title, the previous chapter title and the next chapter title of the chapter title and content indicating information;
the chapter content output by the article generation tool is received.
In one possible implementation, when the directory is a multi-level directory, the chapter content generation instruction carries a chapter title, a chapter title immediately preceding and next to the chapter title, a chapter title immediately preceding the chapter title, and content indication information.
Any combination of the above optional solutions may be adopted to form an optional embodiment of the present application, which is not described herein.
Fig. 3 is a flowchart of an article generating method according to an embodiment of the present application, where an execution body is exemplified as a computer device, and referring to fig. 3, the method includes:
301. the computer device displays an article generation interface.
The article generating interface is an interface for generating an article, and it should be noted that the article generating interface in the embodiment of the present application is merely an interface having an article generating function, and of course, the interface may also have other functions, for example, a dialogue function, a comment function, and the like, which is not limited in the embodiment of the present application.
The user may input article indication information in the article generation interface to cause the article generation interface to generate a corresponding article based on the article indication information. The article indication information is information for indicating an article to be generated. In some embodiments, the article indication information includes content indication information and space indication information. The content indication information is used for indicating the content of the article to be generated, and the space indication information is used for indicating the space size of the article to be generated. Of course, the article indication information may also include other information, which is not limited in the embodiment of the present application.
It should be noted that, in the embodiment of the present application, the display style of the article generating interface and the manner of inputting the article indication information in the article generating interface are not limited, and only the following embodiments are described as examples:
in one possible implementation, the article generation interface includes an information input box for acquiring article indication information and article generation options. After the user inputs the article indication information in the information input box, clicking the article generation option to generate an article generation instruction carrying the article indication information, and receiving the article generation instruction by the computer equipment.
In another possible implementation manner, the article generating interface is a dialogue interface between the user and the intelligent robot, and after the user sends the article indication information to the intelligent robot in the dialogue interface, the article matched with the article indication information and returned by the intelligent robot can be received. The computer device generates article generation instructions based on the transmitted information in response to the information transmission operation in the conversation interface.
302. The computer device receives an article generation instruction based on the article generation interface, wherein the article generation instruction comprises content indication information and space indication information, the content indication information is used for indicating the content of an article to be generated, and the space indication information is used for indicating the size of the space of the article to be generated.
The user performs an article generation operation in the article generation interface to trigger an article generation instruction, which is received by the computer device, performs an article generation step described below,
it should be noted that, the above step 302 is the same as the above step 201, and will not be described in detail here. Another point to be described is that the embodiment of the present application is only exemplified by displaying an article generating interface on a computer device, and receiving an article generating instruction based on the article generating interface. In yet another embodiment, the computer device does not need to display an article generation interface, and the user can generate the article generation instruction through voice or other modes, so that the computer device receives the article generation instruction.
303. The computer device invokes the article generation tool to generate a catalog including a plurality of section titles if the space indicated by the space indication information is greater than the single output maximum space of the article generation tool.
As can be seen from the description in step 201, the text instruction information may include the article type, the minimum word number, or both the article type and the minimum word number.
In a first possible implementation, the spread indication information includes article types, and different article types are used to indicate different article spreads. Some article types indicate a larger article space and some article types indicate a smaller article space. For example, when the article type is a description text, the indicated article has a smaller space; when the article type is a novel, the indicated article has a larger space. Therefore, the embodiment of the application classifies the article types into the first type and the second type based on the sizes of the spaces indicated by the different article types. Wherein articles belonging to the first type are usually more extensive articles; articles belonging to the second type are typically less-extensive articles. Therefore, in the embodiment of the present application, when the article type belongs to the first type, the space indicated by the space indication information is greater than the maximum space of the single output of the article generating tool, and step 303 and step 304 described below are performed; when the article type belongs to the second type, the space indicated by the space indication information is not larger than the maximum space of single output of the article generating tool, and the article generating tool is directly called to generate the article.
That is, the computer device calls the article generating tool to generate a catalog in a case that the space indicated by the space indication information is greater than the single output maximum space of the article generating tool, including: and calling an article generating tool to generate a catalogue under the condition that the article type included in the article generating instruction belongs to the first type.
Alternatively, the first type may comprise papers, novels, scripts, etc., and the second type may comprise descriptions, narratives, treatises, proses, poems, fairy tales, etc. The embodiment of the application does not limit the types of the articles included in the first type and the types of the articles included in the second type, and in practical application, the types of the articles can be divided according to the maximum single output space of the article generating tool.
In some cases, the space of the article to be generated is large, and even if the catalog is generated first, the space requirement of the article cannot be met by generating the respective chapter contents based on the respective chapter titles in the target. In order to solve the problem, when the embodiment of the application generates the catalogue, not only the primary catalogue but also the multi-stage catalogue can be generated. When the space requirement of the articles to be generated is large, the method can be adopted to generate the multi-level catalogue.
In order to enable the article generating tool to generate the primary catalogue and the multi-stage catalogue more accurately, the embodiment of the application divides the first type into a plurality of sub-types according to the sizes of the sections indicated by the article types, and the sections indicated by the article types under different sub-types are different in size.
Taking the first type including the first subtype and the second subtype as an example, the article space indicated by the first subtype is smaller than the article space indicated by the second subtype, and when the article type belongs to the first subtype, the space requirement can be met by only generating a first-level catalogue; when the article type belongs to the second subtype, a multi-level catalog needs to be generated to meet the space requirement. In some embodiments, the computer device invokes the article generation tool to generate a catalog if the article types included in the article generation instructions belong to a first type, comprising: under the condition that the article type included in the article generating instruction belongs to a first subtype, invoking an article generating tool to generate a first-level catalogue; and calling an article generating tool to generate a multi-level catalogue under the condition that the article type included in the article generating instruction belongs to the second subtype.
It should be noted that, in the embodiment of the present application, only the first type includes the first subtype and the second subtype, and the process of generating the directory is described as an example, and in other embodiments, the first type may further include any one or more subtypes of the third subtype, the fourth subtype, the fifth subtype, etc., and the number of the subtypes included in the first type is not limited in the embodiment of the present application. Wherein the article space indicated by the first subtype, the second subtype, the third subtype, the fourth subtype and the fifth subtype are sequentially increased. When the article type belongs to the first subtype, invoking an article generating tool to generate a first-level catalogue; when the article type belongs to the second subtype, invoking an article generating tool to generate a second-level catalog; when the article type belongs to the third subtype, invoking an article generating tool to generate a three-level catalog; in the case where the article type belongs to the fourth subtype, the article generation tool is invoked to generate a fourth-level catalog, and so on.
Next, an exemplary description is given of how the article generating tool is caused to generate a one-level catalog or a multi-level catalog according to an embodiment of the present application:
in some embodiments, the computer device, upon invoking the article generation tool to generate the catalog, may inform the article generation tool whether to generate the primary catalog or the multi-level catalog. For example, the computer device, upon invoking the article generation tool, may send a catalog type to the article generation tool to inform the article generation tool whether to generate a primary catalog or a multi-level catalog. Optionally, the computer device invokes the article generation tool to generate the first level catalog if the article type included in the article generation instruction belongs to the first subtype, including: the method comprises the steps that under the condition that an article type included in an article generating instruction belongs to a first subtype, the computer equipment sends a first catalog generating instruction to an article generating tool, wherein the first catalog generating instruction comprises content indicating information and a catalog type of a first grade catalog and is used for indicating the article generating tool to generate the first grade catalog; a first level catalog of article generation tool outputs is received. Optionally, the computer device invokes the article generation tool to generate the multi-level catalog if the article type included in the article generation instruction belongs to the second subtype, including: if the article type included in the article generating instruction belongs to a second sub type, sending a second catalog generating instruction to the article generating tool, wherein the second catalog generating instruction comprises content indicating information and catalog types of the multi-level catalog and is used for indicating the article generating tool to generate the multi-level catalog; a multi-level catalog output by the article generation tool is received.
In other embodiments, the article generation tool may determine whether to generate a primary catalog or a multi-level catalog based on article types, simply by sending the article types to the article generation tool. Optionally, the computer device invokes the article generation tool to generate a catalog if the article type included in the article generation instruction belongs to the first type, including: if the article type included in the article generation instruction belongs to a first type, transmitting a catalog generation instruction carrying content indication information and the article type to an article generation tool, wherein if the article type belongs to a first subtype in the first type, the article type is used for indicating the article generation tool to generate a first-level catalog, and if the article type belongs to a second subtype in the first type, the article type is used for indicating the article generation tool to generate a multi-level catalog; a catalog of article generation tool outputs is received.
In a second possible implementation manner, the space indication information includes a minimum word number of the articles to be generated, if the minimum word number is greater than a single output maximum word number of the article generating tool, the articles output by the article generating tool cannot meet the word number requirement, and the method for generating the catalogue to regenerate chapter contents and splicing the chapter contents into the articles by using the first generation catalogue provided by the embodiment of the application can be adopted. That is, the computer device calls the article generating tool to generate a catalog in a case that the space indicated by the space indication information is greater than the single output maximum space of the article generating tool, including: and calling the article generating tool to generate a first catalogue under the condition that the minimum word number included in the article generating instruction is larger than the maximum word number of single output of the article generating tool.
The first directory may be a primary directory or a multi-level directory, which is not limited in the embodiment of the present application. In some embodiments, the first directory is a primary directory. Optionally, when the computer device invokes the article generating tool to generate the first catalog, the computer device sends the content indicating information and the minimum word number to the article generating tool, and the article generating tool generates a chapter title according to the content indicating information and determines the chapter number according to the minimum word number. In other embodiments, the first catalog may be a first-level catalog or a multi-level catalog, and when the computer device invokes the article generating tool to generate the first catalog, the computer device sends content indication information and a minimum word number to the article generating tool, and the article generating tool determines whether to generate the first-level catalog or the multi-level catalog according to the minimum word number, and determines a chapter title according to the content indication information.
In order to avoid that the article meeting the minimum word number cannot be generated based on the first catalog, the word number of the article generated based on the first catalog can be estimated based on the first catalog after the first catalog is generated. If the estimated word number does not reach the minimum word number, expanding the first catalogue to obtain a second catalogue, and generating an article based on the second catalogue; if the estimated number of words can reach the minimum number of words, an article is generated based on the first catalog. In some embodiments, the method further comprises: obtaining the product of the chapter number of the first catalog and the single-output reference word number of the article generating tool; if the product is less than the minimum word number, the article generation tool is invoked to expand the first catalog into a second catalog. Wherein the number of chapters of the second directory is greater than the number of chapters of the first directory.
In some embodiments, the reference word count is any one of: the maximum number of words output by the article generation tool at a time, the minimum number of words output by the article generation tool, and the average number of words output by the article generation tool. The embodiment of the application is only for exemplary illustration of the reference word number, but not for limiting the reference word number, and in other embodiments, the reference word number may also be a word number, an empirical value, etc. preset in the computer device.
In some embodiments, the first directory and the second directory are peer directories, e.g., the first directory is a primary directory and the second directory is a primary directory; as another example, the first directory is a secondary directory and the second directory is a secondary directory. In other embodiments, the first directory and the second directory are directories of different levels, e.g., the first directory is a primary directory and the second directory is a secondary directory. As another example, the first directory is a secondary directory and the second directory is a tertiary directory.
In a third possible implementation, the spread indication information includes the article type and the minimum number of words of the article to be generated. When the computer device invokes the article generating tool, the content indicating information, the article type and the minimum word count may be sent to the article generating tool, the article generating tool may determine whether to generate a catalog based on the article type, if the catalog is generated, generate a first-level catalog or a multi-level catalog, control the number of chapter titles in the catalog based on the minimum word count, and determine a specific chapter title in the catalog based on the content indicating information.
304. The computer device sequentially calls the article generating tool to generate chapter contents corresponding to the chapter titles based on the chapter titles included in the catalog.
In the embodiment of the application, when the computer equipment sequentially calls the article generating tool to generate the chapter contents corresponding to each chapter title, the article generating tool outputs only the chapter contents corresponding to one chapter title at a time, so that in order to ensure the consistency of the chapter contents corresponding to the front chapter title and the back chapter title, the embodiment of the application can input the current chapter title, the content indicating information, the previous chapter title and the next chapter title of the current chapter title, so that the article generating tool controls the whole article when generating the chapter contents, and the consistency after splicing the chapter contents is better. In one possible implementation, the computer device sequentially invokes the article generating tool to generate chapter contents corresponding to each chapter title based on a plurality of chapter titles included in the catalog, including: for any chapter title in the catalog, the computer equipment sends a chapter content generating instruction to the article generating tool, wherein the chapter content generating instruction carries the chapter title, a previous chapter title and a next chapter title of the chapter title and content indicating information; the chapter content output by the article generation tool is received.
In some embodiments, when the directory is a multi-level directory, it is necessary to generate chapter contents corresponding to the chapter title of the lowest level. To ensure continuity between chapter contents, the chapter content generation instruction may carry a chapter title, a previous chapter title and a next chapter title of the chapter title, a previous chapter title of the chapter title, and content indication information.
It should be noted that, in the embodiment of the present application, only the previous chapter title and the next chapter title of the chapter title are taken as examples for carrying the chapter content instruction, and in another embodiment, the chapter content instruction may also carry the previous N chapter titles and the next M chapter titles of the current chapter title, where N and M are any integer greater than 1, N and M may be the same or different, and the embodiment of the present application does not limit N and M. In another embodiment, the chapter content instruction may also carry a directory, which is not limited by the embodiment of the present application.
305. And the computer equipment splices the chapter contents corresponding to the chapter titles based on the catalogues to obtain articles.
The computer equipment splices chapter contents corresponding to each chapter title based on the catalogue, and when an article is obtained, the chapter titles can be spliced in; instead of splicing the chapter titles, only the chapter contents corresponding to the chapter titles may be spliced together according to the arrangement order of the chapter titles. The embodiment of the present application is not limited thereto.
In some embodiments, the spread indication information includes an article type, and the computer device determines a manner of splicing the chapter content based on the article type. For example, when the article type is a paper, the titles of the chapters and the contents of the chapters are spliced together to obtain the article. For another example, when the article type is novel, only the individual chapter contents need to be spliced together.
306. The computer device displays the article in an article generation interface.
Wherein the computer device may display the article in any form in the article generation interface. In some embodiments, the computer device directly displays the article content of the article. In other embodiments, the computer device displays the article in a file, and the user opens the file before viewing the article content.
According to the method for generating the article, when a user needs to generate the long-space article, the article generating tool can be called to generate the catalog, then the article generating tool is called to generate the chapter content corresponding to each chapter title in sequence based on the chapter titles included in the catalog, and the chapter content is spliced to obtain the long-space article, so that the problem of limited article space is solved.
In addition, when the catalogue is generated, the first-level catalogue or the multi-level catalogue can be generated according to the space requirements, so that the articles meeting the space requirements of users can be generated more accurately, and the accuracy of article generation is improved.
Fig. 4 is a schematic structural diagram of an article generating device according to an embodiment of the present application, as shown in fig. 4, where the device includes:
the receiving module 401 is configured to receive an article generating instruction, where the article generating instruction includes content indication information and space indication information, the content indication information is used to indicate a content of an article to be generated, and the space indication information is used to indicate a size of a space of the article to be generated;
a generating module 402, configured to invoke the article generating tool to generate a catalog, where the content indicated by the content indication information is greater than a single output maximum content of the article generating tool, and the catalog includes a plurality of chapter titles;
the generating module 402 is further configured to sequentially invoke the article generating tool to generate chapter contents corresponding to each chapter title based on a plurality of chapter titles included in the catalog;
and the splicing module 403 is configured to splice chapter contents corresponding to each chapter title based on the catalogue, so as to obtain an article.
In one possible implementation, the article-related information includes article types, and different article types are used to indicate different article-related information; and the generating module 402 is configured to invoke the article generating tool to generate a catalog when the article type included in the article generating instruction belongs to the first type.
In one possible implementation, the first type includes a first subtype and a second subtype, the first subtype indicating a smaller article space than the second subtype;
a generating module 402, configured to invoke an article generating tool to generate a first-level catalog when an article type included in the article generating instruction belongs to a first subtype; and calling an article generating tool to generate a multi-level catalogue under the condition that the article type included in the article generating instruction belongs to the second subtype.
In a possible implementation manner, the generating module 402 is configured to send a first catalog generating instruction to the article generating tool when the article type included in the article generating instruction belongs to a first subtype, where the first catalog generating instruction includes content indicating information and a catalog type of the first-level catalog, and is configured to instruct the article generating tool to generate the first-level catalog; receiving a first-level catalog output by an article generating tool;
a generating module 402, configured to send a second catalog generating instruction to the article generating tool when the article type included in the article generating instruction belongs to a second subtype, where the second catalog generating instruction includes content indicating information and a catalog type of the multi-level catalog, and is configured to instruct the article generating tool to generate the multi-level catalog; a multi-level catalog output by the article generation tool is received.
In a possible implementation manner, the generating module 402 is configured to send, to the article generating tool, a catalog generating instruction that carries content indicating information and an article type if the article type belongs to a first subtype in the first type, and instruct the article generating tool to generate a first-level catalog if the article type belongs to a second subtype in the first type, where the article type is used to instruct the article generating tool to generate a multi-level catalog; a catalog of article generation tool outputs is received.
In one possible implementation, the spread indication information includes a minimum number of words of the article to be generated; the generating module 402 is configured to invoke the article generating tool to generate the first catalog when the minimum word count included in the article generating instruction is greater than the single output maximum word count of the article generating tool.
In one possible implementation, the generating module 402 is further configured to obtain a product of the number of chapters of the first catalog and the number of single output reference words of the article generating tool; if the product is less than the minimum word number, the article generation tool is invoked to expand the first catalog into a second catalog.
In one possible implementation, the reference number is any one of the following:
the maximum number of words of a single output of the article generating tool;
the minimum number of words is output by the article generating tool once;
the average number of words output by the article generation tool.
In one possible implementation manner, the generating module 402 is configured to send, to the article generating tool, a chapter content generating instruction for instructing the article generating tool to generate a chapter content corresponding to a chapter title, where the chapter content generating instruction carries the chapter title, a previous chapter title and a next chapter title of the chapter title, and content indicating information; the chapter content output by the article generation tool is received.
In one possible implementation, when the directory is a multi-level directory, the chapter content generation instruction carries a chapter title, a chapter title immediately preceding and next to the chapter title, a chapter title immediately preceding the chapter title, and content indication information.
It should be noted that: in the article generating apparatus provided in the above embodiment, only the division of the above functional modules is used for illustration when generating an article, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the computer device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the article generating device and the article generating method provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the article generating device and the article generating method are detailed in the method embodiments, which are not repeated herein.
Fig. 5 shows a block diagram of an electronic device 500 according to an exemplary embodiment of the application. The electronic device 500 includes: a processor 501 and a memory 502.
Processor 501 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 501 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 501 may also include a main processor and a coprocessor, the main processor being a processor for processing data in an awake state, also referred to as a CPU (Central Processing Unit ); a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 501 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 501 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 502 may include one or more computer-readable storage media, which may be non-transitory. Memory 502 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 502 is used to store at least one program code for execution by processor 501 to implement the article-generating method provided by the method embodiments of the present application.
In some embodiments, the electronic device 500 may further optionally include: a peripheral interface 503 and at least one peripheral. The processor 501, memory 502, and peripheral interface 503 may be connected by buses or signal lines. The individual peripheral devices may be connected to the peripheral device interface 503 by buses, signal lines or circuit boards. Specifically, the peripheral device includes: at least one of radio frequency circuitry 504, a display 505, a camera 506, audio circuitry 507, a positioning component 508, and a power supply 509.
Peripheral interface 503 may be used to connect at least one Input/Output (I/O) related peripheral to processor 501 and memory 502. In some embodiments, processor 501, memory 502, and peripheral interface 503 are integrated on the same chip or circuit board; in some other embodiments, either or both of the processor 501, memory 502, and peripheral interface 503 may be implemented on separate chips or circuit boards, which is not limited in this embodiment.
The display 505 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display 505 is a touch display, the display 505 also has the ability to collect touch signals at or above the surface of the display 505. The touch signal may be input as a control signal to the processor 501 for processing. At this time, the display 505 may also be used to provide virtual buttons and/or virtual keyboards, also referred to as soft buttons and/or soft keyboards. In some embodiments, the display 505 may be one, providing a front panel of the electronic device 500; in other embodiments, the display 505 may be at least two, and disposed on different surfaces of the electronic device 500 or in a folded design; in still other embodiments, the display 505 may be a flexible display disposed on a curved surface or a folded surface of the electronic device 500. Even more, the display 505 may be arranged in a non-rectangular irregular pattern, i.e., a shaped screen. The display 505 may be made of LCD (Liquid Crystal Display ), OLED (Organic Light-Emitting Diode) or other materials.
The power supply 509 is used to power the various components in the electronic device 500. The power supply 509 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 509 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
Those skilled in the art will appreciate that the structure shown in fig. 5 is not limiting of the electronic device 500 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
Fig. 6 is a schematic structural diagram of a server according to an embodiment of the present application, where the server 600 may have a relatively large difference due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 601 and one or more memories 602, where at least one program code is stored in the memories 602, and the at least one program code is loaded and executed by the processors 601 to implement the methods provided in the foregoing method embodiments. Of course, the server may also have a wired or wireless network interface, a keyboard, an input/output interface, and other components for implementing the functions of the device, which are not described herein.
The server 600 is configured to perform the steps performed by the server in the method embodiment described above.
The embodiment of the application also provides a computer readable storage medium, wherein at least one program code is stored in the computer readable storage medium, and the at least one program code is loaded and executed by a processor to realize the article generating method according to any implementation mode.
Embodiments of the present application also provide a computer program product comprising at least one program code loaded and executed by a processor to implement an article-generating method as described in any of the above implementations.
In some embodiments, a computer program according to an embodiment of the present application may be deployed to be executed on one computer device or on multiple computer devices located at one site, or on multiple computer devices distributed across multiple sites and interconnected by a communication network, where the multiple computer devices distributed across multiple sites and interconnected by a communication network may constitute a blockchain system.
The foregoing is illustrative of the present application and is not to be construed as limiting thereof, but rather as various modifications, equivalent arrangements, improvements, etc., which fall within the spirit and principles of the present application.
Claims (13)
1. A method of generating an article, the method comprising:
receiving an article generation instruction, wherein the article generation instruction comprises content indication information and space indication information, the content indication information is used for indicating the content of an article to be generated, and the space indication information is used for indicating the space size of the article to be generated;
invoking the article generating tool to generate a catalog including a plurality of chapter titles under the condition that the space indicated by the space indicating information is larger than the single output maximum space of the article generating tool;
sequentially calling the article generating tool to generate chapter contents corresponding to each chapter title based on a plurality of chapter titles included in the catalog;
and splicing the chapter contents corresponding to the chapter titles based on the catalogue to obtain articles.
2. The method of claim 1, wherein the text indication information includes article types, different article types being used to indicate different text; and when the space indicated by the space indication information is larger than the maximum space of single output of the article generating tool, invoking the article generating tool to generate a catalogue, wherein the method comprises the following steps:
And calling the article generating tool to generate the catalogue under the condition that the article type included in the article generating instruction belongs to the first type.
3. The method of claim 2, wherein the first type comprises a first subtype and a second subtype, the first subtype indicating a smaller article space than the second subtype;
and under the condition that the article type included in the article generating instruction belongs to a first type, invoking the article generating tool to generate the catalogue, wherein the method comprises the following steps:
under the condition that the article type included in the article generating instruction belongs to the first subtype, invoking the article generating tool to generate a first-level catalogue;
and calling the article generating tool to generate a multi-level catalogue under the condition that the article type included in the article generating instruction belongs to the second subtype.
4. The method of claim 3, wherein invoking the article generation tool to generate a first level catalog if the article type included in the article generation instruction belongs to the first subtype comprises:
sending a first catalog generation instruction to the article generation tool under the condition that the article type included in the article generation instruction belongs to the first subtype, wherein the first catalog generation instruction comprises the content indication information and the catalog type of the primary catalog and is used for indicating the article generation tool to generate the primary catalog; receiving a first-level catalog output by the article generating tool;
And when the article type included in the article generating instruction belongs to the second subtype, invoking the article generating tool to generate a multi-level catalogue, wherein the method comprises the following steps:
sending a second catalog generation instruction to the article generation tool under the condition that the article type included in the article generation instruction belongs to the second subtype, wherein the second catalog generation instruction comprises the content indication information and the catalog type of the multi-level catalog and is used for indicating the article generation tool to generate the multi-level catalog; and receiving the multi-level catalogue output by the article generating tool.
5. The method of claim 3, wherein invoking the article generation tool to generate the catalog if the article type included in the article generation instruction belongs to a first type comprises:
if the article type included in the article generation instruction belongs to a first type, sending a catalog generation instruction carrying the content indication information and the article type to the article generation tool, if the article type belongs to a first subtype in the first type, the article type is used for indicating the article generation tool to generate a first-level catalog, and if the article type belongs to a second subtype in the first type, the article type is used for indicating the article generation tool to generate a multi-level catalog;
And receiving the catalogue output by the article generating tool.
6. The method of claim 1, wherein the spread indication information includes a minimum number of words of the article to be generated; and when the space indicated by the space indication information is larger than the maximum space of single output of the article generating tool, invoking the article generating tool to generate a catalogue, wherein the method comprises the following steps:
and calling the article generating tool to generate a first catalogue under the condition that the minimum word number included in the article generating instruction is larger than the single-output maximum word number of the article generating tool.
7. The method of claim 6, wherein after the invoking the article generation tool to generate the first catalog, the method further comprises:
obtaining the product of the chapter number of the first catalog and the single output reference word number of the article generating tool;
and if the product is smaller than the minimum word number, calling the article generating tool to expand the first catalogue into a second catalogue.
8. The method of claim 7, wherein the reference word count is any one of:
the article generating tool outputs a maximum number of words for a single time;
A single output minimum word number of the article generating tool;
the article generates an average number of output words for the tool.
9. The method of claim 1, wherein the sequentially invoking the article generation tool to generate chapter content corresponding to each chapter title based on the plurality of chapter titles included in the catalog comprises:
for any chapter title in the catalog, sending a chapter content generating instruction to the article generating tool, wherein the chapter content generating instruction is used for instructing the article generating tool to generate chapter content corresponding to the chapter title, and the chapter content generating instruction carries the chapter title, a previous chapter title and a next chapter title of the chapter title and the content indicating information;
and receiving the chapter content output by the article generating tool.
10. The method according to claim 9, wherein when the directory is a multi-level directory, the chapter content generation instruction carries the chapter title, a previous chapter title and a next chapter title of the chapter title, a previous chapter title of the chapter title, and the content indication information.
11. An article generating apparatus, the apparatus comprising:
The receiving module is used for receiving an article generation instruction, wherein the article generation instruction comprises content indication information and space indication information, the content indication information is used for indicating the content of an article to be generated, and the space indication information is used for indicating the space size of the article to be generated;
the generation module is used for calling the article generation tool to generate a catalog when the space indicated by the space indication information is larger than the maximum space of single output of the article generation tool, and the catalog comprises a plurality of chapter titles;
the generation module is further used for sequentially calling the article generation tool to generate chapter contents corresponding to each chapter title based on the chapter titles included in the catalog;
and the splicing module is used for splicing the chapter contents corresponding to the chapter titles based on the catalogue to obtain articles.
12. A computer device comprising a processor and a memory, wherein the memory has stored therein at least one program code that is loaded and executed by the processor to implement the article generating method of any of claims 1 to 10.
13. A computer readable storage medium having stored therein at least one program code, the at least one program code being loaded and executed by a processor to implement the article generating method of any one of claims 1 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311113911.0A CN117093707A (en) | 2023-08-31 | 2023-08-31 | Article generation method, device, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311113911.0A CN117093707A (en) | 2023-08-31 | 2023-08-31 | Article generation method, device, equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117093707A true CN117093707A (en) | 2023-11-21 |
Family
ID=88771338
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311113911.0A Pending CN117093707A (en) | 2023-08-31 | 2023-08-31 | Article generation method, device, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117093707A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118093087A (en) * | 2024-04-28 | 2024-05-28 | 广东省电信规划设计院有限公司 | Ultralong spread data processing method and device applied to AIGC platform |
-
2023
- 2023-08-31 CN CN202311113911.0A patent/CN117093707A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118093087A (en) * | 2024-04-28 | 2024-05-28 | 广东省电信规划设计院有限公司 | Ultralong spread data processing method and device applied to AIGC platform |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110795195B (en) | Webpage rendering method and device, electronic equipment and storage medium | |
RU2693909C2 (en) | Command user interface for displaying and scaling selected control elements and commands | |
CN109358936A (en) | Information processing method, device, storage medium, electronic equipment and system | |
US10860790B2 (en) | Conversion of data ranges to table objects | |
EP3531290A1 (en) | Data backup method, apparatus, electronic device, storage medium, and system | |
CN108984258A (en) | Using multi-screen display method, device, storage medium and electronic equipment | |
CN112230909B (en) | Method, device, equipment and storage medium for binding data of applet | |
CN105378817A (en) | Incorporating external dynamic content into a whiteboard | |
CN105378623A (en) | Inset dynamic content preview pane | |
CN108027695A (en) | Application user interface based on experience mode conversion reconfigures | |
CN117093707A (en) | Article generation method, device, equipment and medium | |
CN112702261A (en) | Information display method and device and electronic equipment | |
CN111142722A (en) | Method, device, terminal equipment and storage medium for displaying application content | |
WO2020063088A1 (en) | Method for calling bottom layer of game platform, and related product | |
CN114327087A (en) | Input event processing method and device, electronic equipment and storage medium | |
US20240089223A1 (en) | Information display method and apparatus, and electronic device | |
CN113485600A (en) | Singing list sharing method and device and electronic equipment | |
CN111813407B (en) | Game development method, game running device and electronic equipment | |
CN110852093B (en) | Poem generation method, device, computer equipment and storage medium | |
CA3041079C (en) | Layered content selection | |
CN109492249A (en) | Rapid generation, device and the terminal device of design drawing | |
CN109657179A (en) | A kind of method for processing business, system and storage medium | |
CN114416234B (en) | Page switching method and device, computer equipment and storage medium | |
CN111325311B (en) | Neural network model generation method for image recognition and related equipment | |
CN106685807A (en) | method and server for displaying information |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |