A personalized official document draft generation method and system based on multi-source data fusion
By integrating multi-source data and improving the Linformer architecture to generate official document drafts, the problems of low efficiency and lack of personalization in official document writing have been solved, achieving efficient and personalized official document draft generation and improving the standardization and consistency of official document generation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU HUIZHENG SOFTWARE DEV CO LTD
- Filing Date
- 2026-01-30
- Publication Date
- 2026-05-29
AI Technical Summary
The current method of drafting official documents by hand is inefficient and highly dependent on the professional skills of the writers. It is prone to problems such as omissions, unreasonable structure, or inconsistent expression style, especially when there is a need for complex official documents or high-frequency document generation.
A personalized document draft generation method based on multi-source data fusion is adopted. It utilizes multi-source heterogeneous data, attention fusion algorithm and improved Linformer architecture to generate document outlines and perform standardization verification. This includes obtaining data from public material library, local knowledge base and personal material library, constructing user personalized feature data, and generating document drafts under the constraints of target document structure template.
It improves the efficiency of official document generation, enhances the relevance of content and the standardization of structure, reduces the workload of manual proofreading, and improves the personalization and consistency of generated texts.
Smart Images

Figure CN122113860A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent text generation, and in particular to a method and system for generating personalized official document drafts based on multi-source data fusion. Background Technology
[0002] With the rapid development of information technology and digital government, official documents, as an important vehicle for management, decision-making, and communication in government agencies, enterprises, institutions, and various organizations, are seeing a continuous increase in both quantity and complexity. Official documents typically feature strong formatting standards, rigorous content, and clear hierarchical structure. In practice, their drafting often requires comprehensive reference to various sources, including policy documents, historical models, policy interpretations, and business cases, while also considering the specific document type, writing context, and the writer's expression habits. Therefore, how to improve the efficiency of official document drafting while ensuring standardization and catering to personalized needs has become a pressing technical challenge in the field of official document processing.
[0003] In existing technologies, official document drafting mainly relies on manual methods. Drafters need to manually search for relevant materials in multiple systems or databases and then select, organize, and reorganize these materials based on their own experience. This method is not only inefficient but also highly dependent on the drafter's professional skills and experience. When faced with complex document tasks or high-frequency document generation needs, it is prone to problems such as omissions, unreasonable structures, or inconsistent expression styles. Therefore, some existing technologies attempt to introduce computer-aided writing or template-based generation methods to alleviate the manual burden. Summary of the Invention
[0004] One objective of this invention is to propose a personalized document draft generation method and system based on multi-source data fusion. This invention fully utilizes multi-source heterogeneous data fusion, attention fusion algorithms, and an improved Linformer architecture. It preprocesses and semantically relevance-ranks document materials from a public resource library, a local knowledge base, and a personal resource library to generate fused representation data. It then combines user historical draft data and user editing behavior data to construct personalized user feature data. Under the constraints of a target document structure template, it generates document outline data and further generates document draft text. Finally, it performs standardization verification on the document draft text, revises it, and outputs a personalized document draft. This method boasts advantages such as high generation efficiency, strong content relevance, good structural standardization, and high personalization.
[0005] A method for generating personalized official document drafts based on multi-source data fusion according to an embodiment of the present invention includes the following steps:
[0006] Obtain document generation task information, which includes document category identifier, writing scenario identifier, user identifier, and basic writing element information input by the user;
[0007] Based on document category identifiers, writing scenario identifiers, and user identifiers, candidate data for document association is obtained from multi-source heterogeneous data;
[0008] Preprocess the candidate data associated with official documents to obtain standardized candidate data;
[0009] The standardized candidate data is classified according to its source. Based on the semantic relevance between the basic writing element information and the standardized candidate data, the classified standardized candidate data is sorted and aggregated. An attention fusion algorithm is then used to generate fused representation data.
[0010] Based on user identifiers, user historical manuscript data and user editing behavior data are obtained to construct personalized user feature data;
[0011] Obtain the target document structure template based on the document category identifier and writing scenario identifier;
[0012] The data is integrated with the characterization data and the user's personalized feature data. The document generation model is composed of an improved Linformer architecture and generates document outline data under the constraints of the target document structure template. Based on the document outline data, the document draft text is generated.
[0013] Perform standardization verification on the draft official document text, revise the draft official document text based on the results of the standardization verification, and output a personalized draft official document.
[0014] Optionally, the acquisition process involves receiving a document generation request submitted by a user, reading the title information and key content information input by the user from the document generation request, and combining the title information and key content information to form basic writing element information. The process also involves reading the document category identifier, writing scenario identifier, and user identifier from the document generation request, and summarizing the document category identifier, the writing scenario identifier, the user identifier, and the basic writing element information to form document generation task information.
[0015] Optionally, the acquisition of the document-related candidate data specifically includes:
[0016] By combining document category identifiers, writing scenario identifiers, and user identifiers, search criteria for document type attributes, writing scenario attributes, and user attributes are generated.
[0017] Based on the search criteria, candidate data matching the search criteria are obtained from public material libraries, local knowledge bases, and personal material libraries in multi-source heterogeneous data.
[0018] Candidate data obtained from public resource libraries, local knowledge bases, and personal resource libraries are aggregated to obtain aggregated candidate data.
[0019] The aggregated candidate data is processed by type labeling, which includes labeling policy basis texts, policy interpretation texts, model texts, and case material texts, generating candidate data related to official documents.
[0020] Optionally, obtaining the standardized candidate data specifically includes:
[0021] The candidate data associated with official documents are preprocessed, including normalization, text segmentation, noise filtering, sensitive information masking, text deduplication, and unified encoding.
[0022] Perform standardized processing on candidate data associated with official documents;
[0023] Text segmentation is performed on the standardized candidate data of official documents.
[0024] Noise filtering is performed on the candidate data of related official documents after text segmentation.
[0025] Sensitive information masking is applied to the candidate data of official documents after noise filtering.
[0026] After sensitive information is masked, text deduplication is performed on the candidate data of the official documents associated with them. Text deduplication includes deleting duplicate text based on text content consistency comparison.
[0027] After text deduplication, the associated candidate data of official documents is subjected to unified encoding processing to form standardized candidate data.
[0028] Optionally, the generation of the fused representation data specifically includes:
[0029] Based on the data source, the standardized candidate data is classified and processed to form a subset of candidate data, which includes a public material data set, a local knowledge data set, and a personal material data set.
[0030] The basic writing element information is converted into a first semantic representation vector, and the standardized candidate data in each candidate data subset is converted into a second semantic representation vector, generating a corresponding content feature vector for each standardized candidate data.
[0031] An attention fusion algorithm is used to calculate the attention weight value corresponding to each standardized candidate data based on the semantic correlation between the first semantic representation vector and the second semantic representation vector.
[0032] Based on the attention weight values, a weighted fusion process is performed on the content feature vectors to generate intermediate fusion vectors corresponding to each candidate data subset;
[0033] The intermediate fusion vectors corresponding to each candidate data subset are uniformly combined to generate fusion representation data.
[0034] Optionally, the construction of the user personalized feature data specifically includes:
[0035] Based on the user identifier, the user's historical manuscript data and user editing behavior data are obtained. The user's historical manuscript data includes a set of historical official document texts associated with the user identifier, and the user editing behavior data includes a set of editing operation records of the historical official document text set.
[0036] Text parsing is performed on a collection of historical official documents to obtain a set of statistical features of writing style.
[0037] The set of editing operation records is processed by behavior serialization to obtain a set of editing behavior features;
[0038] A thesaurus of keywords is constructed based on a collection of historical official documents. The frequency of each keyword in the thesaurus of keywords in the collection of historical official documents is counted. The weight of each keyword is calculated based on the frequency of occurrence. The thesaurus of keywords is then arranged into a theme preference feature vector according to the index order of the keywords in the thesaurus of keywords.
[0039] An expression pair set is constructed based on the replacement operation records in the edit operation record set, and the number of operations for each expression pair in the expression pair set is counted. The expression preference weight corresponding to each expression pair is calculated based on the number of operations, and the expression preference feature vector is formed according to the index order of the expression pairs in the expression pair set.
[0040] By concatenating the feature vectors of writing style, editing behavior, topic preference, and expression preference, we obtain personalized user feature data.
[0041] Optionally, obtaining the target document structure template specifically includes:
[0042] The target document structure template identifier is obtained based on the document category identifier and the writing scenario identifier, and the corresponding candidate structure template set is obtained based on the target document structure template identifier.
[0043] Based on the basic writing element information, structural matching processing is performed on each candidate structural template in the candidate structural template set to obtain the matching degree score corresponding to each candidate structural template.
[0044] The candidate structure template set is sorted based on the matching score, and the candidate structure template with the highest matching score is selected as the target document structure template.
[0045] Optionally, the generation of the draft document text specifically includes:
[0046] The fused representation data and user-personalized feature data are input into the document generation model, which is composed of an improved Linformer architecture. The improved Linformer architecture includes a low-rank attention computation unit, a multi-condition injection unit, and a structure template constraint generation unit. The improvement of the improved Linformer architecture lies in performing low-rank projection on the key representation and value representation to generate attention output, and using the fused representation data and user-personalized feature data as conditions to modulate the attention output to generate the hidden state after condition injection. A structure-aware alignment mechanism is introduced to generate document outline data under the constraint of the target document structure template.
[0047] In the low-rank attention computation unit, attention computation processing is performed on the fused representation data, low-rank projection processing is performed on the key representation and value representation in the attention computation, and attention output is generated based on the key representation and value representation after low-rank projection processing. The low-rank projection processing refers to linearly mapping the key representation and value representation from the original dimension to the low-rank projection representation in the attention computation.
[0048] In the multi-condition injection unit, conditional injection processing is performed on the attention output based on fused representation data and user-personalized feature data to generate the hidden state after conditional injection.
[0049] In the structural template constraint generation unit, a structure-aware alignment mechanism is introduced to align the hidden state after condition injection with the chapter structure, paragraph order and content element slots in the target document structural template to obtain the structural alignment representation corresponding to each content element slot and generate document outline data.
[0050] By using the fill content corresponding to each content element slot in the document outline data, the fill content is used as the input condition for paragraph generation to generate corresponding paragraph text. The paragraph texts are then spliced together according to the chapter structure and paragraph order to obtain the document draft text.
[0051] Optionally, the draft document text undergoes a standardization verification process, which includes format standardization verification, structural standardization verification, terminology standardization verification, and citation standardization verification. The standardization verification results are output, and text fragments in the draft document text that do not conform to the set of document standardization rules are located based on the standardization verification results. The set of document standardization rules consists of document category identifiers and writing scenario identifiers. Revision instructions are generated for the text fragments, and the draft document text is revised based on the revision instructions to obtain the revised draft document text, thus forming a personalized draft document.
[0052] A personalized official document draft generation system based on multi-source data fusion according to an embodiment of the present invention includes:
[0053] The task information acquisition module is used to acquire document generation task information, which includes document category identifier, writing scenario identifier, user identifier, and basic writing element information input by the user.
[0054] The candidate data acquisition module is used to acquire candidate data related to official documents from multi-source heterogeneous data based on document category identifiers, writing scenario identifiers, and user identifiers.
[0055] The preprocessing module is used to preprocess the candidate data associated with official documents to obtain standardized candidate data;
[0056] The data fusion module is used to classify standardized candidate data according to data sources, and sort and aggregate the classified standardized candidate data based on the semantic relevance between basic writing element information and standardized candidate data, and generate fused representation data using attention fusion algorithm;
[0057] The personalized feature construction module is used to obtain user's historical manuscript data and user editing behavior data based on user identifiers, and to construct user personalized feature data.
[0058] The structure template acquisition module is used to obtain the target document structure template based on the document category identifier and the writing scenario identifier.
[0059] The document generation module is used to input the fused representation data and user personalized feature data into the document generation model, generate document outline data under the constraints of the target document structure template, and generate document draft text based on the document outline data. The document generation model is composed of an improved Linformer architecture.
[0060] The standardization verification and revision module is used to perform standardization verification on the draft text of official documents, and revise the draft text based on the results of the standardization verification to output personalized draft official documents.
[0061] The beneficial effects of this invention are:
[0062] This invention organizes document generation tasks around document category identifiers, writing scenario identifiers, user identifiers, and basic writing element information. This ensures that document generation has clear task boundaries and input elements from the outset, avoiding the semantic constraints of existing technologies that rely solely on keyword retrieval or static template filling. In the candidate data acquisition and preprocessing stage, this invention obtains document-related candidate data from multi-source heterogeneous data such as public resource libraries, local knowledge bases, and personal resource libraries. It then performs standardization, segmentation, noise filtering, sensitive information masking, deduplication, and unified encoding on the candidate data to form standardized candidate data. This improves the usability and consistency of data from different sources, reduces the risks of content redundancy, logical repetition, and non-standard terminology caused by differences in data quality, and provides a more stable corpus foundation for subsequent generation.
[0063] In the multi-source data fusion stage, this invention classifies standardized candidate data according to its source and maps basic writing element information to a unified semantic space. Attention weight values are calculated through semantic relevance, and content feature vectors are weighted, fused, and combined accordingly to generate fused representation data. This process ensures that materials from different data sources are no longer simply pieced together or coarsely filtered, but rather aggregated and represented with a focus based on the writing task requirements. This enhances the relevance between the generated content and the writing theme, reducing problems in existing technologies such as "numerous but irrelevant materials," "content generalization," and "lack of focus."
[0064] At the personalization level, this invention obtains users' historical manuscript data and user editing behavior data based on user identifiers, and constructs user-personalized feature data that includes writing style features, theme preference features, and expression preference features. This enables the document draft generation process to inherit the user's expression habits and preferences, and improves the problems of unstable generation style, inconsistent language, and insufficient personalization caused by the existing technology of "only looking at the current input and ignoring historical writing features". This improves the consistency between the generated text and the user's long-term writing habits.
[0065] In terms of generation and structural control, this invention inputs fused representational data and user-personalized feature data into a document generation model composed of an improved Linformer architecture. Under the constraints of a target document structure template, it generates document outline data, and then generates draft text. By introducing mechanisms such as low-rank projection attention calculation, multi-condition injection, and structural template constraint generation, the generation process is simultaneously driven by multi-source fused corpora and user-personalized features. Furthermore, chapter structure, paragraph order, and content element slots are used as explicit structural constraints in outline and draft generation, thereby reducing the probability of incomplete structure, disordered paragraph hierarchy, or missing content elements in existing technologies, and improving the structural consistency and controllability of the generated results.
[0066] Furthermore, this invention performs standardization verification on the draft official document text during the output stage, and revises the draft official document text based on the standardization verification results to output personalized draft official documents. This makes the generated text more in line with the requirements of official document standards in terms of format, structure, wording and citation, thereby reducing the workload of manual proofreading and revision, and improving the direct usability of the draft official document and the overall generation efficiency. Attached Figure Description
[0067] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0068] Figure 1 This is an overall flowchart of a personalized official document draft generation method and system based on multi-source data fusion proposed in this invention;
[0069] Figure 2 This is a schematic diagram illustrating the construction of fusion representation data for a personalized official document draft generation method and system based on multi-source data fusion proposed in this invention.
[0070] Figure 3 This is a schematic diagram of the improved Linformer architecture of a personalized official document draft generation method and system based on multi-source data fusion proposed in this invention. Detailed Implementation
[0071] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0072] refer to Figures 1-3 A method for generating personalized official document drafts based on multi-source data fusion includes the following steps:
[0073] Obtain document generation task information, which includes document category identifier, writing scenario identifier, user identifier, and basic writing element information input by the user;
[0074] Based on document category identifiers, writing scenario identifiers, and user identifiers, candidate data for document association is obtained from multi-source heterogeneous data;
[0075] Preprocess the candidate data associated with official documents to obtain standardized candidate data;
[0076] The standardized candidate data is classified according to its source. Based on the semantic relevance between the basic writing element information and the standardized candidate data, the classified standardized candidate data is sorted and aggregated. An attention fusion algorithm is then used to generate fused representation data.
[0077] Based on user identifiers, user historical manuscript data and user editing behavior data are obtained to construct personalized user feature data;
[0078] Obtain the target document structure template based on the document category identifier and writing scenario identifier;
[0079] The data is integrated with the representational data and the user's personalized feature data. The document generation model is composed of an improved Linformer architecture and generates document outline data under the constraints of the target document structure template. Based on the document outline data, the document draft text is generated.
[0080] Perform standardization verification on the draft official document text, revise the draft official document text based on the results of the standardization verification, and output a personalized draft official document.
[0081] In this embodiment, the acquisition process involves receiving a document generation request submitted by a user, reading the title information and key content information input by the user from the document generation request, and combining the title information and key content information to form basic writing element information. The document category identifier, writing scenario identifier, and user identifier are read from the document generation request, and the document category identifier, writing scenario identifier, user identifier, and basic writing element information are summarized to form document generation task information.
[0082] In this embodiment, the acquisition of document-related candidate data specifically includes:
[0083] By combining document category identifiers, writing scenario identifiers, and user identifiers, search criteria for document type attributes, writing scenario attributes, and user attributes are generated.
[0084] The combination process is as follows: The document category identifier, writing scenario identifier, and user identifier are formatted uniformly; the uniformly formatted document category identifier, writing scenario identifier, and user identifier are sequentially written into the same search condition data structure according to a fixed field order, and a corresponding field position is assigned to each identifier; based on the field position, a relationship is established between the document category identifier, writing scenario identifier, and user identifier to form search conditions representing document type attributes, writing scenario attributes, and user attributes.
[0085] Based on the search criteria, candidate data matching the search criteria are obtained from public material libraries, local knowledge bases, and personal material libraries in multi-source heterogeneous data.
[0086] The acquisition process is as follows: Search criteria are sent as search parameters to the data access interfaces of the public resource library, local knowledge base, and personal resource library, respectively. In each resource library, the stored data is compared field-by-field based on the search criteria. This comparison involves comparing the document category identifier, writing scenario identifier, and user identifier in the search criteria with the corresponding fields in each data record. If the document category identifier, writing scenario identifier, and user identifier in the same data record are identical to those in the search criteria, the data record is considered to meet the consistency matching criteria. Data records meeting the consistency matching criteria are retained as target data records, while those not meeting the criteria are excluded. The corresponding text content is then read from the target data records as candidate data.
[0087] Candidate data obtained from public resource libraries, local knowledge bases, and personal resource libraries are aggregated to obtain aggregated candidate data.
[0088] The aggregated candidate data is processed by type labeling, which includes labeling policy basis texts, policy interpretation texts, model texts, and case material texts, generating candidate data related to official documents.
[0089] In this embodiment, obtaining standardized candidate data specifically includes:
[0090] The candidate data associated with official documents are preprocessed, including normalization, text segmentation, noise filtering, sensitive information masking, text deduplication, and unified encoding.
[0091] Perform standardized processing on candidate data associated with official documents;
[0092] The standardization process specifically involves: sequentially scanning each text entry in the candidate data of the official document from the first character to the last character; performing case-consistent processing on English letters in the text; performing character standardization on full-width characters in the text; performing unified mapping processing on punctuation marks in the text, including replacing Chinese commas with commas, Chinese colons with colons, Chinese semicolons with semicolons, Chinese quotation marks with unified quotation marks, and ellipses with unified ellipses; and deleting consecutive whitespace characters at the beginning and end of the text, including spaces, tabs, and newlines.
[0093] Text segmentation is performed on the standardized candidate data of official documents.
[0094] The text segmentation process is as follows: Each text in the standardized candidate data for document association is scanned sequentially, and the text is divided into paragraphs based on predefined paragraph boundary markers, including line breaks and paragraph separators. After paragraph division, the text within each paragraph is scanned sequentially, and the text within each paragraph is divided into sentences based on sentence boundary markers, including periods, question marks, exclamation marks, and corresponding Chinese punctuation marks. The text divided according to paragraph and sentence boundaries is then used as the segmented candidate data for document association.
[0095] Noise filtering is performed on the candidate data of related official documents after text segmentation.
[0096] The noise filtering process specifically involves: sequentially scanning the text in the candidate data of official documents after text segmentation, identifying symbolic characters that do not carry semantic information, and deleting these characters from the text. Non-semantic symbolic characters include control characters, invisible characters, and decorative symbols unrelated to the text content; detecting line separators in the text, determining lines that do not contain valid character content as invalid blank lines, and deleting these invalid blank lines; and detecting consecutive occurrences of the same punctuation marks in the text. When the same punctuation mark is detected to appear consecutively in adjacent positions, the corresponding punctuation mark character is retained, and the duplicate punctuation mark character is deleted.
[0097] Sensitive information masking is applied to the candidate data of official documents after noise filtering.
[0098] The sensitive information masking process is as follows: The text in the candidate data for document association after noise filtering is sequentially scanned, and character sequences in the text are matched and detected according to sensitive information identification rules. When a character sequence is detected to match the sensitive information features corresponding to the sensitive information identification rules, the character sequence is determined to be sensitive information. A replacement process is performed on the character sequences determined to be sensitive information, replacing the character sequences corresponding to the sensitive information with masking markers in a predefined format. The text after the replacement process is used as the candidate data for document association after the sensitive information masking process is completed.
[0099] After sensitive information is masked, text deduplication is performed on the candidate data of the official documents associated with them. Text deduplication includes deleting duplicate text based on text content consistency comparison.
[0100] The text deduplication process is as follows: For each text in the candidate data of official documents after sensitive information masking, a corresponding text feature value is generated. The text feature value refers to the character sequence feature of the text content. The text feature values of any two texts are compared one by one. When the text feature values of two texts are exactly the same, the two texts are determined to be consistent in text content. If multiple texts are determined to be consistent, one text is retained as the retained text, and the remaining consistent texts are deleted.
[0101] After text deduplication, the associated candidate data of official documents is subjected to unified encoding to form standardized candidate data;
[0102] The unified encoding process is as follows: each text in the candidate data of official documents after text deduplication is read character by character to obtain the character encoding type corresponding to each character; when a character in the text is detected whose character encoding type is inconsistent with the target character encoding type, the character is re-encoded according to the target character encoding rule, which is to uniformly adopt the UTF-8 character encoding standard, and the text after re-encoding is traversed and confirmed.
[0103] In this embodiment, the generation of fused characterization data specifically includes:
[0104] Based on the data source, the standardized candidate data is classified and processed to form a subset of candidate data, which includes a public material data set, a local knowledge data set, and a personal material data set.
[0105] The basic writing element information is converted into a first semantic representation vector, and the standardized candidate data in each candidate data subset is converted into a second semantic representation vector, generating a corresponding content feature vector for each standardized candidate data.
[0106] The conversion process is as follows: Text parsing is performed on the basic writing elements information. The corresponding title information, content points, and writing constraints are segmented, tagged with parts of speech, and semantically encoded. A pre-defined text encoding model maps the basic writing elements information into a unified first semantic representation vector. This first semantic representation vector represents the overall semantic requirements of this document generation task. Standardized candidate data in each subset of candidate data are then encoded using text encoding. This text encoding process includes segmenting the candidate data text, semantic unit segmentation, and context modeling. Each standardized candidate data item is mapped to a corresponding second semantic representation vector using the same encoding space as the first semantic representation vector. Based on the generated second semantic representation vector, feature information related to content expression is extracted from the standardized candidate data. This feature information includes syntactic structure features, keyword distribution features, and semantic importance features. This feature information is then encoded into a corresponding content feature vector.
[0107] An attention fusion algorithm is adopted to calculate the attention weight value corresponding to each standardized candidate data based on the semantic correlation between the first semantic representation vector and the second semantic representation vector. The attention weight value is obtained by normalizing the similarity between the first semantic representation vector and each second semantic representation vector.
[0108] Based on the attention weight values, a weighted fusion process is performed on the content feature vectors to generate intermediate fusion vectors corresponding to each candidate data subset. The weighted fusion process includes weighting each content feature vector with its corresponding attention weight value and accumulating the weights.
[0109] The intermediate fusion vectors corresponding to each candidate data subset are uniformly combined to generate fusion representation data.
[0110] The unified combination processing is as follows: Dimension alignment and scale normalization are performed on each intermediate fusion vector. The intermediate fusion vectors after dimension alignment and scale normalization are concatenated according to the order of data source to obtain a combined vector. Based on the combined vector, the concatenated features are compressed and reorganized through linear transformation to output fusion representation data with fixed dimensions. The linear transformation adopts matrix multiplication and bias term addition.
[0111] In this embodiment, the construction of user personalized feature data specifically includes:
[0112] Based on user identifiers, user historical manuscript data and user editing behavior data are obtained. User historical manuscript data includes a set of historical official document texts associated with user identifiers, and user editing behavior data includes a set of editing operation records of the historical official document text set.
[0113] The acquisition process is as follows: After receiving the user identifier, the system uses the user identifier as a search key to query the user data storage module and obtain a list of historical document text identifiers associated with the user identifier; based on the list of historical document text identifiers, the system reads the corresponding historical document text content one by one, and aggregates the read historical document text content to form a historical document text set, which serves as the user's historical manuscript data; based on the list of historical document text identifiers, the system retrieves the editing operation records corresponding to each historical document text identifier in the editing behavior data storage module. The editing operation records include the editing operation type, editing operation location, editing operation content, and editing operation time; the editing operation records corresponding to each historical document text identifier are aggregated to form an editing operation record set, which serves as the user's editing behavior data;
[0114] Text parsing is performed on a collection of historical official documents to obtain a set of statistical features of writing style.
[0115] The text parsing process specifically involves: segmenting and sentence-by-sentence processing for each historical document in the historical document text set to obtain paragraph and sentence sequences; counting the number of characters or words in each sentence based on the sentence sequences and forming sentence length distribution features by length intervals; counting the number of characters or words in each paragraph based on the paragraph sequences and forming paragraph length distribution features by length intervals; identifying and counting punctuation marks in the historical document text set, and counting the frequency and proportion of different punctuation marks to form punctuation usage distribution features; extracting fixed expressions from the historical document text set and counting the frequency of each fixed expression to form fixed expression usage frequency features; and combining the sentence length distribution features, paragraph length distribution features, punctuation usage distribution features, and fixed expression usage frequency features to obtain a set of writing style statistical features.
[0116] The set of editing operation records is processed by behavior serialization to obtain a set of editing behavior features;
[0117] The serialization process specifically involves: extracting the editing operation type, time, location, and content from each editing operation record in the editing operation record set; sorting the editing operation records according to the time to form an editing behavior sequence; mapping the editing operation types in the editing behavior sequence to deletion, replacement, addition, paragraph rearrangement, and standardization revision operations; counting the number of operations for each type of editing operation in the editing behavior sequence and calculating the proportion of each type of editing operation to the total number of editing operations, thus obtaining the proportion characteristics of deletion, replacement, addition, paragraph rearrangement, and standardization revision operations, forming an editing behavior feature set;
[0118] A thesaurus of keywords is constructed based on a collection of historical official documents. The frequency of each keyword in the thesaurus is counted in the historical official documents. The weight of each keyword is calculated based on the frequency of occurrence. The keyword weights are then combined into a theme preference feature vector according to the index order of the keywords in the thesaurus.
[0119] The construction process is as follows: each historical document in the historical document text set is segmented and stop words are removed to obtain a candidate word set. The candidate word set is then subjected to word form merging and low-frequency words are removed to form a subject word list set.
[0120] The calculation process is as follows: for each keyword in the keyword thesaurus, the frequency of occurrence of the keyword in the historical document text set is counted; the frequency of occurrence of the keyword in the historical document text set is used as the original weight value of the keyword; the original weight values of all keywords in the keyword thesaurus are normalized, which includes calculating the sum of the occurrence frequencies of all keywords and dividing the occurrence frequency of each keyword by the sum of the occurrence frequencies to obtain the corresponding keyword weight;
[0121] A set of expression pairs is constructed based on the replacement operation records in the set of edit operation records. The number of operations for each expression pair in the set of expression pairs is counted. The expression preference weights corresponding to each expression pair are calculated based on the number of operations. The expression preference weights are then combined into an expression preference feature vector according to the index order of the expression pairs in the set of expression pairs.
[0122] The construction process is as follows: filter replacement operation records with the editing operation type of replacement operation from the set of editing operation records; extract the original expression to be replaced and the target expression after replacement for each replacement operation record, and form a set of expression pairs by combining the original expression and the target expression; perform deduplication on the expression pairs obtained from all replacement operation records to form a set of expression pairs;
[0123] The calculation process is as follows: for each expression pair in the expression pair set, count the number of times it appears in the replacement operation record to obtain the number of operations; use the number of operations as the original preference value of the expression pair, and normalize the original preference values of all expression pairs in the expression pair set. The normalization process includes calculating the sum of the number of operations of all expression pairs, and dividing the number of operations of each expression pair by the sum of the number of operations to obtain the expression preference weight corresponding to the expression pair.
[0124] By concatenating the feature vectors of writing style, editing behavior, topic preference, and expression preference, we obtain personalized user feature data.
[0125] In this embodiment, obtaining the target document structure template specifically includes:
[0126] The target document structure template identifier is obtained based on the document category identifier and the writing scenario identifier, and the corresponding candidate structure template set is obtained based on the target document structure template identifier.
[0127] The specific process is as follows: After receiving the document category identifier and the writing scenario identifier, the system combines the document category identifier and the writing scenario identifier to generate template search conditions; based on the template search conditions, the system performs a search in the template storage module to obtain the target document structure template identifier that matches the template search conditions.
[0128] Based on the basic writing element information, structural matching processing is performed on each candidate structural template in the candidate structural template set to obtain the matching degree score corresponding to each candidate structural template.
[0129] The structural matching process is as follows: Basic writing element information is extracted to obtain a basic writing element set, which includes title elements, content point elements, and writing constraint elements; template structure information is extracted from each candidate structure template in the candidate structure template set, including chapter structure, paragraph order, and content element slots corresponding to each paragraph; each basic writing element in the basic writing element set is matched item by item with the content element slots, and the number of successfully matched basic writing elements is counted relative to the total number of basic writing elements; the ratio of the number of successfully matched basic writing elements to the total number of basic writing elements is used as the matching score for the candidate structure template.
[0130] The candidate structure template set is sorted based on the matching score, and the candidate structure template with the highest matching score is selected as the target document structure template.
[0131] In this embodiment, the generation of the draft document text specifically includes:
[0132] The document generation model is composed of an improved Linformer architecture, which includes a low-rank attention computation unit, a multi-condition injection unit, and a structure template constraint generation unit. The improvement of the Linformer architecture lies in performing low-rank projection on the key representation and value representation to generate attention output, and using the fused representation data and user-personalized feature data as conditions to modulate the attention output to generate the hidden state after condition injection. A structure-aware alignment mechanism is introduced to generate document outline data under the constraint of the target document structure template.
[0133] In the low-rank attention computation unit, attention computation processing is performed on the fused representation data, low-rank projection processing is performed on the key representation and value representation in the attention computation, and attention output is generated based on the key representation and value representation after low-rank projection processing. Low-rank projection processing refers to linearly mapping the key representation and value representation from the original dimension to the low-dimensional projected representation in the attention computation.
[0134] In the multi-condition injection unit, conditional injection processing is performed on the attention output based on fused representation data and user-personalized feature data to generate the hidden state after conditional injection.
[0135] Conditional injection processing refers to combining the fusion conditional representation of the fused representation data and the personalized conditional representation of the user's personalized feature data to obtain a conditional representation, and modulating the attention output based on the conditional representation. Modulation involves replacing the conditional representation with scaling and offset parameters consistent with the dimensions of the attention output, performing scaling processing on each dimension component of the attention output and superimposing offset processing to obtain the modulated attention output, and integrating the modulated attention output to generate the hidden state after conditional injection.
[0136] In the structural template constraint generation unit, a structure-aware alignment mechanism is introduced to align the hidden state after condition injection with the chapter structure, paragraph order and content element slots in the target document structural template to obtain the structural alignment representation corresponding to each content element slot and generate document outline data.
[0137] By using the fill content corresponding to each content element slot in the document outline data, the fill content is used as the input condition for paragraph generation to generate corresponding paragraph text. The paragraph texts are then spliced together according to the chapter structure and paragraph order to obtain the document draft text.
[0138] In this embodiment, the draft official document text undergoes standardization verification, which includes format standardization verification, structural standardization verification, terminology standardization verification, and citation standardization verification. The standardization verification results are output, and text fragments in the draft official document text that do not conform to the set of official document standardization rules are located based on the standardization verification results. The set of official document standardization rules consists of official document category identifiers and writing scenario identifiers. Revision instructions are generated for the text fragments, and the draft official document text is revised based on the revision instructions to obtain the revised draft official document text, thus forming a personalized draft official document.
[0139] A personalized official document draft generation system based on multi-source data fusion includes:
[0140] The task information acquisition module is used to acquire document generation task information, which includes document category identifier, writing scenario identifier, user identifier, and basic writing element information input by the user.
[0141] The candidate data acquisition module is used to acquire candidate data related to official documents from multi-source heterogeneous data based on document category identifiers, writing scenario identifiers, and user identifiers.
[0142] The preprocessing module is used to preprocess the candidate data associated with official documents to obtain standardized candidate data;
[0143] The data fusion module is used to classify standardized candidate data according to data sources, and sort and aggregate the classified standardized candidate data based on the semantic relevance between basic writing element information and standardized candidate data, and generate fused representation data using attention fusion algorithm;
[0144] The personalized feature construction module is used to obtain user's historical manuscript data and user editing behavior data based on user identifiers, and to construct user personalized feature data.
[0145] The structure template acquisition module is used to obtain the target document structure template based on the document category identifier and the writing scenario identifier.
[0146] The document generation module is used to input the integrated representation data and user personalized feature data into the document generation model, generate document outline data under the constraints of the target document structure template, and generate document draft text based on the document outline data. The document generation model consists of an improved Linformer architecture.
[0147] The standardization verification and revision module is used to perform standardization verification on the draft text of official documents, and revise the draft text based on the results of the standardization verification to output personalized draft official documents.
[0148] Example 1: In the daily administrative processing of a municipal government office, staff frequently need to draft a large number of standardized official documents, such as meeting minutes, requests for instructions, reports, work summaries, and policy communication documents. These documents must not only conform to standardized formats but also closely adhere to the actual content, while also incorporating the unit's language style and specific business characteristics. For a long time, staff have mainly relied on manual drafting or using static templates, and then manually searching for and combining materials. This method is inefficient, has a high error rate, and lacks personalized expression.
[0149] To address this issue, the Information Management Section of the General Office launched a pilot application of an "AI-assisted document draft generation system." In the pilot, the system adopted the personalized document draft generation method and system based on multi-source data fusion proposed in this invention. It was specifically deployed within the unit's internal business support platform, integrating three types of data sources: the unit's document database, departmental experience documents, and individual historical drafts. It also linked with a user behavior log system to obtain real-time information on user writing behavior and preferences.
[0150] In practical applications, when staff input a title such as "Report on Promoting the Renovation of Old Urban Residential Areas" and supplement it with key points such as "task completion status, next steps, existing problems and suggestions," the system first parses the input and automatically constructs basic writing elements. Then, based on document type, writing scenario, and user identity, it retrieves text data matching the task from three types of resource databases, performs preprocessing, removes redundant content, standardizes format encoding, and forms a standardized candidate dataset.
[0151] Next, the system classifies and ranks these candidate data based on semantic encoding results, fusing them to generate fused representation data that reflects both "task features" and "user style." Simultaneously, the system extracts 34 official documents drafted by the user over the past year, analyzing their paragraph structure preferences, word usage tendencies, sentence length distribution, etc., constructing a writing style vector, and combining this with their editing behavior to generate expression preference features. All this information is then merged and input into the improved Linformer model. The model utilizes a low-rank attention mechanism to reduce semantic computation costs and embeds user style and current task semantics into the generation logic through a conditional injection mechanism.
[0152] During the generation process, the system first outputs a document outline that conforms to the structural template requirements, and then generates text drafts paragraph by paragraph. In the post-processing stage, the system performs standardization checks on the generated drafts based on the internal standardization library of the government affairs office, automatically identifying problems such as "inappropriate wording," "failure to properly cite policy numbers," and "incomplete structure," and automatically revising them. The entire process takes only about 12 seconds, greatly improving writing efficiency.
[0153] To evaluate the effectiveness of the system, the efficiency and quality of results of 20 staff members were compared between the traditional manual writing method and the use of this system. The statistics are as follows.
[0154] Table 1 Comparison of Application Effects of Intelligent Document Draft Generation System
[0155] Indicator Item Traditional method (average) The method of this invention (average) Increase Average time (in seconds) to complete a draft 1167 54 ↓ Approximately 95.4% Average number of revisions (times) 4.6 1.3 ↓ Approximately 71.7% Text-task relevance score (out of 5) 3.2 4.6 ↑ Approximately 43.8% User style consistency score (out of 5) 2.9 4.5 ↑ Approximately 55.2% Structural compliance pass rate (%) 62% 96% ↑ Approximately 54.8%
[0156] As shown in Table 1, after using the method proposed in this invention, the time for staff to draft a standardized official document draft was significantly reduced to less than 1 minute, while the traditional method took an average of nearly 20 minutes. The number of revisions to the generated text was also significantly reduced, reflecting that the system output is more in line with user intent and standard requirements. In manual review, the relevance score between the text content and the task points improved from 3.2 to 4.6, and the user style consistency score also improved significantly, indicating that the system accurately models the user's historical writing characteristics and significantly enhances personalized expression capabilities. The structural compliance pass rate jumped from 62% to 96%, indicating that the system's understanding and execution of the template structure during the generation process is more stable and accurate.
[0157] In summary, this invention provides a comprehensive and automated solution for multi-source data fusion, user feature modeling, and document structure constraint generation, which greatly improves the efficiency and quality of document writing and fully demonstrates the practicality and advancement of this method in actual government office scenarios.
[0158] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for generating personalized official document drafts based on multi-source data fusion, characterized in that, Includes the following steps: Obtain document generation task information, which includes document category identifier, writing scenario identifier, user identifier, and basic writing element information input by the user; Based on document category identifiers, writing scenario identifiers, and user identifiers, candidate data for document association is obtained from multi-source heterogeneous data; Preprocess the candidate data associated with official documents to obtain standardized candidate data; The standardized candidate data is classified according to its source. Based on the semantic relevance between the basic writing element information and the standardized candidate data, the classified standardized candidate data is sorted and aggregated. An attention fusion algorithm is then used to generate fused representation data. Based on user identifiers, user historical manuscript data and user editing behavior data are obtained to construct personalized user feature data; Obtain the target document structure template based on the document category identifier and writing scenario identifier; The data is integrated with the characterization data and the user's personalized feature data. The document generation model is composed of an improved Linformer architecture and generates document outline data under the constraints of the target document structure template. Based on the document outline data, the document draft text is generated. Perform standardization verification on the draft official document text, revise the draft official document text based on the results of the standardization verification, and output a personalized draft official document.
2. A method for generating personalized official document drafts based on multi-source data fusion according to claim 1, characterized in that, The acquisition process involves receiving a document generation request submitted by a user, reading the title information and key content information input by the user from the document generation request, and combining the title information and key content information to form basic writing element information. The document category identifier, writing scenario identifier, and user identifier are read from the document generation request. The document category identifier, writing scenario identifier, user identifier, and basic writing element information are then summarized to form document generation task information.
3. A method for generating personalized official document drafts based on multi-source data fusion according to claim 1, characterized in that, The acquisition of the document-related candidate data specifically includes: By combining document category identifiers, writing scenario identifiers, and user identifiers, search criteria for document type attributes, writing scenario attributes, and user attributes are generated. Based on the search criteria, candidate data matching the search criteria are obtained from public material libraries, local knowledge bases, and personal material libraries in multi-source heterogeneous data. The candidate data obtained from the public resource library, the candidate data obtained from the local knowledge base, and the candidate data obtained from the personal resource library are aggregated and processed to obtain aggregated candidate data; The aggregated candidate data is processed by type labeling, which includes labeling policy basis texts, policy interpretation texts, model texts, and case material texts, generating candidate data related to official documents.
4. A method for generating personalized official document drafts based on multi-source data fusion according to claim 1, characterized in that, The standardization of candidate data is obtained specifically through: The candidate data associated with official documents are preprocessed, including normalization, text segmentation, noise filtering, sensitive information masking, text deduplication, and unified encoding. Perform standardized processing on candidate data associated with official documents; Text segmentation is performed on the standardized candidate data of official documents. Noise filtering is performed on the candidate data of related official documents after text segmentation. Sensitive information masking is applied to the candidate data of official documents after noise filtering. After sensitive information is masked, text deduplication is performed on the candidate data of the official documents associated with them. Text deduplication includes deleting duplicate text based on text content consistency comparison. The candidate data of official documents after text deduplication are subjected to unified encoding processing to form standardized candidate data.
5. A method for generating personalized official document drafts based on multi-source data fusion according to claim 1, characterized in that, The generation of the fusion representation data specifically includes: Based on the data source, the standardized candidate data is classified and processed to form a subset of candidate data, which includes a public material data set, a local knowledge data set, and a personal material data set. The basic writing element information is converted into a first semantic representation vector, and the standardized candidate data in each candidate data subset is converted into a second semantic representation vector, generating a corresponding content feature vector for each standardized candidate data. An attention fusion algorithm is used to calculate the attention weight value corresponding to each standardized candidate data based on the semantic correlation between the first semantic representation vector and the second semantic representation vector. Based on the attention weight values, a weighted fusion process is performed on the content feature vectors to generate intermediate fusion vectors corresponding to each candidate data subset; The intermediate fusion vectors corresponding to each candidate data subset are uniformly combined to generate fusion representation data.
6. A method for generating personalized official document drafts based on multi-source data fusion according to claim 1, characterized in that, The construction of the user personalized feature data specifically includes: Based on the user identifier, the user's historical manuscript data and user editing behavior data are obtained. The user's historical manuscript data includes a set of historical official document texts associated with the user identifier, and the user editing behavior data includes a set of editing operation records of the historical official document text set. Text parsing is performed on a collection of historical official documents to obtain a set of statistical features of writing style. The set of editing operation records is processed by behavior serialization to obtain a set of editing behavior features; A thesaurus of keywords is constructed based on a collection of historical official documents. The frequency of each keyword in the thesaurus of keywords in the collection of historical official documents is counted. The weight of each keyword is calculated based on the frequency of occurrence. The thesaurus of keywords is then arranged into a theme preference feature vector according to the index order of the keywords in the thesaurus of keywords. An expression pair set is constructed based on the replacement operation records in the edit operation record set, and the number of operations for each expression pair in the expression pair set is counted. The expression preference weight corresponding to each expression pair is calculated based on the number of operations, and the expression preference feature vector is formed according to the index order of the expression pairs in the expression pair set. By concatenating the feature vectors of writing style, editing behavior, topic preference, and expression preference, we can obtain personalized user feature data.
7. A method for generating personalized official document drafts based on multi-source data fusion according to claim 1, characterized in that, Obtaining the target document structure template specifically includes: The target document structure template identifier is obtained based on the document category identifier and the writing scenario identifier, and the corresponding candidate structure template set is obtained based on the target document structure template identifier. Based on the basic writing element information, structural matching processing is performed on each candidate structural template in the candidate structural template set to obtain the matching degree score corresponding to each candidate structural template. The candidate structure template set is sorted based on the matching score, and the candidate structure template with the highest matching score is selected as the target document structure template.
8. A method for generating personalized official document drafts based on multi-source data fusion according to claim 1, characterized in that, The generation of the draft document text specifically includes: The fused representation data and user-personalized feature data are input into the document generation model, which is composed of an improved Linformer architecture. The improved Linformer architecture includes a low-rank attention computation unit, a multi-condition injection unit, and a structure template constraint generation unit. The improvement of the improved Linformer architecture lies in performing low-rank projection on the key representation and value representation to generate attention output, and using the fused representation data and user-personalized feature data as conditions to modulate the attention output to generate the hidden state after condition injection. A structure-aware alignment mechanism is introduced to generate document outline data under the constraint of the target document structure template. In the low-rank attention computation unit, attention computation processing is performed on the fused representation data, low-rank projection processing is performed on the key representation and value representation in the attention computation, and attention output is generated based on the key representation and value representation after low-rank projection processing. The low-rank projection processing refers to linearly mapping the key representation and value representation from the original dimension to the low-rank projection representation in the attention computation. In the multi-condition injection unit, conditional injection processing is performed on the attention output based on fused representation data and user-personalized feature data to generate the hidden state after conditional injection. In the structural template constraint generation unit, a structure-aware alignment mechanism is introduced to align the hidden state after condition injection with the chapter structure, paragraph order and content element slots in the target document structural template to obtain the structural alignment representation corresponding to each content element slot and generate document outline data. By using the fill content corresponding to each content element slot in the document outline data, the fill content is used as the input condition for paragraph generation to generate corresponding paragraph text. The paragraph texts are then spliced together according to the chapter structure and paragraph order to obtain the document draft text.
9. A method for generating personalized official document drafts based on multi-source data fusion according to claim 1, characterized in that, The draft official document text undergoes a standardization verification process, which includes format standardization verification, structural standardization verification, terminology standardization verification, and citation standardization verification. The standardization verification results are output, and text fragments in the draft official document text that do not conform to the set of official document standardization rules are located based on the standardization verification results. The set of official document standardization rules consists of official document category identifiers and writing scenario identifiers. Revision instructions are generated for the text fragments, and the draft official document text is revised based on the revision instructions to obtain the revised draft official document text, thus forming a personalized draft official document.
10. A personalized official document draft generation system based on multi-source data fusion, comprising the personalized official document draft generation method based on multi-source data fusion according to any one of claims 1 to 9, characterized in that, include: The task information acquisition module is used to acquire document generation task information, which includes document category identifier, writing scenario identifier, user identifier, and basic writing element information input by the user. The candidate data acquisition module is used to acquire candidate data related to official documents from multi-source heterogeneous data based on document category identifiers, writing scenario identifiers, and user identifiers. The preprocessing module is used to preprocess the candidate data associated with official documents to obtain standardized candidate data; The data fusion module is used to classify standardized candidate data according to data sources, and sort and aggregate the classified standardized candidate data based on the semantic relevance between basic writing element information and standardized candidate data, and generate fused representation data using attention fusion algorithm; The personalized feature construction module is used to obtain user's historical manuscript data and user editing behavior data based on user identifiers, and to construct user personalized feature data. The structure template acquisition module is used to obtain the target document structure template based on the document category identifier and the writing scenario identifier. The document generation module is used to input the fused representation data and user personalized feature data into the document generation model, generate document outline data under the constraints of the target document structure template, and generate document draft text based on the document outline data. The document generation model is composed of an improved Linformer architecture. The standardization verification and revision module is used to perform standardization verification on the draft official document text, and revise the draft official document text based on the results of the standardization verification, and output personalized draft official documents.