Document generation method and electronic equipment
By introducing a knowledge base and an artificial intelligence generation engine in document generation, the traditional document generation method is solved, and intelligent and efficient document generation is achieved.
Patent Information
- Application Number
- CN202510629595.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2045-05-16
AI Technical Summary
Traditional document generation methods rely on manual entry, which makes it time-consuming and labor-intensive and easy to generate wrong files, and cannot meet the needs of intelligence and high efficiency.
Through an intelligent document generation method based on the knowledge base and the artificial intelligence generation engine, the target templates and knowledge modules in the preset knowledge base are used, and the missing content is generated in combination with the artificial intelligence generation engine to achieve automated and intelligent document generation.
This method can significantly reduce user workload, improve document generation efficiency and accuracy, and meet the needs of intelligent document generation.
Smart Images

Figure CN120146022A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and particularly to a document generation method and an electronic device. Background Art
[0002] From the perspectives of user requirements and product management, product documents (including product random materials, CE (Conformité Européene) certification materials, R & D process documents, manufacturing process documents, usage process documents, etc.) have already been an indispensable part of products. With the rapid development of technology, people's intelligent requirements for product document generation are getting higher and higher. Traditional document generation mostly relies on manual input, which is not only time-consuming and laborious, but also prone to generating error files. Summary of the Invention
[0003] In view of this, embodiments of this application provide a document generation method and an electronic device, which can generate documents based on a knowledge base, or jointly and intelligently generate documents based on a knowledge base and an artificial intelligence generation engine. While reducing the workload of users, the generation efficiency and accuracy of documents can also be improved.
[0004] To achieve the above object, this application adopts the following technical solutions: In a first aspect, embodiments of this application provide a document generation method, including: Determine a target template from a preset knowledge base according to a document generation request, where the document generation request contains information related to the theme 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, and the target template includes fixed content information and module placeholders, and the module placeholders are set at preset positions in the target template; Retrieve a target knowledge module from the preset knowledge base based on document configuration information and pre-constructed configuration rules, and use the target knowledge module to replace the module placeholder. The pre-constructed configuration rules include the mapping relationship between the document configuration information and the knowledge modules in the preset knowledge base; When there are module placeholders in the module placeholder that have not been replaced by the target knowledge module, generate knowledge content through an artificial intelligence generation engine, use the knowledge content to replace the module placeholders in the module placeholder that have not been replaced by the target knowledge module, and integrate the target knowledge module and the knowledge content into the document; where, 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.
[0005] Based on the first aspect, in some embodiments, generating knowledge content through an artificial intelligence generation engine, and using the knowledge content to replace the module placeholders that have not been replaced by the target knowledge module in the module placeholders, and integrating the target knowledge module and the knowledge content into the document, includes: Obtain the context content of the module placeholders that have not been replaced by the target knowledge module from the fixed content information; Generate structured information according to the context content and preset structured constraint conditions; Input the structured information into the artificial intelligence generation engine to generate knowledge content; Use the knowledge content to replace the module placeholders that have not been replaced by the knowledge module in the module placeholders, and integrate the target knowledge module and the knowledge content into the document.
[0006] Based on the first aspect, in some embodiments, determining a target template from a preset knowledge base according to a document generation request includes: Determine the theme content, chapter content, and content keywords of the document according to the document generation request; Determine the historical matching success rate of each first template in the preset knowledge base, where the first template is a template related to the theme content of the document in the preset knowledge base; Calculate the semantic similarity between the content keywords and the template keywords of the first template; Calculate the structural matching degree between the chapter content of the document and the chapter content of the first template; Determine the target template from the first templates according to the historical matching success rate, the semantic similarity, and the structural matching degree.
[0007] Based on the first aspect, in some embodiments, calculating the semantic similarity between the content keywords and the template keywords of the first template includes: 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 according to the similarity; 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, where the nodes in the knowledge graph represent chapter titles, and the edges in the knowledge graph represent the relationship types between chapters, and the relationship types include hierarchical nesting relationship, sequential relationship, and semantic association relationship; 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.
[0008] Based on the first aspect, in some embodiments, determining the target template from the first templates 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 sum 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 the matching value of each template in the first templates; Determining one or more templates with the highest matching value in the first templates as the target template.
[0009] Based on the first aspect, in some embodiments, the method for constructing the configuration rules includes: Constructing a document template, where the document template at this time contains fixed content information; Adding module placeholders to the document template and setting a knowledge module list corresponding to the module placeholders, the knowledge module list containing multiple knowledge modules, and all or some of the module placeholders added to the document template corresponding to at least one knowledge module in the knowledge module list; Creating a configuration condition list, the configuration condition list containing at least one configuration condition and at least one configuration option corresponding to each configuration condition in the at least one configuration condition; Establishing a mapping relationship between each configuration option and each knowledge module in the knowledge module list.
[0010] Based on the first aspect, in some embodiments, the document generation method includes: Parsing the generated document to determine the title hierarchy and number continuity, and performing a format check and verification on the generated document according to the title hierarchy and number continuity to obtain a format check result; Performing word segmentation on the generated document to obtain a plurality of words, and performing a consistency comparison between the plurality of words and the enterprise terms in the preset knowledge base to obtain an enterprise term check result; Detecting whether the chapter content of the generated document is missing, and whether the reference relationship and logic between each document are correct to obtain a content integrity check result; Detecting whether the generated document meets the normative standards to obtain a normative compliance check result; Generating a final check result of the document according to the format check result, the enterprise term check result, the content integrity check result, and the normative compliance check result.
[0011] Based on the first aspect, in some embodiments, the document generation method includes: During the process of generating a document, in response to an enterprise term retrieval request, match the words in the document with the enterprise terms in the preset knowledge base; If a certain word in the document is inconsistent with the enterprise term with the highest matching degree, generate a word replacement prompt; In response to a word replacement instruction, replace the word with the enterprise term with the highest matching degree.
[0012] Based on the first aspect, in some embodiments, the document generation method includes: Establish an LRU cache, and store the target template in the preset knowledge base in the LRU cache.
[0013] In a second aspect, an embodiment of the present application provides an electronic device, including a memory and a processor. A computer program that can run on the processor is stored in the memory. When the processor executes the computer program, the document generation method described in any item of the first aspect is implemented.
[0014] The beneficial effects of the embodiments of the present application compared with the prior art include: In the embodiments of the present application, a target template is determined from a preset knowledge base according to 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-constructed configuration rules, a target knowledge module is retrieved from the preset knowledge base, and the module placeholder is replaced with the target knowledge module. When there are module placeholders in the module placeholder that have not been replaced by the target knowledge module, knowledge content is generated through an artificial intelligence generation engine, and the knowledge content is used to replace the module placeholders in the module placeholder that have not been replaced by the target knowledge module, and the target knowledge module and the knowledge content are integrated into the document.
[0015] In the embodiments of the present application, for the case where there is a knowledge module corresponding to the module placeholder in the knowledge base, the knowledge module in the knowledge base is used to replace the corresponding module placeholder; for the case where 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, and there is no need for the user to edit the document from scratch. Therefore, a document can be intelligently generated based on the knowledge base, or a document can be jointly and intelligently generated based on the knowledge base and the artificial intelligence generation engine. While reducing the workload of the user, the generation efficiency and accuracy of the document can also be improved. Description of the Drawings
[0016] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0017] Figure 1 is a schematic diagram of an application scenario provided by an embodiment of the present application; Figure 2 is a schematic diagram of a part of the content of a template provided by an embodiment of the present application; Figure 3 is a schematic flowchart of a document generation method provided by an embodiment of the present application; Figure 4 is a schematic diagram of generating a target template based on semantic dimension, structural dimension and historical dimension provided by an embodiment of the present application; Figure 5 is a schematic diagram of constructing configuration rules provided by an embodiment of the present application; Figure 6 is a schematic diagram of data interaction between a user terminal, a server and an AI engine provided by an embodiment of the present application; Figure 7 is a schematic structural diagram of a document generation device provided by an embodiment of the present application; Figure 8 is a schematic diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0018] The following will further clarify the present application 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 still be made. These all belong to the protection scope of the present application.
[0019] To make the purpose, technical solutions and advantages of the present application clearer, the following will be described through specific embodiments with reference to the accompanying drawings.
[0020] 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.
[0021] Specifically, taking the generation of a tender document as an example for illustration, but the document in this application is not limited to a tender document, and 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 a tender document (such as generating a tender document with the requirement of XXX) or upload a file carrying the requirements for generating a tender document (such as the tender requirement document issued by the tenderer) or check the tender generation requirements in a preset area of the user-side display interface. The user side identifies and determines the requirements for generating a tender document, and generates a document generation request according to the requirements for generating a tender document and reports it to the electronic device. The electronic device responds to the document generation request, determines a target template from the preset knowledge base, and sends the target template to the user side for display. The target template contains fixed content information and module placeholders. Figure 2 It is a 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 the other content is fixed content. In the embodiment of this application, only the corresponding content needs to be filled in the module placeholders of the target template to generate a tender document.
[0022] After that, the user inputs or selects document configuration information on the user side and sends it to the electronic device. The electronic device retrieves the corresponding knowledge modules (which can be text, pictures, and / or numbers, etc.) from the preset knowledge base according to the document configuration information and the pre-constructed configuration rules and fills them in the module placeholders. For the module placeholders for which the knowledge modules cannot 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 according to 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 tender document.
[0023] After that, the electronic device sends the preliminary tender document to the client for display. The user determines the content of the preliminary tender document through the user side, especially confirming the knowledge content generated by the AI engine. After the user confirms or modifies and confirms, the electronic device performs subsequent processing on the tender document and sends the final electronic tender document to the user side. Thus, the process of generating a tender document is completed.
[0024] In the embodiment of this application, a plurality of knowledge modules are stored in the preset knowledge base. The knowledge module can be generated by processing the data, files, etc. of an enterprise. The knowledge module can be a set composed of data knowledge, information knowledge, pattern knowledge, etc.
[0025] Specifically, data knowledge is a collection of facts, numbers, symbols, or descriptive materials in their original form. Data knowledge is usually unorganized, without clear meaning and context. Data knowledge can be in the form of numbers, texts, images, sounds, etc. For example, a set of numbers, a passage of text, or a picture can all be data.
[0026] Information knowledge is the meaningful content obtained after processing and interpreting data. Information knowledge is the result of organizing, classifying, analyzing, and interpreting data, with a certain context and meaning. Information knowledge can help people understand and make decisions. For example, calculating a set of numbers and drawing a conclusion, organizing and summarizing a passage of text, and analyzing and interpreting a picture can all obtain information knowledge.
[0027] Pattern knowledge refers to the working processes that are summarized and formed during people's long-term work and have been verified to be effective. The characteristic of pattern knowledge is that there is no need to question the process itself, and only by completing according to the requirements of the process can the expected results be obtained. This characteristic enables us to refine and summarize this kind of knowledge, normalize, generalize, and standardize patterns of different forms, shapes, and characteristics, so that it can be automated using computer technology.
[0028] In the embodiments of the present application, the preset knowledge base can be stored in the above-mentioned electronic device or in other devices outside the above-mentioned electronic device, and this is not limited.
[0029] In addition, the data in the knowledge module can all come from the preset knowledge base, or a part can come from the preset knowledge base and another part can come from an external system, such as an ERP (Enterprise Resource Planning) system, etc. If a part of the data in the knowledge module comes from an external system, then when retrieving the target knowledge module from the preset knowledge base, relevant data can be retrieved from the external system at the same time.
[0030] In the embodiments 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 can be shared, as well as a set of document configuration information and a set of configuration rules. The module placeholders in each document can all be replaced with corresponding knowledge modules through a preset knowledge base, a set of document configuration information, and a set of configuration rules, so as to generate multiple interrelated documents at a time.
[0031] See Figure 3 , the document generation method provided by the embodiments of the present application may include steps 101 to 103. The above-mentioned document generation method can be applied to one end of an electronic device, and the electronic device can be a server. The above-mentioned document generation method is described in detail as follows: Step 101: Determine a target template from a preset knowledge base according to a document generation request.
[0032] Among them, the above document generation request contains information related to the theme content and chapter content of the document. The above document generation request is used to request the generation of one document or multiple interrelated documents. The above target template is one template or multiple templates. The above target template includes fixed content information and module placeholders, and the module placeholders are set at preset positions in the target template. The theme 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 to describe a product, a bid in response to a tender, a technology contract, etc. The chapter content can be the chapters included in the document and the logical structure between the chapters, etc.
[0033] Specifically, the fixed content information can be the fixed content in the document, and for the dynamic content that changes with the change of the document in the document, module placeholders can be used to replace it. The user can input document configuration information through the user terminal, and then determine the knowledge module corresponding to the module placeholder from the preset knowledge base, and use this knowledge module to replace the module placeholder.
[0034] In some embodiments, the implementation process of step 101 may include: determining the theme content, chapter content, and content keywords of the document according to 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 related to the theme content of the document in the preset knowledge base; calculating the semantic similarity between the content keywords and the 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; and determining the target template from the first templates according to the historical matching success rate, semantic similarity, and structural matching degree.
[0035] In the embodiments of the present application, multiple document templates may be stored in the preset knowledge base, and each document template may correspond to the name, template keywords, and chapter content of the document template. The historical matching success times of each document template can be recorded. Based on this, the historical matching success rate of each document template in the first templates related to the theme content of the above document in the preset knowledge base can be determined. The above historical matching success rate can be the probability that the document template is selected by the user after being recommended to the user. For example, a certain document template is recommended to the user M times as the target template, and the number of times it is selected by the user is N times, N≤M, then the historical matching success rate of this document template is N / M.
[0036] See Figure 4, for a document requirement (i.e., selecting a target template for generating a document), the target template can be selected from three aspects: the semantic dimension, the structural dimension, and the historical dimension. For the semantic dimension, the semantic similarity between the content keywords and the template keywords of the template can be calculated; for the structural dimension, the structural matching degree between the chapter content of the document and the chapter content of the template can be calculated; for the historical dimension, the historical matching success rate of each template can be calculated. Then, the historical matching success rate, semantic similarity, and structural matching degree can be weighted and summed to calculate the matching value of each template.
[0037] For example, calculating 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 according to the similarity.
[0038] For example, calculating the structural matching degree between the chapter content of the document and the chapter content of the first template may specifically include: pre-constructing a knowledge graph of the chapter content of each template in a preset knowledge base, where the nodes in the knowledge graph represent chapter titles, and the edges in the knowledge graph represent the relationship types between chapters, and the relationship types include hierarchical nesting 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.
[0039] Exemplarily, determining the target template from the first template according to 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 on the historical matching success rate, semantic similarity, and structural matching degree according to the first weight, second weight, and 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.
[0040] 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 can be sorted from large to small, and one or more templates corresponding to the sorted top matching values can be recommended to the user terminal as the target template. The user can select one of them as the finally used template.
[0041] 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 as to make the template with the highest matching value calculated according to the three weights consistent with the template finally selected by the user.
[0042] In some examples, the implementation scenario of step 101 can be: obtaining the text input by the user through the user terminal, where the text contains key information representing the theme content of the document; determining the theme content of the document according to the key information, and determining the chapter content according to the theme content of the document.
[0043] For example, the user terminal receives the text: Generate the user manual for XX product. The user terminal can extract from this text the key information containing the theme content of the document (such as product usage instructions), so as to determine that the theme content of the document is product usage instructions. After that, the user terminal determines the chapter content of the document according to the theme content of this document, such as the title hierarchy, numbering hierarchy, relationship between chapters, relationship between paragraphs, etc. A database of the theme content and chapter content of the document can be preset in the user terminal. This database stores the theme content of multiple documents and multiple chapter contents. Each theme content of the document corresponds to a chapter content. Therefore, the chapter content corresponding to the known theme content of the document can be determined through this database.
[0044] In some other examples, the implementation scenario of step 101 can be: the user terminal receives a text and a document, where the text contains key information representing the theme content of the document, determining the theme content of the document according to the key information, and then determining the chapter content of the document to be generated according to the theme content of the document and the chapter content of the received document.
[0045] For example, the user terminal receives a tender requirement document and a text: Generate a tender document (i.e., bid). The user terminal determines from this text that the user wants to generate a tender document, and determines that the theme content of the document is a tender document. Then, according to the tender requirement document uploaded by the user, information such as the tender industry, field, company, requirements, etc. are determined, so as to determine the chapter content of the tender document, such as the title hierarchy, numbering hierarchy, relationship between chapters, relationship between paragraphs, etc. Similarly, a database of the theme content and chapter content of the document can be preset in the user terminal. This database stores the theme content of multiple documents and multiple chapter contents. Each theme content of the document corresponds to a chapter content. Therefore, the chapter content corresponding to the known theme content of the document can be determined through this database.
[0046] The implementation scenario of step 101 will be described below with a specific application example of generating a bid document.
[0047] When a bid document needs to be generated, the user enters "Generate bid document, requirements: XXX" at the corresponding position in the user interface, or enters "Generate bid document" and inputs a tender requirement document, or checks the bid document generation requirements. At this time, the user side can determine that the user needs to generate a bid document based on this information input by the user, generate a bid document generation request based on this, send it to an electronic device (such as a server), and at the same time send the tender requirement document (if any) to the electronic device.
[0048] After that, the electronic device determines the theme content, chapter content, and content keywords of the bid document to be generated according to the bid document generation request and the tender requirement document. Among them, the theme content indicates what kind of document it is, which is a bid document in this embodiment. The chapter content indicates the chapter content structure of the bid document, including the title level, numbering level, relationship between chapters, relationship between paragraphs, etc. The content keywords indicate information such as the industry field and enterprise name of the bid document.
[0049] After that, the electronic device determines the bid template from three aspects: semantic dimension, structural dimension, and historical dimension for all the templates stored in the knowledge base according to the determined theme content, chapter content, and content keywords. How to determine the bid template from the three aspects of semantic dimension, structural dimension, and historical dimension, please refer to Figure 4 and the foregoing relevant content, which will not be elaborated here.
[0050] Step 102, retrieve the target knowledge module from the preset knowledge base based on the document configuration information and the pre-constructed configuration rules, and use the target knowledge module to replace the module placeholder.
[0051] Among them, the above pre-constructed configuration rules may include the mapping relationship between the document configuration information and the knowledge modules in the preset knowledge base.
[0052] In some scenarios, after determining one or more target templates, the user can select one of them for use. After that, the user side displays the content for document configuration on the display interface for the user to select. After the user finishes selecting, the user side obtains the document configuration information, and then retrieves the target knowledge module from the preset knowledge base according to the document configuration information and the pre-constructed configuration rules.
[0053] Exemplarily, the method for constructing configuration rules may specifically include: constructing a document template, where no module placeholder is set in the document template at this time, only fixed content information; adding module placeholders in the document template, and setting a knowledge module list corresponding to the module placeholders. The knowledge module list may include multiple knowledge modules, and all or some of the module placeholders added in the document template may correspond to at least one knowledge module in the knowledge module list; creating a configuration condition list, where 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; establishing a mapping relationship between each configuration option and each knowledge module in the knowledge module list. Among them, the configuration option is a requirement option corresponding to the configuration condition. For example, if the configuration condition is "the output countries and regions of the product", the configuration options may include all countries and regions in the world, and one configuration option is set for each country and region.
[0054] In the embodiment of the present application, each module placeholder in the module placeholders added in the document template may correspond to at least one knowledge module in the knowledge module list, or some module placeholders have no corresponding knowledge module. For the case where a module placeholder has no corresponding knowledge module, the knowledge content may be generated by the artificial intelligence generation engine in step 103.
[0055] It should be noted that when constructing the configuration rules, the document template may be constructed first and then the configuration condition list may be created, or the configuration condition list may be created first and then the document template may be constructed, or the construction of the document template and the configuration condition list may be executed simultaneously. The embodiment of the present application does not limit this.
[0056] As Figure 5 shown, in the Figure 5 configuration condition list area, the configuration conditions are on the right side. Figure 5 Two configuration conditions are shown in it, namely consulting service and typical case. The specific presentations of these two configuration conditions in the user-side display interface may be "What kind of consulting service do you want?" and "What kind of typical case do you want?". The left side of the configuration condition list area is the configuration option for each configuration condition. For the configuration condition of consulting service, the set configuration options are machine safety, reliability, modularization and product configuration, and digital factory; for the configuration condition of typical case, the set configuration options are machine safety case - Company R, machine safety case - Company X, and machine safety case - Company Z.
[0057] Figure 5Two module placeholders, namely typical cases and consulting services, are set in the module placeholder area in []. Among them, three knowledge modules are correspondingly set for the module placeholder of typical cases, namely: Typical Cases - Machine Safety Cases - Company R, Typical Cases - Machine Safety Cases - Company X, and Typical Cases - Machine Safety Cases - Company Z. That is, at the position of the module placeholder of typical cases in the template, the information corresponding to the three knowledge modules of Typical Cases - Machine Safety Cases - Company R, Typical Cases - Machine Safety Cases - Company X, and Typical Cases - Machine Safety Cases - Company Z can be imported. Four knowledge modules are correspondingly set for the module placeholder of consulting services, namely: Consulting Services - Machine Safety, Consulting Services - Modularity and Product Configuration, Consulting Services - Digital Factory, and Consulting Services - Reliability. That is, at the position of the module placeholder of consulting services in the template, the information corresponding to the four knowledge modules of Consulting Services - Machine Safety, Consulting Services - Modularity and Product Configuration, Consulting Services - Digital Factory, and Consulting Services - Reliability can be imported.
[0058] After constructing the above configuration condition list, module placeholders, and knowledge modules, it is also necessary to construct the association mapping relationships between each configuration option of the configuration conditions and each knowledge module. As Figure 5 shown, the configuration option of machine safety can be associated and mapped with knowledge modules such as Typical Cases - Machine Safety Cases - Company R, Typical Cases - Machine Safety Cases - Company X, and Typical Cases - Machine Safety Cases - Company Z corresponding to the module placeholder of typical cases. In addition, it is also associated and mapped with the knowledge module of Consulting Services - Machine Safety corresponding to the module placeholder of consulting services.
[0059] For configuration options such as reliability, modularity and product configuration, digitalization, Machine Safety Cases - Company R, Machine Safety Cases - Company X, and Machine Safety Cases - Company Z, the association mapping relationships between each configuration option and the knowledge module are as Figure 5 shown and will not be elaborated here.
[0060] The document configuration information can be the information generated after the user clicks and selects the configuration options in the configuration condition list displayed in the user - side display interface. For example, the user - side generates the document configuration information based on the configuration options selected by the user.
[0061] For example, the user inputs text on the user - side. The user - side learns that the user wants to configure and generate a document. Then, the user - side displays multiple configuration conditions required for configuring and generating the document in the display interface, and multiple configuration options are set under each configuration condition. The user makes selections according to needs among the configuration options of each configuration condition, and the user - side can generate the document configuration information based on the user's selections.
[0062] Optionally, an "Other" option can also be set in the configuration options of all or some of the configuration conditions, and the content of this "Other" option is filled in by the user according to actual needs. For example, if the user wants to display relevant information about intellectual property rights in the document, the user can fill in "Intellectual Property Rights" in the "Other" option. If there is a knowledge module related to intellectual property rights in the knowledge base, the knowledge module related to intellectual property rights in the knowledge base can be associated and mapped with this configuration option of intellectual property rights. If there is no knowledge module related to intellectual property rights in the knowledge base, knowledge content related to intellectual property rights can be generated through the AI engine.
[0063] For example, the user inputs text on the user side. The user side learns that the user wants to configure and generate a document. Then, the user side displays multiple configuration conditions required for configuring and generating the document on the display interface, and multiple configuration options are set under each configuration condition. The user makes selections according to needs in the configuration options of each configuration condition. The user also fills in personalized requirement content (such as intellectual property rights) in the "Other" configuration option of some configuration conditions. The user side can then generate document configuration information according to the user's selections.
[0064] The following uses a specific application example of generating a product description document to illustrate the implementation scenario of step 102.
[0065] First, construct the configuration rules. Please refer to the construction method of the above configuration rules.
[0066] Secondly, after determining the target template in step 101, the user side generates controls for the user to configure the document.
[0067] Specifically, the user side can generate several questions (i.e., the above configuration conditions), and one or more question options (i.e., the above configuration options) are set under each question. For example, question 1 is: Where is the product sold? Question 2 is: What language is the document in? Question 3 is: What industry field is the product in? Question 4 is: What should the product manual include? Question 5 is: Other.
[0068] For each of the above questions, there is one or more question options. For example, for Question 1, question options such as "Country A", "Country B", "Country C", etc. can be set for the user to choose. For Question 2, question options such as "English", "Chinese", "Russian", "French", etc. can be set for the user to choose. For Question 3, question options such as "coal mine machinery", "intelligent robot", "chip manufacturing", etc. can be set for the user to choose. For Question 4, question options such as "name", "usage", "specification parameters", "circuit structure", "standards", "precautions", "configuration list", "installation operation guide", etc. can be set for the user to choose. For Question 5, the user needs to input personalized requirements, that is, content that the user is more concerned about but not covered in the above questions. For example, the user can input "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.
[0069] Users can make selections from the above questions and corresponding question options according to the actual situation of the product. The user side generates document configuration information based on the selection operations imposed by the user from the above questions and corresponding question options. The document configuration information is specifically the questions and corresponding question options selected by the user. Specifically, the document configuration information can be: the product sales locations are 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 name, usage, specification parameters, precautions, configuration list, installation operation guide, etc. The above example is only an exemplary explanation for the convenience of others' understanding, and the settings of questions and question options in the actual product should be set according to the actual situation.
[0070] Next, the user side sends the document configuration information to the electronic device, and the electronic device then retrieves the target knowledge module from the preset knowledge base according to the document configuration information and configuration rules.
[0071] For example, for the document configuration information of "the product sales locations are 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 name, usage, specification parameters, precautions, configuration list, installation operation guide, etc.", through the association mapping relationship between each question option in the configuration rules and each knowledge module in the preset knowledge base, the knowledge module (usually can be text, picture, and / or data) corresponding to each question option can be determined.
[0072] Finally, replace the corresponding module placeholder with the target knowledge module, and fill in the content of the target knowledge module at the position of the corresponding module placeholder.
[0073] Such as Figure 5As shown, the user selects a question (i.e., configuration condition) and question options (i.e., configuration options) in the user terminal. Then, according to the association relationship between the configuration options and the knowledge modules, the target knowledge module can be determined based on the question and question options selected by the user. Further, according to the association relationship between the module placeholders and the knowledge modules in the figure, the module placeholder corresponding to the target knowledge module can be determined, so as to 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.
[0074] Optionally, the above document generation method may include: establishing an LRU (Least Recently Used Cache) cache and storing the target templates in the preset knowledge base in the LRU cache. Multiple templates are stored in the LRU cache space. When the LRU cache space is insufficient, the template with the lowest usage frequency will be preferentially removed, and the templates with higher usage frequencies will be retained. And the templates with higher usage frequencies have a higher probability of being selected by the user compared to the templates with lower usage frequencies. Therefore, the templates with higher usage frequencies can be stored in the LRU cache for easy and quick retrieval.
[0075] In some examples, if all the module placeholders in the target template can retrieve knowledge modules from the preset knowledge base through the document configuration information and configuration rules, then the knowledge modules can be retrieved from the preset knowledge base through step 102 to replace the module placeholders in the target template.
[0076] In some other examples, for all the module placeholders in the target template, knowledge modules for some of the module placeholders can be retrieved from the preset knowledge base through the document configuration information and configuration rules, but knowledge modules for some other module placeholders cannot be retrieved from the preset knowledge base through the document configuration information and configuration rules. For the module placeholders for which knowledge modules can be retrieved, the knowledge modules are retrieved from the preset knowledge base through step 102 for replacement, and for the module placeholders for which knowledge modules cannot be retrieved, knowledge content is generated through step 103 for replacement.
[0077] Step 103, when there are module placeholders in the module placeholders that have not been replaced by the target knowledge module, generate knowledge content through an artificial intelligence generation engine, 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.
[0078] Exemplarily, generating knowledge content through the artificial intelligence generation engine, and using the knowledge content to replace the module placeholders in the placeholder that have not been replaced by the target knowledge module, and integrating the target knowledge module and the knowledge content into the document may include: obtaining the context content of the module placeholders in the placeholder that have not been replaced by the target knowledge module from the fixed content information; generating structured information according to the context content and preset structured constraint conditions; 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 placeholder that have not been replaced by the knowledge module, and integrating the target knowledge module and the knowledge content into the document.
[0079] For example, the user fills in "intellectual property" in the question of "others" and sets the module placeholder corresponding to the question of "others", and it can be determined that the content related to intellectual property needs to be added to the document that the user wants. Then, according to the context content of this module placeholder, it can be determined whether it is necessary to explain the types included in intellectual property, or the application process of intellectual property, or the intellectual property situation of the industry where the product is located, etc. The preset structured constraint conditions are used to limit the text content generated by the artificial intelligence generation engine to be output to the electronic device according to the preset rules, formats and other requirements.
[0080] Exemplarily, the above-mentioned integrating the target knowledge module and the knowledge content into the document may be: using the target knowledge module to replace the module placeholder, and using the knowledge content to replace the module placeholders in the placeholder that have not been replaced by the target knowledge module, that is, the integration of the target knowledge module and the knowledge content into the document is completed.
[0081] Specifically, fill in the content of the target knowledge module at the position of the corresponding module placeholder, and then fill in the generated knowledge content at the position of the module placeholder that has not been replaced by the target knowledge module. At this time, all the module placeholders in the template have been filled with relevant content, and a preliminary document can be obtained, such as a tender document, a product instruction document, etc.
[0082] In this step, structured information is generated according to the context content and preset structured constraint conditions. Through this structured information, knowledge content that can replace the module placeholders can be generated from the artificial intelligence generation engine. After obtaining the knowledge content, the knowledge content is used to replace the module placeholders that have not been replaced by the knowledge modules in the module placeholders, thereby obtaining the initial document. At this time, the initial document can be sent to the client for the user to review and modify, especially for the review and modification of the knowledge content part. Through the user's review and modification of the knowledge content part, it can also be verified 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 context content, structured constraint conditions, etc.
[0083] In the embodiment of the present application, the ratio of the first number of module placeholders replaced by the target knowledge module in the target template to the second number of module placeholders not replaced by the target knowledge module can be 4:1. Most of the module placeholders in the target template can retrieve the target knowledge module from the preset knowledge base to replace the module placeholders, and a small number of module placeholders in the target template need to generate knowledge content through the artificial intelligence generation engine to replace the module placeholders.
[0084] In some embodiments, the above document generation method may include: during the process of generating a document, in response to an enterprise term retrieval request, matching the words in the document with the enterprise terms in the preset knowledge base; if a certain word in the document is inconsistent with the enterprise term with the highest matching degree, generating a word replacement prompt; in response to the word replacement instruction, replacing the word with the enterprise term with the highest matching degree.
[0085] In some scenarios, the user can click on the enterprise term retrieval control in the display interface of the client during the document generation process. The client generates an enterprise term retrieval request and sends it to the electronic device. The electronic device responds to the enterprise term retrieval request and matches the words in the document with the enterprise terms in the preset knowledge base. If a certain word in the document is inconsistent with the enterprise term with the highest matching degree, a word replacement prompt is generated in the display interface of the client; the user clicks on the enterprise term replacement consent control in response to the word replacement prompt to replace the word in the document with the enterprise term in the enterprise term library.
[0086] In some embodiments, to ensure that the generated document meets the requirements in terms of format, terms, content, compliance, etc., it can be checked and verified in terms of format, enterprise terms, content integrity, and compliance. Specifically, the above document generation method may include: Parsing the generated document to determine the title hierarchy and number continuity, and checking and verifying the generated document in terms of format according to the title hierarchy and number continuity to obtain a format check result; Tokenize the generated document to obtain multiple words, and compare the multiple words with the enterprise terms in the preset knowledge base to obtain the enterprise term inspection result; Detect whether the chapter content of the generated document is missing, and whether the reference relationships and logic among the documents are correct, to obtain the content integrity inspection result; Detect whether the generated document meets the normative standards to obtain the norm compliance inspection result; Generate the final inspection result of the document according to the format inspection result, the enterprise term inspection result, the content integrity inspection result, and the norm compliance inspection result.
[0087] In the embodiments of the present application, the multiple related documents can share the same module placeholder, and the corresponding information in the multiple related documents is 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 related documents can correspond to the same module placeholder, and the corresponding information in the document can be synchronously managed and updated by setting the knowledge module associated with the mapping of the same module placeholder.
[0088] The scenarios of generating one document at a time and multiple related documents are described below respectively.
[0089] In the scenario of generating one document at a time, the document generation request is used to request the generation of one document, and the template determined according to the document generation request is one template. At this time, the target knowledge module is retrieved from the preset knowledge base to replace the module placeholder in the one document, and when there is a module placeholder in the module placeholder that is not replaced by the target knowledge module, the knowledge content generated by the artificial intelligence generation engine is used to replace the module placeholder that is not replaced by the target knowledge module, and the target knowledge module and the knowledge content are integrated into this one document.
[0090] In the scenario of generating multiple related documents at a time, the document generation request is used to request the generation of multiple documents, and the templates determined according to the document generation request are multiple templates. Each template is provided with a module placeholder, and the module placeholders in each module can 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. Then, the knowledge module is used to replace the module placeholder in each document, and when there is a module placeholder in the module placeholder that is not replaced by the target knowledge module, the knowledge content generated by the artificial intelligence generation engine is used to replace the module placeholder that is not replaced by the target knowledge module, and the knowledge module and the knowledge content are integrated into each document, so as to generate multiple related documents at a time.
[0091] As Figure 6 shown, the data interaction among the client, the server, and the AI engine in the embodiments of the present application is as described below: Step A1, when a document needs to be generated, the user inputs text or text and a document at the client. The client generates a request according to the input text or text and document of the user and sends it to the server.
[0092] Step A2, the server determines the theme content, chapter content, and content keywords of the document according to the document generation request, and determines a target template from a preset knowledge base. Multiple document templates are stored in the preset knowledge base, and each document module corresponds to the theme content, chapter content, and content keywords of a type of document; the target template includes fixed content information and module placeholders, and the module placeholders are configured in the fixed content information, and the fixed content information and the module placeholders together constitute the target template.
[0093] Step A3, the client generates controls for the user to configure the document. After the user selects some controls, the client generates document configuration information according to the selected controls of the user and sends it to the server.
[0094] Step A4, the server retrieves the target knowledge module from the preset knowledge base according to the document configuration information and the pre-constructed configuration rules, and uses the target knowledge module to replace the module placeholders in the target template.
[0095] Step A5, when there are module placeholders in the module placeholders that are not replaced by the target knowledge module, the server generates a content generation request (such as structured information) and sends the content generation request to the AI engine.
[0096] Step A6, the AI engine generates knowledge content according to the context information and structured information in the content generation request and sends it to the server.
[0097] Step A7, the server uses the knowledge content to replace the module placeholders in the target template that are not replaced by the target knowledge module, so that the target knowledge module and the knowledge content are fused into the document.
[0098] Step A8, the server checks and validates the generated document in terms of format, enterprise terms, content integrity, and compliance with specifications, and sends the inspection result and the final document to the client.
[0099] The above-mentioned document generation method determines a target template from a preset knowledge base according to a document generation request. The target template includes fixed content information and module placeholders reserved at preset positions in the target template. Based on document configuration information and pre-constructed configuration rules, the target knowledge module is retrieved from the preset knowledge base, and the module placeholder is replaced with the target knowledge module. When there are module placeholders in the module placeholder that are not 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 placeholder that are not replaced by the target knowledge module, and the target knowledge module and the knowledge content are integrated into the document.
[0100] In the embodiment of the present application, for the case where there is a knowledge module corresponding to the module placeholder in the knowledge base, the knowledge module in the knowledge base is used to replace the corresponding module placeholder; for the case where 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, and there is no need for the user to edit the document from scratch. Therefore, the document can be intelligently generated based on the knowledge base, or the document can be jointly and intelligently generated based on the knowledge base and the artificial intelligence generation engine. While reducing the workload of the user, the generation efficiency and accuracy of the document can also be improved.
[0101] It should be understood that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the order of execution is prior or subsequent. The execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
[0102] Corresponding to the document generation method described in the above embodiments, Figure 7 The structural block diagram of the document generation device provided by the embodiment of the present application is shown. For the sake of convenience of description, only the parts related to the embodiment of the present application are shown.
[0103] See Figure 7 , the 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.
[0104] Specifically, the template determination module 201 is configured to determine a target template from a preset knowledge base according to a document generation request. The document generation request is used to request to generate one document or multiple interrelated documents. The target template is one template or multiple templates. The document generation request includes information related to the theme content and chapter content of the document. The target template includes fixed content information and module placeholders, and the module placeholders are set at preset positions in the target template.
[0105] The first replacement module 202 is configured to retrieve a target knowledge module from the preset knowledge base based on the document configuration information and pre-constructed configuration rules, and use the target knowledge module to replace the module placeholder. The pre-constructed configuration rules include the mapping relationship between the document configuration information and the knowledge modules in the preset knowledge base.
[0106] When there are still module placeholders in the module placeholder that have not been replaced by the target knowledge module, the second replacement module 203 is configured to generate knowledge content through an artificial intelligence generation engine, use the knowledge content to replace the module placeholders in the module placeholder that have not been replaced by the target knowledge module, and integrate the target knowledge module and the knowledge content into the document.
[0107] For the beneficial effects of the above document generation device, please refer to the relevant descriptions of the above document generation method, which will not be elaborated here.
[0108] Figure 8 It is a schematic diagram of an electronic device provided by an embodiment of the present invention. As Figure 8 shown, the electronic device 300 of this embodiment includes a processor 310 and a memory 320. A computer program that can run on the processor 310 is stored in the memory 320, such as a document generation program. When the processor 310 executes the computer program, it implements the steps in the above embodiment of the document generation method, such as Figure 3 shown in 101 to 103. Alternatively, when the processor 310 executes the computer program, it implements the functions of each module in the above device embodiments, such as Figure 7 the functions of the template determination module 201 to the second replacement module 203 shown.
[0109] Exemplarily, the computer program can be divided into one or more modules. The one or more modules / units are stored in the memory 320 and executed by the processor 310 to complete the present invention. The one or more modules can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments are used to describe the execution process of the computer program in the electronic device 300. For example, the computer program can be divided into a template determination module, a first replacement module, and a second replacement module.
[0110] The electronic device 300 can be a computing device such as a desktop computer, a notebook, a palm computer, and a cloud server. The electronic device may include, but is not limited to, a processor 310 and a memory 320. Those skilled in the art can understand that Figure 8This is only an example of the electronic device 300, which does not constitute a limitation on the electronic device 300. It may include more or fewer components than those shown in the figure, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.
[0111] The so-called processor 320 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0112] The memory 320 may be an internal storage unit of the electronic device 300, such as the hard disk or memory of the electronic device 300. The memory 320 may also be an external storage device of the electronic device 300, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 300. Further, the memory 320 may also include both the internal storage unit and the external storage device of the electronic device 300. The memory 320 is used to store the computer program and other programs and data required by the electronic device. The memory 320 may also be used to temporarily store the data that has been output or will be output.
[0113] The above-described embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A document generation method, characterized in that: include: Determine 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, and 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, and the target template includes fixed content information and module placeholders, and the module placeholders are set at preset positions in the target template; Retrieving a target knowledge module from the preset knowledge base based on the document configuration information and a pre-constructed configuration rule, and replacing the module placeholder with the target knowledge module, wherein the pre-constructed configuration rule includes a mapping relationship between the document configuration information and the knowledge modules in the preset knowledge base; 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 associated documents share the same module placeholder, and the corresponding information in the multiple associated documents is synchronously managed and updated through the same module placeholder.
2. The document generation method according to claim 1, characterized in that: The step of generating knowledge content by using an artificial intelligence generation engine, replacing module placeholders in the 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 in a document includes: Acquire, from the fixed content information, contextual content of the module placeholders in the module placeholders that are not replaced by the target knowledge module; Generating structured information according to the context content and preset structured 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 contents, and the target knowledge module and the knowledge contents are integrated into the document.
3. The document generation method according to claim 1, characterized in that: Determining the 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; Determine a historical matching success rate of each first template in the preset knowledge base, wherein 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 keyword and the template keyword 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, characterized in that: 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 according to 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 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, characterized in that: The step of 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 in the first templates are determined as target templates.
6. The document generation method according to claim 1, characterized in that: The method for constructing the configuration rules includes: Build a document template, which contains fixed content information; Adding module placeholders in the document template, and setting a knowledge module list corresponding to the module placeholders, 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 between each configuration option and each knowledge module in the knowledge module list is established.
7. The document generation method according to claim 1, characterized in that: 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 according to the title hierarchy and numbering continuity to obtain a format checking result; Segmenting the generated document to obtain a plurality of words, comparing the plurality of words with the enterprise terms in the preset knowledge base for consistency, and obtaining an enterprise terminology check result; 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, characterized in that: The document generation method comprises: In the process of generating a document, responding to a corporate terminology search request, matching words in the document with corporate terminology in the preset knowledge base; If a word in the document is inconsistent with the enterprise term with the highest matching degree, a prompt for word replacement 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, characterized in that: 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, characterized in that: When the processor executes the computer program, the steps of the document generation method as described in 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
Method and device for generating oil and gas document
CN114662454A
Knowledge graph construction method and device, storage medium and electronic device
CN116484010A
Asset allocation report generation method and related device
CN117113933A
Contract file automatic generation method and device, computer equipment and storage medium
CN117196491A