A Model-Based Document Generation Method
Through model -based document generation methods, automatically obtain the document structure and keywords, build a diagram of the relationship diagram of text fragments, and moisturize through large language models to solve the problem of low content efficiency in document writing, realize high -efficiency and automated documentation documents Generate consistency and context.
Patent Information
- Application Number
- CN202410994538.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2044-07-23
AI Technical Summary
During the document writing process, especially for documents with high requirements for contextual logical correspondence, when adjusting the content of a certain module in the document, it is necessary to manually find out whether other content is relevant and adjust it simultaneously, which is inefficient and prone to omissions or errors, resulting in the document Context inconsistent.
Using a model -based document generation method, by collecting text fragments and entering the text classification models and text recognition models that are built, automatically obtain the document structure and metadata tags and keywords, build the relationship diagram of text fragments, and use large language models through large language models Run color generate document.
The fully automated process from text collection to generating documents has been achieved, which greatly improves the efficiency of document generation, avoids the inefficiency and errors of manual adjustment, and ensures the consistency of the document.
Smart Images

Figure CN118940761B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of document generation, and more specifically, to a model-based document generation method. Background Art
[0002] With the development of artificial intelligence technology, model-based automatic document generation has become a hot research direction. Traditional document generation relies on manual editing and organization, which is inefficient and difficult to scale. In recent years, many studies have begun to explore the use of deep learning models to automatically process various links and achieve fully automated document generation.
[0003] For example, the Chinese patent with publication number CN1 01216849A discloses a method for automatically generating documents based on an integrated enterprise model, which is characterized in that a document generation database is established in a computer, including attribute tables of text, charts, and directory templates, attribute tables, format tables, and structure tables of document templates, and attribute tables, text and chart content tables of documents, so as to manage the information and content of document templates and documents; and the automatic generation of documents is achieved by following the steps of establishing, maintaining, and publishing document templates, creating documents and editing document content, and automatically generating documents. While simplifying the document generation process, the invention ensures the standardization, uniformity, and standardization of documents by forcing the use of document templates, and improves the consistency between documents and enterprise models. It also standardizes the storage of documents related to enterprise modeling, providing a reference for enterprises to implement informatization.
[0004] However, in the current document writing process, especially for documents with high requirements for contextual logical correspondence (such as technical documents, bidding documents, etc.), when adjusting the content of a module in a document, the document writer needs to manually find out whether other content in the document is related to it. If there is relevant content, it needs to be adjusted synchronously. This manual adjustment method of generating documents is inefficient and prone to omissions or errors, resulting in inconsistent document context. Summary of the invention
[0005] In order to solve the above problems, an embodiment of the present invention provides a model-based document generation method, the method comprising:
[0006] Collect text snippets;
[0007] Input text snippets into a pre-built text classification model to output document structure and metadata tags;
[0008] Input text snippets into a pre-built text recognition model to output keywords;
[0009] Build a relationship graph of text fragments based on keywords, document structure and metadata tags;
[0010] Based on the relationship graph and text fragments, the document is polished and generated through a large language model.
[0011] Furthermore, the text fragments include complete documents and document fragments.
[0012] Furthermore, the document structure includes modules, chapters, paragraphs and structural relationships; the metadata tags include ID, structural classification name and structural name.
[0013] Furthermore, the text classification model is a CNN model, which includes an input layer, a word embedding layer, a convolutional layer, a fully connected layer, and an output layer; the input layer receives a digitized word vector sequence, and the input length represents the length of the input word vector sequence; the vocabulary size of the word embedding layer is 30,000, and the word vector dimension is 128; the convolutional layer includes a first convolutional layer, a second convolutional layer, and a third convolutional layer; the pooling sizes of the first convolutional layer, the second convolutional layer, and the third convolutional layer are all 2, and maximum pooling is used; the convolution kernel size of the first convolutional layer is 3, and the number is 32; the convolution kernel size of the second convolution layer is 4, and the number is 64; the convolution kernel size of the third convolution layer is 5, and the number is 128; the fully connected layer includes the first fully connected layer and the second fully connected layer; the first fully connected layer and the second fully connected layer both use the ReLU function as the activation function, the input dimension of the first fully connected layer is 128133, and the number of neurons is 256; the input dimension of the second fully connected layer is 256, and the number of neurons is 128; the output layer is a Softmax output layer, with an input dimension of 128, a number of neurons of 7, and no activation function.
[0014] Furthermore, the training method of the text classification model includes:
[0015] Extract p historical text classification logs from the database. Each historical text classification log includes a text segment and a set of document structures and metadata tags corresponding to the text segment. Divide the p historical text classification logs into a training set and a validation set. The training set is H historical text classification logs, and the validation set is z historical text classification logs. The optimizer is the Adam optimizer with an initial learning rate of 0.001. Import the training set into the text classification model to complete the forward calculation from the input layer to the output layer. Use cross entropy as the loss function. The loss function loos formula is:
[0016]
[0017] In the formula, H represents the total number of text segments, X i is the i-th text segment, E i is the actual document structure and metadata label corresponding to the i-th text segment, A(X i ) is the predicted document structure and metadata label of the i-th text segment, η is a hyperparameter, is the regularization of the weights of the first fully connected layer and the second fully connected layer;
[0018] Update the parameter values of the text classification model according to the optimizer, reduce the learning rate by half every 5-10 rounds, calculate the loss function on the validation set, and observe after 100-150 rounds whether the loss function converges. If it converges, end the training.
[0019] Furthermore, the text recognition model is an unsupervised learning model constructed based on the TextRank algorithm. The process of constructing the text recognition model based on the TextRank algorithm includes:
[0020] S1. Create a co-occurrence relationship diagram between words:
[0021] Set a window size of L words, scroll the window to browse all text fragments, count the co-occurrence times of each word in the window, build a co-occurrence matrix between words, convert the word connection relationship in the co-occurrence matrix into a graph representation, and if the co-occurrence times of word Rt and word Re exceed the co-occurrence threshold, then establish an edge between word Rt and word Re in the graph, and the co-occurrence threshold is a preset value;
[0022] S2. Calculate the PageRank value of the word node:
[0023] Each word is considered as a node in the co-occurrence graph. According to the PageRank principle, the node score is proportional to the number of edges pointing to it. If the node score of a node exceeds the score threshold, the node is a keyword, and the score threshold is a preset value. The algorithm is iterated in the graph until the node score converges, then the iteration stops.
[0024] The node score calculation formula is:
[0025] PR(G)=(1-d)+d×(PR(T1) / C(T1)+......+PR(T n ) / C(T n ));
[0026] Where G is the node for which the node score needs to be calculated, PR(G) represents the score of node G, d is the damping coefficient, T1 is the first node pointing to G, and T n is the last node pointing to G, C(T n ) represents node T n Out-degree, PR(T n ) represents node T n score.
[0027] Furthermore, a model-based document generation method further includes:
[0028] Collect word meaning maps;
[0029] Input the word meaning graph, text fragments and keywords into the pre-built word meaning identification model and output the final keywords.
[0030] Furthermore, the method for constructing the word meaning identification model includes:
[0031] Convert each set of word meaning graphs, text fragments and keywords into the form of a first feature vector;
[0032] The set of all first feature vectors is used as input of a word sense identification model, wherein the word sense identification model uses the final keyword predicted for each set of word sense graphs, text segments and keywords as output, uses the actual final keyword corresponding to each set of word sense graphs, text segments and keywords as a prediction target, and uses minimizing the sum of the first prediction accuracies of all predicted final keywords as a training target;
[0033] Among them, the calculation formula of the first prediction accuracy is: Vc u =(Vr u -Vz u ) 2 , where Vc u is the first prediction accuracy, Vr u is the predicted final keyword corresponding to the u-th group of word meaning graphs, text fragments and keywords, Vz u is the actual final keyword corresponding to the u-th group of word meaning graphs, text fragments and keywords; the word meaning identification model is trained until the sum of the first prediction accuracies reaches convergence and the training is stopped; the word meaning identification model is LSTM or CNN.
[0034] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the model-based document generation method is implemented.
[0035] A computer-readable storage medium stores a computer program, and when the computer program is executed, the model-based document generation method is implemented.
[0036] The technical effects and advantages of a model-based document generation method provided by the present invention are as follows:
[0037] The present invention realizes a fully automated process from text collection to document generation, greatly improving the efficiency of document generation; automatically obtains document structure and metadata tags through a CNN text classification model to realize structured expression of text information; automatically extracts keywords using an unsupervised learning model based on a TextRank algorithm to represent important information in the text; establishes a co-occurrence relationship graph between words, and uses a PageRank algorithm to calculate the importance of vocabulary; constructs a text fragment relationship graph based on structural information such as keywords, and fully expresses the inherent knowledge structure of the text; introduces a word meaning graph and a word meaning discrimination model to effectively identify keyword ambiguity and improve keyword accuracy; uses a large language model to polish the relationship graph and automatically generate a fluent target document; the overall method is based on a deep learning model, and after training, automatic document generation can be realized without human participation to avoid omissions or errors; the scheme design takes user participation into consideration, realizes transparency of the generation process and allows modification at any time, and better serves writing needs; compared with existing methods, this scheme realizes a fully automatic closed loop from text to knowledge and then to documents, and has high application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A flowchart of a model-based document generation method in Example 1;
[0039] Figure 2 A flowchart of a model-based document generation method in Example 2;
[0040] Figure 3 is a schematic diagram of an electronic device of the present invention;
[0041] Figure 4 Schematic diagram of the storage medium of the present invention. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] Example 1
[0044] like Figure 1 As shown, the document generation method based on the model described in this embodiment includes:
[0045] Collect text snippets;
[0046] Input text snippets into a pre-built text classification model to output document structure and metadata tags;
[0047] Input text snippets into a pre-built text recognition model to output keywords;
[0048] Build a relationship graph of text fragments based on keywords, document structure and metadata tags;
[0049] Based on the relationship graph and text fragments, the document is polished and generated through a large language model.
[0050] The text fragments include complete documents and document fragments. The user is inputting text fragments during the writing process. Since the document generation is completed in the background, it is transparent to the user (the transparency here refers to the transparency in the computer sense, that is, it exists in the computer, but the user does not need to know it), so the input of text fragments is followed up in real time. Only when the user uses document generation, the document is quickly generated in the background, so the document may be complete or incomplete. This design is more conducive to classification and is convenient for users to adjust and modify documents at any time.
[0051] The document structure includes modules, chapters, paragraphs and structural relationships; modules are the highest-level structural units, for example, a document can be divided into several modules; chapters are structural units that are further divided under modules, for example, a module contains several chapters; paragraphs are the smallest structural units divided under chapter content; structural relationships include hierarchical relationships, sequential relationships and association relationships; the hierarchical relationship is module->chapter->paragraph, indicating a hierarchical structure of inclusion-inclusion; sequential relationships are used to describe the sequential relationship of structural elements in the document flow, such as chapter 1 is before chapter 2, etc.; association relationships are used to describe the strength of the association between structural elements, such as the content of one chapter is associated with another chapter, etc.
[0052] The metadata tags include ID, structural classification name and structural name; ID is a unique identifier, such as module ID and chapter ID, which is used to mark the document structure to facilitate the subsequent construction of a relationship map: the structural classification name is used to label different contents in the text, such as paragraphs, charts and lists; the name is the name of the structural element, such as "Module 1" and "Chapter 1".
[0053] The text classification model is a CNN model, which includes an input layer, a word embedding layer, a convolutional layer, a fully connected layer, and an output layer; the input layer receives a digitized word vector sequence, and the input length represents the length of the input word vector sequence; the vocabulary size of the word embedding layer is 30,000, and the word vector dimension is 128; the convolutional layer includes the first convolutional layer, the second convolutional layer, and the third convolutional layer; the pooling size of the first convolutional layer, the second convolutional layer, and the third convolutional layer is 2, and the maximum pooling is used; the convolution kernel size of the first convolutional layer is 3, and the number is 32 ; The convolution kernel size of the second convolution layer is 4, and the number is 64; the convolution kernel size of the third convolution layer is 5, and the number is 128; the fully connected layer includes the first fully connected layer and the second fully connected layer; the first fully connected layer and the second fully connected layer both use the ReLU function as the activation function, the input dimension of the first fully connected layer is 128133, and the number of neurons is 256; the input dimension of the second fully connected layer is 256, and the number of neurons is 128; the output layer is a Softmax output layer, with an input dimension of 128, a number of neurons of 7, and no activation function.
[0054] The training method of the text classification model includes:
[0055] Extract p historical text classification logs from the database. Each historical text classification log includes a text segment and a set of document structures and metadata tags corresponding to the text segment. Divide the p historical text classification logs into a training set and a validation set. The training set is H historical text classification logs, and the validation set is z historical text classification logs. The optimizer is the Adam optimizer with an initial learning rate of 0.001. Import the training set into the text classification model to complete the forward calculation from the input layer to the output layer. Use cross entropy as the loss function. The loss function loos formula is:
[0056]
[0057] In the formula, H represents the total number of text segments, X i is the i-th text segment, E i is the actual document structure and metadata label corresponding to the i-th text segment, A(X i ) is the predicted document structure and metadata label of the i-th text segment, η is a hyperparameter, is the regularization of the weights of the first and second fully connected layers.
[0058] Update the parameter values of the text classification model according to the optimizer, reduce the learning rate by half every 5-10 rounds, calculate the loss function on the validation set, and observe after 100-150 rounds whether the loss function converges. If it converges, end the training.
[0059] The keywords refer to words automatically extracted from the text that can represent the text theme and important information. For example, the keyword in "Several popular mobile phones in the summer of 2022" is mobile phone.
[0060] The text recognition model is an unsupervised learning model constructed based on the TextRank algorithm. The process of constructing a text recognition model based on the TextRank algorithm includes:
[0061] S1. Create a co-occurrence relationship diagram between words:
[0062] Set a window size of L words, scroll the window to browse all text fragments, count the co-occurrence times of each word in the window, build a co-occurrence matrix between words, and convert the word connection relationship in the co-occurrence matrix into a graph representation. If the co-occurrence times of word Rt and word Re exceed the co-occurrence threshold, then establish an edge between word Rt and word Re in the graph. The co-occurrence threshold is a preset value.
[0063] S2. Calculate the PageRank value of the word node:
[0064] Each word is considered as a node in the co-occurrence graph. According to the PageRank principle, the node score is proportional to the number of edges pointing to it. If the node score of a node exceeds the score threshold, the node is a keyword, and the score threshold is a preset value. The algorithm is iterated in the graph until the node score converges, then the iteration stops.
[0065] The node score calculation formula is:
[0066] PR(G)=(1-d)+d×(PR(T1) / C(T1)+......+PR(T n ) / C(T n ));
[0067] Where G is the node for which the node score needs to be calculated, PR(G) represents the score of node G, d is the damping coefficient, T1 is the first node pointing to G, and T n is the last node pointing to G, C(T n ) represents node T n The out-degree PR(T n ) represents node T n score.
[0068] It is particularly important to note that: since the TextRank algorithm is an unsupervised learning algorithm, the various thresholds need to be preset in advance and then evaluated and compared to improve the threshold settings; since there is no need for data input training and manual adjustment, and there are no real labels for comparison, evaluation methods such as the silhouette coefficient and the Davis-Balding index can be used.
[0069] The large language model is LLM, which stands for Large language model. It is a pre-trained language model in the field of AI and performs a variety of text processing tasks. The relationship graph enhances LLM editing as a form of knowledge graph.
[0070] Example 2
[0071] like Figure 2 As shown, this embodiment is further improved on the basis of the embodiment 1. The difference is that when the model-based document generation method described in the embodiment 1 is running, a special situation will occur, that is, keyword ambiguity; words in the Chinese context will have multiple meanings, and even the same word will have completely opposite meanings in a different context. For example, "repression" means frustration in the emotional context and containment in the behavioral context; in the context of moral education, "indulgence" means letting human nature go wrong and not following the rules, and in the context of entertainment and leisure, "indulgence" means enjoying life and relaxing oneself; and keywords play the role of connecting the upper and lower key points in the relationship map. If keyword ambiguity occurs, it may cause structural errors in the generation of the entire document, so it is necessary to identify and filter the keywords after they are output by the text recognition model. Therefore, the model-based document generation method provided by this embodiment also includes:
[0072] Collect word meaning maps;
[0073] Input the word meaning graph, text fragments and keywords into the pre-built word meaning identification model and output the final keywords;
[0074] The word meaning graph is obtained from Baidu Baike and other encyclopedia knowledge bases, online corpora and dictionaries to clarify all possible meanings of words and avoid misextraction caused by ambiguity. It filters low-frequency and inappropriate word meanings based on the distribution statistics of word meanings in the corpus, considers the relevance and matching between keywords and context word meanings, and associates word meanings at the pragmatic level, such as polysemous word relations. The model can learn the intrinsic semantic implicit relations between word meanings.
[0075] The construction method of the word meaning identification model includes:
[0076] Convert each set of word meaning graphs, text fragments and keywords into the form of a first feature vector;
[0077] The set of all first feature vectors is used as the input of the word sense identification model. The word sense identification model takes the final keyword predicted for each group of word sense graphs, text fragments and keywords as the output, takes the actual final keyword corresponding to each group of word sense graphs, text fragments and keywords as the prediction target, and takes minimizing the sum of the first prediction accuracies of all predicted final keywords as the training goal.
[0078] Among them, the calculation formula of the first prediction accuracy is: Vc u =(Vr u -Vz u ) 2 , where Vc u is the first prediction accuracy, Vr u is the predicted final keyword corresponding to the u-th group of word meaning graphs, text fragments and keywords, Vz u is the actual final keyword corresponding to the u-th group of word meaning graphs, text fragments and keywords; the word meaning identification model is trained until the sum of the first prediction accuracies reaches convergence and the training is stopped; the word meaning identification model is any one of LSTM or CNN.
[0079] Example 3
[0080] See also Figure 3 As shown, according to another aspect of the present application, an electronic device 500 is also provided. The electronic device 500 may include one or more processors and one or more memories. The memories store computer readable codes, and when the computer readable codes are executed by one or more processors, a model-based document generation method as described above may be executed.
[0081] The system according to the embodiment of the present application can also be used by Figure 3 The electronic device architecture shown in FIG. Figure 3 As shown, the electronic device 500 may include a bus 501, one or more CPUs 502, a ROM 503, a RAM 504, a communication port 505 connected to a network, an input / output 506, a hard disk 507, etc. The storage device in the electronic device 500, such as the ROM 503 or the hard disk 507, may store a model-based document generation method provided by the present application. Furthermore, the electronic device 500 may also include a user interface 508. Of course, Figure 3 The architecture shown is only exemplary and can be omitted according to actual needs when implementing different devices. Figure 3 One or more components of an electronic device are shown.
[0082] Example 4
[0083] See also Figure 4As shown, it is a computer-readable storage medium according to an embodiment of the present application. Computer-readable instructions are stored on the computer-readable storage medium. When the computer-readable instructions are executed by the processor, a model-based document generation method according to an embodiment of the present application described with reference to the above figures can be executed. The storage medium includes, but is not limited to, for example, volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc.
[0084] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0085] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A document generation method based on a model, characterized in that the method include: Collect text snippets; Input text snippets into a pre-built text classification model to output document structure and metadata tags; Input text snippets into a pre-built text recognition model to output keywords; Build a relationship graph of text fragments based on keywords, document structure and metadata tags; Based on the relationship graph and text fragments, the document is polished and generated through a large language model; The training method of the text classification model includes: Extract p historical text classification logs from the database. Each historical text classification log includes a text segment and a set of document structures and metadata tags corresponding to the text segment. Divide the p historical text classification logs into a training set and a validation set. The training set is H historical text classification logs, and the validation set is z historical text classification logs. The optimizer is the Adam optimizer with an initial learning rate of 0.
001. Import the training set into the text classification model to complete the forward calculation from the input layer to the output layer. Use cross entropy as the loss function. The loss function loos formula is: In the formula, H represents the total number of text segments, X i is the i-th text segment, E i is the actual document structure and metadata label corresponding to the i-th text segment, A(X i ) is the predicted document structure and metadata label of the i-th text segment, η is a hyperparameter, is the regularization of the weights of the first fully connected layer and the second fully connected layer; Update the parameter values of the text classification model according to the optimizer, reduce the learning rate by half every 5-10 rounds, calculate the loss function on the validation set, and observe whether the loss function converges after 100-150 rounds. If it converges, end the training; The text recognition model is an unsupervised learning model constructed based on the TextRank algorithm. The process of constructing a text recognition model based on the TextRank algorithm includes: S1. Create a co-occurrence relationship diagram between words: Set a window size of L words, scroll the window to browse all text fragments, count the co-occurrence times of each word in the window, build a co-occurrence matrix between words, convert the word connection relationship in the co-occurrence matrix into a graph representation, and if the co-occurrence times of word Rt and word Re exceed the co-occurrence threshold, then establish an edge between word Rt and word Re in the graph, and the co-occurrence threshold is a preset value; S2. Calculate the PageRank value of the word node: Each word is considered as a node in the co-occurrence graph. According to the PageRank principle, the node score is proportional to the number of edges pointing to it. If the node score of a node exceeds the score threshold, the node is a keyword, and the score threshold is a preset value. The algorithm is iterated in the graph until the node score converges, then the iteration stops. The node score calculation formula is: PR(G)=(1-d)+d×(PR(T1) / C(T1)+......+PR(T n ) / C(T n , Where G is the node for which the node score needs to be calculated, PR(G) represents the score of node G, d is the damping coefficient, T1 is the first node pointing to G, and T n is the last node pointing to G, C(T n ) represents node T n Out-degree, PR(T n ) represents node T n score.
2. A model-based document generation method according to claim 1, characterized in that: The text segments include complete documents and document segments.
3. A model-based document generation method according to claim 2, characterized in that: The document structure includes modules, chapters, paragraphs and structural relationships; the metadata tags include ID, structural classification name and structural name.
4. A model-based document generation method according to claim 2 or 3, characterized in that: The text classification model is a CNN model, which includes an input layer, a word embedding layer, a convolutional layer, a fully connected layer, and an output layer; the input layer receives a digitized word vector sequence, and the input length represents the length of the input word vector sequence; the vocabulary size of the word embedding layer is 30,000, and the word vector dimension is 128; the convolutional layer includes the first convolutional layer, the second convolutional layer, and the third convolutional layer; the pooling size of the first convolutional layer, the second convolutional layer, and the third convolutional layer is 2, and the maximum pooling is used; the convolution kernel size of the first convolutional layer is 3, and the number is 32; The convolution kernel size of the second convolution layer is 4, and the number is 64; the convolution kernel size of the third convolution layer is 5, and the number is 128; the fully connected layer includes the first fully connected layer and the second fully connected layer; the first fully connected layer and the second fully connected layer both use the ReLU function as the activation function, the input dimension of the first fully connected layer is 128133, and the number of neurons is 256; the input dimension of the second fully connected layer is 256, and the number of neurons is 128; the output layer is a Softmax output layer, with an input dimension of 128, a number of neurons of 7, and no activation function.
5. The model-based document generation method according to claim 1, characterized in that: Also includes: Collect word meaning maps; Input the word meaning graph, text fragments and keywords into the pre-built word meaning identification model and output the final keywords.
6. A model-based document generation method according to claim 5, characterized in that: The construction method of the word meaning identification model includes: Convert each set of word meaning graphs, text fragments and keywords into the form of a first feature vector; The set of all first feature vectors is used as input of a word sense identification model, wherein the word sense identification model uses the final keyword predicted for each set of word sense graphs, text segments and keywords as output, uses the actual final keyword corresponding to each set of word sense graphs, text segments and keywords as a prediction target, and uses minimizing the sum of the first prediction accuracies of all predicted final keywords as a training target; Among them, the calculation formula of the first prediction accuracy is: Vc u =(Vr u -Vz u ) 2 , where Vc u is the first prediction accuracy, Vr u is the predicted final keyword corresponding to the u-th group of word meaning graphs, text fragments and keywords, Vz u is the actual final keyword corresponding to the u-th group of word meaning graphs, text fragments and keywords; the word meaning identification model is trained until the sum of the first prediction accuracies reaches convergence and the training is stopped; the word meaning identification model is any one of LSTM or CNN.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the model-based document generation method according to any one of claims 1 to 6 is implemented.
8. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed, the model-based document generation method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Document automatic creation method based on integration business model
CN101216849A
Metadata grading and classifying method based on machine learning algorithm
CN114676253A
Keyword generation method based on heterogeneous associated subgraph
CN114840633A