Intelligent article generation method based on large language model and model essay template
By using a combination of large language models and model essay templates in AI-assisted writing, the problem of insufficient word count and depth of the generated content and poor content quality is solved, and high-quality article content that meets business needs is achieved.
Patent Information
- Application Number
- CN202411695441.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-02-28
AI Technical Summary
The text content generated by existing AI-assisted writing technologies often has information "illusion", insufficient number of words and depth, and poor content quality, making it difficult to meet business needs.
The article intelligent generation method based on large language model and model essay templates is adopted. By matching the templates in the model essay template library, content that meets the title and type of the article is generated, and the material in the document database is used to generate the text content of titles at all levels through the large language model.
It improves the content structure, word count scale and depth of the generated article, ensures that the generated content is consistent with business needs, eliminates the "illusion" of writing content, and improves the quality of the article.
Smart Images

Figure CN119538896A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence technology, and in particular relates to an article intelligent generation method based on a large language model and a model article template. Background Art
[0002] With the development of artificial intelligence (AI) technology, AI-assisted writing technology is becoming more and more widely used. Existing AI-assisted writing technology mainly relies on the free creation ability of large language models. There are two main technical implementation methods:
[0003] One is that the user describes the title and writing requirements in natural language, and then automatically completes the writing task based on the encoding and conversion capabilities of the large language model itself. The other is human-computer interactive associative writing. During the user's writing process, the algorithm model automatically performs semantic association based on the contextual information already entered by the user, based on probability statistical models such as Markov chains or deep learning models, and recommends subsequent vocabulary, sentences or paragraphs.
[0004] However, using this approach, the text content automatically generated by the large language model often has information "hallucinations", that is, it does not conform to the actual situation or violates common sense, and the generated text content is missing, the word count and depth of the article generated content are insufficient. At the same time, since AI-assisted writing mainly generates text content based on general common sense, it is difficult to fully learn from and inherit the experience and thinking models in existing business activities. The generated content is often inconsistent with the business, and if the generated text paragraphs are too long, it will lead to problems such as "topic drift", and the quality of the generated text content will be reduced. Summary of the invention
[0005] The purpose of the present invention is to provide an intelligent article generation method based on a large language model and a model essay template, so as to solve the problems of insufficient word size and depth and poor content quality of content generated by AI-assisted writing in the prior art.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions:
[0007] In a first aspect, the present invention provides an article intelligent generation method based on a large language model and a model article template, comprising:
[0008] Based on the article title and article type of the article to be generated, multiple sample article templates with the same article type and matching the article title are matched from the sample article template library;
[0009] For any level title of the article to be generated, based on the matching degree between the any level title and the level titles in each model article template, determine a candidate reference title for generating a next level title of the any level title;
[0010] Based on the next level title of the candidate reference title, generate the next level title of any one level title;
[0011] Searching for document materials matching the leaf titles of the article to be generated from a document database, wherein the leaf title is the lowest-level title among all the titles of the article to be generated;
[0012] Based on the document materials matching the leaf titles at each level, the text content of the leaf titles at each level is generated through a large language model;
[0013] The titles at all levels of the article to be generated and the main text contents of the leaf titles at all levels are combined to obtain the article content of the article to be generated.
[0014] Based on the above disclosed content, the present invention matches multiple model templates with the same article type and matching the article title from the model template library based on the article title and article type of the article to be generated; for any level title of the article to be generated, based on the matching degree between any level title and each level title in each model template, determine the candidate reference title for generating the next level title of any level title; based on the next level title of the candidate reference title, generate the next level title of any level title; find out the document materials matching the leaf titles at all levels of the article to be generated from the document database; based on the document materials matching the leaf titles at all levels, generate the main content of the leaf titles at all levels through a large language model; combine the titles at all levels of the article to be generated and the main content of the leaf titles at all levels to obtain the article content of the article to be generated. In this way, when AI-assisted writing is used, the writing framework of the model template can be used for reference and learning, so that the article content structure meets business requirements. At the same time, based on the same type of document materials, the content under each level of title is generated respectively, so that the word count and depth of the generated article content meet the requirements. In addition, the model template for AI-assisted writing is of the same article type as the article to be generated and the article title matches, so that the generated content is consistent with the user's business and eliminates the "illusion" of writing content.
[0015] In one possible design, the method further includes:
[0016] Based on the content of the sub-titles of non-leaf titles, a summary of the non-leaf title is generated through a large language model;
[0017] The step of combining the titles of each level and the text contents of each level of leaf titles of the article to be generated to obtain the article content of the article to be generated includes:
[0018] The titles at all levels of the article to be generated, the main content of the leaf titles at all levels, and the abstracts of the non-leaf titles are combined to obtain the article content of the article to be generated.
[0019] In one possible design, the method further includes:
[0020] In response to a simplification operation initiated by a user, the selected content in the article is automatically simplified through a large language model.
[0021] In one possible design, the method further includes:
[0022] In response to the word replacement operation initiated by the user, the large language model is used to recommend and confirm the synonyms or near-synonyms of the selected words;
[0023] Replace the selected word with its synonym or near-synonym.
[0024] In one possible design, the method further includes:
[0025] Detecting whether there are banned words in the article content;
[0026] If there are banned words in the article content, marking the banned words in the article content;
[0027] Detect whether there is AI-curated expression content in the article;
[0028] If there is AI solidified expression content in the article content, the AI solidified expression content is deleted or the expression of the AI solidified expression content is adjusted through a large language model.
[0029] In a possible design, when any one-level title is an article title, the matching degree between any one-level title and the corresponding level title in the sample article template is:
[0030] Score(v i , v j )=sim(v i , v j );
[0031] When the any-level title is a title other than the article title, the matching degree between the any-level title and the candidate title to be matched in the sample article template is:
[0032] Score(v i , v j )=Score(v p(i) , v p(j) )×sim(v i , v j );
[0033] Among them, Score(v i , v j) represents the matching degree between any level title i of the article to be generated and the candidate title j to be matched in the template, sim(v i , v j ) represents the semantic similarity between any level title i of the article to be generated and the candidate title j to be matched in the template, Score(v p(i) , v p(j) ) represents the degree of match between the previous level title of any level title i and the previous level title of the candidate title j to be matched in the model template.
[0034] In a possible design, searching for document materials matching the leaf titles at all levels of the article to be generated from the document database includes:
[0035] For any level leaf title of the article to be generated, combine the any level leaf title with all the upper level titles of the any level leaf title to obtain a character string combination corresponding to the any level leaf title;
[0036] Perform semantic similarity matching on the string combination corresponding to any level leaf title and the document blocks of each document material in the document database to obtain the document material matching any level leaf title;
[0037] Each document material in the document database is divided into a plurality of document blocks according to a preset length.
[0038] In a possible design, the document material based on the matching of leaf titles at each level generates the text content of leaf titles at each level through a large language model, including:
[0039] Generate task prompts based on the title content of leaf titles at all levels;
[0040] Based on the reference of the document materials matching the leaf titles at each level, the main text content related to the task prompt words corresponding to the leaf titles at each level is generated through the big language.
[0041] In a second aspect, the present invention provides an article intelligent generation device based on a large language model and a model article template, comprising:
[0042] A matching unit, configured to match a plurality of sample article templates of the same article type and matching the article title from a sample article template library based on the article title and article type of the article to be generated;
[0043] A determination unit, for determining, for any level title of the article to be generated, a candidate reference title for generating a next level title of any level title based on the matching degree between the any level title and the level titles in each model article template;
[0044] A first generating unit, configured to generate a next-level title of any first-level title based on a next-level title of a level title corresponding to any first-level title in the candidate reference titles;
[0045] A search unit, used to search for document materials matching the leaf titles of each level of the article to be generated from a document database, wherein the leaf title is the lowest level title among all the titles of the article to be generated;
[0046] The second generation unit is used to generate the text content of the leaf titles at each level through the large language model based on the document materials matched by the leaf titles at each level;
[0047] The combining unit is used to combine the titles at all levels and the text contents of the leaf titles at all levels of the article to be generated to obtain the article content of the article to be generated.
[0048] In a third aspect, the present invention provides an electronic device comprising a memory, a processor and a transceiver which are communicatively connected in sequence, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program to execute the intelligent article generation method based on a large language model and a model template as described in the first aspect or any possible design of the first aspect.
[0049] In a fourth aspect, the present invention provides a computer-readable storage medium having instructions stored thereon, which, when executed on a computer, executes the intelligent article generation method based on a large language model and a model template as described in the first aspect or any possible design of the first aspect.
[0050] In a fifth aspect, the present invention provides a computer program product comprising instructions, which, when executed on a computer, causes the computer to execute the method for intelligently generating articles based on a large language model and a model template as described in the first aspect or any possible design of the first aspect.
[0051] Beneficial effects:
[0052] The intelligent article generation method based on a large language model and a model template provided by the present invention can refer to the writing framework of the model template for reference and learning during AI-assisted writing, so that the article content structure meets business requirements, and at the same time, based on the same type of document materials, the content under each level of title is generated respectively, so that the word count and depth of the generated article content meet the requirements. In addition, the model template for AI-assisted writing is the same as the article type of the article to be generated and the article title matches, so that the generated content is consistent with the user's business, eliminating the "illusion" of writing content, and facilitating practical application and promotion.
[0053] In addition, the generated article content can be streamlined, vocabulary adjusted, banned words identified and marked, and AI-cured expression content optimized to improve the quality of the generated articles. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 A flowchart of a method for intelligently generating articles based on a large language model and a sample article template provided in an embodiment of the present application;
[0055] Figure 2 A schematic block diagram of an apparatus for intelligently generating articles based on a large language model and a sample article template provided in an embodiment of the present application;
[0056] Figure 3 A schematic block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the present invention will be briefly introduced below in combination with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the structure of the drawings is only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention.
[0058] It should be understood that although the terms first, second, etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are only used to distinguish one unit from another unit. For example, a first unit can be referred to as a second unit, and similarly, a second unit can be referred to as a first unit without departing from the scope of the exemplary embodiments of the present invention.
[0059] It should be understood that the term "and / or" that may appear in this article is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can represent three situations: A exists alone, B exists alone, and A and B exist at the same time. The term " / and" that may appear in this article describes another type of association object relationship, indicating that two relationships may exist. For example, A / and B can represent two situations: A exists alone, and A and B exist alone. In addition, the character " / " that may appear in this article generally indicates that the previous and next associated objects are in an "or" relationship.
[0060] In order to improve the quality of content generated by AI-assisted writing, the embodiments of the present application provide a method, device and product for intelligent generation of articles based on a large language model and a model template. The method, device and product for intelligent generation of articles based on a large language model and a model template can make the structure, word count and depth of the content of articles generated by AI-assisted writing meet the requirements, thereby improving the quality of the generated articles.
[0061] The article intelligent generation method based on a large language model and a model article template provided in the embodiment of the present application can be applied to a user terminal or a server. It can be understood that the execution subject does not constitute a limitation on the embodiment of the present application.
[0062] The following is a detailed description of the intelligent article generation method based on a large language model and a sample template provided in an embodiment of the present application.
[0063] like Figure 1 As shown, it is a flowchart of the intelligent article generation method based on the large language model and the model template provided in the first aspect of the embodiment of the present application. The intelligent article generation method based on the large language model and the model template may include but is not limited to the following steps S101-S106.
[0064] Step S101. Based on the article title and article type of the article to be generated, multiple sample templates with the same article type and matching the article title are matched from the sample template library.
[0065] In the embodiment of the present application, a sample template library is pre-constructed, and the sample template library records various types of sample templates and elements of each sample template. The elements of the sample template may include, but are not limited to, the article type, article title, sub-titles at all levels, the number of words in each title, etc. The sub-titles at all levels may include first-level sub-titles, second-level sub-titles, third-level sub-titles, etc., wherein the first-level sub-title is the next-level title of the article title, the second-level sub-title is the next-level title of the first-level sub-title, the third-level sub-title is the next-level title of the second-level sub-title, and so on.
[0066] When an article needs to be generated, the user can input the article title and article type of the article to be generated, and then multiple sample templates with the same article type and matching the article title can be matched from the sample template library.
[0067] When performing model template matching (equivalent to matching article titles), the article type can be accurately matched first, and then the article title can be semantically matched; when performing semantic matching, the article title entered by the user can first be subjected to named entity recognition and content replacement, and then the text (article title) can be converted into a vector through the document's semantic embedding model, and the semantic vector of the article title entered by the user is compared with the semantic vector similarity of all article titles in the model template library, and multiple model templates with similarities higher than a preset similarity threshold are selected as multiple model templates that have the same article type as the article to be generated and match the article title.
[0068] The semantic embedding model may be, but is not limited to, Open AI's text-embedding-ada-002, embedding text2vec-base-chinese, BERT series models or FastText models.
[0069] Step S102. For any level title of the article to be generated, based on the matching degree between any level title and each level title in each model article template, determine the candidate reference title for generating the next level title of any level title.
[0070] Specifically, when determining the candidate reference titles for generating the next-level title of any first-level title, the first candidate reference title for generating the first-level subtitle of the article to be generated can be determined based on the degree of matching between the article title of the article to be generated and the titles of each level of each model template (select a title with the largest matching degree and a matching degree exceeding a preset matching degree threshold); the second candidate reference title for generating the second-level subtitle of the article to be generated can be determined based on the degree of matching between the first-level subtitle of the article to be generated and the subtitles of each level of each model template, and so on.
[0071] In one or more embodiments, when determining the second-level subtitle and its lower-level subtitle for generating the article to be generated, all the lower-level subtitles of the first N titles with the highest matching degrees can be selected from the candidate reference titles matched last time as candidate reference titles for determining the next-level subtitle, where the value of N can be set according to actual conditions. That is, when determining the candidate reference titles for generating the next-level titles of any first-level title, the first candidate reference title for generating the first-level subtitle of the article to be generated can be determined based on the degree of match between the article title of the article to be generated and the titles of each level of each model template (select a title with the largest degree of match and a degree of match exceeding a preset matching threshold); then all subordinate titles of the top N titles with the largest degree of match with the article title of the article to be generated are selected as candidate titles, and based on the degree of match between the first-level subtitle of the article to be generated and each candidate title, a second candidate reference title for generating the second-level subtitle of the article to be generated is determined; then all subordinate titles of the top N titles with the largest degree of match with the first-level subtitle of the article to be generated are selected as candidate titles, and based on the degree of match between the second-level subtitle of the article to be generated and each candidate title, a third candidate reference title for generating the third-level subtitle of the article to be generated is determined, and so on.
[0072] In the embodiment of the present application, when the any-level title is an article title, the matching degree between the any-level title and the candidate title to be matched in the sample article template can be expressed as:
[0073] Score(v i , v j )=sim(v i , v j );
[0074] When the any-level title is a title other than the article title, the matching degree between the any-level title and the candidate title to be matched in the sample article template can be expressed as:
[0075] Score(v i , v j )=Score(v p(i) , v p(j) )×sim(v i , v j );
[0076] Among them, Score(v i , v j ) represents the matching degree between any level title i of the article to be generated and the candidate title j to be matched in the template, sim(v i , v j ) represents the semantic similarity between any level title i of the article to be generated and the candidate title j to be matched in the template, Score(vp(i) , v p(j) ) represents the matching degree between the previous level title of any level title i and the previous level title of the candidate title j to be matched. The semantic similarity can be measured using the cosine similarity coefficient.
[0077] Step S103: Generate a next-level title of any level title based on the next-level title of the candidate reference title.
[0078] In the embodiment of the present application, the next level title of the candidate reference title can be used as a reference to generate the next level title of any level title through a large language model.
[0079] In the process of intelligent article generation, based on the matching degree between the article title of the article to be generated (the article title can be regarded as the 0-level title) and the titles of each level of each model template, a first candidate reference title for generating the first-level subtitle of the article to be generated can be determined, and the first-level subtitle of the article to be generated can be generated through the large language model with reference to the next-level subtitle of the first candidate reference title. Then, based on the matching degree between the first-level subtitle of the article to be generated and the titles of each level of each model template, a second candidate reference title for generating the second-level subtitle of the article to be generated can be determined, and the second-level subtitle of the article to be generated can be generated through the large language model with reference to the next-level subtitle of the second candidate reference title, and so on, until the user no longer decomposes the problem according to business needs.
[0080] After generating the next level title of any level title, the user can delete, modify and supplement the titles at all levels through the human-computer interaction interface, so as to personalize the overall framework of the generated article according to the user's needs.
[0081] In one or more embodiments, after generating titles of various levels of the article to be generated, the recommended number of words in the text content under various levels of titles of the article to be generated can be automatically generated based on the number of words in the text content under various levels of titles of the model templates in the model template library. The recommended number of words in the text content under various levels of titles of the article to be generated can be the average number of words in the text content under the same level of titles in the model templates; if the average value cannot be calculated, it can be a pre-set default number of words.
[0082] Step S104: Find document materials matching the leaf titles at all levels of the article to be generated from the document database.
[0083] The leaf title is the lowest-level title among all the titles of the article to be generated.
[0084] Specifically, step S104 may include but is not limited to the following steps S1041-S1042.
[0085] Step S1041. For any level leaf title of the article to be generated, combine any level leaf title with all the parent titles of any level leaf title to obtain the character string combination corresponding to any level leaf title.
[0086] Step S1042. Perform semantic similarity matching on the character string combination corresponding to any level leaf title and the document blocks of each document material in the document database to obtain the document material matching any level leaf title.
[0087] Each document material in the document database is divided into a plurality of document blocks according to a preset length.
[0088] In the embodiment of the present application, a document database is pre-established, and each document material in the document database is divided into multiple document blocks according to a preset length, for example, every 500 characters are divided into a document block, and each document block is converted into a semantic vector representation. When searching for document materials that match the leaf titles at all levels of the article to be generated from the document database, the character string combinations corresponding to the leaf titles at all levels can be quantized, and then similarity matching is performed with the semantic vectors corresponding to each document block of each document material, and the document material corresponding to the document block with the highest matching pair can be used as the document material matching the leaf title.
[0089] Step S105: Based on the document materials matched by the leaf titles at each level, the main text content of the leaf titles at each level is generated through a large language model.
[0090] Specifically, task prompts can be generated according to the title content of leaf titles at all levels, and then the document materials matching the leaf titles at all levels are used as references to generate the text content related to the task prompts corresponding to the leaf titles at all levels through big language. In one or more embodiments, the task prompts can also include information such as the number of words required for writing and the writing style. When generating the text content of the leaf titles, it can also be required by default that the generated text content has a clear structure, standardized expression, and concise content.
[0091] In an embodiment of the present application, a prompt word template can be set in advance. Before the main content of each level of leaf titles is generated through a large language model, the title content and other prompt words of each level of leaf titles can be imported into the prompt word template to generate task prompt words for each level of leaf titles.
[0092] Step S106. Combine the titles at all levels of the article to be generated and the main content of the leaf titles at all levels to obtain the article content of the article to be generated.
[0093] In one or more embodiments, the abstract of the non-leaf title can also be generated by the large language model based on the content of the subordinate title of the non-leaf title. When generating the content of the article to be generated, the titles of each level of the article to be generated, the main content of the leaf titles of each level, and the abstracts of the non-leaf titles can be combined to obtain the content of the article to be generated.
[0094] AI-generated text is prone to excessive formulaic expressions and redundant information. Therefore, in one or more embodiments, after generating the content of the article to be generated, the user can simplify the article content. When simplifying the article content, the user can select the content to be simplified through the human-computer interaction interface and initiate a simplification operation. At this time, the selected content in the article content can be automatically simplified through the large language model in response to the simplification operation initiated by the user.
[0095] The text content generated by AI is prone to repeated vocabulary expressions. Therefore, in one or more embodiments, after generating the content of the article to be generated, the user can replace the repeated words in the article content. When replacing the repeated words in the article content, the user can select the words to be replaced through the human-computer interaction interface and initiate the word replacement operation. At this time, in response to the word replacement operation initiated by the user, the large language model can be used to recommend and confirm the synonyms or near synonyms of the selected words, and then the selected words are replaced with the synonyms or near synonyms of the selected words.
[0096] In an embodiment of the present application, a banned word library can be constructed based on banned words agreed upon by the industry or policy, and it can be detected whether there are banned words in the article content. If there are banned words in the article content, the banned words in the article content can be marked to prompt the user to modify the banned words.
[0097] In the article content generated by the large language model, there may be some AI-fixed expressions that affect the user's reading experience. Therefore, after generating the article content to be generated, it is also possible to detect whether there is AI-fixed expression content in the article content. If there is AI-fixed expression content in the article content, the AI-fixed expression content can be deleted or the expression method of the AI-fixed expression content can be adjusted through the large language model. When detecting whether there is AI-fixed expression content in the article content, regular expression rules can be defined for the AI-fixed expression content, and the AI-fixed expression content in the article content can be identified through regular expressions.
[0098] In summary, the intelligent article generation method based on a large language model and model templates provided by the present invention matches multiple model templates with the same article type and matching the article title from a model template library based on the article title and article type of the article to be generated; for any level title of the article to be generated, based on the matching degree between any level title and each level title in each model template, a candidate reference title for generating the next level title of any level title is determined; based on the next level title of the candidate reference title, a next level title of any level title is generated; document materials matching the leaf titles at all levels of the article to be generated are searched from a document database; based on the document materials matching the leaf titles at all levels, the main text content of the leaf titles at all levels is generated through a large language model; the titles at all levels of the article to be generated and the main text content of the leaf titles at all levels are combined to obtain the article content of the article to be generated. In this way, when AI assists in writing, one can refer to and learn from the writing framework of the standard sample template, so that the article content structure meets business requirements. At the same time, based on the same type of document materials, the content under each level of title is generated respectively, so that the word count and depth of the generated article content meet the requirements. Secondly, the sample template for AI-assisted writing is of the same article type as the article to be generated and the article title matches, so that the generated content is consistent with the user's business, eliminating the "illusion" of the writing content. In addition, the generated article content can be streamlined, vocabulary adjusted, banned words identified and annotated, and AI solidified expression content optimized, reducing the probability of low-quality content output, improving the quality of generated articles, and facilitating practical application and promotion.
[0099] See also Figure 2 The second aspect of the embodiment of the present application provides an article intelligent generation device based on a large language model and a model template, and the article intelligent generation device based on a large language model and a model template includes:
[0100] A matching unit, configured to match a plurality of sample article templates of the same article type and matching the article title from a sample article template library based on the article title and article type of the article to be generated;
[0101] A determination unit, for determining, for any level title of the article to be generated, a candidate reference title for generating a next level title of any level title based on the matching degree between the any level title and the level titles in each model article template;
[0102] A first generating unit, configured to generate a next-level title of any one-level title based on the next-level title of the candidate reference title;
[0103] A search unit, used to search for document materials matching the leaf titles of each level of the article to be generated from a document database, wherein the leaf title is the lowest level title among all the titles of the article to be generated;
[0104] The second generation unit is used to generate the text content of the leaf titles at each level through the large language model based on the document materials matched by the leaf titles at each level;
[0105] The combining unit is used to combine the titles at all levels and the text contents of the leaf titles at all levels of the article to be generated to obtain the article content of the article to be generated.
[0106] The working process, working details and technical effects of the intelligent article generation device based on a large language model and a sample template provided in the second aspect of this embodiment can be found in the first aspect of the embodiment and will not be described in detail here.
[0107] like Figure 3 As shown, the third aspect of an embodiment of the present application provides an electronic device, comprising a memory, a processor and a transceiver that are communicatively connected in sequence, wherein the memory is used to store a computer program, the transceiver is used to send and receive messages, and the processor is used to read the computer program to execute the intelligent article generation method based on a large language model and a model template as described in the first aspect of the embodiment.
[0108] For specific examples, the memory may include but is not limited to random access memory (RAM), read-only memory (ROM), flash memory, first-in-first-out memory (FIFO) and / or first-in-last-out memory (FILO), etc.; the processor may be but is not limited to a microprocessor of the STM32F105 series, an ARM (Advanced RISC-Machines), an X86 or other architecture processor, or a processor with an integrated NPU (neural-network processing units); the transceiver may be but is not limited to a WiFi (Wireless Fidelity) wireless transceiver, a Bluetooth wireless transceiver, a General Packet Radio Service (GPRS) wireless transceiver, a ZigBee protocol (a low-power local area network protocol based on the IEEE802.15.4 standard, ZigBee) wireless transceiver, a 3G transceiver, a 4G transceiver and / or a 5G transceiver, etc.
[0109] The fourth aspect of this embodiment provides a computer-readable storage medium storing instructions for the method for intelligently generating articles based on a large language model and a model template as described in the first aspect of the embodiment, that is, the computer-readable storage medium stores instructions, and when the instructions are run on a computer, the method for intelligently generating articles based on a large language model and a model template as described in the first aspect is executed. The computer-readable storage medium refers to a carrier for storing data, which may include but is not limited to a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash drive, and / or a memory stick, etc., and the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0110] The fifth aspect of this embodiment provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the intelligent article generation method based on a large language model and a model template as described in the first aspect of the embodiment, wherein the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0111] It should be understood that certain details are provided in the following description to facilitate a complete understanding of the example embodiments. However, it should be understood by those of ordinary skill in the art that the example embodiments can be implemented without these certain details. For example, the system can be shown in a block diagram to avoid obscuring the example with unnecessary details. In other examples, well-known processes, structures, and techniques may not be shown in unnecessary detail to avoid obscuring the example embodiments.
[0112] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An intelligent article generation method based on a large language model and a sample article template, characterized in that: include: Based on the article title and article type of the article to be generated, multiple sample article templates with the same article type and matching the article title are matched from the sample article template library; For any level title of the article to be generated, based on the matching degree between the any level title and the level titles in each sample article template, determine a candidate reference title for generating a next level title of the any level title; Based on the next level title of the candidate reference title, generate the next level title of any one level title; Searching for document materials matching the leaf titles of the article to be generated from a document database, wherein the leaf title is the lowest-level title among all the titles of the article to be generated; Based on the document materials matching the leaf titles at each level, the text content of the leaf titles at each level is generated through a large language model; The titles at all levels of the article to be generated and the main text contents of the leaf titles at all levels are combined to obtain the article content of the article to be generated.
2. The method for intelligently generating articles based on a large language model and a sample article template according to claim 1, characterized in that: The method further comprises: Based on the content of the sub-titles of non-leaf titles, a summary of the non-leaf title is generated through a large language model; The step of combining the titles of each level and the text contents of each level of leaf titles of the article to be generated to obtain the article content of the article to be generated includes: The titles at all levels of the article to be generated, the main content of the leaf titles at all levels, and the abstracts of the non-leaf titles are combined to obtain the article content of the article to be generated.
3. The method for intelligently generating articles based on a large language model and a sample article template according to claim 1, characterized in that: The method further comprises: In response to a simplification operation initiated by a user, the selected content in the article is automatically simplified through a large language model.
4. The method for intelligently generating articles based on a large language model and a sample article template according to claim 1, characterized in that: The method further comprises: In response to the word replacement operation initiated by the user, the large language model is used to recommend and confirm the synonyms or near-synonyms of the selected words; Replace the selected word with its synonym or near-synonym.
5. The method for intelligently generating articles based on a large language model and a sample article template according to claim 1, characterized in that: The method further comprises: Detecting whether there are banned words in the article content; If there are banned words in the article content, marking the banned words in the article content; Detect whether there is AI-curated expression content in the article; If there is AI solidified expression content in the article content, the AI solidified expression content is deleted or the expression of the AI solidified expression content is adjusted through a large language model.
6. The method for intelligently generating articles based on a large language model and a sample article template according to claim 1, characterized in that: When any one-level title is an article title, the matching degree between any one-level title and the candidate title to be matched in the sample article template is: Score(v i ,v j )=sim(v i ,v j ); When the any-level title is a title other than the article title, the matching degree between the any-level title and the candidate title to be matched in the sample article template is: Score(v i ,v j )=Score(v p(i) ,v p(j) )×sim(v i ,v j ); Among them, Score(v i , v j ) represents the matching degree between any level title i of the article to be generated and the candidate title j to be matched in the template, sim(v i , v j ) represents the semantic similarity between any level title i of the article to be generated and the candidate title j to be matched in the template, Score(v p(i) , v p(j) ) represents the degree of match between the previous level title of any level title i and the previous level title of the candidate title j to be matched in the model template.
7. The method for intelligently generating articles based on a large language model and a sample article template according to claim 1, characterized in that: The step of searching for document materials matching the leaf titles at all levels of the article to be generated from the document database includes: For any level leaf title of the article to be generated, combine the any level leaf title with all the upper level titles of the any level leaf title to obtain a character string combination corresponding to the any level leaf title; Perform semantic similarity matching on the string combination corresponding to any level leaf title and the document blocks of each document material in the document database to obtain the document material matching any level leaf title; Each document material in the document database is divided into a plurality of document blocks according to a preset length.
8. The method for intelligently generating articles based on a large language model and a sample article template according to claim 1, characterized in that: The document material based on the matching of leaf titles at each level generates the text content of leaf titles at each level through a large language model, including: Generate task prompts based on the title content of leaf titles at all levels; Based on the reference of the document materials matching the leaf titles at each level, the main text content related to the task prompt words corresponding to the leaf titles at each level is generated through the big language.
9. An intelligent article generation device based on a large language model and a sample article template, characterized in that: include: A matching unit, configured to match a plurality of sample article templates of the same article type and matching the article title from a sample article template library based on the article title and article type of the article to be generated; A determination unit, for determining, for any level title of the article to be generated, a candidate reference title for generating a next level title of any level title based on the matching degree between the any level title and the level titles in each model article template; A first generating unit, configured to generate a next-level title of any one-level title based on the next-level title of the candidate reference title; A search unit, used to search for document materials matching the leaf titles of each level of the article to be generated from a document database, wherein the leaf title is the lowest level title among all the titles of the article to be generated; The second generation unit is used to generate the text content of the leaf titles at each level through the large language model based on the document materials matched by the leaf titles at each level; The combining unit is used to combine the titles at all levels and the text contents of the leaf titles at all levels of the article to be generated to obtain the article content of the article to be generated.
10. A computer program product comprising a computer program or instructions, characterized in that When the computer program or the instruction is executed by a computer, the method for intelligently generating articles based on a large language model and a model article template as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Document processing method and device, computer program product and readable storage medium
CN116136958A
Article generation method and apparatus based on large language model, and electronic device
CN117709295A
Professional field generation type question answering method and electronic equipment
CN117725189A
Knowledge processing method and device based on large model, knowledge question and answer method and device based on large model, and medium
CN117743558A
Method for generating article content and electronic equipment
CN117875274A
Cited By
Intelligent writing method based on multi-agent cooperation
CN120632092A
An intelligent writing method based on multi-agent cooperation
CN120632092B
Power planning report three-level title structured analysis generation method and device and medium
CN121581020A
Power document analysis and generation method and device based on large language model, and medium
CN121581021A