A method and system for generating accurate citation articles based on a large model

By combining the big model and the RAG knowledge base, the problem of inaccurate word count control and citation in article generation is solved, and articles with rigorous logic and rich content are generated to ensure the quality and credibility of the article.

CN119357386BActive Publication Date: 2025-08-26CHENGDU GUOZHI FUTURE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411507107.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-28
Publication Date
2025-08-26
Estimated Expiration
2044-10-28

AI Technical Summary

Technical Problem

Existing article generation technology is difficult to achieve accurate word count control and accurate citation, resulting in low accuracy in article generation.

Method used

Through the method of accurately citing articles based on large models, the RAG knowledge base and scoring model are used to generate article abstracts, auxiliary materials, article outlines and text content to achieve word count control and accurate citation of references.

Benefits of technology

Generate articles with clear structure, rich content and rigorous logic to ensure that each part is appropriately spaced and improve the quality and credibility of the article.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357386B_ABST
    Figure CN119357386B_ABST
Patent Text Reader

Abstract

The present invention provides a method and system for generating articles with precise citations based on a large model, belonging to the technical field of article generation. The method obtains user input of article generation requirements, generates an article abstract based on the requirements using a large model; retrieves knowledge related to the abstract in the RAG knowledge base based on the abstract; generates a series of question-answer pairs based on the RAG search results using the large model; generates an outline of the article based on the title, keywords, and questions in the question-answer pairs; uses a scoring model to evaluate the importance of each chapter in the outline and calculates the number of words to be allocated to each chapter; splits the generated outline according to the lowest-level title, merges the title, keywords, answers in the question-answer pairs, and the word arrays allocated to this section into the large model, generates the corresponding text content; and combines the text content in the order of the outline to obtain the final article. The present invention can achieve word count control and precise citation during article generation, improve the accuracy and reliability of article generation, and enhance user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of article generation methods, and in particular to a method and system for generating accurate citation articles based on a large model. Background Art

[0002] With the development of deep learning technology, large models have made significant progress in understanding and generating natural language in the current field of artificial intelligence, and are increasingly being used in article generation. These models are capable of processing and analyzing large amounts of data, understanding and generating natural language text, and thus play a vital role in a variety of fields, including content creation, data reporting, and academic research.

[0003] However, despite the significant potential of large models for article generation, generating long articles still faces several challenges. For example, long articles need to maintain thematic coherence across multiple paragraphs and chapters, which presents a challenge for automated generation systems. Long articles often delve into topics and provide detailed analysis and supporting evidence, requiring models to possess a high level of comprehension and creativity. Long articles also require precise word count to fully meet the needs of the article type and user needs.

[0004] Therefore, developing an article generation technology that can achieve word count control and accurate citation during article generation has important practical application value. Summary of the Invention

[0005] In view of this, an embodiment of the present invention provides a method and system for generating accurate citation articles based on a large model, so as to solve the problem that the existing article generation technology is difficult to achieve accurate control of the number of words and accurate citation in the generated article, resulting in low accuracy of article generation.

[0006] The technical solution adopted in the present invention is:

[0007] In a first aspect, the present invention provides a method for generating accurate citation articles based on a large model, comprising:

[0008] Obtain the article generation requirements and selected references input by the user, perform data preprocessing on the references, and store the preprocessed references in the RAG knowledge base;

[0009] Generate a first prompt word based on the preprocessed article generation requirements, and generate an article summary based on the first prompt word using the large model;

[0010] Based on the article abstracts, text and vector searches were performed in the RAG knowledge base to obtain auxiliary materials for article generation;

[0011] Inputting auxiliary data generated by the article into the large model to generate question text and question answers, constructing a third data set based on the question text, and constructing a fourth data set based on the question text and question answers;

[0012] Constructing a second prompt word according to the preprocessed article generation requirements and the third data set, and inputting the second prompt word into the large model to generate an article outline;

[0013] Use the scoring model to rate the importance of each chapter in the article outline, and calculate the number of words to be allocated to each chapter or section based on the importance score and the total word count requirement of the article;

[0014] The article outline is split into chapter or section-level titles, and the titles, preprocessed article generation requirements, the fourth dataset, and the number of words allocated to the chapter or section are combined to construct the third prompt word. The third prompt word is input into the large model to generate the main content of the corresponding chapter or section. At the same time, the main content of each chapter or section is combined in the order of the outline to obtain the article required by the user.

[0015] Furthermore, the process of obtaining the article generation requirements and selected references input by the user, performing data preprocessing on the references, and storing the preprocessed references in the RAG knowledge base includes:

[0016] Obtaining the article generation requirements and selected references input by the user, and performing data cleaning and standardization on the references to obtain pre-processed references; the article generation requirements include the article title, keywords, and total word count requirements;

[0017] The text content of the preprocessed references is extracted by a text parser, the text content of the references is stored in the RAG knowledge base, and a text index is established for the text content.

[0018] Furthermore, generating a first prompt word based on the article generation requirement, and generating an article summary using a large model based on the first prompt word, includes:

[0019] Collect article data and perform incremental pre-training and model fine-tuning on open source models to obtain a large model for article generation;

[0020] Combine the title and keywords in the article generation requirements to generate the first prompt word, and input the first prompt word into the macro model to generate the article abstract;

[0021] The article summary is sent to the user, and the article summary is regenerated or manually modified based on the user's feedback on the article summary to obtain an article summary that meets the user's needs.

[0022] Furthermore, the article data is collected and the open source model is incrementally pre-trained and fine-tuned to obtain a large model for article generation, including:

[0023] Collect data from various articles and construct a first dataset of plain text. Based on the first dataset, perform full parameter training on the large model to obtain the large model after incremental pre-training.

[0024] Extracting articles with specific overviews or brief descriptions from the article data of the first dataset, and constructing multiple question-answer pairs based on the extracted articles to obtain a second dataset;

[0025] The second dataset is used to perform Lora fine-tuning on the incremental pre-trained large model to obtain a large model for article generation.

[0026] Furthermore, the article abstract is regenerated or manually modified based on the user's feedback on the article abstract to obtain an article abstract that meets the user's needs, including:

[0027] If the user chooses to regenerate, the large model will be called again to generate the article summary based on the same first prompt word until it meets the user's requirements;

[0028] If the user chooses to modify manually, an editing interface will be provided to the user to allow the user to directly modify and improve the article abstract.

[0029] Furthermore, the text and vector search is performed in the RAG knowledge base based on the article abstract to obtain auxiliary materials for article generation, including:

[0030] Extract keywords or phrases based on the article abstract, and use the keywords or phrases to perform text search in the RAG knowledge base to obtain the first candidate materials related to the article topic;

[0031] The article abstract and the text content in the RAG knowledge base are converted into vectors and vector search is performed. The similarity score between the article abstract vector and the text content vector is calculated. Based on the similarity score, the text content in the RAG knowledge base that is closest in semantics to the article abstract is selected as the second candidate material.

[0032] The first candidate material and the second candidate material are input into the pre-trained rearrangement model for sorting, and the ranking score of each material is obtained. The materials are sorted from high to low according to the ranking score, and the top k materials are selected as auxiliary materials for article generation.

[0033] Furthermore, the article generation auxiliary data is input into the large model to generate question text and question answers, construct a third data set based on the question text, and construct a fourth data set based on the question text and question answers, including:

[0034] Segmenting the auxiliary data for article generation to obtain multiple data segments, inputting the multiple data segments into a large model for article generation, automatically generating multiple question texts corresponding to each data segment using the large model, and constructing a third data set based on the question texts in the multiple data segments;

[0035] The question texts of multiple data segments are input into the big model again, and the big model is used to generate the question answers corresponding to the question texts in each data segment. The question texts and the question answers are combined into question-answer pairs, and a fourth data set is constructed based on the question-answer pairs.

[0036] Furthermore, the method constructs a second prompt word according to the pre-processed article generation requirements and the third data set, and inputs the second prompt word into the large model to generate an article outline, including:

[0037] Combine the title and keywords in the article generation requirements with the third data set in a structured manner to construct the second prompt word;

[0038] Enter the second prompt into the big model to guide the big model to generate an article outline in markdown format.

[0039] Furthermore, the scoring model is used to score the importance of each chapter in the article outline, and the number of words to be allocated to each chapter or section is calculated based on the importance score and the total word count requirement of the article, including:

[0040] Evaluate the importance of each chapter based on its position within the article structure, the richness of the chapter content, and the chapter's contribution to the article theme. Determine the chapter importance evaluation criteria based on the evaluation results.

[0041] Input the article outline into the preset scoring model, score the text importance of each chapter according to the chapter importance evaluation criteria, and obtain the importance score of each chapter in the article outline;

[0042] Calculate the word count ratio for each chapter based on the importance scores of all chapters, and then calculate the word count for each chapter or section based on the word count ratio for each chapter based on the total word count requirement of the article.

[0043] In a second aspect, the present invention provides a system for generating accurate citation articles based on a large model, comprising:

[0044] The data acquisition module is used to obtain the article generation requirements and selected references input by the user, perform data preprocessing on the references, and store the preprocessed references in the RAG knowledge base;

[0045] A summary generation module is used to generate a first prompt word based on the pre-processed article generation requirements, and generate an article summary based on the first prompt word using the large model;

[0046] The data retrieval module is used to perform text and vector searches in the RAG knowledge base based on article abstracts to obtain auxiliary data for article generation;

[0047] A data set construction module is used to input auxiliary materials generated by the article into the large model, generate question text and question answers, construct a third data set based on the question text, and construct a fourth data set based on the question text and question answers;

[0048] An outline generation module is used to construct a second prompt word according to the preprocessed article generation requirements and the third data set, and input the second prompt word into the large model to generate an article outline;

[0049] The word count allocation module is used to use the scoring model to score the importance of each chapter in the article outline, and calculate the number of words to be allocated to each chapter or section based on the importance score and the total word count requirement of the article;

[0050] The main text generation module is used to split the article outline into chapter or section-level titles, combine the titles, preprocessed article generation requirements, the fourth dataset, and the number of words allocated to the chapter or section, construct the third prompt word, and input the third prompt word into the large model to generate the main text content of the corresponding chapter or section. At the same time, the main text content of each chapter or section is combined in the order of the outline to obtain the article required by the user.

[0051] In summary, the beneficial effects of the present invention are as follows:

[0052] The present invention provides a method for generating accurate cited articles based on a large model. With the assistance of the large model, it can generate articles with clear structure, rich content, and strict logic. At the same time, it uses a scoring model to evaluate the importance of each part of the outline, reasonably allocate the number of words, and ensure that each part of the article can get an appropriate length, avoiding problems such as uneven length or lack of emphasis.

[0053] At the same time, the present invention utilizes the references in the RAG knowledge base, constructs questions and answers, and generates an outline and text based on the constructed questions and answers, thereby achieving accurate citation of references, ensuring that the information and data sources in the article are reliable, and improving the quality and credibility of the article. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following is a brief introduction to the drawings required for use in the embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work, and these are all within the scope of protection of the present invention.

[0055] Figure 1 This is a flow chart of a method for generating accurate citation articles based on a large model according to the present invention;

[0056] Figure 2 This is a functional module diagram of a large model-based accurate citation article generation system in the present invention. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. It should be noted that, in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. If there is no conflict, the various features of the present invention and the embodiments can be combined with each other and are all within the scope of protection of the present invention.

[0058] Example 1:

[0059] See Figure 1 , Figure 1 This is a flow chart of a method for generating accurate citation articles based on a large model in Example 1 of the present invention. Figure 1 As shown, the method provided by the present invention includes:

[0060] Obtain the article generation requirements and selected references input by the user, perform data preprocessing on the references, and store the preprocessed references in the RAG knowledge base;

[0061] Generate a first prompt word based on the preprocessed article generation requirements, and generate an article summary based on the first prompt word using the large model;

[0062] Based on the article abstracts, text and vector searches were performed in the RAG knowledge base to obtain auxiliary materials for article generation;

[0063] Inputting auxiliary data generated by the article into the large model to generate question text and question answers, constructing a third data set based on the question text, and constructing a fourth data set based on the question text and question answers;

[0064] Constructing a second prompt word according to the preprocessed article generation requirements and the third data set, and inputting the second prompt word into the large model to generate an article outline;

[0065] Use the scoring model to rate the importance of each chapter in the article outline, and calculate the number of words to be allocated to each chapter or section based on the importance score and the total word count requirement of the article;

[0066] The article outline is split into chapter or section-level titles, and the titles, preprocessed article generation requirements, the fourth dataset, and the number of words allocated to the chapter or section are combined to construct the third prompt word. The third prompt word is input into the large model to generate the main content of the corresponding chapter or section. At the same time, the main content of each chapter or section is combined in the order of the outline to obtain the article required by the user.

[0067] Specifically, the overall idea of ​​the method for generating accurate citation articles based on a large model proposed in an embodiment of the present invention is as follows: the user inputs requirements such as title, keywords, word count requirements, etc.; the large model is used to generate summary information of the article according to the requirements input by the user, including an overview of the main content of the article, key arguments or writing points, etc.; based on the generated summary, knowledge related to the summary is retrieved in the RAG knowledge base, and according to the search results, the materials that are most relevant to the article topic and the most information-rich are screened out as auxiliary materials for subsequent generation; based on the RAG search results, a series of questions and corresponding answers are generated based on the large model as the basis for the outline and main text content; based on the title, keywords and questions generated by the large model, an outline of the article is generated based on the large model; a scoring model is used to evaluate the importance of each chapter in the generated outline, thereby calculating the number of words to be allocated to each chapter; the generated outline is split according to the lowest-level title, and the title, keywords, answers generated by the large model, and the number of words allocated to this section are combined and input into the large model to generate the corresponding main text content; the generated main text is combined in the order of the outline to obtain the final article.

[0068] Furthermore, in an embodiment of the present invention, obtaining the article generation requirements and selected references input by the user, performing data preprocessing on the references, and storing the preprocessed references in the RAG knowledge base specifically includes:

[0069] First, the article generation requirements and selected references input by the user are obtained, and the references are cleaned and standardized to obtain preprocessed references; the article generation requirements include the article title, keywords and total word count requirements.

[0070] Specifically, users enter their article generation requirements, including title, keywords, and the desired total word count. Users can also optionally enter other requirements, such as style and tone, to further guide the generation process. They can also specify or select relevant references. After receiving the user-entered reference data, the system performs data cleaning and standardization, removing unnecessary spaces and punctuation to ensure consistency in subsequent processing.

[0071] A title is a brief summary of the content, typically appearing at the top or beginning of a piece of content. It serves to attract readers' attention and summarize the main themes. A title is the first impression that determines whether or not to continue reading. A clear and engaging title can spark reader interest. Titles should be concise and clear, quickly conveying the core message of the content and closely related to the content to avoid misleading readers. Keywords are important words or phrases in an article that describe the article's theme, content, or field. Keywords can quickly guide readers to the article's theme and key points, helping them better understand and remember the content. Appropriate use of keywords in an article can help authors better organize the content, making it more coherent and logically sound. Word count refers to the total number of characters in the final generated article. Many types of articles have specific word count requirements, such as reports, which generally have higher word counts, while letters, etc., have lower word counts. In the field of large-scale model-based article generation, achieving word count control is crucial. Article style refers to the unique style of an article, reflecting the specific methods and approaches used to express thoughts, emotions, and opinions. Article style is not only closely related to the content but is also deeply influenced by the author's personality, thinking process, and creative intent. For example, academic papers develop arguments centered on arguments and evidence, and the style requires to be rigorous, thorough, and logical; general official documents require to be concise, accurate, and complete.

[0072] In this embodiment of the present invention, references can be books, papers, web pages, and other formats, supporting Word, PDF, Excel, PPT, and images. These are uploaded and stored in a Retriever-Augmented Generation (RAG) knowledge base for subsequent outline and text generation. For uploaded files, the text content is extracted using a suitable parser (such as a PDF reader or Word processing library), stored in the knowledge base, and indexed for rapid retrieval and use.

[0073] Then, the text content of the preprocessed references is extracted by a text parser, the text content of the references is stored in the RAG knowledge base, and a text index is established for the text content.

[0074] Furthermore, in an embodiment of the present invention, a first prompt word is generated based on the article generation requirements, and based on the first prompt word, an article summary is generated using a large model, specifically including:

[0075] Collect article data and perform incremental pre-training and model fine-tuning on open source models to obtain a large model for article generation;

[0076] Combine the title and keywords in the article generation requirements to generate the first prompt word, and input the first prompt word into the macro model to generate the article abstract;

[0077] The article summary is sent to the user, and the article summary is regenerated or manually modified based on the user's feedback on the article summary to obtain an article summary that meets the user's needs.

[0078] Specifically, the title and keywords entered by the user are combined into the first prompt, guiding the large-scale model to understand the user's intent and the article's theme. Based on this constructed prompt, the large-scale model generates an article summary, including an overview of the article's main content, key arguments, or writing points. The generated summary is displayed to the user for review. If the user is dissatisfied, they can choose to regenerate or manually modify the summary to ensure it accurately reflects the core content of the article.

[0079] In some embodiments, the present invention provides some prompt examples, specifically:

[0080] "Please generate a summary of the article based on the title '[user-entered title]' and the keywords '[user-entered keywords]', outlining its main content, key arguments, and writing points."

[0081] In this embodiment of the present invention, the large model uses open-source models (such as Qwen and llama), trained using article data, and possesses powerful text understanding and generation capabilities. The large model analyzes the input prompt word to understand user intent and the article topic. Based on this understanding of the article topic, the model generates a summary. The article summary should include an overview of the article's main content, key arguments, or key points, while maintaining fluent and coherent language.

[0082] Furthermore, in an embodiment of the present invention, article data is collected and incremental pre-training and model fine-tuning are performed on the open source model to obtain a large model for article generation, specifically including:

[0083] Collect data from various articles and construct a first dataset of plain text. Based on the first dataset, perform full parameter training on the large model to obtain the large model after incremental pre-training.

[0084] Extracting articles with specific overviews or brief descriptions from the article data of the first dataset, and constructing multiple question-answer pairs based on the extracted articles to obtain a second dataset;

[0085] The second dataset is used to perform Lora fine-tuning on the incremental pre-trained large model to obtain a large model for article generation.

[0086] Specifically, in some embodiments, large-scale model training includes two processes: incremental pre-training and fine-tuning of article data. Incremental pre-training collects high-quality article data from Xinhua Daily, high-quality books, and papers to construct a first dataset of pure text. This is then used to train the large-scale model's full parameters, improving its expertise and ability to understand different types of articles.

[0087] Fine-tuning addresses shortcomings in article generation in the large model after incremental pre-training by extracting specific parts from the articles in the first dataset to construct question-answer pairs. For example, if the overviews / introductions generated by the large model after incremental pre-training are not concise and clear, then articles with better overviews / introductions are extracted to construct question-answer pairs: "Write an overview / introduction for the daily article 'Visiting the Shuanghuaishu Site: Tracing the Origins of Civilization of the 'Heluo Ancient Kingdom'"" - "On the south bank of the Yellow River and east of the Yiluo River, on a high plateau in Shuanghuaishu Village, Heluo Town, Gongyi City, lies a massive settlement site from the middle and late Yangshao culture. The Shuanghuaishu Site, a massive settlement dating back to approximately 5,300 years ago, is located south of Shuanghuaishu Village. After years of archaeological surveys, explorations, and excavations, the site's remaining area is approximately 1.17 million square meters, with over 4,000 square meters of excavation focused on. In early summer, when everything is in full bloom, visiting the Shuanghuaishu Site reveals the light of civilization through its discoveries." Multiple question-answer pairs comprise the second dataset. Using Lora technology, the second data set is used to fine-tune the incremental pre-trained large model to enhance the large model's ability to generate specific content.

[0088] Furthermore, in an embodiment of the present invention, the article abstract is regenerated or manually modified based on the user's feedback on the article abstract to obtain an article abstract that meets the user's needs, specifically including:

[0089] If the user chooses to regenerate, the large model will be called again based on the same first prompt word to generate the article summary until it meets the user's requirements;

[0090] If the user chooses to modify manually, an editing interface will be provided to the user to allow the user to directly modify and improve the article abstract.

[0091] Furthermore, in an embodiment of the present invention, text and vector searches are performed in the RAG knowledge base based on the article abstract to obtain auxiliary materials for article generation, specifically including:

[0092] First, keywords or phrases are extracted based on the article abstract, and the keywords or phrases are used to perform text search in the RAG knowledge base to obtain the first candidate information related to the article topic.

[0093] Specifically, text retrieval involves extracting keywords or phrases from abstracts. These keywords or phrases represent the article's theme and core content. Using these keywords, traditional text searches, such as those based on inverted indexes, are performed within the RAG knowledge base to find documents or paragraphs containing these keywords. Based on metrics such as keyword matching and document relevance scores, a preliminary list of candidate documents is selected.

[0094] Then, the article abstract and the text content in the RAG knowledge base are converted into vectors and vector retrieval is performed respectively. The similarity score between the article abstract vector and the text content vector is calculated. Based on the similarity score, the text content with the closest semantics to the article abstract is selected from the text content in the RAG knowledge base as the second candidate material.

[0095] Specifically, vector retrieval converts the abstract and the documents or paragraphs in the RAG knowledge base into representations in a high-dimensional vector space (generated using a model fine-tuned on article data, such as BERT). Using metrics such as cosine similarity, the similarity between the abstract vector and the vectors of each document or paragraph in the knowledge base is calculated. Based on the similarity scores, the document or paragraph with the closest semantics to the abstract is selected as the second candidate.

[0096] Finally, the first candidate material and the second candidate material are input into the pre-trained rearrangement model for sorting, and the ranking score of each material is obtained. They are then sorted from high to low according to the ranking score, and the top k materials are selected as auxiliary materials for article generation.

[0097] Among them, a reranking model (such as bge-reranker) is pre-trained using article data. This model can rank the candidate materials obtained by text retrieval and vector retrieval.

[0098] The embodiment of the present invention searches for knowledge related to the generated article abstract in the RAG knowledge base, and based on the search results, selects the materials that are most relevant to the article topic and have the richest information as auxiliary materials generated subsequently.

[0099] Furthermore, in an embodiment of the present invention, auxiliary materials for article generation are input into a large model to generate question text and question answers, a third data set is constructed based on the question text, and a fourth data set is constructed based on the question text and question answers, specifically including:

[0100] Segmenting the auxiliary data for article generation to obtain multiple data segments, inputting the multiple data segments into a large model for article generation, automatically generating multiple question texts corresponding to each data segment using the large model, and constructing a third data set based on the question texts in the multiple data segments;

[0101] The question texts of multiple data segments are input into the big model again, and the big model is used to generate the question answers corresponding to the question texts in each data segment. The question texts and the question answers are combined into question-answer pairs, and a fourth data set is constructed based on the question-answer pairs.

[0102] In some embodiments, the embodiments of the present invention segment the retrieved knowledge, and for each segment, use the big model to generate 3-5 question pairs that are closely related to the content of the reference material. The questions should be representative and cover the key information and core ideas in the paragraph. For each generated question, the big model is used again to generate the corresponding answer or explanation. The answer should directly answer the question, provide accurate and detailed information, and maintain coherence and consistency with the content of the paragraph as much as possible. In the process of generating answers, attention should be paid to answering according to the knowledge segmentation. Match the generated questions and answers to form a complete question-answer pair. Ensure that each question has a corresponding answer and that the answer can accurately answer the question.

[0103] Furthermore, in an embodiment of the present invention, a second prompt word is constructed based on the pre-processed article generation requirements and the third data set, and the second prompt word is input into the large model to generate an article outline, which specifically includes:

[0104] The title and keywords in the article generation requirements are combined with the third data set in a structured manner to construct a second prompt word. In this embodiment of the present invention, the title, keywords, and question set are organized in a structured manner. For example, a template in JSON or Markdown format can be used to organize this information. The template should contain clear instructions, such as "Please generate an outline of the article based on the following title, keywords, and questions." One or more outline examples are provided as examples to help the large model understand the structure and style of the required output.

[0105] The second prompt is input into the main model to instruct it to generate an article outline in Markdown format. The outline is output in Markdown format to clearly show the hierarchical structure of the article.

[0106] In some embodiments, the markdown format supports structural elements such as headings and lists, making it very suitable for expressing outlines. An example of an outline format is:

[0107] #Chapter 1

[0108] Section 1

[0109] First measure

[0110] Section 2

[0111] Section 2

[0112] First measure

[0113] Section 2

[0114] #Chapter 2

[0115] Section 1

[0116] First measure

[0117] Section 2

[0118] Section 2

[0119] First measure

[0120] ###Second section.

[0121] Furthermore, in an embodiment of the present invention, a scoring model is used to score the importance of each chapter in the article outline, and the number of words to be allocated to each chapter or section is calculated based on the importance score and the total word count requirement of the article, specifically including:

[0122] Evaluate the importance of each chapter based on its position within the article structure, the richness of the chapter content, and the chapter's contribution to the article theme. Determine the chapter importance evaluation criteria based on the evaluation results.

[0123] Input the article outline into the preset scoring model, score the text importance of each chapter according to the chapter importance evaluation criteria, and obtain the importance score of each chapter in the article outline;

[0124] Calculate the word count ratio for each chapter based on the importance scores of all chapters, and then calculate the word count for each chapter or section based on the word count ratio for each chapter based on the total word count requirement of the article.

[0125] In some embodiments, the word count allocation method of an embodiment of the present invention is: select a scoring model suitable for evaluating the importance of a text, which can understand and analyze the content of the text and give a corresponding score. Determine the criteria for evaluating the importance of a chapter, including the position of the chapter in the overall structure of the article (such as introduction, main text, conclusion, etc.), the richness of the chapter content, the contribution of the chapter to the theme, etc. Input each chapter in the generated outline into the scoring model, and score the chapter according to the established evaluation criteria. The score is in numerical form, ranging from 1 to 10 points, indicating the importance of the chapter. Based on the score of the large model, calculate the proportion of the number of words to be allocated to each chapter. For example, if the score of a chapter accounts for 1 / 5 of the total score, then the number of words to be allocated to the chapter should also account for 1 / 5 of the total number of words. Multiply the total number of words in the article by the word count ratio of each chapter to obtain the specific number of words that should be written in each chapter.

[0126] The calculation method for word count is: Assuming the total number of words in the article is , the outline is Each section is scored , then the number of words in each section x for:

[0127] .

[0128] Furthermore, in an embodiment of the present invention, the generated outline is split into chapter or subsection-level headings, such as "Subsection 1," according to the lowest-level headings. This ensures that the structure after the split maintains the hierarchy and order of the original outline, allowing for subsequent assembly of the main text in the order of the outline. The title, keywords, the fourth data set, and the number of words allocated for this subsection are combined to construct a third prompt. The constructed third prompt is input into the master model to generate the corresponding main text content. The generated main text is assembled in the order of the outline to obtain the final article.

[0129] Furthermore, the generated text content is output in JSON format, consisting of key-value pairs, which facilitates subsequent processing and editing. The key corresponds to the outline name, and the value corresponds to the generated text. This format facilitates subsequent processing and editing. Text output example:

[0130] {

[0131] Section 1:

[0132] "XXXXXXX"

[0133] }

[0134] Among them, the large model can be used for article generation after fine-tuning.

[0135] The beneficial effects of the method for generating accurate citation articles based on a large model in an embodiment of the present invention include:

[0136] 1. With the help of the big model, we can generate articles with clear structure, rich content and strict logic. At the same time, we use the scoring model to evaluate the importance of each part of the outline, reasonably allocate the number of words, and ensure that each part of the article has an appropriate length, avoiding problems such as uneven length or lack of emphasis.

[0137] 2. Utilize the references in the RAG knowledge base, construct questions and answers, and generate the outline and main text based on the constructed questions and answers respectively, to achieve accurate citation of references, ensure the information and data sources in the article are reliable, and improve the quality and credibility of the article.

[0138] Example 2: Reference Figure 2 As shown, based on Example 1, the present invention provides a system for generating accurate citation articles based on a large model, including:

[0139] The data acquisition module is used to obtain the article generation requirements and selected references input by the user, perform data preprocessing on the references, and store the preprocessed references in the RAG knowledge base;

[0140] A summary generation module is used to generate a first prompt word based on the pre-processed article generation requirements, and generate an article summary based on the first prompt word using the large model;

[0141] The data retrieval module is used to perform text and vector searches in the RAG knowledge base based on article abstracts to obtain auxiliary data for article generation;

[0142] A data set construction module is used to input auxiliary materials generated by the article into the large model, generate question text and question answers, construct a third data set based on the question text, and construct a fourth data set based on the question text and question answers;

[0143] An outline generation module is used to construct a second prompt word according to the preprocessed article generation requirements and the third data set, and input the second prompt word into the large model to generate an article outline;

[0144] The word count allocation module is used to use the scoring model to score the importance of each chapter in the article outline, and calculate the number of words to be allocated to each chapter or section based on the importance score and the total word count requirement of the article;

[0145] The main text generation module is used to split the article outline into chapter or section-level titles, combine the titles, preprocessed article generation requirements, the fourth dataset, and the number of words allocated to the chapter or section, construct the third prompt word, and input the third prompt word into the large model to generate the main text content of the corresponding chapter or section. At the same time, the main text content of each chapter or section is combined in the order of the outline to obtain the article required by the user.

[0146] In an embodiment of the present invention, the system obtains user input such as title, keywords, word count requirements, etc.; uses the big model to generate summary information of the article according to the user input requirements; then searches the RAG knowledge base for knowledge related to the summary based on the generated summary; and generates a series of questions and corresponding answers based on the big model based on the RAG search results, and generates an outline of the article based on the big model according to the title, keywords and questions generated by the big model. Then, a scoring model is used to evaluate the importance of each chapter in the generated outline, so as to calculate the number of words that should be allocated to each chapter. The generated outline is then split according to the lowest-level title, and the title, keywords, answers generated by the big model, and the number of words allocated to this section are combined and input into the big model to generate the corresponding text content; finally, the generated text is combined in the order of the outline to obtain the final article.

[0147] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating accurate citation articles based on a large model, characterized by: include: Obtain the article generation requirements and selected references input by the user, perform data preprocessing on the references, and store the preprocessed references in the RAG knowledge base; Generate a first prompt word based on the preprocessed article generation requirements, and generate an article summary based on the first prompt word using the large model; Based on the article abstracts, text and vector searches were performed in the RAG knowledge base to obtain auxiliary materials for article generation; Inputting auxiliary data generated by the article into the large model to generate question text and question answers, constructing a third data set based on the question text, and constructing a fourth data set based on the question text and question answers; Constructing a second prompt word according to the preprocessed article generation requirements and the third data set, and inputting the second prompt word into the large model to generate an article outline; Use the scoring model to rate the importance of each chapter in the article outline, and calculate the number of words to be allocated to each chapter or section based on the importance score and the total word count requirement of the article; The article outline is split into chapter or section-level titles, and the titles, preprocessed article generation requirements, the fourth dataset, and the number of words allocated to the chapter or section are combined to construct the third prompt word. The third prompt word is input into the large model to generate the main content of the corresponding chapter or section. At the same time, the main content of each chapter or section is combined in the order of the outline to obtain the article required by the user.

2. The method for generating accurate citation articles based on a large model according to claim 1 is characterized in that: The method of obtaining the article generation requirements and selected references input by the user, performing data preprocessing on the references, and storing the preprocessed references in the RAG knowledge base includes: Obtaining the article generation requirements and selected references input by the user, and performing data cleaning and standardization on the references to obtain pre-processed references; the article generation requirements include the article title, keywords, and total word count requirements; The text content of the preprocessed references is extracted by a text parser, the text content of the references is stored in the RAG knowledge base, and a text index is established for the text content.

3. The method for generating accurate citation articles based on a large model according to claim 1 is characterized in that: The article generation requirement after preprocessing is generated by generating a first prompt word, and based on the first prompt word, generating an article summary using a large model, including: Collect article data and perform incremental pre-training and model fine-tuning on open source models to obtain a large model for article generation; Combine the title and keywords in the article generation requirements to generate the first prompt word, and input the first prompt word into the macro model to generate the article abstract; The article summary is sent to the user, and the article summary is regenerated or manually modified based on the user's feedback on the article summary to obtain an article summary that meets the user's needs.

4. The method for generating accurate citation articles based on a large model according to claim 3 is characterized in that: The method of collecting article data and performing incremental pre-training and model fine-tuning on the open source model to obtain a large model for article generation includes: Collect data from various articles and construct a first dataset of plain text. Based on the first dataset, perform full parameter training on the large model to obtain the large model after incremental pre-training. Extracting articles with specific overviews or brief descriptions from the article data of the first dataset, and constructing multiple question-answer pairs based on the extracted articles to obtain a second dataset; The second dataset is used to perform Lora fine-tuning on the incremental pre-trained large model to obtain a large model for article generation.

5. The method for generating accurate citation articles based on a large model according to claim 3 is characterized in that: The article summary is regenerated or manually modified based on the user's feedback on the article summary to obtain an article summary that meets the user's needs, including: If the user chooses to regenerate, the large model will be called again to generate the article summary based on the same first prompt word until it meets the user's requirements; If the user chooses to modify manually, an editing interface will be provided to the user to allow the user to directly modify and improve the article abstract.

6. The method for generating accurate citation articles based on a large model according to claim 1 is characterized in that: The article abstracts are used to search the RAG knowledge base for text and vector information, and to obtain auxiliary materials for article generation, including: Extract keywords or phrases based on the article abstract, and use the keywords or phrases to perform text search in the RAG knowledge base to obtain the first candidate materials related to the article topic; The article abstract and the text content in the RAG knowledge base are converted into vectors and vector search is performed. The similarity score between the article abstract vector and the text content vector is calculated. Based on the similarity score, the text content in the RAG knowledge base that is closest in semantics to the article abstract is selected as the second candidate material. The first candidate material and the second candidate material are input into the pre-trained rearrangement model for sorting, and the ranking score of each material is obtained. The materials are sorted from high to low according to the ranking score, and the top k materials are selected as auxiliary materials for article generation.

7. The method for generating accurate citation articles based on a large model according to claim 1 is characterized in that: The method of inputting auxiliary data generated from the article into the large model, generating question text and question answers, constructing a third data set based on the question text, and constructing a fourth data set based on the question text and question answers includes: Segmenting the auxiliary data for article generation to obtain multiple data segments, inputting the multiple data segments into a large model for article generation, automatically generating multiple question texts corresponding to each data segment using the large model, and constructing a third data set based on the question texts in the multiple data segments; The question texts of multiple data segments are input into the big model again, and the big model is used to generate the question answers corresponding to the question texts in each data segment. The question texts and the question answers are combined into question-answer pairs, and a fourth data set is constructed based on the question-answer pairs.

8. The method for generating accurate citation articles based on a large model according to claim 1 is characterized in that: The method constructs a second prompt word according to the pre-processed article generation requirements and the third data set, and inputs the second prompt word into the large model to generate an article outline, including: Combine the title and keywords in the article generation requirements with the third data set in a structured manner to construct the second prompt word; Enter the second prompt into the big model to guide the big model to generate an article outline in markdown format.

9. The method for generating accurate citation articles based on a large model according to claim 1 is characterized in that: The scoring model is used to score the importance of each chapter in the article outline, and the number of words to be allocated to each chapter or section is calculated based on the importance score and the total word count requirement of the article, including: Evaluate the importance of each chapter based on its position within the article structure, the richness of the chapter content, and the chapter's contribution to the article theme. Determine the chapter importance evaluation criteria based on the evaluation results. Input the article outline into the preset scoring model, score the text importance of each chapter according to the chapter importance evaluation criteria, and obtain the importance score of each chapter in the article outline; Calculate the word count ratio for each chapter based on the importance scores of all chapters, and then calculate the word count for each chapter or section based on the word count ratio for each chapter based on the total word count requirement of the article.

10. A system for generating accurate citation articles based on a large model, characterized by: include: The data acquisition module is used to obtain the article generation requirements and selected references input by the user, perform data preprocessing on the references, and store the preprocessed references in the RAG knowledge base; A summary generation module is used to generate a first prompt word based on the pre-processed article generation requirements, and generate an article summary based on the first prompt word using the large model; The data retrieval module is used to perform text and vector searches in the RAG knowledge base based on article abstracts to obtain auxiliary data for article generation; A data set construction module is used to input auxiliary materials generated by the article into the large model, generate question text and question answers, construct a third data set based on the question text, and construct a fourth data set based on the question text and question answers; An outline generation module is used to construct a second prompt word according to the preprocessed article generation requirements and the third data set, and input the second prompt word into the large model to generate an article outline; The word count allocation module is used to use the scoring model to score the importance of each chapter in the article outline, and calculate the number of words to be allocated to each chapter or section based on the importance score and the total word count requirement of the article; The main text generation module is used to split the article outline into chapter or section-level titles, combine the titles, preprocessed article generation requirements, the fourth dataset, and the number of words allocated to the chapter or section, construct the third prompt word, and input the third prompt word into the large model to generate the main text content of the corresponding chapter or section. At the same time, the main text content of each chapter or section is combined in the order of the outline to obtain the article required by the user.

Citation Information

Patent Citations

  • Document generation method and device, equipment and medium

    CN117725895A

  • Long text generation method, device and equipment based on large language model

    CN118536502A