Precise reference article generation method and system based on large model

Through the accurate citation article generation method based on large models, the problem of word count control and citation accuracy in article generation is solved, and high-quality, clear-structured articles are achieved.

CN119357386AActive Publication Date: 2025-01-24CHENGDU GUOZHI FUTURE TECH CO LTD

Patent Information

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

AI Technical Summary

Technical Problem

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

Method used

Using a large model-based accurate citation article generation method, data preprocessing is performed by obtaining the article generation requirements and references input by the user, the article summary is generated, and text and vector retrieval are performed in the RAG knowledge base to build a question and answer data set. Generate article outlines and body content, and use a scoring model to allocate word count.

Benefits of technology

Generate articles with clear structure, rich content and strict logic, ensure that each part gets appropriate length, achieve accurate citation of references, and improve the quality and credibility of the article.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357386A_ABST
    Figure CN119357386A_ABST
Patent Text Reader

Abstract

The invention provides a method and a system for generating an accurately referenced article based on a large model, and belongs to the technical field of article generation. The method comprises the following steps: acquiring an article generation demand input by a user, and generating an abstract of an article according to the demand by using a large model; retrieving knowledge related to the abstract in an RAG knowledge base based on the abstract; generating a series of question and answer pairs by utilizing a large model based on an RAG retrieval result; generating an outline of the article according to the title, the keyword and the question in the question-answer pair; performing importance evaluation on each chapter in the outline by using a scoring model, and calculating the number of words to be distributed to each chapter; splitting the generated outline according to the lowest-level title, combining the title, the keyword, the answer in the question and answer pair and the number of words allocated to the section, and inputting into a large model to generate corresponding text content; and combining the text contents according to an outline sequence to obtain a final article. According to the invention, word number control and accurate reference during article generation can be realized, the accuracy and reliability of article generation are improved, and the user experience is improved.
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, in the current field of artificial intelligence, large models have made significant progress in understanding and generating natural language, and are increasingly being used in article generation. These models can process and analyze large amounts of data, understand and generate natural language text, and thus play an important role in content creation, data reporting, academic research and other fields.

[0003] However, despite the great potential of large models in article generation, long article generation still faces some challenges. For example, long articles need to maintain the coherence of the topic across multiple paragraphs and chapters, which is a challenge for automatic generation systems. Long articles often need to explore the topic in depth and provide detailed analysis and arguments, which requires the model to have a high level of understanding and creativity. Long articles need to accurately control the number of words to fully meet the article type and user needs.

[0004] Therefore, developing an article generation technology that can achieve word count control and accurate citation when generating articles 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 by the present invention is: In a first aspect, the present invention provides a method for generating accurate citation articles based on a large model, comprising: 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 a 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, 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; 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 data set and the number of words to be allocated to the chapter or section are combined to construct the third prompt word, and the third prompt word is input into the large model to generate the text content of the corresponding chapter or section. At the same time, the text content of each chapter or section is combined in the order of the outline to obtain the article required by the user.

[0007] Furthermore, the method of obtaining the article generation requirements and the 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 preprocessed references; the article generation requirements include the title, keywords and total word count requirements of the article; 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.

[0008] Furthermore, the generating of a first prompt word based on the article generation requirement, and generating an article summary based on the first prompt word using a large model, includes: Collect article data and perform incremental pre-training and model fine-tuning on open source models to obtain a large model for article generation; Combining the title and keywords in the article generation requirements to generate the first prompt word, and inputting the first prompt word into the large 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.

[0009] 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: Collect various article data and construct a first data set of plain text, perform full parameter training on the large model based on the first data set, and obtain a large model after incremental pre-training; Extracting articles with specific overviews or brief descriptions from the article data of the first data set, and constructing multiple question-answer pairs based on the extracted articles to obtain a second data set; 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.

[0010] Furthermore, the article abstract is regenerated or manually modified according to the user's feedback on the article abstract to obtain an article abstract 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 is provided to the user to allow the user to directly modify and improve the article abstract.

[0011] 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: 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 respectively. The similarity score between the article abstract vector and the text content vector is calculated. Based on the similarity score, the text content closest to the article abstract in semantics is selected from the text content in the RAG knowledge base 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.

[0012] Furthermore, the article generation auxiliary data is input into the 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 the question answers, including: Segmenting the auxiliary data for article generation to obtain multiple data segments, inputting the multiple data segments into the large model for article generation respectively, automatically generating multiple question texts corresponding to each data segment using the large model, and constructing a third data set according to the question texts of 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.

[0013] Furthermore, the second prompt word is constructed according to the preprocessed article generation requirements and the third data set, and the second prompt word is input into the large model to generate the article outline, including: Combining the title and keywords in the article generation requirements with the third data set in a structured manner to construct a second prompt word; Input the second prompt into the big model to guide the big model to generate an article outline in markdown format.

[0014] 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: Evaluate the importance of each chapter based on its position within the article structure, the richness of the chapter content, and the contribution of the chapter to the article theme in the article outline, and 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; The word count ratio to be allocated to each chapter is calculated based on the importance scores of all chapters, and the word count to be allocated to each chapter or section is calculated based on the total word count requirement of the article according to the word count ratio to be allocated to each chapter.

[0015] In a second aspect, the present invention provides a system for generating accurate citation articles based on a large model, comprising: 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, used to generate a first prompt word based on the preprocessed article generation requirements, and generate an article summary based on the first prompt word using a 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, used for inputting auxiliary materials generated by 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 the 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, and combine the titles, pre-processed article generation requirements, the fourth data set and the number of words to be 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.

[0016] In summary, the beneficial effects of the present invention are as follows: 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, a scoring model is used to evaluate the importance of each part in the outline, and the number of words is reasonably allocated to ensure that each part of the article can get an appropriate length, avoiding the problem of uneven length or lack of emphasis.

[0017] At the same time, the present invention utilizes the references in the RAG knowledge base, constructs questions and answers, and generates an outline and a text based on the constructed questions and answers, respectively, to achieve accurate citation of references, ensure that the information and data sources in the article are reliable, and improve the quality and credibility of the article. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0019] Figure 1 A flow chart of a method for generating accurate citation articles based on a large model according to the present invention; Figure 2 This is a functional module diagram of a large model-based accurate citation article generation system in the present invention. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solution and advantages of the embodiment of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such 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, all within the scope of protection of the present invention.

[0021] Embodiment 1:

[0022] See also Figure 1 , Figure 1 FIG. 1 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 comprises: 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 a 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, 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; 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 data set and the number of words to be allocated to the chapter or section are combined to construct the third prompt word, and the third prompt word is input into the large model to generate the text content of the corresponding chapter or section. At the same time, the text content of each chapter or section is combined in the order of the outline to obtain the article required by the user.

[0023] Specifically, the overall idea of ​​the method for generating accurate cited articles based on a big 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 big 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 theme and have the richest information 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 big model as the basis for the outline and the main text content; according to the title, keywords and questions generated by the big model, an outline of the article is generated based on the big 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 big model, and the number of words allocated to this section are combined and input into the big model to generate the corresponding main text content; the generated text is combined in the order of the outline to obtain the final article.

[0024] Furthermore, in an embodiment of the present invention, obtaining the article generation requirements input by the user and the selected references, performing data preprocessing on the references, and storing the preprocessed references in the RAG knowledge base specifically includes: 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 title, keywords and total word count requirements of the article.

[0025] Specifically, the user enters the requirements for article generation, including the title, keywords, and the total number of words expected in the article. In addition, the user can optionally enter other requirements, such as the style and tone of the article, to further guide the generation process. At the same time, specify or select relevant references. After receiving the reference data entered by the user, data cleaning and standardization are performed to remove redundant spaces, punctuation marks, etc. to ensure consistency in subsequent processing.

[0026] Among them, the title is a brief summary of the content, which usually appears at the top or beginning of the content, and is used to attract the reader's attention and summarize the main theme of the content. The title is the first impression that determines whether to continue reading the content. A clear and attractive title can stimulate the reader's interest. The title is required to be concise and clear, and can quickly convey the core information of the content, and is closely related to the content to avoid misleading readers. Keywords are important words or phrases in the article, which are used to describe the theme, content or field of the article. Keywords can guide readers to quickly understand the theme and focus of the article, and help them better understand and remember the content of the article. The reasonable use of keywords in the article can help authors better organize the content structure and make the article more organized and logical. The word count is the total number of characters in the final generated article. Many types of articles have special requirements for the word count. For example, reports generally have more word count requirements, while letters have fewer word count requirements. In the field of article generation based on large models, achieving word count control is an important content. Article style refers to the unique style of the article, reflecting the specific ways and methods used to express thoughts, emotions and opinions. Article style is not only closely related to the content of the article, but also deeply influenced by the author's personality characteristics, thinking path and creative intention. For example, academic papers develop their arguments around arguments and evidence, and the style requires to be rigorous, thorough and logical; general official documents are required to be concise, accurate and complete.

[0027] In the embodiment of the present invention, the references can be books, papers, web pages, etc., supporting formats such as word, pdf, excel, ppt, and pictures, uploaded and stored in the Retriever-Augmented Generation (RAG) knowledge base for subsequent outline and text generation. For the uploaded files, a suitable parser (such as a PDF reader, a Word processing library, etc.) is used to extract the text content, which is stored in the knowledge base and indexed for quick retrieval and use.

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

[0029] Further, in an embodiment of the present invention, a first prompt word is generated based on the article generation requirement, and based on the first prompt word, an article summary is generated using a large model, specifically 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; Combining the title and keywords in the article generation requirements to generate the first prompt word, and inputting the first prompt word into the large 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.

[0030] Specifically, the title and keywords entered by the user are combined into the first prompt word to guide the big model to understand the user's intention and the theme of the article. Based on the constructed prompt words, the big model is used to generate the summary information of the article, including the main content overview, key arguments or writing points of the article. The generated summary is displayed to the user for review. If the user is not satisfied, he or she can choose to regenerate or manually modify the summary to ensure that it accurately reflects the core content of the article.

[0031] In some embodiments, the embodiments of the present invention provide some prompt examples, specifically: "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." In the embodiment of the present invention, the big model uses an open source model (such as qwen, llama, etc.), is trained using article data, and has strong text understanding and generation capabilities. The big model analyzes the input prompt words to understand the user's intention and the article topic. Based on the understanding of the article topic, the model generates a summary text. The article summary should include an overview of the main content of the article, key arguments or writing points, while maintaining the fluency and coherence of the language.

[0032] 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: Collect various article data and construct a first data set of plain text, perform full parameter training on the large model based on the first data set, and obtain a large model after incremental pre-training; Extracting articles with specific overviews or brief descriptions from the article data of the first data set, and constructing multiple question-answer pairs based on the extracted articles to obtain a second data set; 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.

[0033] Specifically, in some embodiments, the large model training includes two processes: incremental pre-training and fine-tuning of article data. Incremental pre-training collects high-quality article data such as Xinhua Daily, high-quality books, and papers, builds a first plain text data set, and performs full parameter training on the large model to improve the professional knowledge of the large model and its ability to understand different types of articles.

[0034] Fine-tuning According to the shortcomings of article generation of the large model after incremental pre-training, specific parts of the articles in the first dataset are extracted to construct question-answer pairs. For example, if the overview / introduction of the article generated by the large model after incremental pre-training is not concise and clear enough, the articles with better overview / introduction descriptions are extracted to construct question-answer pairs: "Write an overview / introduction for the daily article "Visiting the Shuanghuaishu Site, the "Heluo Ancient Kingdom" Tracing the Origin of Civilization"" - "On the south bank of the Yellow River and the east of the Yiluo River, on the high platform of Shuanghuaishu Village, Heluo Town, Gongyi City, a giant settlement site of the middle and late Yangshao culture, the Shuanghuaishu Site, verifies the history of the origin of Chinese civilization. From 2013 to 2020, archaeologists excavated the capital of the "Heluo Ancient Kingdom" about 5,300 years ago in the south of Shuanghuaishu Village. After years of archaeological investigation, exploration and excavation, it is confirmed that the existing area of ​​the site is about 1.17 million square meters, with a focus on excavation of more than 4,000 square meters. In early summer, everything is in full bloom. Walking into the Shuanghuaishu Site, you can glimpse the light of civilization in one archaeological discovery after another.". Multiple question-answer pairs constitute the second dataset. Lora technology is used to fine-tune the incremental pre-trained large model using the second data set to enhance the large model's ability to generate specific content.

[0035] Further, in an embodiment of the present invention, the article abstract is regenerated or manually modified according to the user's feedback on the article abstract to obtain an article abstract that meets the user's needs, specifically 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 is provided to the user to allow the user to directly modify and improve the article abstract.

[0036] Furthermore, in the embodiment of the present invention, text and vector retrieval is performed in the RAG knowledge base based on the article abstract to obtain auxiliary materials for article generation, which specifically include: First, extract keywords or phrases based on the article abstract, and use the keywords or phrases to perform text retrieval in the RAG knowledge base to obtain the first candidate information related to the article topic.

[0037] Specifically, text retrieval is to extract keywords or phrases from the abstract, which represent the theme and core content of the article. Use these keywords to perform traditional text retrieval in the RAG knowledge base, such as searching based on inverted indexes, to find documents or paragraphs containing these keywords. Based on indicators such as the matching degree of keywords and the relevance score of documents, a batch of first candidate materials are initially screened out.

[0038] Then, the article abstract and the text content in the RAG knowledge base are converted into vectors and vector retrieval is performed respectively, and 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.

[0039] 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 with 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 score, the document or paragraph that is closest to the abstract semantics is selected as the second candidate material.

[0040] 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. 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.

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

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

[0043] Furthermore, in an embodiment of the present invention, the auxiliary data generated by the article is input into the large model to generate a question text and a question answer, a third data set is constructed based on the question text, and a fourth data set is constructed based on the question text and the question answer, specifically including: Segmenting the auxiliary data for article generation to obtain multiple data segments, inputting the multiple data segments into the large model for article generation respectively, automatically generating multiple question texts corresponding to each data segment using the large model, and constructing a third data set according to the question texts of 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.

[0044] In some embodiments, the embodiments of the present invention divide the retrieved knowledge into segments, 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 corresponding answers or explanations. The answers should directly answer the questions, 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 segments. 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.

[0045] Furthermore, in the embodiment of the present invention, a second prompt word is constructed according to the preprocessed 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: 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. Among them, the embodiment of the present invention organizes the title, keywords and question set 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.

[0046] The second prompt is input into the big model to instruct the big model to generate the article outline in markdown format. The outline is output in markdown format to clearly show the hierarchical structure of the article.

[0047] In some embodiments, the markdown format supports structural elements such as headings and lists, which is very suitable for expressing outlines. An example of the outline format is: #Chapter 1 ##Section 1 ###First section ###Second Section ##Section 2 ###First section ###Second Section #Chapter 2 ##Section 1 ###First section ###Second Section ##Section 2 ###First section ###Second section.

[0048] 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: Evaluate the importance of each chapter based on its position within the article structure, the richness of the chapter content, and the contribution of the chapter to the article theme in the article outline, and 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; The word count ratio to be allocated to each chapter is calculated based on the importance scores of all chapters, and the word count to be allocated to each chapter or section is calculated based on the total word count requirement of the article according to the word count ratio to be allocated to each chapter.

[0049] 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 the text, which can understand and analyze the text content and give a corresponding score. Determine the criteria for evaluating the importance of chapters, including the position of the chapter in the overall structure of the article (such as introduction, 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. According to the large model score, calculate the proportion 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.

[0050] The calculation method for word count distribution is: Assuming the total number of words in the article is , the outline is Sections, each section is scored , then the number of words per section x for: .

[0051] Furthermore, in an embodiment of the present invention, the generated outline is split into chapter or subsection level titles according to the lowest level titles, such as "First Subsection", to ensure that the structure after the split still maintains the hierarchy and order of the original outline, so that the text can be combined in the order of the outline later. The title, keywords, the fourth data set, and the number of words allocated to this subsection are combined to construct a third prompt. The constructed third prompt is input into the large model to generate the corresponding text content. The generated text is combined in the order of the outline to obtain the final article.

[0052] Furthermore, the generated text content is output in Json format, consisting of Key-value pairs, which is convenient for subsequent processing and editing. The Key corresponds to the outline name, and the Value corresponds to the generated text. This format is convenient for subsequent processing and editing. Text output example: { "First Section": "XXXXXXX" } Among them, the large model can be used for article generation after fine-tuning.

[0053] The beneficial effects of the method for generating accurate citation articles based on a large model in an embodiment of the present invention include: 1. With the help of the big model, you can generate articles with clear structure, rich content and strict logic. At the same time, use the scoring model to evaluate the importance of each part of the outline, reasonably allocate the number of words, ensure that each part of the article can get an appropriate length, and avoid problems such as uneven length or lack of emphasis; 2. Utilize the references in the RAG knowledge base, construct questions and answers, and generate the outline and text based on the constructed questions and answers, so as 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.

[0054] 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: 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, used to generate a first prompt word based on the preprocessed article generation requirements, and generate an article summary based on the first prompt word using a 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, used for inputting auxiliary materials generated by 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 the 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, and combine the titles, pre-processed article generation requirements, the fourth data set and the number of words to be 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.

[0055] In an embodiment of the present invention, the system obtains user input of the title, keywords, word count and other requirements; uses the big model to generate the summary information of the article according to the user input requirements; then retrieves the knowledge related to the summary in the RAG knowledge base 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 the outline of the article based on the big model according to the title, keywords and questions generated by the big model. Then use the scoring model to evaluate the importance of each chapter in the generated outline, so as to calculate the number of words to be allocated to each chapter. Then split the generated outline according to the lowest-level title, combine the title, keywords, answers generated by the big model, and the number of words allocated to this section, and input them into the big model to generate the corresponding text content; finally, combine the generated text in the order of the outline to get the final article.

[0056] 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 aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned 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 in that: 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 a 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, 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; 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 data set and the number of words to be allocated to the chapter or section are combined to construct the third prompt word, and the third prompt word is input into the large model to generate the text content of the corresponding chapter or section. At the same time, the text 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 step 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 preprocessed references; the article generation requirements include the title, keywords and total word count requirements of the article; 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 step of generating a first prompt word based on the article generation requirement, and generating an article summary based on the first prompt word using a large model includes: Collect article data and perform incremental pre-training and model fine-tuning on open source models to obtain a large model for article generation; Combining the title and keywords in the article generation requirements to generate the first prompt word, and inputting the first prompt word into the large 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 various article data and construct a first data set of plain text, perform full parameter training on the large model based on the first data set, and obtain a large model after incremental pre-training; Extracting articles with specific overviews or brief descriptions from the article data of the first data set, and constructing multiple question-answer pairs based on the extracted articles to obtain a second data set; 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 abstract is regenerated or manually modified according to the user's feedback on the article abstract to obtain an article abstract 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 is 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 text and vector search is performed in the RAG knowledge base based on the article abstract 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 respectively. The similarity score between the article abstract vector and the text content vector is calculated. Based on the similarity score, the text content closest to the article abstract in semantics is selected from the text content in the RAG knowledge base as the second candidate material; The first candidate data and the second candidate data are input into the pre-trained rearrangement model for sorting, and the sorting score of each data is obtained. The data are sorted from high to low according to the sorting score, and the top k data are selected as auxiliary data for article generation.

7. The method for generating accurate citation articles based on a large model according to claim 1, characterized in that: The method of inputting the auxiliary data generated by 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 the question answers includes: Segmenting the auxiliary data for article generation to obtain multiple data segments, inputting the multiple data segments into the large model for article generation respectively, automatically generating multiple question texts corresponding to each data segment using the large model, and constructing a third data set according to the question texts of 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 preprocessed article generation requirements and the third data set, and inputs the second prompt word into the large model to generate an article outline, including: Combining the title and keywords in the article generation requirements with the third data set in a structured manner to construct a second prompt word; Input 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, 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 contribution of the chapter to the article theme in the article outline, and 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; The word count ratio to be allocated to each chapter is calculated based on the importance scores of all chapters, and the word count to be allocated to each chapter or section is calculated based on the total word count requirement of the article according to the word count ratio to be allocated to each chapter.

10. A system for generating accurate citation articles based on a large model, characterized in that: 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, used to generate a first prompt word based on the preprocessed article generation requirements, and generate an article summary based on the first prompt word using a 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, used for inputting auxiliary materials generated by 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 the 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, and combine the titles, pre-processed article generation requirements, the fourth data set and the number of words to be 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

  • Method for generating article content and electronic equipment

    CN117875274A

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

    CN118536502A

  • Tuning a generative artificial intelligence model

    US11875240B1

  • Text generation method and apparatus, storage medium, and electronic device

    WO2020258948A1

Cited By

  • Large model writing method and system based on structured meta-knowledge base

    CN120087341A

  • Article AI illustration method and device based on artificial intelligence, and computer readable medium

    CN120451340A

  • Instruction fine tuning data set construction method and system for large model long text generation

    CN120910193A

  • Long text writing generation method and system based on multi-agent cooperation

    CN120911415A

  • A long text writing generation method and system based on multi-agent cooperation

    CN120911415B