Method, system, storage medium and program product for automatic generation of cross-domain documents

By using historical data from the target domain to construct structural templates and terminology dictionaries in the automatic document generation system, and combining cross-domain alignment and contextual adaptation, the problems of non-standard structure and inaccurate wording in cross-domain document generation are solved, and high-quality cross-domain migration and self-optimization of document content are achieved.

CN120975065BActive Publication Date: 2026-04-28BEIJING QUANKE ONLINE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING QUANKE ONLINE TECH CO LTD
Filing Date
2025-08-05
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

When existing document automatic generation technologies are applied across different fields, they are prone to problems such as non-standard structure and inaccurate wording, making it difficult to meet the requirements of the target field for structural standardization and professional expression.

Method used

By extracting structural templates and terminology dictionaries from historical official document data in the target domain, structural and contextual adaptations are performed. Combined with cross-domain alignment mapping tables and confidence calculations, the generated official document content is dynamically optimized.

Benefits of technology

It improves the accuracy and practicality of cross-domain document generation, ensures that the document structure and wording conform to the target domain's standards, reduces structural confusion and wording errors caused by domain differences, and enhances the system's adaptability and compliance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120975065B_ABST
    Figure CN120975065B_ABST
Patent Text Reader

Abstract

The application provides an automatic generation method and system of cross-field official documents, a storage medium and a program product, and relates to the field of electric digital data processing. The method comprises the following steps: extracting key information from historical official document data of a target field to provide basic support for subsequent research and template construction; constructing a structure template for representing the structure composition and paragraph order of the official documents of the target field according to the key information; developing a term dictionary of the target field based on the historical official document data; performing structure adaptation on the preliminary text according to the structure template to generate a structure adaptation text with the structure characteristics of the target field; and performing context adaptation on the structure adaptation text according to the term dictionary, so as to finally obtain a context adaptation text that conforms to the specifications of the target field in terms of word usage, expression and professional context. By implementing the method, the problems of non-standard structure and inaccurate word usage in cross-field migration can be reduced, and the accuracy and practicality of the automatically generated official documents in multi-field application scenarios are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic digital data processing, and in particular to a method, system, storage medium, and program product for automatically generating cross-domain official documents. Background Technology

[0002] Against the backdrop of rapid development in informatization and intelligentization, more and more organizations and units have an increasingly urgent need to utilize automation technologies such as artificial intelligence to improve the efficiency of official document writing and management. With the continuous advancement of artificial intelligence technology, especially natural language processing and generation technology, automatic document generation has become an important means for many enterprises and institutions to optimize office processes, improve office efficiency, and reduce labor costs. By automatically generating document content, human resources can be saved, and the standardization and normalization of official documents can be improved, providing solid support for efficient office work and standardized management.

[0003] In related technologies, pre-trained models for general domains are generally used to automatically generate different types of official documents, or existing domain-specific document data is fine-tuned to enable the model to output text with certain domain characteristics. Furthermore, some systems can combine keyword extraction and template matching to further improve the relevance and standardization of the generated document content. These methods, to a certain extent, meet the needs for automatic document generation in some scenarios, especially when the data volume is sufficient and the domain is relatively simple, enabling the output of relatively standardized document content.

[0004] However, with the increasing prevalence of automated document generation systems across various industries and departments, more and more users hope to utilize the same system to meet the document writing needs of multiple business areas. For example, companies want to migrate their automated document generation capabilities, originally applied to administrative management, to new business scenarios such as human resources, finance, and healthcare, in order to save R&D resources and improve system reusability. Related technologies typically rely on training general-domain models, template reuse, or simple fine-tuning. When applied to target domains with significant differences in structural norms, vocabulary habits, or expression styles, this often results in incomplete output text structure, unreasonable paragraph arrangement, and inaccurate terminology. This makes it difficult for generated documents to meet the structural norms and professional expression requirements of the target domain in cross-domain application scenarios. Summary of the Invention

[0005] This application provides a method, system, storage medium, and program product for automatically generating cross-domain official documents, which addresses the problems of non-standard document structure and inaccurate wording that easily occur when existing automatic document generation technologies are applied across domains.

[0006] Firstly, this application provides a method for automatically generating cross-domain official documents, applied to an automatic document generation system, the method comprising the following:

[0007] Key information is extracted from historical official document data in the target domain, and this key information provides the basic support for template construction.

[0008] Based on the key information, a structural template is constructed to represent the structural composition and paragraph order of official documents in the target domain. The historical document data is a collection of existing document texts in the target domain.

[0009] A terminology dictionary for the target domain is constructed based on the historical document data. The terminology dictionary is used to represent high-frequency professional terms in the documents of the target domain and the contextual distribution of the corresponding high-frequency professional terms.

[0010] Based on the structural template, the preliminary text is structurally adapted to generate structurally adapted text with target domain structural features. The preliminary text is a cross-domain draft text generated based on an existing domain model.

[0011] The structure-adapted text is context-adapted based on the terminology dictionary to generate context-adapted text that meets the professional requirements of the target field in terms of word choice and expression.

[0012] Through the above embodiments, the system automatically extracts and establishes structural templates and terminology dictionaries based on historical official document data in the target domain, enabling cross-domain official document generation to adapt to the structural norms and professional terminology requirements of the target domain. Unlike existing technologies that simply rely on general models, this solution uses structural templates to adapt the text structure after generating the initial draft, ensuring that the overall layout and paragraph order of the official document conform to the conventions of the target domain; at the same time, it performs contextual adaptation based on the terminology dictionary, effectively improving the accuracy of professional terminology and the professionalism of expression. The combination of these two approaches can reduce the problems of structural irregularities and inaccurate terminology in cross-domain migration, improving the accuracy and practicality of automatically generated official documents in multi-domain applications.

[0013] In some embodiments, after the step of performing structural adaptation on the preliminary text according to the structural template to generate structurally adapted text with target domain structural features, the method further includes:

[0014] Establish mapping relationships between the target domain and existing domains on structural templates and terminology dictionaries respectively, and generate cross-domain alignment mapping tables;

[0015] Based on the cross-domain alignment mapping table, target structures and target terms in the structure-adapted text are extracted for cross-domain alignment to generate preliminary aligned text.

[0016] Calculate the confidence level of each target structure and target term in the preliminary aligned text and the corresponding mapping relationship in the cross-domain alignment mapping table, and generate a confidence level list;

[0017] Historical official document data is used to perform contextual supplementation matching on target structures and target terms with confidence levels below a preset threshold, generating aligned structure-adapted text.

[0018] Through the above embodiments, the system achieves cross-domain alignment using a cross-domain alignment mapping table and supplements the context for low-confidence parts. This method can accurately identify and correct structural and terminology mismatches that occur during rule migration, improving the adaptability to structures and professional terms across heterogeneous domains. By dynamically determining confidence and supplementing and optimizing with historical data, it effectively addresses structural confusion and professional terminology errors caused by domain differences, further enhancing the standardization and accuracy of cross-domain document generation.

[0019] In some embodiments, the step of calling historical official document data to perform contextual supplementation matching on the target structures and target terms with confidence scores below a preset threshold, and generating aligned structure-adapted text, specifically includes:

[0020] Obtain historical document paragraphs or text fragments with a comprehensive relevance greater than a preset relevance threshold to the target structure and target terms, and generate historical context use cases;

[0021] Generate a context similarity list based on the similarity between the historical context use cases and the target structure and target terms corresponding to the current context;

[0022] Obtain the structural description and terminology expression corresponding to the historical context use case with the highest similarity;

[0023] The structural representation and terminology are used to replace or complete target structures and terms with confidence levels below a preset threshold, generating aligned structure-adapted text.

[0024] Through the above embodiments, the system uses similarity retrieval of historical document paragraphs to supplement and replace the context of structures and terms with confidence levels below a threshold. This not only achieves high-quality correction of low-confidence content but also enhances the contextual rationality and professionalism of newly generated documents by utilizing numerous real historical cases. Dynamic matching and replacement reduce the risks caused by non-standard structures and inaccurate wording, making the generated documents more aligned with the expression habits and business needs of the target domain.

[0025] In some embodiments, the step of performing context adaptation on the structure-adapted text according to the terminology dictionary to generate context-adapted text that conforms to the professional requirements of the target domain in terms of word choice and expression specifically includes:

[0026] The structure-adapted text is divided into sentence-level segments, paragraph-level segments, and full-text content to generate multi-level text segments.

[0027] High-frequency specialized terms in the terminology dictionary are identified in text fragments at different levels, and a terminology distribution list corresponding to each text fragment at different levels is generated.

[0028] Based on the context distribution information in the terminology dictionary, a set of context adaptation suggestions is determined for each high-frequency professional term in the terminology distribution list. The set of context adaptation suggestions includes the adaptation contexts given for high-frequency professional terms in different levels of text fragments.

[0029] If all the adaptation contexts in the context adaptation suggestion set are consistent, the structural adaptation text is directly adjusted according to the adaptation context to generate context adaptation text that meets the professional requirements of the target field in terms of word choice and expression.

[0030] If there are inconsistent adaptation contexts in the set of context adaptation suggestions, the target adaptation context is determined according to the priority of different levels of text fragments, and the structural adaptation text is adjusted accordingly.

[0031] Through the above embodiments, the system segments the structure-adapted text into multi-level (sentence, paragraph, full text) segments, identifies and analyzes high-frequency professional terms hierarchically, and combines the contextual distribution information of the terminology dictionary to perform targeted contextual adaptation for text fragments at different levels. This approach can address the one-sidedness caused by traditional single-level word replacement, enabling professional terms to generate accurate expressions in different contexts, significantly improving the professionalism of the wording and the coherence of the context, and overcoming the inaccuracy of existing automatic document generation technologies.

[0032] In some embodiments, the step of determining the target adaptation context based on the priority corresponding to different levels of text fragments specifically includes:

[0033] Based on the preset priority of each level of text fragments, the context matching degree of high-frequency professional terms in the initial text, and the historical confidence degree corresponding to the high-frequency professional terms, the comprehensive priority score of each suitable context is calculated, and a comprehensive priority score sequence is generated.

[0034] The highest-scoring fitting context is selected from the comprehensive priority score sequence as the target fitting context.

[0035] Through the above embodiments, the system calculates and selects the optimal appropriate context by setting priorities, context matching degree, and historical confidence degree for multi-level text fragments, ensuring that the final wording and expression conform to the mainstream norms and expression habits of the target domain. This comprehensive priority decision-making mechanism can automatically make the most reasonable choice when multiple expressions are possible, reducing inconsistencies in wording and inaccuracies in expression caused by errors in priority judgment, and improving the accuracy and domain standardization of cross-domain official document generation.

[0036] In some embodiments, after the step of performing context adaptation on the structure-adapted text according to the terminology dictionary to generate context-adapted text that conforms to the professional requirements of the target domain in terms of word choice and expression, the method further includes:

[0037] Extract high-frequency professional terms from the context-adapted text and generate a target term set;

[0038] The target term set is compared with the existing domain term dictionary and the target domain term dictionary to generate a domain term difference set;

[0039] The domain-specific terminology difference set is matched with the risk-sensitive terminology library of the target domain to generate a risk terminology set;

[0040] Query the domain knowledge graph for the aforementioned set of risk terms to generate a set of risk labels;

[0041] Based on the risk label set, the corresponding risk words in the context-adapted text are automatically corrected to generate risk-corrected text.

[0042] Through the above embodiments, after word matching, the system further compares the target word set with the domain terminology dictionary to identify and screen risk-sensitive words, and combines the domain knowledge graph to achieve automatic risk labeling and correction. This process enhances the compliance and risk control capabilities of automatically generated official documents, proactively discovering and correcting sensitive words and potential expression risks caused by domain migration, effectively addressing compliance issues caused by non-standard structures and inaccurate wording, and improving the security and reliability of automatically generated official documents.

[0043] In some embodiments, after the step of performing context adaptation on the structure-adapted text according to the terminology dictionary to generate context-adapted text that conforms to the professional requirements of the target domain in terms of word choice and expression, the method further includes:

[0044] Collect user feedback information on the context-adapted text across multiple preset evaluation dimensions to generate a multi-dimensional user feedback set;

[0045] Cluster analysis is performed on the multi-dimensional user feedback set based on the similarity of user feedback content to generate feedback clustering results, which include different feedback categories and cluster centers corresponding to different feedback categories.

[0046] Based on the feedback clustering results, the feedback weights of each entry in the structure template and terminology dictionary are calculated, and a feedback weight distribution is generated.

[0047] Based on the feedback weight distribution, the corresponding entries in the structure template and terminology dictionary are adjusted to form the optimized structure template and terminology dictionary;

[0048] The optimized structure template and terminology dictionary are used to generate a new round of context-adapted text. The structure template and terminology dictionary are iteratively adjusted based on the new round of user feedback until the accuracy of structure adaptation and context adaptation meets the preset accuracy threshold.

[0049] Through the above embodiments, the system collects user feedback across multiple evaluation dimensions, performs cluster analysis on the feedback, and dynamically calculates and adjusts the feedback weights of the structure template and terminology dictionary, thereby achieving automatic optimization and self-iteration of the structure template and terminology dictionary. This mechanism can continuously improve the system based on feedback from actual applications, enhance the accuracy of structure and context adaptation, reduce structural and terminology inconsistencies that may arise during domain migration, and achieve continuous optimization of generated official document content and dynamic improvement of the system's intelligence level.

[0050] Secondly, this application provides an automatic document generation system, which includes: one or more processors and a memory;

[0051] The memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions;

[0052] The one or more processors execute the computer instructions, enabling the document automatic generation system to implement the cross-domain document automatic generation method provided in the above embodiments, which will not be elaborated here.

[0053] Thirdly, this application provides a computer-readable storage medium including instructions that, when executed on an automatic document generation system, enable the automatic document generation system to implement the cross-domain document automatic generation method provided in the above embodiments, which will not be elaborated here.

[0054] Fourthly, this application provides a computer program product that, when run on an automatic document generation system, enables the automatic document generation system to implement the cross-domain document automatic generation method provided in the above embodiments, which will not be elaborated here.

[0055] One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages:

[0056] 1. A scheme that automatically extracts structural templates and terminology dictionaries from historical official document data in the target domain, and performs in-depth adjustments to the initial cross-domain text through two stages: structural adaptation and contextual adaptation. This dual adaptation mechanism can specifically address common problems such as non-standard structure and inaccurate professional terminology when official documents are migrated between different domains, ensuring that the generated official documents not only have a reasonable overall framework, but also that the professional terminology and expressions meet the normative requirements of the target domain, thereby improving the accuracy and practicality of cross-domain official document generation.

[0057] 2. The system introduces structural and terminological mapping relationships between the target domain and existing domains, and achieves intelligent alignment and dynamic optimization through confidence calculation and contextual supplementation mechanisms. For uncertain or low-confidence content during cross-domain migration, the system can automatically retrieve historical context for completion and correction, thereby significantly reducing structural imbalances and word errors caused by domain differences. This dynamic adjustment process enhances the system's adaptability to complex multi-domain scenarios and the professionalism of the generated text.

[0058] 3. In addition to focusing on the standardization and professionalism of automatically generated text, the system also introduces an automatic identification, annotation, and correction mechanism for domain-sensitive keywords, effectively improving the compliance and security of official document generation. Simultaneously, by collecting and clustering multi-dimensional user feedback, the system dynamically adjusts and optimizes its structure templates and terminology dictionary, achieving self-evolution and continuous optimization. This user feedback-driven adaptive mechanism enhances the system's flexibility and intelligence in practical applications, enabling it to continuously meet the high standards required for official document generation across various fields. Attached Figure Description

[0059] Figure 1 This is a flowchart illustrating an automatic generation method for cross-domain official documents in an embodiment of this application;

[0060] Figure 2 This is another flowchart illustrating an automatic generation method for cross-domain official documents in an embodiment of this application;

[0061] Figure 3 This is a schematic diagram of the physical device structure of an automatic document generation system in the embodiments of this application. Detailed Implementation

[0062] The terminology used in the following embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used in the specification and appended claims of this application, the singular expressions “a,” “an,” “the,” “the,” “the,” and “this” are intended to include the plural expressions as well, unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in this application refers to any or all possible combinations including one or more of the listed items.

[0063] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature, and in the description of the embodiments of this application, unless otherwise stated, "multiple" means two or more.

[0064] For ease of understanding, the method provided in this implementation is described in process below. Please refer to [link / reference]. Figure 1 This is a flowchart illustrating an automatic generation method for cross-domain official documents in an embodiment of this application.

[0065] S101. Extract key information from historical official document data in the target domain. This key information provides basic support for template construction.

[0066] S102. Based on the key information, construct a structural template within the target domain to represent the structural composition and paragraph order of official documents in the target domain.

[0067] Among them, the target field refers to the specific field (such as medical, education, finance, etc.) that the document automatic generation system needs to generate documents for. The historical document data represents the collection of document texts that already exist in the target field, including various formal documents formed in the past in this field. The structure template is used to represent the structural composition of documents in the target field (such as modules such as title, body, and attachment description) and paragraph order (such as a fixed order of first explaining the background, then explaining the purpose, and finally proposing measures).

[0068] This step is performed after the document automatic generation system receives a cross-domain document generation request, but before the initial text has been processed. It is suitable for scenarios where existing domain document generation capabilities need to be migrated to a new target domain.

[0069] Specifically, the system first collects historical official document data within the target domain. This data covers different types and scenarios of official documents in the target domain to ensure coverage of common structural features of official documents in this domain. Then, it uses text parsing technology to perform structured analysis on the historical official document data, identifying recurring fixed modules in various types of official documents (such as the "request for instructions" and "reason explanation" modules in "request for instructions" type documents) and the order of arrangement between modules (i.e., key information), and then extracts structural templates that can represent the general structural rules of official documents in this domain.

[0070] Optionally, preprocess the historical official document data to remove redundant information (such as non-structural content like signatures and dates); use a rule-based method to divide paragraphs and modules according to punctuation marks (such as full stops and semicolons) and format markers (such as title levels); count the frequencies of each module and the sequential relationships between modules, and determine the structural template by combining modules that appear frequently and have a fixed order.

[0071] Optionally, use a text classification model in natural language processing to classify the historical official document data according to the type of official document (such as notices, reports, and approvals); for each type of official document, use a sequence labeling algorithm to identify the boundaries of key modules; through clustering analysis, find the common characteristics of the module composition and order in the same type of official documents, generate the structural template for this type of official document, and then integrate it into the overall structural template for the target field.

[0072] It can be understood that other methods can also be used to extract the structural template. For example, a deep learning model can be combined to perform end-to-end recognition and extraction of the official document structure, which is not limited here.

[0073] S103. Build a term dictionary for the target field based on historical official document data.

[0074] Among them, the term dictionary is used to represent the high-frequency professional terms in the official documents of the target field and the context distribution corresponding to the high-frequency professional terms; high-frequency professional terms refer to the words that appear frequently and have domain specificity in the official documents of the target field (such as "limitation of action" in the legal field and "diagnostic criteria" in the medical field); context distribution refers to the usage and collocation relationships of high-frequency professional terms in different context environments (such as different sentence and paragraph topics).

[0075] Specifically, the system performs word extraction and statistics on the historical official document data, filters out the words whose occurrence frequencies exceed the preset threshold as high-frequency professional terms. Then analyze the context in which these high-frequency professional terms are located, record their usage cases in different topics and sentence patterns, determine the context distribution characteristics of each word, and finally organize this information into a term dictionary to provide a reference for text word adjustment in subsequent processing.

[0076] Optionally, perform word segmentation on the historical official document data to remove stop words (such as "de", "shi", etc.); count the number of occurrences of each word, filter out high-frequency words; perform domain relevance judgment on the high-frequency words (such as through domain expert annotation or pre-training model classification) to determine professional terms; extract the sentences and paragraphs where the professional terms are located as context examples, and build a term dictionary containing the words and their corresponding context distributions.

[0077] S104. Perform structural adaptation on the preliminary text according to the structural template to generate a structurally adapted text with the structural characteristics of the target field.

[0078] Among them, preliminary text refers to cross-domain draft text generated based on existing domain models, that is, official document drafts that have been migrated from existing domains and have not yet undergone structural adjustments to the target domain; structure-adapted text refers to text that has undergone structural adjustments and has the structural characteristics of the target domain (such as conforming to the module composition and paragraph order of the target domain).

[0079] Specifically, the system breaks down the initial text according to its existing structure, generating various components. Then, referring to the structural template of the target domain, it rearranges, adds, removes, or adjusts the order of the components of the initial text. For example, if the target domain's official documents require the "implementation basis" to be stated before the "work arrangement," but the initial text has the reverse order, then these two parts are swapped to ultimately form a structurally adapted text.

[0080] Optionally, semantic understanding is performed on the preliminary text to identify core content modules (such as "purpose", "measures", and "conclusion"); the identified modules are matched with modules in the structural template; for successfully matched modules, they are arranged in the order of the template; for modules that exist in the template but not in the preliminary text, prompt information is generated or default content is added; for modules that exist in the preliminary text but not in the template, it is determined whether to retain or adjust their position based on relevance, and structurally adapted text is generated.

[0081] Optionally, a template-filling method can be used to extract key information (such as time, location, and event) from the initial text; according to the module format and order of the structural template, the extracted key information can be filled into the corresponding modules; the text after filling can be checked for coherence and adjusted to ensure that the transition between modules is natural and form a structurally adapted text.

[0082] It is understandable that other methods can be used to achieve structural adaptation, such as combining human-computer interaction, where human assistance adjusts the initial text structure to match the template; this is not limited here.

[0083] S105. Based on the terminology dictionary, perform context adaptation on the structure-adapted text to generate context-adapted text that meets the professional requirements of the target field in terms of word choice and expression.

[0084] Among them, context adaptation refers to adjusting the wording in the structure-adapted text to conform to the professional norms of the target field according to the context of the vocabulary; context-adapted text refers to text that, after context adaptation, conforms to the professional requirements of the target field in terms of wording and expression.

[0085] This step is performed after the structure adaptation is completed. When the structure of the adapted text already conforms to the characteristics of the target domain, but the wording may still carry traces of the existing domain, this step is used to make professional adjustments to the wording. It is suitable for scenarios where the accuracy and professionalism of the wording in official documents are highly required.

[0086] Specifically, the system analyzes the structure-adapted text sentence by sentence, identifying words and comparing them with high-frequency professional terms in the terminology dictionary. For words that do not conform to the professional terminology norms of the target domain, the system replaces them with appropriate professional terms based on their context and the contextual distribution of corresponding high-frequency professional terms in the terminology dictionary, while ensuring that the replaced expression remains grammatically and semantically coherent, ultimately generating context-adapted text.

[0087] In some embodiments, contextual adaptation of structurally adapted text can be performed based on a terminology dictionary in various ways:

[0088] Optionally, the structure-adapted text is segmented and tagged with parts of speech; each word is traversed to determine whether it is a high-frequency professional term in the target field. If not, a professional term with similar semantics and that fits the current context is searched in the terminology dictionary; the replaced text is grammatically checked to ensure that the sentences are fluent; the above process is repeated until all non-professional terms in the text have been adapted or confirmed to be unnecessary to replace, and context-adapted text is generated.

[0089] Optionally, a pre-trained language model is used to encode the structure-adapted text to generate a semantic representation of the text; a list of candidate replacement words is generated by combining the contextual distribution information of high-frequency professional words in the terminology dictionary; the semantic similarity between the candidate words and the original words in the current context is calculated, and the candidate word with the highest similarity is selected for replacement; the overall semantic consistency of the replaced text is evaluated, inappropriate replacements are adjusted, and context-adapted text is generated.

[0090] It is understandable that other methods can be used to achieve context adaptation, such as introducing feedback from domain experts to correct the adaptation results, which is not limited here.

[0091] Furthermore, when extracting high-frequency specialized terms from context-adapted text to generate a target term set, the system first segments the context-adapted text, removing general and low-frequency words. It then combines this with a target domain terminology dictionary to filter out terms within the specialized terminology category, statistically analyzing their frequency. Specialized terms with frequencies exceeding a preset threshold are included in the set, forming the target term set and ensuring that the vocabulary in the set is both high-frequency and domain-specific. When comparing the target term set with existing and target domain terminology dictionaries to generate a domain terminology difference set, the system performs a bidirectional comparison, filtering out words from the target terminology that do not appear in the target domain terminology dictionary, and words that exist in existing domain terminology dictionaries but have no corresponding or semantically incompatible terms in the target domain terminology dictionary. These two categories of words are then integrated to form a domain terminology difference set, showcasing the "deviation" in terminology during cross-domain migration. When matching a set of domain-specific terminology differences with a risk-sensitive terminology database of the target domain to generate a set of risk terms, the system performs precise and fuzzy matching on each word in the difference set. For successfully matched words, it verifies whether their usage scenarios in the context-adapted text actually pose a risk, and includes confirmed risk words in the risk terminology set. When querying the domain knowledge graph to generate a risk-annotated set, the system uses risk terms as query keywords to retrieve corresponding entities and relationships in the domain knowledge graph. Based on this information, it annotates each risk term with its risk type, risk level, and reference standards, integrating them into a risk-annotated set to ensure that each risk has a clear explanation and correction direction. When automatically correcting corresponding risk terms in the context-adapted text based on the risk-annotated set to generate risk-corrected text, the system locates the risk terms according to the correction suggestions, replaces directly replaceable words, adds necessary information to words requiring supplementary explanation, reconstructs sentences for complex risks based on context, checks text coherence and professionalism after correction, and finally generates risk-corrected text.

[0092] In another embodiment, when collecting user feedback information on context-appropriate text across multiple preset evaluation dimensions to generate a multi-dimensional user feedback set, the system first displays the preset evaluation dimensions and provides feedback input entry points. It then collects specific user feedback across each dimension, categorizes and integrates it by dimension, and removes duplicate or invalid feedback to form a set covering key issues across each dimension. When performing cluster analysis on the multi-dimensional user feedback set based on the similarity of user feedback content to generate feedback clustering results, the system preprocesses the feedback text and converts it into feature vectors. It then uses a clustering algorithm to group semantically similar feedback into one category, extracts core keywords for each category, and selects the most frequent feedback as the cluster center, forming a result containing the feedback category and cluster centers. When calculating the feedback weights of each entry in the structure template and terminology dictionary based on the feedback clustering results to generate a feedback weight distribution, the system associates the feedback clustering results with the entries in the structure template and terminology dictionary. It calculates the weights based on the frequency of the entry being mentioned in feedback and the importance of the category to which the feedback belongs, and integrates the weights of all entries to form an overall distribution. When adjusting the corresponding entries in the structure template and terminology dictionary based on the feedback weight distribution to form an optimized version, the system prioritizes supplementing or correcting high-weight entries and makes appropriate fine-tuning to low-weight entries, ensuring that the adjustments focus on the core issues raised by users. A new round of context-adapted text is generated using the optimized structure template and terminology dictionary, and iterative adjustments are made based on the new round of user feedback until the accuracy of structure and context adaptation meets preset thresholds. The system then repeats the process of generating text, collecting feedback, optimizing templates and dictionaries, and calculating the accuracy after each iteration until both meet the standards, at which point the iteration stops.

[0093] In the above embodiments, the system automatically extracts and establishes structural templates and a terminology dictionary based on historical official document data in the target domain. This enables cross-domain document generation to adapt to the structural norms and professional terminology requirements of the target domain. Unlike existing technologies that rely solely on general models, this solution uses structural templates to adapt the text structure after generating the initial draft, ensuring that the overall layout and paragraph order of the document conform to the conventions of the target domain. Simultaneously, it performs contextual adaptation based on the terminology dictionary, effectively improving the accuracy of professional terminology and the professionalism of expression. The combination of these two approaches reduces the problems of structural inconsistencies and imprecise terminology during cross-domain migration, enhancing the accuracy and practicality of automatically generated documents in multi-domain applications.

[0094] The following provides a more detailed description of the process of the method provided in this implementation. Please refer to [link / reference]. Figure 2 This is another flowchart illustrating an automatic generation method for cross-domain official documents in an embodiment of this application.

[0095] S201. Establish the mapping relationship between the target domain and the existing domain on the structural template and terminology dictionary respectively, and generate a cross-domain alignment mapping table.

[0096] Among them, the mapping relationship refers to the correspondence between the target domain and the existing domain in the modules of the structural template and the vocabulary of the terminology dictionary (such as "employee" in the existing domain corresponding to "medical staff" in the target medical domain); the cross-domain alignment mapping table is a table that integrates the above mapping relationships and is used to guide the alignment of structure and terminology across domains.

[0097] This step is performed after generating the structure-adapted text based on the structure template, but before cross-domain alignment of the text; it is suitable for scenarios where the target domain and the existing domain differ in structural composition or terminology, and accurate migration needs to be achieved by clearly defining the correspondence.

[0098] Specifically, the system first parses the structural templates of the target domain and the existing domain separately, identifying the core structural modules of both (such as "background introduction," "core content," and "concluding remarks"), and establishing the correspondence between the modules (e.g., "work arrangement" in the existing domain corresponds to "treatment plan" in the target domain). Simultaneously, it compares the terminology dictionaries of the two domains, identifying semantically similar or functionally identical professional terms (e.g., "budget" in the existing domain corresponds to "funding" in the target education domain), and establishing terminology correspondences. Finally, the structural module mapping relationships and terminology mapping relationships are integrated into a unified cross-domain alignment mapping table, providing a clear basis for subsequent alignment.

[0099] Optionally, the structural templates of the target domain and existing domains can be manually sorted out to list the structural modules of both; domain experts can be organized to compare the functions of the modules and mark the mapping relationship between the modules (such as "cause analysis" corresponding to "cause explanation"); the terminology dictionaries of the two domains can be matched lexically, and highly matched term pairs can be selected by semantic similarity calculation (such as cosine similarity) and the term mapping relationship can be marked; the structural module mapping and term mapping can be integrated into a table to generate a cross-domain alignment mapping table.

[0100] S202. Based on the cross-domain alignment mapping table, extract the target structure and target terms in the structure-adapted text, perform cross-domain alignment, and generate preliminary aligned text.

[0101] Here, the target structure refers to the structural modules in the structure adaptation text that need to be aligned with the target domain (such as the "Implementation Steps" module); the target terminology refers to the professional terms in the structure adaptation text that need to be aligned with the target domain (such as the "customer" remaining in the existing domain needing to be aligned with the "patient" in the target domain).

[0102] Specifically, based on the structural module mapping relationships in the cross-domain alignment mapping table, the system locates the target structure to be aligned in the structure-adapted text (e.g., identifying the "workflow" module in the text as corresponding to the "operation specifications" module in the target domain); simultaneously, based on the terminology mapping relationships, it locates the target terms to be aligned in the text (e.g., identifying "partner" as corresponding to "collaborating unit" in the target domain). Then, according to the correspondence in the mapping table, the target structure is adjusted to the standard module names and order of the target domain, and the target terms are replaced with equivalent terms in the target domain. Finally, the adjusted text undergoes a coherence check to ensure that the structural and terminology adjustments do not disrupt the text's semantics, generating preliminary aligned text.

[0103] Optionally, the system can perform keyword matching in the structure-adapted text based on structural module keywords (such as "measures" or "plans") in the cross-domain alignment mapping table to locate the position and scope of the target structure; then, using a named entity recognition model, combined with the term list in the term mapping table, it marks the target terms that need to be aligned in the text; then, according to the correspondence in the mapping table, it replaces the module name of the target structure with the standard name of the target domain, and replaces the target terms with the corresponding terms; finally, it splices the adjusted structure and terms to generate the preliminary aligned text.

[0104] S203. Calculate the confidence level of each target structure and target term in the preliminary aligned text and the corresponding mapping relationship in the cross-domain alignment mapping table, and generate a confidence level list.

[0105] Specifically, for each target structure in the initially aligned text, the system compares its functional consistency (such as the sub-items included in the module and the expression style) with the corresponding target domain structure module in the cross-domain alignment mapping table, and calculates the structure confidence score using preset scoring rules (such as the percentage of functional overlap). For each target term, the system compares its semantic similarity with the corresponding target domain term in the mapping table (such as word vector similarity calculated through a pre-trained language model), and calculates the term confidence score by combining the term's accuracy in historical alignments. Finally, the confidence scores of all target structures and target terms are organized into a confidence score list in order of position, clearly showing the reliability of each alignment point.

[0106] Optionally, the system extracts features such as the number of paragraphs and core keywords from the target structure in the initially aligned text, compares them with the features of the corresponding target domain structure in the mapping table, and calculates the feature matching score (e.g., keyword overlap rate × 0.6 + paragraph number deviation × 0.4) as the structure confidence score. For the target terms, the system uses the Word2Vec model to generate term vectors and calculates the cosine similarity with the corresponding term vectors in the mapping table as the term confidence score. Then, according to the order in which the target structure and target terms appear in the text, the calculated confidence scores are sequentially filled into the list to generate a confidence score list.

[0107] In the above embodiments, the system achieves cross-domain alignment through a cross-domain alignment mapping table and provides contextual supplementation for low-confidence portions. This method can accurately identify and correct structural and terminological mismatches that occur during rule migration, improving the adaptability to structures and professional terms across heterogeneous domains. Through dynamic confidence determination and optimization using supplementary historical data, it effectively addresses structural confusion and terminological errors caused by domain differences, further enhancing the standardization and accuracy of cross-domain document generation.

[0108] S204. Obtain historical document paragraphs or text fragments with a comprehensive relevance greater than a preset relevance threshold to the target structure and target terms, and generate historical context use cases.

[0109] Specifically, the system first identifies the low-confidence target structures and terms that need to be processed. Then, using these structures and terms as the core of the retrieval, it extracts relevant paragraphs or text fragments from historical official document data in the target domain. By calculating the comprehensive semantic and thematic relevance of these fragments to the target structures and terms (such as similarity calculation based on word vectors), fragments with a comprehensive relevance higher than a preset relevance threshold are selected and integrated into historical context use cases, providing a real and reliable reference for subsequent replacement or completion.

[0110] Optionally, the system extracts the core module names of the target structure (such as "acceptance standards") and target terms (such as "qualified") as search keywords, and expands the keywords (such as adding synonyms "acceptance specifications" and "meets standards") to broaden the search scope; based on the expanded keywords, it retrieves relevant paragraphs or text fragments from the historical document database; it uses the BM25 algorithm to calculate the relevance of each fragment to the target structure and target terms; and it filters fragments with a relevance greater than a preset relevance threshold (such as 0.7) to form historical context use cases.

[0111] S205. Generate a context similarity list based on the similarity between historical context use cases and target structures and target terms in the current context.

[0112] Specifically, the system first extracts the current context (such as sentences containing the target terms and paragraphs) of the initially aligned text for the target structure and terms. Then, it calculates the similarity between each historical context use case and the current context. The calculation considers not only lexical matching (such as keyword overlap rate) but also semantic consistency (such as determining semantic equivalence through a pre-trained language model). Finally, all historical context use cases are arranged in descending order of similarity values ​​to form a context similarity list, facilitating the rapid identification of the most suitable use case.

[0113] S206. Use the structural descriptions and terminology expressions corresponding to the historical context use cases with the highest similarity to replace or complete the target structures and target terms with confidence levels below a preset threshold, and generate aligned structure-adapted text.

[0114] Specifically, the system selects the historical context use cases with the highest similarity from the context similarity list, and deeply analyzes the module organization method (such as whether it contains subheadings and logical order) and the collocation habits of target terms (such as "budget" instead of "funds budget") in the use case corresponding to the target structure. Then, it locates the target structure and terms with low confidence in the preliminary alignment text, adjusts the format of the target structure or completes the content (such as adding the missing "notes" submodule) with reference to the structural description of the use case, and replaces the target terms with expressions that conform to the conventions of the target domain with reference to the terminology expression. Finally, it checks the coherence of the corrected text with the surrounding text to ensure semantic consistency and generates aligned structure-adapted text.

[0115] Optionally, semantic parsing is performed on the historical context use cases with the highest similarity to identify the logical hierarchy of the target structure (such as general-to-specific structure, causal structure) and the semantic role of the target terms (such as subject, object); logical defects in the target structure (such as reversed order) and semantic inappropriateness of the target terms (such as mismatch) in the initially aligned text are analyzed; the paragraph order of the target structure is reorganized according to the logical hierarchy of the use cases to ensure logical coherence; the position of the target terms in the sentences is adjusted or replaced with synonyms according to the semantic role of the terms in the use cases (such as replacing "medical personnel" with "medical staff"); and the fluency of the corrected text is optimized using a language model (such as GPT) to generate aligned structure-adapted text.

[0116] It is understandable that other methods can be used to achieve replacement or completion, such as adapting the use case content by combining the correction rules preset by domain experts, which is not limited here.

[0117] In the above embodiments, the system uses similarity retrieval of historical document paragraphs to supplement and replace the context of structures and terms with confidence levels below a threshold. This not only achieves high-quality correction of low-confidence content but also enhances the contextual rationality and professionalism of newly generated documents by utilizing numerous real historical cases. Through dynamic matching and replacement, the risks caused by non-standard structures and inaccurate wording are reduced, making the generated documents more aligned with the expression habits and business needs of the target domain.

[0118] S207. Divide the structure-adapted text into sentence-level segments, paragraph-level segments, and full-text content to generate multi-level text segments.

[0119] Among them, a sentence-level fragment refers to a text fragment generated by splitting the structure-adapted text in units of sentences (such as "Please submit the materials within 3 days"); a paragraph-level fragment refers to a text fragment generated by splitting in units of paragraphs (such as a "work requirement" paragraph composed of multiple sentences); the full-text content refers to the overall content of the structure-adapted text; a multi-level text fragment refers to a set of text fragments integrating sentence-level, paragraph-level, and full-text-level fragments, which is used to analyze text features at different granularities.

[0120] Specifically, the system first identifies the sentence boundaries in the structure-adapted text through punctuation marks (such as full stops, question marks, exclamation marks), splits the text into independent sentence-level fragments, and marks the position information for each fragment (such as the paragraph serial number it belongs to). Then, according to format features such as line breaks and paragraph markers (such as "I.", "1"), the text is split into paragraph-level fragments, and the topic keywords of each paragraph (such as "budget statement") are recorded. Finally, the entire structure-adapted text is used as the complete full-text content, which together with the sentence-level and paragraph-level fragments forms a multi-level text fragment.

[0121] Optionally, (1) adopt a rule-based text segmentation method, set sentence segmentation rules (such as split when encountering ".?!") and paragraph segmentation rules (such as split when encountering consecutive line breaks or "Chapter X" markers); (2) scan the structure-adapted text character by character, split out sentence-level fragments according to the rules, count the number of sentences and number them; (3) perform secondary integration on the sentence-level fragments, combine them into paragraph-level fragments according to paragraph rules, and mark the starting and ending sentence numbers of each paragraph; (4) associate all sentence-level and paragraph-level fragments with the complete text to form a multi-level text fragment.

[0122] S208. Identify the high-frequency professional terms in the term dictionary in different-level text fragments respectively, and generate the term distribution lists corresponding to different-level text fragments respectively.

[0123] Specifically, for sentence-level fragments, the system scans the text sentence by sentence, identifies the high-frequency professional terms in it through term dictionary matching, and records the occurrence times of each term and its position in the sentence. For paragraph-level fragments, count the total occurrence times of high-frequency professional terms in each paragraph, and analyze the co-occurrence relationship between terms (such as "prescription drug" often co-occurs with "doctor's advice"). For the full-text content, summarize the occurrence frequencies of all high-frequency professional terms, and determine the core professional terms in the text (such as "diagnosis and treatment plan" appears 10 times in the full text and is a core term). Finally, generate independent term distribution lists for each level, presenting the distribution rules of terms in text at different granularities.

[0124] Optionally, the system can construct a terminology dictionary index, use an exact matching algorithm (such as an Aho-Corasick automaton) to match sentence-by-sentence segments, and identify high-frequency professional terms; for paragraph-level segments, it can count the frequency of each term, calculate the proportion of the term in the paragraph (e.g., the number of times the term appears / the total number of words in the paragraph), and filter out terms whose proportion exceeds a preset threshold; for full-text content, it can summarize the total number of times all terms appear, sort them in descending order of frequency, and take the top N (e.g., 20) as core terms; and generate distribution lists containing terms, frequencies, and positions for sentence-level, paragraph-level, and full-text-level terms respectively.

[0125] S209. Based on the contextual distribution information in the terminology dictionary, determine the set of contextual adaptation suggestions for each high-frequency professional term in the terminology distribution list.

[0126] Specifically, the system retrieves the contextual distribution information of each high-frequency professional term from the terminology dictionary, including its typical collocations in historical official documents, common sentence structures (such as "In view of XX, this plan is hereby formulated"), and its subject category (such as "fund management" or "project execution"). Then, combining the term's position in sentence-level, paragraph-level, and full-text-level segments and related vocabulary from the terminology distribution list, it analyzes its current contextual characteristics (e.g., the sentence-level sentence structure is an imperative sentence, and the paragraph-level subject is "equipment procurement"). Finally, based on the matching degree between the contextual distribution information and the current context, it generates context-appropriate suggestions for each level (e.g., sentence-level suggestion "use 'procurement budget' collocation," paragraph-level suggestion "supplementary budget approval process explanation"), integrating them into a set of context-appropriate suggestions.

[0127] Optionally, the system extracts historical context examples for each high-frequency professional term from the terminology dictionary (e.g., sentences using "budget" in 100 historical official documents); for sentence-level segments, it compares the sentence structure of the current sentence (e.g., declarative or interrogative) with the sentence structure of historical context examples, selecting the case with the highest matching degree as sentence-level context-appropriate suggestions; for paragraph-level segments, it analyzes the similarity between the paragraph theme and the theme of historical context examples, extracting typical collocations under similar themes as paragraph-level suggestions; for full-text content, it determines the overall usage scenario of the term in conjunction with the theme of the full text (e.g., "annual budget planning"), as a full-text-level suggestion; finally, it integrates the suggestions at the three levels to form a set of context-appropriate suggestions.

[0128] S210. Are all adapted contexts consistent?

[0129] Specifically, the system compares the contextual suggestions corresponding to sentence-level, paragraph-level, and full-text-level segments one by one, analyzing their consistency in terms of core terminology collocation (e.g., whether "funding" must always be associated with "purpose"), sentence structure (e.g., whether all require declarative sentences), and thematic relevance (e.g., whether all revolve around "project approval"). If the suggestions at the three levels completely match or are consistent in their core elements, they are judged as "consistent," and proceed to step S211; if there is at least one conflict in core elements (e.g., sentence-level suggestion "budget" is paired with "quantity," paragraph-level suggestion is paired with "amount"), they are judged as "inconsistent," and proceed to step S212.

[0130] S211. Next, adjust the structure of the adapted text according to the appropriate context to generate a context-adapted text that meets the professional requirements of the target field in terms of word choice and expression.

[0131] Specifically, the system adjusts the structure of the text sentence by sentence and paragraph by paragraph based on the explicit terminology collocation rules (e.g., "diagnosis and treatment" must be paired with "plan"), sentence structure requirements (e.g., imperative sentences are often used in official documents such as "notices"), and thematic relevance elements (e.g., "teaching evaluation" must include "evaluation indicators") in the context. For example, it replaces "doctor's plan" in sentence-level segments with "medical staff's diagnosis and treatment plan," and adds missing "evaluation indicators" to paragraph-level segments to ensure consistency in theme and terminology throughout the text. After adjustment, the system verifies sentence fluency using a grammar checker, ultimately generating context-adapted text.

[0132] Optionally, the system can extract specific adjustment rules from the context (such as replacing 'project' with 'topic' and pairing it with 'research cycle'), and apply the adjustment rules sequentially at the sentence level → paragraph level → full text level to replace terminology collocations and correct sentence structures. After each level of adjustment is completed, the system checks the coherence of the text at that level with the preceding and following text (such as logical connections between paragraphs). Finally, all adjustments are integrated to generate context-adapted text and perform overall semantic verification.

[0133] In the above embodiments, the system performs multi-level (sentence, paragraph, full text) segmentation of the structure-adapted text, identifies and analyzes high-frequency professional terms in a hierarchical manner, and combines the contextual distribution information of the terminology dictionary to perform targeted contextual adaptation on text fragments at different levels. This multi-level adaptation mechanism can effectively address the one-sidedness problem caused by traditional single-level word replacement, ensuring that professional terms can be accurately expressed in different contexts, greatly improving the professionalism of the terminology and the coherence of the context, and making up for the inaccuracy of word choice in existing automatic document generation technologies.

[0134] S212. Based on the preset priority of each level of text fragments, the context matching degree of high-frequency professional terms in the preliminary text, and the historical confidence degree, calculate the comprehensive priority score of each suitable context and generate a comprehensive priority score sequence.

[0135] Among them, the preset priority of each level of text fragment refers to the system's pre-set order of importance of sentence-level, paragraph-level, and full-text-level fragments (e.g., paragraph-level > sentence-level > full-text-level); the context matching degree of high-frequency professional terms in the initial text refers to the degree of fit between the current context of the term and the appropriate context (e.g., the matching degree between the current collocation of "budget" and "amount" and the suggested appropriate context); the historical confidence degree corresponding to high-frequency professional terms refers to the probability that the term is judged to be accurate in historical context matching (e.g., the past matching accuracy rate of "budget" is 92%); the comprehensive priority score refers to the quantitative value of the appropriate context priority calculated by combining the above three factors; the comprehensive priority score sequence refers to the list of appropriate contexts arranged from high to low according to the comprehensive priority score.

[0136] Specifically, the system assigns weights to each level based on preset priorities (e.g., 0.4 for paragraph level, 0.3 for sentence level, and 0.3 for full-text level), and calculates the priority score for each appropriate context (e.g., 0.4 for paragraph-level appropriate context). Then, it calculates the matching score (0-1 points) between the term's current context and the appropriate context using a semantic similarity algorithm (e.g., cosine similarity). Combined with the term's historical confidence score (e.g., 0.92), a weighted summation formula (e.g., overall score = priority score × 0.5 + matching score × 0.3 + historical confidence score × 0.2) is used to calculate the overall score for each appropriate context, and finally, the contexts are arranged in descending order of score to form a sequence.

[0137] S213. Select the highest-scoring suitable context from the comprehensive priority score sequence as the target suitable context, and adjust the structural suitable text to generate the context suitable text.

[0138] Specifically, the system extracts the top-ranked matching context from the comprehensive priority score sequence as the target matching context, and analyzes its core requirements (such as "'funding' must be paired with 'approval process', using declarative sentences"). Then, it locates the position of this high-frequency professional term in the structurally matching text, adjusts the terminology collocation according to the target matching context (such as changing "funding usage" to "funding approval process"), corrects sentence structure (such as changing interrogative sentences to declarative sentences), and ensures that the adjusted content is consistent with the paragraph theme and the overall logic of the text. Finally, the adjusted text is thoroughly read and verified to confirm the absence of grammatical errors and semantic conflicts, generating the context-matched text.

[0139] In the above embodiments, the system calculates and selects the optimal suitable context by setting priorities, context matching degree, and historical confidence degree for multi-level text fragments, ensuring that the final wording and expression conform to the mainstream norms and expression habits of the target domain. This comprehensive priority decision-making mechanism can automatically make the most reasonable choice when multiple expressions are possible, reducing inconsistencies in wording and inaccuracies in expression caused by errors in priority judgment, and improving the accuracy and domain standardization of cross-domain official document generation.

[0140] The document automatic generation system of this invention is applied to electronic devices. Figure 3 A schematic diagram of the architecture of an electronic device suitable for implementing embodiments of the present invention is shown.

[0141] It should be noted that, Figure 3 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments of the present invention.

[0142] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by instructions (i.e., computer programs) or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. The electronic device of this embodiment includes a storage medium and a processor, wherein the storage medium stores multiple instructions that can be loaded by the processor to execute any step of the method provided in the embodiments of the present invention.

[0143] Specifically, the storage medium and the processor are electrically connected directly or indirectly to enable data transmission or interaction. For example, these components can be electrically connected to each other via one or more signal lines. The storage medium stores computer-executable instructions that implement data access control methods, including at least one software functional module that can be stored in the storage medium in the form of software or firmware. The processor executes various functional applications and data processing by running the software program and module stored in the storage medium. The storage medium can be, but is not limited to, Random Access Memory (RAM), Read-Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The storage medium stores the program, and the processor executes the program after receiving the execution instructions.

[0144] Furthermore, the software programs and modules within the aforementioned storage medium may also include an operating system, which may include various software components and / or drivers for managing system tasks (e.g., memory management, storage device control, power management, etc.) and can communicate with various hardware or software components to provide an operating environment for other software components. The processor may be an integrated circuit chip with signal processing capabilities. The aforementioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc., which can implement or execute the methods, steps, and logic flowcharts disclosed in this embodiment. The general-purpose processor may be a microprocessor or any conventional processor.

[0145] Since the instructions stored in the storage medium can execute the steps in any of the methods provided in the embodiments of the present invention, the beneficial effects of any of the methods provided in the embodiments of the present invention can be achieved, as detailed in the preceding embodiments, and will not be repeated here.

[0146] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for automatically generating cross-domain official documents, applied to an automatic document generation system, characterized in that, The method includes the following: Key information is extracted from historical official document data in the target domain, and this key information provides the basic support for template construction. Based on the key information, a structural template is constructed to represent the structural composition and paragraph order of official documents in the target domain. The historical document data is a collection of existing document texts in the target domain. A terminology dictionary for the target domain is constructed based on the historical document data. The terminology dictionary is used to represent high-frequency professional terms in the documents of the target domain and the contextual distribution of the corresponding high-frequency professional terms. Based on the structural template, the preliminary text is structurally adapted to generate structurally adapted text with target domain structural features. The preliminary text is a cross-domain draft text generated based on an existing domain model. Establish mapping relationships between the target domain and existing domains on structural templates and terminology dictionaries respectively, and generate cross-domain alignment mapping tables; Based on the cross-domain alignment mapping table, target structures and target terms in the structure-adapted text are extracted for cross-domain alignment to generate preliminary aligned text. Calculate the confidence level of each target structure and target term in the preliminary aligned text and the corresponding mapping relationship in the cross-domain alignment mapping table, and generate a confidence level list; Obtain historical document paragraphs or text fragments with a comprehensive relevance greater than a preset relevance threshold to the target structure and target terms, and generate historical context use cases; A context similarity list is generated based on the similarity between the historical context use cases and the target structure and target terms corresponding to the current context; Obtain the structural description and terminology expression corresponding to the historical context use case with the highest similarity; The structural and terminological expressions are used to replace or complete target structures and terms with confidence levels below a preset threshold, generating aligned, structure-adapted text. The structurally adapted text is context-adapted based on the terminology dictionary to generate context-adapted text that conforms to the professional requirements of the target domain in terms of word choice and expression; wherein, the step of context-adapting the structurally adapted text based on the terminology dictionary to generate context-adapted text that conforms to the professional requirements of the target domain in terms of word choice and expression specifically includes: The structure-adapted text is divided into sentence-level segments, paragraph-level segments, and full-text content to generate multi-level text segments. Identify high-frequency specialized terms in the terminology dictionary in text fragments at different levels, and generate terminology distribution lists corresponding to text fragments at different levels; Based on the context distribution information in the terminology dictionary, a set of context adaptation suggestions is determined for each high-frequency professional term in the terminology distribution list. The set of context adaptation suggestions includes the adaptation contexts given for high-frequency professional terms in different levels of text fragments. If all the adaptation contexts in the context adaptation suggestion set are consistent, the structural adaptation text is directly adjusted according to the adaptation context to generate context adaptation text that meets the professional requirements of the target field in terms of word choice and expression. If there are inconsistent adaptation contexts in the set of context adaptation suggestions, the target adaptation context is determined according to the priority of different levels of text fragments, and the structural adaptation text is adjusted accordingly.

2. The method according to claim 1, characterized in that, The step of determining the target appropriate context based on the priority of different levels of text fragments specifically includes: Based on the preset priority of each level of text fragments, the context matching degree of high-frequency professional terms in the initial text, and the historical confidence degree corresponding to the high-frequency professional terms, the comprehensive priority score of each suitable context is calculated, and a comprehensive priority score sequence is generated. The highest-scoring fitting context is selected from the comprehensive priority score sequence as the target fitting context.

3. The method according to claim 1, characterized in that, After the step of performing context adaptation on the structure-adapted text according to the terminology dictionary to generate context-adapted text that conforms to the professional requirements of the target domain in terms of word choice and expression, the method further includes: Extract high-frequency professional terms from the context-adapted text and generate a target term set; The target term set is compared with the existing domain term dictionary and the target domain term dictionary to generate a domain term difference set; The domain-specific terminology difference set is matched with the risk-sensitive terminology library of the target domain to generate a risk terminology set; Query the domain knowledge graph for the aforementioned set of risk terms to generate a set of risk labels; Based on the risk label set, the corresponding risk words in the context-adapted text are automatically corrected to generate risk-corrected text.

4. The method according to claim 1, characterized in that, After the step of performing context adaptation on the structure-adapted text according to the terminology dictionary to generate context-adapted text that conforms to the professional requirements of the target domain in terms of word choice and expression, the method further includes: Collect user feedback information on the context-adapted text across multiple preset evaluation dimensions to generate a multi-dimensional user feedback set; Cluster analysis is performed on the multi-dimensional user feedback set based on the similarity of user feedback content to generate feedback clustering results, which include different feedback categories and cluster centers corresponding to different feedback categories. Based on the feedback clustering results, the feedback weights of each entry in the structure template and terminology dictionary are calculated, and a feedback weight distribution is generated. Based on the feedback weight distribution, the corresponding entries in the structure template and terminology dictionary are adjusted to form the optimized structure template and terminology dictionary; The optimized structure template and terminology dictionary are used to generate a new round of context-adapted text. The structure template and terminology dictionary are iteratively adjusted based on the new round of user feedback until the accuracy of structure adaptation and context adaptation meets the preset accuracy threshold.

5. An automatic document generation system, characterized in that, The document automatic generation system includes: one or more processors, and a memory; The memory is coupled to the one or more processors, and the memory is used to store computer program code, the computer program code including computer instructions; The one or more processors, by executing the computer instructions, cause the document automatic generation system to perform the method as described in any one of claims 1-4.

6. A computer-readable storage medium comprising instructions, characterized in that, When the instruction is run on the document automatic generation system, the document automatic generation system performs the method as described in any one of claims 1-4.

7. A computer program product, characterized in that, When the computer program product is run on the document automatic generation system, the document automatic generation system performs the method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Text template generation method based on domain feature lexical combination

    CN110362803A