Document auxiliary generation method and device, equipment and medium

By constructing a knowledge base and combining it with a large language model and reordering technology, the issues of flexibility and efficiency in document writing tools are resolved, enabling high-quality, personalized document generation that is suitable for diverse document generation tasks.

CN120930624APending Publication Date: 2025-11-11QINGTA TECH
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202511463759.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-14
Publication Date
2025-11-11

AI Technical Summary

Technical Problem

Existing document writing tools are limited by templates, lack flexibility, are inefficient, cannot effectively utilize external knowledge support, lack intelligent recommendations and personalized optimization, and are difficult to adapt to the needs of frequent updates and diverse document generation.

Method used

A knowledge base is built based on a parent-child segmentation mechanism. Named entity recognition and BERT model are used for parameter recognition. Combined with reordering model and large language model, retrieval enhancement generation technology is used to retrieve target prompt word templates and perform document-assisted generation operations.

Benefits of technology

It enables efficient and personalized document generation, improves document quality and generation efficiency, reduces manual intervention, lowers hardware requirements, and adapts to document generation needs in different fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120930624A_ABST
    Figure CN120930624A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, and provides a document auxiliary generation method and device, equipment and a medium, which can construct a knowledge base based on a father-child segmentation mechanism to ensure that segmentation operation does not damage content integrity. Performing parameter identification on the data input by the user to obtain a target condition parameter, a target action parameter and a target theme parameter, so as to subsequently perform targeted response according to different parameters; based on a retrieval enhancement generation technology, performing retrieval in a knowledge base by utilizing a reordering model according to the target condition parameters, calling a target cue word template according to the target action parameters, and calling a large language model; according to the target prompt word template, the retrieval result, the target condition parameters, the target theme parameters and the user input data, the auxiliary document generation operation based on the auxiliary document generation instruction is executed, and by integrating knowledge base retrieval and a generation model, high-quality documents can be efficiently generated in an auxiliary mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device, and medium for document-assisted generation. Background Technology

[0002] Currently, document drafting largely relies on manual editing and accumulated experience. For example, in higher education, due to the complexity and cumbersome review requirements of degree program applications, drafting and submitting compliant application documents is a time-consuming and costly process. Especially during the degree program application process, document writers often need to draw on past successful cases, conduct extensive literature research and content organization to ensure compliance with all academic and administrative requirements. Furthermore, some university application teams face the need for frequent updates and revisions to application documents; traditional document writing methods become particularly inefficient when faced with high-frequency document generation and constantly changing requirements.

[0003] In existing technologies, document drafting mainly suffers from the following limitations: 1. Limited templates and lack of flexibility: Templated documents are difficult to personalize and tailor to the specific characteristics of the applied discipline or degree program; 2. Manual operation is cumbersome and inefficient: The writers need to consult a large amount of information and manually integrate it to generate each application document, which is inefficient for degree program applications that require frequent updates. 3. Insufficient reliance on external knowledge: In existing methods, the generation of much document content lacks sufficient external knowledge support and cannot effectively utilize best practices and success stories in the field; 4. Lack of intelligent support: Existing tools are mostly limited to formatting document content, lacking intelligent recommendations and content generation that combine subject characteristics, and cannot be personalized and optimized based on historical successful documents, the preferences of review experts, etc.

[0004] In view of the above problems, it is necessary to provide a document generation assistance solution to improve the efficiency and quality of document generation. Summary of the Invention

[0005] In view of the above, it is necessary to provide a document-assisted generation method, apparatus, equipment, and medium to solve the problems of low document generation efficiency and low document quality.

[0006] A document-assisted generation method, the document-assisted generation method comprising: A knowledge base is built based on a parent-child segmentation mechanism; In response to a document-assisted generation instruction triggered by a target user, the document-assisted generation instruction is parsed to obtain the user input data of the target user; The user input data is subjected to parameter recognition to obtain target condition parameters, target action parameters, and target topic parameters; Based on retrieval enhancement generation technology, a re-ranking model is used to search the knowledge base according to the target condition parameters to obtain retrieval results; Retrieve the target prompt word template based on the target action parameters; The large language model is invoked, and a document-assisted generation operation based on the target prompt word template, the search results, the target condition parameters, the target topic parameters, and the user input data is executed.

[0007] According to a preferred embodiment of the present invention, the construction of the knowledge base based on the parent-child segmentation mechanism includes: When a standard document is detected to be uploaded on the dify large language model application development platform, the standard document is split into multiple text segments based on the parent-child segmentation mechanism. Convert the multiple text segments into embedding vectors; The knowledge base is constructed based on the embedding vector.

[0008] According to a preferred embodiment of the present invention, the step of performing parameter identification on the user input data to obtain target condition parameters, target action parameters, and target topic parameters includes: The named entity recognition model is used to identify the time parameter, location parameter, recorded institution in the knowledge base, subject, and target institution in the user input data as the target condition parameters. The user input data is subjected to intent recognition to obtain the target action parameters; Obtain the user group to which the target user belongs, retrieve the BERT-based classifier corresponding to the user group to which the target user belongs as the target classifier, and use the target classifier to process the user input data to obtain the target topic parameters.

[0009] According to a preferred embodiment of the present invention, before retrieving the target prompt word template based on the target action parameters, the method further includes: Configure the prompt word template corresponding to each action parameter.

[0010] According to a preferred embodiment of the present invention, the step of retrieving the large language model and performing a document-assisted generation operation based on the document-assisted generation instruction according to the target prompt word template, the search results, the target condition parameters, the target topic parameters, and the user input data includes: When the target action parameter is a summary, the large language model is used to summarize the search results based on the target prompt word template to obtain a summary result, and the summary result is output. When the target action parameter is a recommendation, the search result is returned using the large language model; When the target action parameter is document generation, the target document is generated based on the target prompt word template using the large language model, according to the target condition parameters and the search results, and the target document is output. When the target action parameter is document polishing, the large language model is used to polish the text based on the target prompt word template and the user input data to obtain the polishing result, and the polishing result is output.

[0011] According to a preferred embodiment of the present invention, the step of retrieving the large language model and performing a document-assisted generation operation based on the document-assisted generation instruction according to the target prompt word template, the search results, the target condition parameters, the target topic parameters, and the user input data further includes: When the target action parameter is an open-ended question, the large language model is used to answer the question in the user input data based on the target prompt word template and the search results.

[0012] According to a preferred embodiment of the present invention, the step of using the large language model to answer questions in the user input data based on the target prompt word template and the search results includes: Obtain the similarity threshold; Obtain the similarity of each sub-retrieval result in the retrieval results obtained when the re-ranking model is used to search the knowledge base according to the target condition parameters; When the similarity of a target sub-retrieval result is greater than the similarity threshold, the large language model is used to conduct a multi-turn dialogue based on the target prompt word template, the target sub-retrieval result, and the questions in the user input data; When no sub-search result corresponds to a similarity greater than the similarity threshold, the large language model is used to conduct multi-turn dialogue based on the target prompt word template, the large language model's own knowledge, and the questions in the user input data; In this process, the dialogue records from each round are recorded as historical parameters and input into the next round of dialogue.

[0013] A document-assisted generation device, the document-assisted generation device comprising: Building units are used to construct knowledge bases based on a parent-child segmentation mechanism; The parsing unit is used to respond to a document-assisted generation instruction triggered by a target user, and parse the document-assisted generation instruction to obtain the user input data of the target user; The identification unit is used to identify parameters in the user input data to obtain target condition parameters, target action parameters, and target topic parameters. The retrieval unit is used to perform retrieval in the knowledge base based on the target condition parameters using a re-ranking model, based on retrieval enhancement generation technology, to obtain retrieval results. The retrieval unit is used to retrieve the target prompt word template according to the target action parameters; The execution unit is used to retrieve the large language model and perform a document-assisted generation operation based on the document-assisted generation instruction according to the target prompt word template, the search results, the target condition parameters, the target topic parameters and the user input data.

[0014] A computer device, the computer device comprising: A memory for storing at least one instruction; and a processor for executing the instructions stored in the memory to implement the document-assisted generation method.

[0015] A computer-readable storage medium storing at least one instruction, which is executed by a processor in a computer device to implement the document-assisted generation method.

[0016] As can be seen from the above technical solutions, this invention can construct a knowledge base based on a parent-child segmentation mechanism, ensuring that segmentation operations do not damage the integrity of the content; it identifies parameters in user input data to obtain target condition parameters, target action parameters, and target topic parameters, so as to facilitate targeted responses based on different parameters; based on retrieval-enhanced generation technology, it uses a re-ranking model to search the knowledge base according to the target condition parameters, retrieves the target prompt word template according to the target action parameters, and retrieves the large language model. Based on the target prompt word template, search results, target condition parameters, target topic parameters, and user input data, it executes a document-assisted generation operation based on document-assisted generation instructions. By integrating the knowledge base retrieval and generation models, it can efficiently assist in the generation of high-quality documents. Attached Figure Description

[0017] Figure 1 This is a flowchart of a preferred embodiment of the document-assisted generation method of the present invention.

[0018] Figure 2 This is a functional block diagram of a preferred embodiment of the document auxiliary generation device of the present invention.

[0019] Figure 3 This is a schematic diagram of the structure of a computer device that implements the document-assisted generation method of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0021] like Figure 1 The diagram shown is a flowchart of a preferred embodiment of the document-assisted generation method of the present invention. The order of the steps in this flowchart can be changed, and some steps can be omitted, depending on different needs.

[0022] The document-assisted generation method is applied to one or more computer devices. The computer device is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. Its hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0023] The computer device can be any electronic product that can interact with the user, such as a personal computer, tablet computer, smartphone, personal digital assistant (PDA), game console, interactive network television (IPTV), smart wearable device, etc.

[0024] The computer equipment may also include network equipment and / or user equipment. The network equipment includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of hosts or network servers.

[0025] The server can be a standalone server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.

[0026] Artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0027] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0028] The network in which the computer device is located includes, but is not limited to, the Internet, wide area network, metropolitan area network, local area network, and virtual private network (VPN).

[0029] S10, a knowledge base is built based on a parent-child segmentation mechanism.

[0030] In this embodiment, the construction of the knowledge base based on the parent-child segmentation mechanism includes: When a standard document is detected to be uploaded on the dify large language model application development platform, the standard document is split into multiple text segments based on the parent-child segmentation mechanism. Convert the multiple text segments into embedding vectors; The knowledge base is constructed based on the embedding vector.

[0031] The dify large language model application development platform can quickly complete the process from prototype to production through an intuitive interface combined with AI (Artificial Intelligence) workflow, RAG (Retrieval-augmented Generation) pipeline, Agent, model management, observability functions, etc.

[0032] The parent-child segmentation mechanism can improve subsequent retrieval efficiency without affecting data integrity.

[0033] The standard documents mentioned above refer to documents that have been proven to be valid, have passed review, and can be used as references, such as approved application documents.

[0034] The format of the standard document may include, but is not limited to, one or more of the following formats: TXT (Text File), MARKDOWN (Markdown File), MDX (MarkdowneXtended), PDF (Portable Document Format), HTML (HyperText Markup Language), XLSX (Microsoft Excel Open XML Spreadsheet), XLS (Microsoft Excel Spreadsheet), DOCX (Microsoft Word Open XML Document), CSV (Comma-Separated Values), MD (Markdown File), HTM (HyperText Markup Language), etc.

[0035] Furthermore, the size of each standard document file shall not exceed a preset size, such as 100MB.

[0036] The multiple text segments can be converted into the embedding vectors using text embedding models such as xiaobu-embedding-v2.

[0037] Through the above embodiments, the knowledge base can be built on the basis of standard documents to serve as the response basis for subsequent large models, ensuring the professionalism and relevance of the content generated by the large models.

[0038] S11, in response to a document-assisted generation instruction triggered by the target user, the document-assisted generation instruction is parsed to obtain the user input data of the target user.

[0039] In this embodiment, the target user can be a staff member responsible for document generation.

[0040] In this embodiment, the document generation assistance instruction can be triggered by the target user based on actual document generation needs.

[0041] In this embodiment, the user input data may include user needs, user questions, etc.

[0042] S12, perform parameter recognition on the user input data to obtain target condition parameters, target action parameters and target topic parameters.

[0043] In this embodiment, the step of performing parameter recognition on the user input data to obtain target condition parameters, target action parameters, and target topic parameters includes: The Named Entity Recognition (NER) model is used to identify the time parameter, location parameter, recorded institution in the knowledge base, subject, and target institution in the user input data as the target condition parameters. The user input data is subjected to intent recognition to obtain the target action parameters; The user group to which the target user belongs is obtained. The classifier based on the BERT (Bidirectional Encoder Representations from Transformers) model corresponding to the user group to which the target user belongs is retrieved as the target classifier. The user input data is processed using the target classifier to obtain the target topic parameters.

[0044] For example, for education-related application documents, the target condition parameters may include: a. Time parameter: year; If the extracted year is a different number (such as an amount), the default value (such as default) will be returned.

[0045] b. Geographical parameter: Province; The province can only be "this province" or the province name; otherwise, the default value will be returned.

[0046] c. The knowledge base already records the following institutions: universities (units); Extract information about universities with relevant case studies from the text. If no university information with relevant case studies is found, return the default value; if information about multiple universities is available, separate them with commas.

[0047] Note that if the input is "Based on University D and University A, please write a list for University B", then the unit will be "University D, University A"; if the input is "Please write a list for University A's xxx", then University A will be the target unit, and the unit will be the default value.

[0048] If the input is "Based on the approved group", then the unit is "approved group".

[0049] d. Subject: Discipline; e. Target institution: Target university (target_unit); When the statement contains requests such as "help me write" or "generate", extract the target university information to be generated from the text. For example, if the input is "Based on University A, help me write one for University B", then target_unit is "University B".

[0050] In summary, assuming the user input is "How to write the application text for philosophy at University C in 2021", the parsed result should be: { "year": "2021", "province": "default", "unit": "University C", "subject": "philosophy", "target_unit": "default" }

[0051] For educational application documents, the target action parameters may include: a. Summary: Summarize the key points of the approved document; When a user's input contains text that expresses a desire to learn how to write a specific text, such as "summary" or "how to write," it is categorized into the current category. Examples include: "How to write training objectives," "Key points for writing application texts," and "Help me write the key points for writing application texts."

[0052] b. Recommendation: Recommend the approved text; When user input contains text such as "recommendation / search / query / how XXX is written / what XXX is like", it is categorized into the current category. For example, "how does University B write it?" or "how does University B write its 'current related disciplines and majors development status'?" would be examples where the model is expected to return University B's case.

[0053] c. Generation: Generate the application text; The user's input includes text such as "generate / write / help me write" that expresses the user's desire to have their application text written.

[0054] Note the special case: If the input is "Add XXX / Delete XXX", it means that there was a previous return value, and it should not be regarded as generation but as polishing.

[0055] d. Polishing: Polishing user-provided text; User input includes text expressing the user's desire to add or remove information or text, such as "add xxx / delete xxx / polish / optimize xxx / rewrite xxx".

[0056] e. Open-ended questions and answers: Other input content.

[0057] For education-related application documents, the target topic parameters may include: Based on the user's user group (academic master's / academic doctoral / professional master's / transfer doctoral) and the user's input, the corresponding classifier is retrieved, and the retrieved classifier is used to classify the user's input into a specific chapter.

[0058] If the user inputs "Refer to the cases of approved units and help me generate 'Accurate analysis of the demand for talents in this discipline in this region (industry), the status of existing authorized points, and the situation of talent training and employment'", then the categorized theme is "Accurate analysis of the demand for talents in this discipline in this region (industry), the status of existing authorized points, and the situation of talent training and employment".

[0059] The above embodiments can generate multi-dimensional parameters, so that subsequent models can respond in a targeted manner according to different parameters, thereby improving accuracy.

[0060] S13, Based on the retrieval enhancement generation technology, the re-ranking model is used to search the knowledge base according to the target condition parameters to obtain the retrieval results.

[0061] For example, based on retrieval enhancement generation technology, a hybrid retrieval can be performed using a re-ranking model, and the top-preset retrieval results with high similarity can be recorded, such as the retrieval results ranked in the top 20 in terms of similarity.

[0062] The preset position can be configured according to the required retrieval accuracy.

[0063] Through the above embodiments, it is possible to use RAG technology to recall similar content from historical standard documents, providing a reference for subsequent processing.

[0064] S14, retrieve the target prompt word template according to the target action parameters.

[0065] In this embodiment, before retrieving the target prompt word template based on the target action parameters, the method further includes: Configure the prompt word template corresponding to each action parameter.

[0066] For example, the prompt template for the summary action could be: You are a professional degree application document assistant, skilled at providing users with writing guidance for application documents / books, and summarizing the key points of writing based on the approved application texts in the knowledge base.

[0067] The prompt template for an open-ended question-and-answer action could be: You are currently having a conversation with a user. Before this conversation, the user has already had one round of conversation with you, the content of which is as follows: {HISTORY}.

[0068] The prompt template for the generated action could be: You are a professional degree application document assistant, skilled at providing users with guidance on writing application documents. Your task is to generate application texts with a similar style but innovative content based on reference texts, helping users create high-quality degree application documents. Please avoid directly copying the original text. Ensure that the regions and institutions involved in the generated text are consistent with those provided by the user. Rewrite using rigorous academic language, enclosing any parts that require modification or replacement in [ ], and ensure innovative expression, not just word replacement, but also changes in sentence structure and style. After generating the text, proactively ask the user, "Is there any part that needs modification or supplementation?" The prompt template for the polishing action could be: You are an experienced expert in polishing degree application documents, skilled at optimizing the structure, logic, grammar, and vocabulary of given application documents to improve their expressiveness, making them more concise, understandable, and persuasive. Your task is to deeply reconstruct the reference content. Rewrite it using rigorous academic language, enclosing any parts that require modification or replacement in [ ], and ensure innovative expression, not just word substitution, but also changes in sentence structure and style.

[0069] Through the above embodiments, prompt word templates for each action can be pre-configured, thereby improving the efficiency of subsequent model responses.

[0070] S15, retrieve the Large Language Model (LLM), and perform a document-assisted generation operation based on the document-assisted generation instruction according to the target prompt word template, the search results, the target condition parameters, the target topic parameters, and the user input data.

[0071] In this embodiment, the step of retrieving the large language model and performing a document-assisted generation operation based on the document-assisted generation instruction according to the target prompt word template, the search results, the target condition parameters, the target topic parameters, and the user input data includes: When the target action parameter is a summary, the large language model is used to summarize the search results based on the target prompt word template to obtain a summary result, and the summary result is output. When the target action parameter is a recommendation, the search result is returned using the large language model; When the target action parameter is document generation, the target document is generated based on the target prompt word template using the large language model, according to the target condition parameters and the search results, and the target document is output. When the target action parameter is document polishing, the large language model is used to polish the text based on the target prompt word template and the user input data to obtain the polishing result, and the polishing result is output.

[0072] Through the above embodiments, by responding to different action parameters, it not only supports automatic document generation, but also supports document polishing and optimization, summarizing and recommending relevant content, thereby improving document quality.

[0073] In this embodiment, the step of retrieving the large language model and performing a document-assisted generation operation based on the document-assisted generation instruction according to the target prompt word template, the search results, the target condition parameters, the target topic parameters, and the user input data further includes: When the target action parameter is an open-ended question, the large language model is used to answer the question in the user input data based on the target prompt word template and the search results.

[0074] Specifically, the step of using the large language model to answer questions in the user input data based on the target prompt word template and the search results includes: Obtain the similarity threshold; Obtain the similarity of each sub-retrieval result in the retrieval results obtained when the re-ranking model is used to search the knowledge base according to the target condition parameters; When the similarity of a target sub-retrieval result is greater than the similarity threshold, the large language model is used to conduct a multi-turn dialogue based on the target prompt word template, the target sub-retrieval result, and the questions in the user input data; When no sub-search result corresponds to a similarity greater than the similarity threshold, the large language model is used to conduct multi-turn dialogue based on the target prompt word template, the large language model's own knowledge, and the questions in the user input data; In this process, the dialogue records from each round are recorded as historical parameters and input into the next round of dialogue.

[0075] The similarity threshold can be the optimal value selected based on the experiment.

[0076] The above embodiments support answering user questions in the form of multi-turn dialogues.

[0077] This embodiment, based on the RAG retrieval mechanism, can quickly retrieve relevant information from the knowledge base according to user input and combine it with LLM for intelligent response, avoiding the tedious manual modification steps in the traditional document writing process. Compared with traditional methods, the automated execution not only improves writing speed but also ensures the accuracy and standardization of document content through multiple rounds of generation and optimization, greatly reducing human intervention. Intelligent adjustment based on standard documents in the knowledge base avoids the common problems of "template-based" or "uniform" documents in existing technologies, giving each generated document a high degree of personalization and improving its professionalism and quality. Through the powerful language understanding and generation capabilities of LLM, the document provided by the user is automatically polished and optimized, ensuring it conforms to academic writing norms and language standards. Compared to the traditional method of multiple manual revisions, this embodiment saves time through automated polishing, significantly reduces human error, and improves the quality of the final document. This embodiment uses an efficient combination of RAG and LLM, enabling document generation tasks to be completed under standard computing resources, compared to the traditional method requiring large amounts of... Compared to the computational resource-intensive generative model, this embodiment has lighter hardware requirements, can run on ordinary servers or standalone devices, reducing the difficulty and cost of system deployment. Furthermore, since the generative model does not rely on a large training set, it can perform high-quality document generation assistance tasks with less computational resources and data volume, exhibiting strong adaptability and low cost. This embodiment supports dynamically optimized generated content, ensuring the system's real-time performance and flexibility in different usage scenarios. Unlike traditional static template generation methods, this embodiment, by combining real-time retrieval and generation models, can dynamically adjust document content according to the user's immediate needs, improving processing efficiency and generation quality. This embodiment, combining in-depth academic writing rules and rich document templates, not only ensures high-quality documents but also enhances the approval rate of application documents, improving the competitiveness of universities and research institutions in the application process.

[0078] This embodiment can rely on the tight integration between hardware facilities and software systems. The system architecture can include a data storage layer, a processing layer, and a presentation layer. The layers are coordinated through interfaces, which ensures the flexibility and scalability of the system. It can run efficiently on standard computing devices, reduce hardware investment requirements, and maintain high-quality document generation while reducing GPU (Graphics Processing Unit) computing resource consumption.

[0079] This embodiment has good vertical domain applicability and can be transferred and applied to document generation in different fields, such as degree application documents, research reports, project application forms, etc., and can be customized by adjusting the domain knowledge base and generation model.

[0080] As can be seen from the above technical solutions, this invention can construct a knowledge base based on a parent-child segmentation mechanism, ensuring that segmentation operations do not damage the integrity of the content; it identifies parameters in user input data to obtain target condition parameters, target action parameters, and target topic parameters, so as to facilitate targeted responses based on different parameters; based on retrieval-enhanced generation technology, it uses a re-ranking model to search the knowledge base according to the target condition parameters, retrieves the target prompt word template according to the target action parameters, and retrieves the large language model. Based on the target prompt word template, search results, target condition parameters, target topic parameters, and user input data, it executes a document-assisted generation operation based on document-assisted generation instructions. By integrating the knowledge base retrieval and generation models, it can efficiently assist in the generation of high-quality documents.

[0081] like Figure 2 The diagram shown is a functional block diagram of a preferred embodiment of the document-assisted generation device of the present invention. The document-assisted generation device 11 includes a construction unit 110, a parsing unit 111, a recognition unit 112, a retrieval unit 113, a retrieval unit 114, and an execution unit 115. The module / unit referred to in this invention refers to a series of computer program segments that can be executed by a processor and perform a fixed function, and are stored in memory. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.

[0082] The construction unit 110 is used to construct a knowledge base based on a parent-child segmentation mechanism. The parsing unit 111 is used to respond to a document-assisted generation instruction triggered by a target user, and parse the document-assisted generation instruction to obtain the user input data of the target user; The recognition unit 112 is used to perform parameter recognition on the user input data to obtain target condition parameters, target action parameters and target topic parameters; The retrieval unit 113 is used to perform a retrieval in the knowledge base based on the target condition parameters using a re-ranking model based on retrieval enhancement generation technology, and obtain retrieval results. The retrieval unit 114 is used to retrieve the target prompt word template according to the target action parameters; The execution unit 115 is used to retrieve the large language model and perform a document-assisted generation operation based on the document-assisted generation instruction according to the target prompt word template, the search results, the target condition parameters, the target topic parameters and the user input data.

[0083] As can be seen from the above technical solutions, this invention can construct a knowledge base based on a parent-child segmentation mechanism, ensuring that segmentation operations do not damage the integrity of the content; it identifies parameters in user input data to obtain target condition parameters, target action parameters, and target topic parameters, so as to facilitate targeted responses based on different parameters; based on retrieval-enhanced generation technology, it uses a re-ranking model to search the knowledge base according to the target condition parameters, retrieves the target prompt word template according to the target action parameters, and retrieves the large language model. Based on the target prompt word template, search results, target condition parameters, target topic parameters, and user input data, it executes a document-assisted generation operation based on document-assisted generation instructions. By integrating the knowledge base retrieval and generation models, it can efficiently assist in the generation of high-quality documents.

[0084] like Figure 3 The diagram shown is a schematic representation of the computer device used to implement the document-assisted generation method of the present invention.

[0085] The computer device 1 may include a memory 12, a processor 13, and a bus (the arrow in the figure represents the bus), and may also include a computer program stored in the memory 12 and executable on the processor 13, such as a document generation program.

[0086] Those skilled in the art will understand that the schematic diagram is merely an example of computer device 1 and does not constitute a limitation on computer device 1. Computer device 1 can be either a bus topology or a star topology. Computer device 1 may also include more or fewer other hardware or software than shown in the diagram, or different component arrangements. For example, computer device 1 may also include input / output devices, network access devices, etc.

[0087] It should be noted that the computer device 1 described is merely an example. Other existing or future electronic products that are adaptable to this invention should also be included within the scope of protection of this invention and are incorporated herein by reference.

[0088] The memory 12 includes at least one type of readable storage medium, such as flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 12 can be an internal storage unit of the computer device 1, such as a portable hard drive of the computer device 1. In other embodiments, the memory 12 can be an external storage device of the computer device 1, such as a plug-in portable hard drive, smart media card (SMC), secure digital card (SD), flash card, etc., equipped on the computer device 1. Furthermore, the memory 12 can include both internal and external storage units of the computer device 1. The memory 12 can be used not only to store application software and various types of data installed on the computer device 1, such as the code of a document generation program, but also to temporarily store data that has been output or will be output.

[0089] In some embodiments, the processor 13 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits packaged with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 13 is the control unit of the computer device 1, connecting various components of the computer device 1 via various interfaces and lines. It performs various functions of the computer device 1 and processes data by running or executing programs or modules stored in the memory 12 (e.g., executing document generation programs) and accessing data stored in the memory 12.

[0090] The processor 13 executes the operating system of the computer device 1 and various installed applications. The processor 13 executes the applications to implement the steps in the above-described embodiments of the document-assisted generation method, for example... Figure 1 The steps are shown.

[0091] For example, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules / units may be a series of computer-readable instruction segments capable of performing a specific function, which describe the execution process of the computer program in the computer device 1. For example, the computer program may be divided into a construction unit 110, a parsing unit 111, an identification unit 112, a retrieval unit 113, a retrieval unit 114, and an execution unit 115.

[0092] The integrated unit implemented as a software functional module described above can be stored in a computer-readable storage medium. This software functional module, stored in a storage medium, includes several instructions to cause a computer device (which may be a personal computer, computer equipment, or network device, etc.) or processor to execute portions of the document-assisted generation method described in the various embodiments of the present invention.

[0093] If the modules / units integrated in the computer device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware devices. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above.

[0094] The computer program includes computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory, etc.

[0095] Furthermore, the computer-readable storage medium may primarily include a stored program area and a stored data area, wherein the stored program area may store the operating system, an application program required for at least one function, etc.; and the stored data area may store data created based on the use of blockchain nodes, etc.

[0096] The blockchain referred to in this invention is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0097] The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, in... Figure 3 The bus is represented by only one straight line, but this does not mean that there is only one bus or one type of bus. The bus is configured to enable communication between the memory 12 and at least one processor 13, etc.

[0098] Although not shown, the computer device 1 may also include a power supply (such as a battery) to power various components. Preferably, the power supply can be logically connected to the at least one processor 13 through a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The computer device 1 may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0099] Furthermore, the computer device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, a Bluetooth interface, etc.), which is typically used to establish communication connections between the computer device 1 and other computer devices.

[0100] Optionally, the computer device 1 may further include a user interface, which may be a display, an input unit (such as a keyboard), and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the computer device 1 and to display a visual user interface.

[0101] It should be understood that the embodiments described are for illustrative purposes only and are not limited to this structure in the scope of the patent application.

[0102] It will be understood by those skilled in the art that Figure 3 The structure shown does not constitute a limitation on the computer device 1, and may include fewer or more components than shown, or combine certain components, or have different component arrangements.

[0103] Combination Figure 1 The memory 12 in the computer device 1 stores multiple instructions to implement a document-assisted generation method, and the processor 13 can execute the multiple instructions to achieve the following: A knowledge base is built based on a parent-child segmentation mechanism; In response to a document-assisted generation instruction triggered by a target user, the document-assisted generation instruction is parsed to obtain the user input data of the target user; The user input data is subjected to parameter recognition to obtain target condition parameters, target action parameters, and target topic parameters; Based on retrieval enhancement generation technology, a re-ranking model is used to search the knowledge base according to the target condition parameters to obtain retrieval results; Retrieve the target prompt word template based on the target action parameters; The large language model is invoked, and a document-assisted generation operation based on the target prompt word template, the search results, the target condition parameters, the target topic parameters, and the user input data is executed.

[0104] Specifically, the processor 13's implementation method for the above instructions can be found in [reference needed]. Figure 1 The descriptions of the relevant steps in the corresponding embodiments are not repeated here.

[0105] It should be noted that all data involved in this case was legally obtained. Software tools or components not belonging to this company that appear in the embodiments of this application are merely illustrative examples and do not represent actual use.

[0106] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0107] This invention can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This invention can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This invention can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0108] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0109] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0110] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0111] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.

[0112] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices described in this invention can also be implemented by a single unit or device through software or hardware. Terms such as "first," "second," etc., are used to indicate names and do not indicate any specific order.

[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A document-assisted generation method, characterized in that, The document-assisted generation method includes: A knowledge base is built based on a parent-child segmentation mechanism; In response to a document-assisted generation instruction triggered by a target user, the document-assisted generation instruction is parsed to obtain the user input data of the target user; The user input data is subjected to parameter recognition to obtain target condition parameters, target action parameters, and target topic parameters; Based on retrieval enhancement generation technology, a re-ranking model is used to search the knowledge base according to the target condition parameters to obtain retrieval results; Retrieve the target prompt word template based on the target action parameters; The large language model is invoked, and a document-assisted generation operation based on the target prompt word template, the search results, the target condition parameters, the target topic parameters, and the user input data is executed.

2. The document-assisted generation method as described in claim 1, characterized in that, The knowledge base constructed based on the parent-child segmentation mechanism includes: When a standard document is detected to be uploaded on the dify large language model application development platform, the standard document is split into multiple text segments based on the parent-child segmentation mechanism. Convert the multiple text segments into embedding vectors; The knowledge base is constructed based on the embedding vector.

3. The document-assisted generation method as described in claim 1, characterized in that, The step of performing parameter recognition on the user input data to obtain target condition parameters, target action parameters, and target topic parameters includes: The named entity recognition model is used to identify the time parameter, location parameter, recorded institution in the knowledge base, subject, and target institution in the user input data as the target condition parameters. The user input data is subjected to intent recognition to obtain the target action parameters; Obtain the user group to which the target user belongs, retrieve the BERT-based classifier corresponding to the user group to which the target user belongs as the target classifier, and use the target classifier to process the user input data to obtain the target topic parameters.

4. The document-assisted generation method as described in claim 1, characterized in that, Before retrieving the target prompt word template based on the target action parameters, the method further includes: Configure the prompt word template corresponding to each action parameter.

5. The document-assisted generation method as described in claim 1, characterized in that, The step of retrieving the large language model and performing a document-assisted generation operation based on the document-assisted generation instruction according to the target prompt word template, the search results, the target condition parameters, the target topic parameters, and the user input data includes: When the target action parameter is a summary, the large language model is used to summarize the search results based on the target prompt word template to obtain a summary result, and the summary result is output. When the target action parameter is a recommendation, the search result is returned using the large language model; When the target action parameter is document generation, the target document is generated based on the target prompt word template using the large language model, according to the target condition parameters and the search results, and the target document is output. When the target action parameter is document polishing, the large language model is used to polish the text based on the target prompt word template and the user input data to obtain the polishing result, and the polishing result is output.

6. The document-assisted generation method as described in claim 1, characterized in that, The step of retrieving the large language model and performing a document-assisted generation operation based on the document-assisted generation instruction according to the target prompt word template, the search results, the target condition parameters, the target topic parameters, and the user input data further includes: When the target action parameter is an open-ended question, the large language model is used to answer the question in the user input data based on the target prompt word template and the search results.

7. The document-assisted generation method as described in claim 6, characterized in that, The step of using the large language model to answer questions in the user input data based on the target prompt word template and the search results includes: Obtain the similarity threshold; Obtain the similarity of each sub-retrieval result in the retrieval results obtained when the re-ranking model is used to search the knowledge base according to the target condition parameters; When the similarity of a target sub-retrieval result is greater than the similarity threshold, the large language model is used to conduct a multi-turn dialogue based on the target prompt word template, the target sub-retrieval result, and the questions in the user input data; When no sub-search result corresponds to a similarity greater than the similarity threshold, the large language model is used to conduct multi-turn dialogue based on the target prompt word template, the large language model's own knowledge, and the questions in the user input data; In this process, the dialogue records from each round are recorded as historical parameters and input into the next round of dialogue.

8. A document-aided generation device, characterized in that, The document-assisted generation device includes: Building units are used to construct knowledge bases based on a parent-child segmentation mechanism; The parsing unit is used to respond to a document-assisted generation instruction triggered by a target user, and parse the document-assisted generation instruction to obtain the user input data of the target user; The identification unit is used to identify parameters in the user input data to obtain target condition parameters, target action parameters, and target topic parameters. The retrieval unit is used to perform retrieval in the knowledge base based on the target condition parameters using a re-ranking model, based on retrieval enhancement generation technology, to obtain retrieval results. The retrieval unit is used to retrieve the target prompt word template according to the target action parameters; The execution unit is used to retrieve the large language model and perform a document-assisted generation operation based on the document-assisted generation instruction according to the target prompt word template, the search results, the target condition parameters, the target topic parameters and the user input data.

9. A computer device, characterized in that, The computer device includes: A memory for storing at least one instruction; and a processor for executing the instructions stored in the memory to implement the document-assisted generation method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, which is executed by a processor in a computer device to implement the document-assisted generation method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Text search intention recognition method and device, electronic equipment and storage medium

    CN114579703A

  • Professional document generation method and device, computer equipment and storage medium

    CN117454863A

  • Official document writing method, device and storage medium based on big model

    CN119761312A

  • Question and answer method and device based on large model, electronic equipment and medium

    CN119884300A

  • Construction plan generation method and device, electronic equipment and storage medium

    CN120106797A