Document generation method and electronic device

Through the document generation method based on the knowledge base and artificial intelligence generation engine, the time-consuming and labor-intensive problem of traditional document generation is solved, and efficient and accurate intelligent document generation is achieved.

CN120146022BActive Publication Date: 2025-08-22QINGDAO KNOWLEDGE VALLEY CLOUD TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510629595.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-16
Publication Date
2025-08-22
Estimated Expiration
2045-05-16

AI Technical Summary

Technical Problem

Traditional document generation relies on manual entry, which is time-consuming and labor-intensive and error-prone, and cannot meet the needs of intelligence.

Method used

Based on the knowledge base and artificial intelligence generation engine, the document generation process is automated by determining target templates, replacing module placeholders and generating knowledge content, and combining the knowledge base and AI generation engine to intelligently generate documents.

Benefits of technology

Reduce user workload, improve document generation efficiency and accuracy, and realize intelligent document generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120146022B_ABST
    Figure CN120146022B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of data processing technology, and provides a document generation method and electronic device. The method includes: determining a target template from a preset knowledge base according to a document generation request, wherein the target template includes fixed content information and module placeholders; retrieving a target knowledge module from the preset knowledge base based on document configuration information and configuration rules, and replacing the module placeholder with the target knowledge module, wherein the configuration rules include a mapping relationship between the document configuration information and the knowledge module in the preset knowledge base; when there is a module placeholder that has not been replaced by the target knowledge module in the module placeholder, generating knowledge content through an artificial intelligence generation engine, replacing the corresponding module placeholder with the knowledge content, and integrating the target knowledge module and the knowledge content into the document. The present application can generate documents based on a knowledge base, or intelligently generate documents based on a knowledge base and an artificial intelligence generation engine, which can reduce user workload and improve document generation efficiency and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a document generation method and an electronic device. Background Art

[0002] From the perspective of user needs and product management, product documentation (including accompanying documents, CE (Safety Conformity Mark) certification materials, R&D process documentation, manufacturing process documentation, and usage process documentation) has become an indispensable component of a product. With the rapid development of technology, there is an increasing demand for intelligent product documentation generation. Traditional document generation mostly relies on manual data entry, which is not only time-consuming and labor-intensive, but also prone to generating errors. Summary of the Invention

[0003] In view of this, the embodiments of the present application provide a document generation method and electronic device that can generate documents based on a knowledge base, or intelligently generate documents based on a knowledge base and an artificial intelligence generation engine. While reducing the user's workload, it can also improve the efficiency and accuracy of document generation.

[0004] To achieve the above objectives, this application adopts the following technical solutions:

[0005] In a first aspect, an embodiment of the present application provides a document generation method, comprising:

[0006] Determining a target template from a preset knowledge base according to a document generation request, wherein the document generation request includes information related to the subject content and chapter content of the document, the document generation request is used to request generation of one document or multiple interrelated documents, and the target template is one template or multiple templates, the target template includes fixed content information and module placeholders, and the module placeholders are set at preset positions in the target template;

[0007] Retrieving a target knowledge module from the preset knowledge base based on the document configuration information and pre-constructed configuration rules, and replacing the module placeholder with the target knowledge module, wherein the pre-constructed configuration rules include a mapping relationship between the document configuration information and the knowledge modules in the preset knowledge base;

[0008] When there are module placeholders in the module placeholders that have not been replaced by the target knowledge module, knowledge content is generated by an artificial intelligence generation engine, and the knowledge content is used to replace the module placeholders in the module placeholders that have not been replaced by the target knowledge module, so that the target knowledge module and the knowledge content are integrated into the document; wherein, the multiple related documents share the same module placeholder, and the corresponding information in the multiple related documents is synchronously managed and updated through the same module placeholder.

[0009] Based on the first aspect, in some embodiments, generating knowledge content by an artificial intelligence generation engine, replacing module placeholders that are not replaced by the target knowledge module with the knowledge content, and integrating the target knowledge module and the knowledge content into a document includes:

[0010] Acquire, from the fixed content information, contextual content of the module placeholders that are not replaced by the target knowledge module in the module placeholders;

[0011] generating structured information according to the context content and preset structural constraints;

[0012] Inputting the structured information into the artificial intelligence generation engine to generate knowledge content;

[0013] The module placeholders that are not replaced by the knowledge modules are replaced by the knowledge content, and the target knowledge module and the knowledge content are integrated into the document.

[0014] Based on the first aspect, in some embodiments, determining a target template from a preset knowledge base according to the document generation request includes:

[0015] Determine the subject content, chapter content, and content keywords of the document according to the document generation request;

[0016] Determining a historical matching success rate of each first template in the preset knowledge base, where the first template is a template in the preset knowledge base that is related to the subject content of the document;

[0017] Calculating semantic similarity between the content keywords and template keywords of the first template;

[0018] Calculating the structural matching degree between the chapter content of the document and the chapter content of the first template;

[0019] The target template is determined from the first templates according to the historical matching success rate, the semantic similarity and the structural matching degree.

[0020] Based on the first aspect, in some embodiments, calculating the semantic similarity between the content keyword and the template keyword of the first template includes: converting the content keyword into a first word vector and converting the template keyword into a second word vector; calculating the similarity between the first word vector and the second word vector, and determining the semantic similarity based on the similarity;

[0021] The method for calculating the structural matching degree between the chapter content of the document and the chapter content of the first template includes: pre-constructing a knowledge graph of the chapter content of each template in the preset knowledge base, wherein the nodes in the knowledge graph represent the chapter titles, and the edges in the knowledge graph represent the relationship types between chapters, wherein the relationship types include hierarchical nested relationships, sequential relationships, and semantic association relationships; comparing and matching the knowledge graph of the chapter content of the first template with the knowledge graph of the chapter content of the document to determine the structural matching degree between the chapter content of the document and the chapter content of the first template.

[0022] Based on the first aspect, in some embodiments, determining the target template from the first template according to the historical matching success rate, the semantic similarity, and the structural matching degree includes:

[0023] Setting a first weight, a second weight, and a third weight for the historical matching success rate, the semantic similarity, and the structural matching degree, respectively;

[0024] performing a weighted summation of the historical matching success rate, the semantic similarity, and the structural matching degree according to the first weight, the second weight, and the third weight to determine a matching value of each template in the first template;

[0025] One or more templates with the highest matching values ​​among the first templates are determined as target templates.

[0026] Based on the first aspect, in some embodiments, the method for constructing the configuration rule includes:

[0027] Build a document template, which contains fixed content information;

[0028] Adding a module placeholder in the document template and setting a knowledge module list corresponding to the module placeholder, wherein the knowledge module list includes multiple knowledge modules, and all or part of the module placeholders added in the document template correspond to at least one knowledge module in the knowledge module list;

[0029] Creating a configuration condition list, the configuration condition list comprising at least one configuration condition and at least one configuration option corresponding to each configuration condition in the at least one configuration condition;

[0030] A mapping relationship is established between each configuration option and each knowledge module in the knowledge module list.

[0031] Based on the first aspect, in some embodiments, the document generation method includes:

[0032] Parsing the generated document to determine the title hierarchy and numbering continuity, and checking and verifying the format of the generated document based on the title hierarchy and numbering continuity to obtain a format checking result;

[0033] Segmenting the generated document to obtain a plurality of words, and comparing the plurality of words with the corporate terms in the preset knowledge base to obtain corporate terminology check results;

[0034] Check whether the chapter content of the generated document is missing, and whether the reference relationship and logic between each document are correct, and obtain the content integrity check result;

[0035] Check whether the generated documents meet the normative standards and obtain the normative compliance check results;

[0036] A final check result of the document is generated according to the format check result, the enterprise terminology check result, the content integrity check result and the specification compliance check result.

[0037] Based on the first aspect, in some embodiments, the document generation method includes:

[0038] In the process of generating a document, responding to an enterprise terminology search request, matching words in the document with enterprise terminology in the preset knowledge base;

[0039] If a word in the document is inconsistent with the enterprise term with the highest matching degree, a word replacement prompt is generated;

[0040] In response to the word replacement instruction, the word is replaced with the enterprise term with the highest matching degree.

[0041] Based on the first aspect, in some embodiments, the document generation method includes:

[0042] An LRU cache is established, and the target template in the preset knowledge base is stored in the LRU cache.

[0043] In a second aspect, an embodiment of the present application provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the document generation method as described in any one of the first aspects is implemented.

[0044] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0045] In an embodiment of the present application, a target template is determined from a preset knowledge base based on a document generation request. The target template includes fixed content information and module placeholders reserved at preset positions in the target template. Based on the document configuration information and pre-built configuration rules, the target knowledge module is retrieved from the preset knowledge base, and the module placeholder is replaced by the target knowledge module. When there are module placeholders that have not been replaced by the target knowledge module in the module placeholders, knowledge content is generated by an artificial intelligence generation engine, and the knowledge content is used to replace the module placeholders that have not been replaced by the target knowledge module in the module placeholders, so that the target knowledge module and the knowledge content are integrated into the document.

[0046] In an embodiment of the present application, if there is a knowledge module corresponding to a module placeholder in the knowledge base, the knowledge module of the knowledge base is used to replace the corresponding module placeholder; if there is no knowledge module corresponding to the module placeholder in the knowledge base, the knowledge content generated by the artificial intelligence generation engine is used to replace the corresponding module placeholder, without the user having to edit the document from scratch. Therefore, the document can be intelligently generated based on the knowledge base, or intelligently generated based on the knowledge base and the artificial intelligence generation engine. While reducing the user's workload, the document generation efficiency and accuracy can also be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0048] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0049] Figure 2 This is a schematic diagram of a portion of the template provided in the embodiment of the present application;

[0050] Figure 3 This is a flowchart of a document generation method provided by an embodiment of the present application;

[0051] Figure 4 This is a schematic diagram of target template generation based on semantic dimension, structural dimension and historical dimension provided by an embodiment of the present application;

[0052] Figure 5 This is a schematic diagram of the configuration rules provided in the embodiment of the present application;

[0053] Figure 6 This is a schematic diagram of data interaction between the user terminal, server, and AI engine provided in an embodiment of the present application;

[0054] Figure 7 It is a schematic structural diagram of the document generation device provided by an embodiment of the present application;

[0055] Figure 8 It is a schematic diagram of the electronic device provided by an embodiment of the present application. Specific embodiments

[0056] The present application will be described more clearly below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the role of the present application, but do not limit the present application in any form. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can be made. These all belong to the protection scope of the present application.

[0057] To make the purpose, technical solution and advantages of the present application clearer, the following will be described through specific embodiments with reference to the accompanying drawings.

[0058] See Figure 1 , the application scenario of the present application may include one or more user terminals, a set of electronic devices and a set of AI engines, and the AI engine is an artificial intelligence generation engine.

[0059] Specifically, taking the generation of a tender document as an example for illustration, but it is not limited that the document in the present application is a tender document, and it can also be various documents such as a product description document, a contract document, etc. When a user needs to generate a tender document, the user can input a text carrying the requirements for generating the tender document (such as generating a tender document with the requirement of XXX) or upload a file carrying the requirements for generating the tender document (such as the tender requirement document issued by the tender inviting party) or check the tender generation requirements in the preset area of the user terminal display interface. The user terminal identifies and determines the requirements for generating the tender document, and generates a document generation request according to the requirements for generating the tender document and reports it to the electronic device. The electronic device responds to the document generation request, determines the target template from the preset knowledge base, and sends the target template to the user terminal for display. The target template contains fixed content information and module placeholders. Figure 2 is part of the template, where "<zsgText_Enterprise Abbreviation>A<zsgText_Enterprise Abbreviation>" and "<zsgModule_Random Document List>Random Document List<zsgModule_Random Document List>" are placeholders, and other content is fixed content. In the embodiments of the present application, the tender document can be generated by simply filling in the corresponding content at the module placeholder of the target template.

[0060] Afterwards, the user enters or selects document configuration information on the user end and sends it to the electronic device. Based on the document configuration information and pre-established configuration rules, the electronic device retrieves the corresponding knowledge modules (which can be text, images, and / or numbers, etc.) from the preset knowledge base and fills them in the module placeholders. For module placeholders where no knowledge modules can be retrieved from the preset knowledge base, the electronic device can send a dynamic content generation request to the AI ​​engine. The AI ​​engine generates knowledge content based on the dynamic content generation request and returns it to the electronic device. The electronic device then fills the knowledge content returned by the AI ​​engine in the corresponding module placeholders, thereby generating a preliminary bid document.

[0061] The electronic device then sends the preliminary bid document to the client for display. The user confirms the content of the preliminary bid document through the client, particularly the knowledge content generated by the AI ​​engine. After the user confirms or modifies the document, the electronic device performs further processing on the bid document and sends the final electronic bid document to the client. This completes the bid document generation process.

[0062] The preset knowledge base described in the embodiment of the present application stores multiple knowledge modules, which can be generated after processing the enterprise's data, files, etc. The knowledge module can be a collection of data knowledge, information knowledge, pattern knowledge, etc.

[0063] Specifically, data knowledge is a collection of facts, numbers, symbols, or descriptive materials in their raw form. Data knowledge is typically unorganized, lacking clear meaning or context. Data knowledge can take the form of numbers, text, images, sounds, and more. For example, a set of numbers, a paragraph of text, or an image can all be considered data.

[0064] Information knowledge is the meaningful content obtained through the processing and interpretation of data. It is the result of organizing, classifying, analyzing, and interpreting data, and it possesses context and meaning. Information knowledge can aid understanding and decision-making. For example, calculating a set of numbers and drawing conclusions, organizing and summarizing a text, or analyzing and interpreting an image all contribute to information knowledge.

[0065] Pattern knowledge refers to proven, effective work processes developed through long-term work. The characteristic of pattern knowledge is that the process itself need not be questioned; simply following the process's requirements will yield the desired results. This characteristic allows us to refine and summarize this knowledge, normalizing, generalizing, and standardizing patterns across diverse forms, characteristics, and characteristics, thereby enabling automation using computer technology.

[0066] In the embodiment of the present application, the preset knowledge base can be stored in the above-mentioned electronic device, or in other devices other than the above-mentioned electronic device, and this is not limited.

[0067] Furthermore, the data in a knowledge module can come entirely from the pre-set knowledge base, or partially from the pre-set knowledge base and partially from an external system, such as an ERP (Enterprise Resource Planning) system. If part of the data in a knowledge module comes from an external system, the target knowledge module can be retrieved from the pre-set knowledge base while simultaneously retrieving related data from the external system.

[0068] In an embodiment of the present application, one document can be generated at a time, or multiple interrelated documents can be generated at a time. For the scenario of generating multiple interrelated documents at a time, a preset knowledge base, a set of document configuration information, and a set of configuration rules can be shared. The module placeholders in each document can be replaced with corresponding knowledge modules using the preset knowledge base, the set of document configuration information, and the set of configuration rules, thereby generating multiple interrelated documents at a time.

[0069] See also Figure 3 The document generation method provided in the embodiment of the present application may include steps 101 to 103. The document generation method may be applied to an electronic device, which may be a server. The document generation method is described in detail as follows:

[0070] Step 101: Determine a target template from a preset knowledge base according to a document generation request.

[0071] The document generation request includes information related to the subject content and chapter content of the document. The document generation request is used to request the generation of one document or multiple interrelated documents. The target template is one template or multiple templates. The target template includes fixed content information and module placeholders. The module placeholders are set at preset positions in the target template. The subject content of the document can be information that can represent the purpose and use of the document. The purpose and use of the document can specifically be a description of the product, a bid in response to a tender, a technical contract, etc. The chapter content can be the chapters contained in the document and the logical structure between the chapters, etc.

[0072] Specifically, fixed content information can be fixed content within a document, while dynamic content that changes as the document changes can be replaced with module placeholders. Users can enter document configuration information through the user terminal, and then the knowledge module corresponding to the module placeholder is determined from a preset knowledge base based on the document configuration information, and the knowledge module is used to replace the module placeholder.

[0073] In some embodiments, the implementation process of step 101 may include: determining the subject content, chapter content and content keywords of the document based on the document generation request; determining the historical matching success rate of each first template in the preset knowledge base, where the first template is a template in the preset knowledge base related to the subject content of the document; calculating the semantic similarity between the content keywords and the template keywords of the first template; calculating the structural matching between the chapter content of the document and the chapter content of the first template; and determining the target template from the first template based on the historical matching success rate, semantic similarity and structural matching.

[0074] In an embodiment of the present application, a plurality of document templates may be stored in a preset knowledge base, and each document template may correspond to a document template name, template keywords, and chapter content. The number of historical matching successes for each document template may be recorded, and based on this, the historical matching success rate of each document template in the first template related to the subject content of the above document in the preset knowledge base may be determined. The above historical matching success rate may be the probability that a document template is selected by a user after being recommended to the user. For example, a document template is recommended to a user as a target template M times, and the number of times selected by the user is N times, where N≤M, then the historical matching success rate of the document template is N / M.

[0075] See also Figure 4 For a document requirement (i.e., selecting a target template for document generation), the target template can be selected based on three dimensions: semantic, structural, and historical. For the semantic dimension, the semantic similarity between the content keywords and the template keywords can be calculated; for the structural dimension, the structural match between the chapter content and the template chapter content can be calculated; and for the historical dimension, the historical matching success rate of each template can be calculated. The matching value of each template can then be calculated by taking a weighted sum of the historical matching success rate, semantic similarity, and structural matching.

[0076] For example, the above calculation of the semantic similarity between the content keywords and the template keywords of the first template may specifically include: converting the content keywords into a first word vector and converting the template keywords into a second word vector; calculating the similarity between the first word vector and the second word vector, and determining the semantic similarity based on the similarity.

[0077] For example, the above calculation of the structural matching degree between the chapter content of the document and the chapter content of the first template can specifically include: pre-constructing a knowledge graph of the chapter content of each template in a preset knowledge base, the nodes in the knowledge graph represent the chapter titles, and the edges in the knowledge graph represent the relationship types between chapters, and the relationship types include hierarchical nested relationships, sequential relationships and semantic association relationships; comparing and matching the knowledge graph of the chapter content of the first template with the knowledge graph of the chapter content of the document to determine the structural matching degree between the chapter content of the document and the chapter content of the first template.

[0078] Exemplarily, the above-mentioned determination of the target template from the first template based on the historical matching success rate, semantic similarity and structural matching degree may specifically include: setting a first weight, a second weight and a third weight for the historical matching success rate, semantic similarity and structural matching degree, respectively; performing weighted summation of the historical matching success rate, semantic similarity and structural matching degree according to the first weight, the second weight and the third weight to determine the matching value of each template in the first template; and determining one or more templates with the highest matching value in the first template as the target template.

[0079] In this embodiment, the first template may be multiple templates. After calculating the matching values ​​of each template in the first template, the matching values ​​may be sorted from largest to smallest, and the templates corresponding to one or more matching values ​​with the highest sorting values ​​may be recommended to the user terminal as target templates. The user may select one template from these templates as the final template to be used.

[0080] Exemplarily, the sum of the first weight, the second weight and the third weight is 1, the initial value of the first weight can be 0.2, the initial value of the second weight can be 0.5, and the initial value of the third weight can be 0.3. The values ​​of the three weights can be dynamically adjusted according to the matching values ​​of each template in the first template and the template finally selected by the user, so that the template with the highest matching value calculated according to the three weights is consistent with the template finally selected by the user.

[0081] In some examples, the implementation scenario of step 101 may be: obtaining text input by the user through the user terminal, which contains key information representing the subject content of the document; determining the subject content of the document based on the key information, and determining the chapter content based on the subject content of the document.

[0082] For example, the user terminal receives the text: Generate XX product instruction manual. The user terminal can extract key information containing the subject content of the document (such as product instructions) from the text, thereby determining that the subject content of the document is the product instructions. Afterwards, the user terminal determines the chapter content of the document based on the subject content of the document, such as the title hierarchy, numbering hierarchy, the relationship between chapters, the relationship between paragraphs, etc. The user terminal can pre-install a database of the subject content and chapter content of the document. The database stores the subject content of multiple documents and multiple chapter contents. The subject content of each document corresponds to a chapter content. Therefore, the chapter content corresponding to the subject content of a known document can be determined through the database.

[0083] In some other examples, the implementation scenario of step 101 may be: the user terminal receives text and a document, the text contains key information representing the subject content of the document, determines the subject content of the document based on the key information, and then determines the chapter content of the document to be produced based on the subject content of the document and the chapter content of the received document.

[0084] For example, a user terminal receives a tender requirement document and a text message: Generate a tender document (i.e., a bid document). The user terminal determines from the text that the user wants to generate a tender document and determines that the subject content of the document is a tender document. Based on the tender requirement document uploaded by the user, the tender industry, field, company, requirements, and other information are determined to determine the chapter content of the tender document, such as the title hierarchy, numbering hierarchy, the relationship between chapters, the relationship between paragraphs, etc. Similarly, a database of the subject content and chapter content of documents can be pre-installed in the user terminal. The database stores the subject content and chapter content of multiple documents. The subject content of each document corresponds to a chapter content. Therefore, the chapter content corresponding to the subject content of a known document can be determined through the database.

[0085] The implementation scenario of step 101 is described below using a specific application example of generating a tender document.

[0086] To generate a bid document, the user enters "Generate bid, requirements are XXX" in the corresponding location on the user interface, or enters "Generate bid" and a tender requirement document, or selects the bid generation requirement. The user interface can then determine, based on the user's input, that the user needs to generate a bid document, generate a bid document generation request based on this information, and send it to the electronic device (e.g., a server), along with the tender requirement document (if any).

[0087] The electronic device then determines the subject content, chapter content, and content keywords of the bid document to be generated based on the bid document generation request and tender requirements document. The subject content indicates the document type; in this embodiment, it is the bid document. The chapter content indicates the chapter content structure of the bid document, including the title hierarchy, numbering hierarchy, relationships between chapters, and relationships between paragraphs. Content keywords indicate information such as the bid document's industry sector and company name.

[0088] Afterwards, the electronic device determines the bid document template from the semantic dimension, structural dimension and historical dimension of all templates stored in the knowledge base based on the determined subject content, chapter content and content keywords. Please refer to the following for how to determine the bid document template from the semantic dimension, structural dimension and historical dimension. Figure 4 The aforementioned related content will not be repeated here.

[0089] Step 102: retrieve a target knowledge module from a preset knowledge base based on the document configuration information and pre-built configuration rules, and replace the module placeholder with the target knowledge module.

[0090] The pre-built configuration rules may include a mapping relationship between document configuration information and knowledge modules in a preset knowledge base.

[0091] In some scenarios, after determining one or more target templates, the user can select one to use. The user then displays the document configuration content on a display interface for the user to select. After the user selects, the user receives the document configuration information and then retrieves the target knowledge module from a pre-set knowledge base based on the document configuration information and pre-built configuration rules.

[0092] Exemplarily, the method for constructing configuration rules may specifically include: constructing a document template, in which case no module placeholder is set in the document template, and only fixed content information is provided; adding module placeholders to the document template, and setting a knowledge module list corresponding to the module placeholder, wherein the knowledge module list may include multiple knowledge modules, and all module placeholders or some module placeholders added to the document template may correspond to at least one knowledge module in the knowledge module list; creating a configuration condition list, wherein the configuration condition list includes at least one configuration condition and at least one configuration option corresponding to each configuration condition in the at least one configuration condition; and establishing a mapping relationship between each configuration option and each knowledge module in the knowledge module list. Wherein, the configuration option is a requirement option corresponding to the configuration condition. For example, if the configuration condition is "the output country and region of the product", the configuration options may include countries and regions in the world, and a configuration option is set for each country and region.

[0093] In an embodiment of the present application, each module placeholder added in the document template can correspond to at least one knowledge module in the knowledge module list, or some module placeholders have no corresponding knowledge modules. In the case where the module placeholder has no corresponding knowledge module, the knowledge content can be generated by the artificial intelligence generation engine in step 103.

[0094] It should be noted that when constructing configuration rules, you can first construct a document template and then create a configuration condition list, or you can first create a configuration condition list and then construct a document template, or you can simultaneously execute the construction of a document template and a configuration condition list. This embodiment of the present application does not limit this.

[0095] like Figure 5 As shown, in Figure 5 In the configuration condition list area, the configuration conditions are on the right. Figure 5 The figure shows two configuration conditions: Consulting Services and Typical Case Studies. These conditions can be presented in the user interface as "What kind of consulting services do you want?" and "What typical cases do you want?" The left side of the configuration condition list displays configuration options for each condition. For the Consulting Services condition, the options are Machine Safety, Reliability, Modularity and Product Configuration, and Digital Factory. For the Typical Case study condition, the options are Machine Safety Case - Company R, Machine Safety Case - Company X, and Machine Safety Case - Company Z.

[0096] Figure 5 The module placeholder area in the template contains two module placeholders: Typical Cases and Consulting Services. The Typical Case module placeholder corresponds to three knowledge modules: Typical Case - Machine Safety Case - Company R, Typical Case - Machine Safety Case - Company X, and Typical Case - Machine Safety Case - Company Z. This means that the information corresponding to these three knowledge modules, Typical Case - Machine Safety Case - Company R, Typical Case - Machine Safety Case - Company X, and Typical Case - Machine Safety Case - Company Z, can be imported into the Typical Case module placeholder in the template. The Consulting Services module placeholder corresponds to four knowledge modules: Consulting Services - Machine Safety, Consulting Services - Modularity and Product Configuration, Consulting Services - Digital Factory, and Consulting Services - Reliability. This means that the information corresponding to these four knowledge modules, Consulting Services - Machine Safety, Consulting Services - Modularity and Product Configuration, Consulting Services - Digital Factory, and Consulting Services - Reliability, can be imported into the Consulting Services module placeholder in the template.

[0097] After constructing the above configuration condition list, module placeholders and knowledge modules, it is also necessary to construct the associated mapping relationship between each configuration option of the configuration condition and each knowledge module. Figure 5As shown, the configuration option of machine safety can be associated and mapped with the knowledge modules such as Typical Case-Machine Safety Case-R Company, Typical Case-Machine Safety Case-X Company and Typical Case-Machine Safety Case-Z Company corresponding to the placeholder of the module Typical Case, and can also be associated and mapped with the knowledge module of Consulting Service Machine Safety corresponding to the placeholder of the module Consulting Service.

[0098] For the configuration options such as reliability, modularity and product configuration, digitalization, machine safety case-R company, machine safety case-X company and machine safety case-Z company, the mapping relationship between each configuration option and the knowledge module is as follows: Figure 5 As shown, no further details are given.

[0099] The document configuration information may be information generated after the user clicks and selects a configuration option in a configuration condition list displayed in the user terminal display interface. For example, the user terminal generates the document configuration information based on the configuration option selected by the user.

[0100] For example, a user enters text on a client. Upon learning that the user wishes to configure and generate a document, the client displays multiple configuration conditions required for document generation on a display interface, with multiple configuration options set for each condition. The user selects the configuration options for each condition as needed, and the client generates document configuration information based on the user's selections.

[0101] Optionally, you can set an "Other" option in the configuration options for all or some of the configuration conditions. The content of this "Other" option is filled in by the user according to actual needs. For example, if a user wants to display relevant information about intellectual property in a document, the user can enter "Intellectual Property" in the "Other" option. If there are knowledge modules related to intellectual property in the knowledge base, the knowledge modules in the knowledge base can be associated with intellectual property and this configuration option. If there are no knowledge modules related to intellectual property in the knowledge base, the AI ​​engine can generate knowledge content related to intellectual property.

[0102] For example, a user enters text on the client side. The client side then learns that the user wishes to configure and generate a document. The client then displays multiple configuration conditions required for document generation, with multiple configuration options for each condition. The user selects the options for each condition as needed. The user also specifies individual requirements (such as intellectual property rights) in the "Other" section of some conditions. The client then generates document configuration information based on the user's selections.

[0103] The implementation scenario of step 102 is described below using a specific application example of generating a product description document.

[0104] First, build the configuration rules. Please refer to the above configuration rule building method.

[0105] Secondly, after determining the target template in step 101, the user terminal generates a control for the user to configure the document.

[0106] Specifically, the user terminal can generate several questions (i.e., the above configuration conditions), and set one or more question options (i.e., the above configuration options) under each question. For example, Question 1 could be: Where is the product sold? Question 2 could be: What language is the document written in? Question 3 could be: What industry does the product operate in? Question 4 could be: What content should the product manual include? Question 5 could be: Other.

[0107] Each of the above questions has one or more question options corresponding to it. For example, for question 1, you can set question options such as "Country A", "Country B", and "Country C" for users to choose from. For question 2, you can set question options such as "English", "Chinese", "Russian", and "French" for users to choose from. For question 3, you can set question options such as "Coal Mining Machinery", "Intelligent Robot", and "Chip Manufacturing" for users to choose from. For question 4, you can set question options such as "Name", "Purpose", "Specifications", "Circuit Structure", "Standards", "Precautions", "Configuration List", and "Installation Guide" for users to choose from. For question 5, users are required to enter personalized needs, that is, content that is not covered in the above questions but that users are more concerned about, for example, users can enter "intellectual property rights". Among them, "not covered in the above questions" means that there is no relevant knowledge module pre-stored in the preset knowledge base.

[0108] Users can select from the above questions and corresponding question options based on the actual situation of the product. The user terminal generates document configuration information based on the user's selection operation from the above questions and corresponding question options. The document configuration information specifically includes the questions and corresponding question options selected by the user. Specifically, the document configuration information may include: the product is sold in Country A and Country C, the document is in English, the product's industry field is intelligent robots, and the product manual must include the name, purpose, specifications, precautions, configuration list, installation and operation guide, etc. The above examples are only illustrative explanations for the convenience of others' understanding. The settings of questions and question options in actual products should be set according to actual conditions.

[0109] Next, the user terminal sends the document configuration information to the electronic device, and the electronic device retrieves the target knowledge module from the preset knowledge base according to the document configuration information and the configuration rules.

[0110] For example, for the document configuration information of "the product is sold in Country A and Country C, the document is in English, the industry field of the product is intelligent robots, and the product manual should include the name, purpose, specifications, precautions, configuration list, installation and operation guide, etc.", the knowledge module corresponding to each question option can be determined by the association mapping relationship between each question option in the configuration rule and each knowledge module in the preset knowledge base (usually text, picture and / or data).

[0111] Finally, replace the corresponding module placeholder with the target knowledge module and fill the content of the target knowledge module in the position of the corresponding module placeholder.

[0112] like Figure 5 As shown, the user selects the question (i.e., configuration condition) and question option (i.e., configuration option) in the user terminal, and then according to the association relationship between the configuration option and the knowledge module, the target knowledge module can be determined according to the question and question option selected by the user; and according to the association relationship between the module placeholder and the knowledge module in the figure, the module placeholder corresponding to the target knowledge module can be determined, thereby replacing the corresponding module placeholder with the target knowledge module, and filling the content of the target knowledge module in the position of the corresponding module placeholder.

[0113] Optionally, the document generation method may include establishing an LRU (Least Recently Used Cache) cache and storing target templates from a preset knowledge base in the LRU cache. The LRU cache stores multiple templates. When the LRU cache runs out of space, the least frequently used templates are removed first, and the more frequently used templates are retained. Frequently used templates are more likely to be selected by users than less frequently used templates. Therefore, frequently used templates can be stored in the LRU cache for quick retrieval.

[0114] In some examples, if all module placeholders in the target template can retrieve knowledge modules from the preset knowledge base through document configuration information and configuration rules, the knowledge modules can be retrieved from the preset knowledge base through step 102 to replace the module placeholders in the target template.

[0115] In some other examples, for all module placeholders in the target template, the knowledge modules of some module placeholders can be retrieved from the preset knowledge base through the document configuration information and configuration rules, but the knowledge modules of some module placeholders cannot be retrieved from the preset knowledge base through the document configuration information and configuration rules. For the module placeholders for which the knowledge modules can be retrieved, the knowledge modules are retrieved from the preset knowledge base in step 102 for replacement, and for the module placeholders for which the knowledge modules cannot be retrieved, the knowledge content is generated in step 103 for replacement.

[0116] Step 103: When there are module placeholders in the module placeholders that have not been replaced by the target knowledge module, knowledge content is generated by the artificial intelligence generation engine, and the module placeholders in the module placeholders that have not been replaced by the target knowledge module are replaced by the knowledge content, so that the target knowledge module and the knowledge content are integrated into the document.

[0117] Exemplarily, the above-mentioned generation of knowledge content through an artificial intelligence generation engine, using the knowledge content to replace the module placeholders in the module placeholders that have not been replaced by the target knowledge module, and fusing the target knowledge module and the knowledge content in the document may include: obtaining the context content of the module placeholders in the module placeholders that have not been replaced by the target knowledge module from the fixed content information; generating structured information based on the context content and preset structured constraints; inputting the structured information into the artificial intelligence generation engine to generate knowledge content; using the knowledge content to replace the module placeholders in the module placeholders that have not been replaced by the knowledge module, and fusing the target knowledge module and the knowledge content in the document.

[0118] For example, if a user enters "intellectual property" in the "Other" question and sets a module placeholder corresponding to this question, it can be determined that the document the user desires will include content related to intellectual property. Based on the context of this module placeholder, it can be determined whether a description of the types of intellectual property rights, the application process for intellectual property rights, or the intellectual property status of the product's industry is required. Preset structured constraints are used to limit the text content generated by the AI ​​generation engine to output to electronic devices according to preset rules, formats, and other requirements.

[0119] Exemplarily, the above-mentioned fusion of the target knowledge module and knowledge content in the document can be: using the target knowledge module to replace the module placeholder, and using the knowledge content to replace the module placeholders that are not replaced by the target knowledge module, thereby completing the fusion of the target knowledge module and knowledge content in the document.

[0120] Specifically, fill in the content of the target knowledge module in the corresponding module placeholder position, and then fill in the generated knowledge content in the module placeholder position that has not been replaced by the target knowledge module. At this time, all module placeholders in the template have been filled in with relevant content, and preliminary documents can be obtained, such as bid documents, product manual documents, etc.

[0121] In this step, structured information is generated based on the contextual content and preset structural constraints, and the knowledge content that can replace the module placeholders can be generated from the artificial intelligence generation engine through the structured information. After obtaining the knowledge content, the module placeholders that have not been replaced by the knowledge modules are replaced by the knowledge content, thereby obtaining the initial document. At this time, the initial document can be sent to the user end for the user to review and modify, especially for the review and modification of the knowledge content part. The user's review and modification of the knowledge content part can also verify whether the above-mentioned structured information is accurate and reasonable. If the user modifies the knowledge content part, the generation conditions of the structured information are adjusted according to the modified knowledge content. The generation conditions of the structured information include contextual content, structural constraints, etc.

[0122] In an embodiment of the present application, the ratio of the first number of module placeholders in the target template that are replaced by the target knowledge module to the second number of module placeholders that are not replaced by the target knowledge module can be 4:1. Most of the module placeholders in the target template can be retrieved from the preset knowledge base to replace the module placeholders with the target knowledge module, and a small number of module placeholders in the target template need to generate knowledge content replacement module placeholders through an artificial intelligence generation engine.

[0123] In some embodiments, the above-mentioned document generation method may include: in the process of generating a document, responding to a corporate terminology retrieval request, matching the words in the document with the corporate terminology in the preset knowledge base; if a word in the document is inconsistent with the corporate term with the highest matching degree, generating a word replacement prompt; responding to the word replacement instruction, replacing the word with the corporate term with the highest matching degree.

[0124] In some scenarios, during the document generation process, the user can click on the enterprise terminology search control in the user-side display interface. The user-side generates an enterprise terminology search request and sends it to the electronic device. The electronic device responds to the enterprise terminology search request and matches the terms in the document with the enterprise terminology in the preset knowledge base. If a term in the document does not match the most closely matched enterprise terminology, a term replacement prompt is generated in the user-side display interface. The user responds to the term replacement prompt and clicks the enterprise term replacement consent control to replace the term in the document with the enterprise terminology in the enterprise terminology base.

[0125] In some embodiments, to ensure that the generated document meets the requirements in terms of format, terminology, content, compliance, etc., it can be checked and verified in terms of format, corporate terminology, content integrity and regulatory compliance. Specifically, the above document generation method may include:

[0126] Parsing the generated document to determine the title hierarchy and numbering continuity, and checking and verifying the format of the generated document based on the title hierarchy and numbering continuity to obtain a format checking result;

[0127] Segmenting the generated document to obtain a plurality of words, and comparing the plurality of words with the corporate terms in the preset knowledge base to obtain corporate terminology check results;

[0128] Check whether the chapter content of the generated document is missing, and whether the reference relationship and logic between each document are correct, and obtain the content integrity check result;

[0129] Check whether the generated documents meet the normative standards and obtain the normative compliance check results;

[0130] A final check result of the document is generated according to the format check result, the enterprise terminology check result, the content integrity check result and the specification compliance check result.

[0131] In an embodiment of the present application, the multiple associated documents can share the same module placeholder, and the corresponding information in the multiple associated documents can be synchronously managed and updated through the same module placeholder. Specifically, a generated document includes fixed content information and variable content information. The variable content information is obtained through the knowledge module or knowledge content determined by the module placeholder. Therefore, the same information in the multiple associated documents can correspond to the same module placeholder. By setting the knowledge module associated with the same module placeholder, the corresponding information in the document can be synchronously managed and updated.

[0132] The following describes the scenarios of generating one document at a time and generating multiple related documents.

[0133] In a scenario where one document is generated at a time, a document generation request is used to request the generation of a single document, and the template determined based on the document generation request is a template. In this case, a target knowledge module is retrieved from a preset knowledge base to replace the module placeholders in the document. Furthermore, if any module placeholders are not replaced by the target knowledge module, the knowledge content generated by the artificial intelligence generation engine replaces the module placeholders that are not replaced by the target knowledge module, integrating the target knowledge module and the knowledge content into the document.

[0134] In a scenario where multiple related documents are generated at one time, a document generation request is used to request the generation of multiple documents. The templates determined according to the document generation request are multiple templates, each of which is provided with module placeholders. The module placeholders in each module can all determine the corresponding knowledge modules through the same preset knowledge base, the same set of document configuration information, and the same set of configuration rules. Afterwards, the module placeholders in each document are replaced by knowledge modules. When there are module placeholders that have not been replaced by the target knowledge module in the module placeholders, the module placeholders that have not been replaced by the target knowledge module are replaced by knowledge content generated by the artificial intelligence generation engine. The knowledge modules and knowledge content are integrated into each document, thereby generating multiple related documents at one time.

[0135] like Figure 6 As shown, the data interaction between the user terminal, server and AI engine in the embodiment of the present application is as follows:

[0136] Step A1: When a document needs to be generated, the user inputs text or text and document on the user terminal. The user terminal generates a request based on the text or text and document input by the user and sends it to the server.

[0137] In step A2, the server determines the document's subject content, chapter content, and content keywords based on the document generation request, and then determines a target template from a pre-set knowledge base. The pre-set knowledge base stores multiple document templates, with each document module corresponding to a document's subject content, chapter content, and content keywords. The target template includes fixed content information and module placeholders, which are allocated within the fixed content information. Together, the fixed content information and module placeholders constitute the target template.

[0138] Step A3: The user terminal generates controls for the user to configure the document. After the user selects certain controls, the user terminal generates document configuration information according to the controls selected by the user and sends it to the server.

[0139] In step A4, the server retrieves the target knowledge module from the preset knowledge base according to the document configuration information and pre-built configuration rules, and replaces the module placeholder in the target template with the target knowledge module.

[0140] In step A5, when there is a module placeholder in the module placeholder that has not been replaced by the target knowledge module, the server generates a content generation request (eg, structured information) and sends the content generation request to the AI ​​engine.

[0141] In step A6, the AI ​​engine generates knowledge content based on the context information and structured information in the content generation request and sends the generated knowledge content to the server.

[0142] In step A7, the server uses the knowledge content to replace the module placeholders in the target template that have not been replaced by the target knowledge module, so that the target knowledge module and the knowledge content are integrated into the generated document.

[0143] In step A8, the server checks and verifies the generated document in terms of format, corporate terminology, content integrity, and compliance with regulations, and sends the check results and the final document to the user end.

[0144] The document generation method described above determines a target template from a preset knowledge base based on a document generation request. The target template includes fixed content information and module placeholders reserved at preset locations within the target template. Based on document configuration information and pre-established configuration rules, the target knowledge module is retrieved from the preset knowledge base and the module placeholders are replaced with the target knowledge module. If a module placeholder exists that has not been replaced by a target knowledge module, knowledge content is generated using an artificial intelligence generation engine. This knowledge content replaces the module placeholders that have not been replaced by the target knowledge module, integrating the target knowledge module and the knowledge content into the document.

[0145] In an embodiment of the present application, if there is a knowledge module corresponding to a module placeholder in the knowledge base, the knowledge module of the knowledge base is used to replace the corresponding module placeholder; if there is no knowledge module corresponding to the module placeholder in the knowledge base, the knowledge content generated by the artificial intelligence generation engine is used to replace the corresponding module placeholder, without the user having to edit the document from scratch. Therefore, the document can be intelligently generated based on the knowledge base, or intelligently generated based on the knowledge base and the artificial intelligence generation engine. While reducing the user's workload, the document generation efficiency and accuracy can also be improved.

[0146] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0147] Corresponding to the document generation method described in the above embodiment, Figure 7 A structural block diagram of a document generation device provided in an embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0148] See also Figure 7 , an embodiment of the present application provides a document generation device, including a template determination module 201, a first replacement module 202 and a second replacement module 203.

[0149] Specifically, the template determination module 201 is used to determine the target template from a preset knowledge base based on a document generation request, wherein the document generation request is used to request the generation of a document or multiple interrelated documents, and the target template is one template or multiple templates. The document generation request contains information related to the subject content and chapter content of the document, and the target template includes fixed content information and module placeholders, and the module placeholders are set at a preset position in the target template.

[0150] The first replacement module 202 is used to retrieve the target knowledge module from the preset knowledge base based on the document configuration information and pre-built configuration rules, and use the target knowledge module to replace the module placeholder. The pre-built configuration rules include the mapping relationship between the document configuration information and the knowledge modules in the preset knowledge base.

[0151] The second replacement module 203 is used to generate knowledge content through an artificial intelligence generation engine when there are module placeholders in the module placeholders that have not been replaced by the target knowledge module, and use the knowledge content to replace the module placeholders in the module placeholders that have not been replaced by the target knowledge module, so as to integrate the target knowledge module and the knowledge content into the document.

[0152] For the beneficial effects of the above-mentioned document generation device, please refer to the relevant description of the above-mentioned document generation method, which will not be repeated here.

[0153] Figure 8 FIG is a schematic diagram of an electronic device provided by an embodiment of the present invention. Figure 8 As shown, the electronic device 300 of this embodiment includes a processor 310 and a memory 320. The memory 320 stores a computer program that can be run on the processor 310, such as a document generation program. When the processor 310 executes the computer program, the steps in the above-mentioned document generation method embodiment are implemented, such as Figure 3 Alternatively, when the processor 310 executes the computer program, the functions of the modules in the above-mentioned device embodiments are realized, for example, Figure 7 The functions of the template determination module 201 to the second replacement module 203 are shown.

[0154] Exemplarily, the computer program may be divided into one or more modules, which are stored in the memory 320 and executed by the processor 310 to implement the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the electronic device 300. For example, the computer program may be divided into a template determination module, a first replacement module, and a second replacement module.

[0155] The electronic device 300 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The electronic device may include, but is not limited to, a processor 310 and a memory 320. It will be understood by those skilled in the art that Figure 8 It is only an example of the electronic device 300 and does not constitute a limitation of the electronic device 300. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device may also include input and output devices, network access devices, buses, etc.

[0156] The processor 320 may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0157] The memory 320 can be an internal storage unit of the electronic device 300, such as a hard drive or memory of the electronic device 300. The memory 320 can also be an external storage device of the electronic device 300, such as a plug-in hard drive, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. equipped on the electronic device 300. Furthermore, the memory 320 can include both an internal storage unit of the electronic device 300 and an external storage device. The memory 320 is used to store the computer program and other programs and data required by the electronic device. The memory 320 can also be used to temporarily store data that has been output or is about to be output.

[0158] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. 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 make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention, and should all be included in the scope of protection of the present invention.

Claims

1. A document generation method, characterized in that: include: Determining a target template from a preset knowledge base based on a document generation request, wherein the document generation request includes information related to the subject content and chapter content of the document, the document generation request is used to request the generation of one document or multiple interrelated documents, and the target template is one template or multiple templates, wherein the target template includes fixed content information and module placeholders, and the module placeholders are set at preset positions in the target template; the user end identifies and determines the document generation requirement, and generates a document generation request based on the document generation requirement; Retrieving a target knowledge module from the preset knowledge base based on document configuration information and pre-constructed configuration rules, and replacing the module placeholder with the target knowledge module, wherein the pre-constructed configuration rules include a mapping relationship between the document configuration information and the knowledge modules in the preset knowledge base; wherein the document configuration information is information generated after the user selects a configuration option in a configuration condition list displayed in a user terminal display interface, and a mapping relationship exists between the configuration option and each knowledge module in the knowledge module list; When there are module placeholders in the module placeholders that have not been replaced by the target knowledge module, knowledge content is generated by an artificial intelligence generation engine, and the module placeholders in the module placeholders that have not been replaced by the target knowledge module are replaced by the knowledge content, so that the target knowledge module and the knowledge content are integrated into the document; wherein the multiple related documents share the same module placeholder, and the corresponding information in the multiple related documents is synchronously managed and updated through the same module placeholder; In the scenario where multiple related documents are generated at one time, the document generation request is used to request the generation of multiple documents. The templates determined according to the document generation request are multiple templates, each of which is provided with a module placeholder. The module placeholders in each module determine the corresponding knowledge module through the same preset knowledge base, the same set of document configuration information and the same set of configuration rules.

2. The document generation method according to claim 1, wherein: Generating knowledge content by using an artificial intelligence generation engine, replacing module placeholders that are not replaced by the target knowledge module with the knowledge content, and integrating the target knowledge module and the knowledge content into a document, includes: Acquire, from the fixed content information, contextual content of the module placeholders that are not replaced by the target knowledge module in the module placeholders; generating structured information according to the context content and preset structural constraints; Inputting the structured information into the artificial intelligence generation engine to generate knowledge content; The module placeholders that are not replaced by the knowledge modules are replaced by the knowledge content, and the target knowledge module and the knowledge content are integrated into the document.

3. The document generation method according to claim 1, wherein: Determining a target template from a preset knowledge base according to the document generation request includes: Determine the subject content, chapter content, and content keywords of the document according to the document generation request; Determining a historical matching success rate of each first template in the preset knowledge base, where the first template is a template in the preset knowledge base that is related to the subject content of the document; Calculating semantic similarity between the content keywords and template keywords of the first template; Calculating the structural matching degree between the chapter content of the document and the chapter content of the first template; The target template is determined from the first templates according to the historical matching success rate, the semantic similarity and the structural matching degree.

4. The document generation method according to claim 3, wherein: The calculating of the semantic similarity between the content keyword and the template keyword of the first template includes: converting the content keyword into a first word vector and converting the template keyword into a second word vector; calculating the similarity between the first word vector and the second word vector, and determining the semantic similarity based on the similarity; The method for calculating the structural matching degree between the chapter content of the document and the chapter content of the first template includes: pre-constructing a knowledge graph of the chapter content of each template in the preset knowledge base, wherein the nodes in the knowledge graph represent the chapter titles, and the edges in the knowledge graph represent the relationship types between chapters, wherein the relationship types include hierarchical nested relationships, sequential relationships, and semantic association relationships; comparing and matching the knowledge graph of the chapter content of the first template with the knowledge graph of the chapter content of the document to determine the structural matching degree between the chapter content of the document and the chapter content of the first template.

5. The document generation method according to claim 3, wherein: The determining the target template from the first template according to the historical matching success rate, the semantic similarity, and the structural matching degree includes: Setting a first weight, a second weight, and a third weight for the historical matching success rate, the semantic similarity, and the structural matching degree, respectively; performing a weighted summation of the historical matching success rate, the semantic similarity, and the structural matching degree according to the first weight, the second weight, and the third weight to determine a matching value of each template in the first template; One or more templates with the highest matching values ​​among the first templates are determined as target templates.

6. The document generation method according to claim 1, wherein: The method for constructing the configuration rules includes: Build a document template, which contains fixed content information; Adding a module placeholder in the document template and setting a knowledge module list corresponding to the module placeholder, wherein the knowledge module list includes multiple knowledge modules, and all or part of the module placeholders added in the document template correspond to at least one knowledge module in the knowledge module list; Creating a configuration condition list, the configuration condition list comprising at least one configuration condition and at least one configuration option corresponding to each configuration condition in the at least one configuration condition; A mapping relationship is established between each configuration option and each knowledge module in the knowledge module list.

7. The document generation method according to claim 1, wherein: The document generation method comprises: Parsing the generated document to determine the title hierarchy and numbering continuity, and checking and verifying the format of the generated document based on the title hierarchy and numbering continuity to obtain a format checking result; Segmenting the generated document to obtain a plurality of words, and comparing the plurality of words with the corporate terms in the preset knowledge base to obtain corporate terminology check results; Check whether the chapter content of the generated document is missing, and whether the reference relationship and logic between each document are correct, and obtain the content integrity check result; Check whether the generated documents meet the normative standards and obtain the normative compliance check results; A final check result of the document is generated according to the format check result, the enterprise terminology check result, the content integrity check result and the specification compliance check result.

8. The document generation method according to claim 1, wherein: The document generation method comprises: In the process of generating a document, responding to an enterprise terminology search request, matching words in the document with enterprise terminology in the preset knowledge base; If a word in the document is inconsistent with the enterprise term with the highest matching degree, a word replacement prompt is generated; In response to the word replacement instruction, the word is replaced with the enterprise term with the highest matching degree.

9. The document generation method according to claim 1, wherein: The document generation method comprises: An LRU cache is established, and the target template in the preset knowledge base is stored in the LRU cache.

10. An electronic device comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, wherein: When the processor executes the computer program, the steps of the document generation method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Document generation method, apparatus and computer storage medium suitable for printing

    CN109240625A

  • Knowledge graph construction method and device, storage medium and electronic device

    CN116484010A

  • Document automatic generation method, system and device, storage medium and product

    CN119443070A

  • Archive knowledge editing and research method, system and equipment and storage medium

    CN119623604A