Document content generation and compliance checking system based on large language model
The document content generation and compliance verification system based on a large language model solves the problems of low efficiency and difficulty in ensuring quality in traditional document writing, realizes efficient and standardized document writing, improves writing efficiency and quality, and meets the personalized needs of different departments and scenarios.
Patent Information
- Application Number
- CN202511384733.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-26
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2045-09-26
AI Technical Summary
Traditional official document writing is inefficient and difficult to guarantee quality. In particular, in emergency situations, it is prone to problems such as incomplete content and unclear logic. Furthermore, the writing styles and requirements of official documents vary greatly among different departments and in different scenarios, and there is a lack of unified standards and normative guidance.
The document content generation and compliance verification system based on a large language model includes a document extraction module, a content generation module, a compliance verification module, and a writing assistance module. By analyzing writing style, format specifications, and logical structure, it provides real-time modification suggestions and compliance verification, supports template management and policy retrieval, and improves writing efficiency and quality.
It significantly shortens the time for official document writing, reduces basic errors and policy risks, ensures that the quality of official documents meets professional standards, improves writing fluency and authority, and achieves seamless knowledge transfer and the satisfaction of personalized needs.
Smart Images

Figure CN120873172B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of large language model, in particular to a document content generation and compliance verification system based on large language model. BACKGROUND
[0002] Traditional document writing mainly relies on manual completion, from the conception framework, data collection to word-by-word writing, the whole process is time-consuming and laborious. Especially for some large institutions or departments that frequently handle document affairs, staff generally need to spend a lot of time on repetitive writing tasks, such as writing routine notices, reports, etc. Moreover, in the face of urgent document tasks, manual writing may not guarantee the quality due to time constraints, and may easily result in incomplete content, unclear logic, etc.
[0003] Due to the differences in writing level, knowledge reserve and experience of different staff, it is difficult to maintain stable document quality. Some novices or non-professional writers may not accurately grasp the document format specifications, language expression requirements and logical structure when writing documents, and may easily make format errors, misuse words, and have incoherent sentences. Even experienced writers may make mistakes due to fatigue after a long period of high-intensity work, affecting the quality of the document. In addition, the writing style and requirements of documents in different departments and different scenarios also differ, and there is a lack of unified standards and guidelines, further exacerbating the uneven quality of documents. SUMMARY
[0004] The purpose of the present application is to provide a document content generation and compliance verification system based on large language model, which can improve the efficiency and quality of document writing.
[0005] In order to achieve the above purpose, the present application provides a document content generation and compliance verification system based on large language model, comprising:
[0006] A document extraction module is used to analyze the uploaded model text through a large language model, extract the writing style and fixed sentence pattern of different document types, construct a document writing knowledge graph, and store the format specifications, common expressions and logical structure of various documents;
[0007] A core intent library of different document types is constructed by the document extraction module, which is used to store typical intent prototype vectors in the field of document writing, and each intent corresponds to a vector representation;
[0008] A content generation module is used to generate subsequent paragraphs based on the context of the input content; to expand writing based on keywords; to analyze behavior data, and to predict writing intent vectors using a lightweight neural network model, with the writing intent vector as a conditional control parameter;
[0009] The compliance verification module is used for real-time warning of inappropriate words; the RAG technology is used for searching relevant policies to verify the logical consistency of the content; the format of each element of the official document is automatically checked to see whether it meets the standard; and pre-verification is performed based on the writing intention vector;
[0010] The writing assistance module is used for providing real-time modification suggestions in the form of annotations displayed in the side bar of the document; and prospective suggestions are provided based on the writing intention vector.
[0011] The beneficial effects of the basic scheme are as follows: the knowledge graph constructed by the official document extraction module and the classification template library can accurately match templates according to agencies and scenarios; users do not need to learn the format specifications and common sentence patterns of different official documents from scratch; and the content can be directly filled based on templates, thereby greatly shortening the time for format learning and framework building.
[0012] The content generation module is based on context continuation; based on the input start of the user, the logical structure of the official document of this type is automatically matched to generate subsequent paragraphs; the keyword expansion supports the input of core information by the user, and automatically expands the core information into complete expressions in the official document style, thereby reducing the threshold for official document writing of non-professional writers.
[0013] The writing assistance module provides real-time suggestions in the form of side bar annotations, and highlights the doubtful content, thereby avoiding repeated reading and modification of the initial draft by the user after completion, and improving the fluency of writing.
[0014] The technical scheme can timely verify compliance, avoid low-level errors and policy risks, identify real-time official document forbidden / unsuitable expressions, avoid the influence of inappropriate words on the seriousness of the official document, search the latest policy files through the RAG technology, verify whether the content of the official document is consistent with the current policy, avoid policy disconnection risks, automatically check whether the necessary elements of the official document are complete and the format meets the standard, and avoid the invalidity of the official document due to format omissions.
[0015] The writing style library constructed by the official document extraction module can distinguish the expression characteristics of official documents of different agencies / scenarios, and fix the sentence patterns and logical structures, so that the official documents written by the user not only meet the compliance requirements, but also meet the professional expression habits, and the authority and readability of the official document are improved.
[0016] The official document extraction module converts the scattered experience of sample documents into a structured knowledge graph, clearly labels the type of the official document, the necessary elements, the commonly used sentence patterns, and the correlation between the policy basis and the applicable scenarios, quickly masters the writing points by querying the knowledge graph, and does not need to rely on personal experience.
[0017] The templates are classified and managed according to agencies / scenarios, and the user can customize the templates, which not only guarantees the universality of knowledge, but also meets the individual needs of different units; meanwhile, the template library can be iterated in real time according to policy updates and changes in agency needs, thereby ensuring the timeliness of the knowledge.
[0018] By importing internal high-quality official document templates into the system, the official document extraction module automatically analyzes and supplements the knowledge graph and template library, forming an internal exclusive knowledge base. New employees do not need long-term training and can quickly master the official document writing standards of the unit through the system, realizing seamless knowledge inheritance.
[0019] The core intent library constructed in combination with the official document extraction module can perform pre-verification based on the writing intent vector to determine whether the current writing direction conforms to the core purpose of the official document type, avoiding the deviation of the intent from the topic of the official document, and ensuring compliance from the writing logic level. Based on the core intent library of the official document extraction module, the writing assistance module can predict the writing intent vector according to the user's input content and provide forward-looking prompts to help users plan the writing structure in advance, avoid finding deviations in ideas at the end of writing, and ensure the logical coherence and completeness of the official document.
[0020] As an implementable preferred solution, the analysis of behavior data includes the following contents:
[0021] The text input feature extraction formula is as follows:
[0022]
[0023] wherein, is the word frequency, is the document frequency, is the total number of documents;
[0024] The cursor behavior coding uses Fourier transformation to reduce the dimensionality of the trajectory sequence:
[0025]
[0026] wherein, and represent the two-dimensional coordinates of the cursor in the document interface at the n th sampling point, n is the summation index, representing the sequence number of the trajectory sampling point; represents the total number of trajectory sampling points in the sliding window; represents the frequency component index; represents the complex value of the th frequency component; i is the imaginary unit.
[0027] As an implementable preferred solution, the official document extraction module inputs the uploaded templates into a pre-trained large language model; identifies the official document type through a text classification algorithm; analyzes the writing style of the official document, including sentence structure, word usage habits, and paragraph layout, extracts fixed sentence patterns and style features; stores the extracted official document type and writing style features in the database for subsequent template construction.
[0028] As an implementable preferred solution, the official document extraction module integrates official document templates and format specification data from multiple channels; uses natural language processing techniques to analyze semantic relationships and structural information in the templates; based on the Neo4j graph database, stores the parsed knowledge as nodes and edges to form an official document writing knowledge graph, with nodes representing official document elements and edges representing relationships between elements; regularly updates the knowledge graph to incorporate the latest official document formats and expressions.
[0029] As an implementable preferred solution, the content generation module is used to input the entered content into a large language model for encoding and analysis; the model understands the current writing context by analyzing the semantics and structure of the entered content; based on the context understanding, the model generates relevant subsequent paragraph suggestions; the predicted paragraphs are displayed to the user in a list format, and the user can choose to accept or reject the suggestions.
[0030] As an implementable preferred solution, the content generation module is also used to extract keywords from the input; retrieve information related to the keywords from the knowledge graph and external policy database; integrate the retrieved information into supplementary content using the text generation capabilities of the large language model; display the supplementary content to the user for reference and editing.
[0031] As an implementable preferred solution, the content generation module controls the style of the generated text by adjusting the generation parameters of the large language model; based on the adjusted parameters, the model generates multiple versions of official document content; the multiple versions of official document content are displayed side by side.
[0032] As an implementable preferred solution, the official document extraction module includes a variational autoencoder model for decoupling the semantic content and writing style of the templates in the hidden space to obtain separate content encoding vectors and style encoding vectors.
[0033] The content generation module generates content-neutral drafts based on the content encoding vectors; it also includes a generative adversarial network for fusing the drafts with the style encoding vectors to generate target style text, and a discriminator to determine whether the generated text is truly consistent with the target style.
[0034] As an implementable preferred solution, the compliance verification module stores a sensitive word library in a database; performs real-time detection on official document content through string matching algorithms; uses a multi-pattern matching algorithm to perform word-by-word scanning on official document text to identify accurately matched sensitive words, expands the sensitive word detection range based on the synonym relationships in the knowledge graph, and converts the official document text and sensitive words into semantic vectors to calculate the similarity and identify semantically similar sensitive expressions; when inputting official document content, real-time detection is performed, sensitive words are highlighted, a warning box is popped up in the sidebar, the sensitivity level and sensitive word interpretation are displayed, and differentiated suggestions are provided for different levels of sensitive words.
[0035] As a preferred solution of the writing assistance module, the suspicious content is identified, marked and highlighted by setting rules and thresholds BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 The schematic diagram of the system architecture for generating and checking the compliance of official document content based on a large language model.
[0037] Figure 2 The schematic diagram of the electronic device structure of the embodiment of the present application.
[0038] The reference signs, the electronic device 500, the processor 501, the communication interface 502, the memory 503, the bus 504. DETAILED DESCRIPTION
[0039] In order to make the technical solutions of the present application and their advantages clearer, the technical solutions of the present application will be further described in detail below in conjunction with the accompanying drawings. It can be understood that the specific embodiments described herein are only part of the embodiments of the present application, and are only used to explain the present application, but not to limit the present application. It should be noted that the technical features described in the following embodiments or the combination of technical features should not be considered in isolation, and they can be combined with each other to achieve better technical effects. The same reference numerals appearing in the accompanying drawings of the following embodiments represent the same features or components, which can be applied to different embodiments.
[0040] In addition, unless otherwise defined, the technical terms or scientific terms used in the description of the present application should have the usual meanings understood by those skilled in the art to which the present application belongs.
[0041] The present application will be further described in detail below in conjunction with the accompanying drawings.
[0042] Embodiment one
[0043] Reference Figure 1 The embodiment of the present application provides a system for generating and checking the compliance of official document content based on a large language model, which comprises an official document extraction module, a content generation module,
[0044] The official document extraction module comprises a document analysis submodule, a knowledge graph construction submodule and a template management submodule.
[0045] The sample document analysis submodule is used to analyze user-uploaded sample documents using a large language model, automatically extracting writing styles and fixed sentence structures for different document types (such as requests, reports, and notices). Specifically, the user-uploaded sample documents are input into a pre-trained large language model; the model identifies the document type, such as requests, reports, and notices, using a built-in text classification algorithm. Further analysis of the document's writing style, including but not limited to sentence structure, word choice habits, and paragraph layout, is performed to extract fixed sentence structures and style features. The extracted document type and writing style features are stored in a database for subsequent template construction.
[0046] The knowledge graph construction submodule is used to build a knowledge graph for official document writing, storing the format specifications, common expressions, and logical structures of various official documents. Specifically, it integrates official document templates and format specifications from multiple channels; uses natural language processing technology to parse the semantic relationships and structural information in the templates; and stores the parsed knowledge as nodes and edges based on graph databases such as Neo4j, forming the official document writing knowledge graph. Nodes represent official document elements (such as titles, body text, attachments, etc.), and edges represent the relationships between elements (such as inclusion, order, etc.). The knowledge graph is updated regularly to incorporate the latest official document formats and expressions.
[0047] The template management submodule is used for multi-level template management, differentiating writing requirements for different organizations and scenarios. Specifically, it categorizes and stores templates according to organization and scenario, such as government department templates, enterprise templates, and emergency notice templates; it provides a template search function, allowing users to filter suitable templates based on their organization and specific scenario; it supports users in customizing templates according to their own needs and storing customized templates in the database; and it regularly checks and updates the template library to ensure the timeliness and applicability of the templates.
[0048] The content generation module includes a fill-in-the-blank submodule, a keyword expansion submodule, and a multi-version generation submodule.
[0049] The autocomplete submodule provides context-aware autocomplete functionality, predicting subsequent paragraphs based on the input. The user's input is fed into a large language model for encoding and analysis; the model understands the current writing context by analyzing the semantics and structure of the input; based on this contextual understanding, the model generates relevant suggestions for subsequent paragraphs; the predicted paragraphs are then displayed to the user in a list format, allowing the user to accept or reject the suggestions.
[0050] The keyword expansion submodule supports keyword-based document expansion, automatically supplementing relevant background information and policy basis. Specifically, it extracts keywords from user input; retrieves information related to the keywords from knowledge graphs and external policy databases; integrates the retrieved information into supplementary content using the text generation capabilities of a large language model; and displays the supplementary content to the user for reference and editing.
[0051] The multi-version generation submodule is configured to implement multi-version generation and provide different styles of writing for users. Specifically, the style of generated text is controlled by adjusting the generation parameters (such as tone, maximum length, etc.) of the large language model. Based on the adjusted parameters, the model generates multiple versions of the official document content. The multiple versions of the official document content are displayed side by side to the user, and the user can select the appropriate version according to the requirements.
[0052] The compliance verification module includes a sensitive word detection submodule, a policy conflict detection submodule, and a format specification checking submodule.
[0053] The sensitive word detection submodule is configured to have a hierarchical sensitive word library (ordinary / secret / top secret) built-in, which is used to alert inappropriate word usage in real time. The sensitive word library is stored in a database, and the ordinary sensitive words are derived from common error cases of official document review and a list of negative expressions for government information disclosure. The secret / top secret sensitive words are derived from relevant security regulations, and the system performs real-time detection on the official document content through a string matching algorithm.
[0054] Specifically, a multi-pattern matching algorithm (AC automaton algorithm) is used to scan the official document text word by word, identify the sensitive words that match exactly, and expand the sensitive word detection range based on the synonym relationship in the knowledge graph. The official document text and the sensitive words are respectively converted into semantic vectors (using the Sentence-BERT model), the similarity is calculated, and the sensitive expressions with similar semantics are identified.
[0055] When the official document content is input, the system detects in real time, highlights the sensitive words in the text immediately after detecting the sensitive words (ordinary sensitive words are highlighted in yellow, secret sensitive words are highlighted in orange, and top secret sensitive words are highlighted in red), and pops up a warning box in the sidebar to display the sensitive level and the sensitive word interpretation. Differentiated suggestions are provided for different levels of sensitive words - ordinary sensitive words provide modification suggestions (such as "change 'not in line with regulations' to 'to be further standardized'"); secret / top secret sensitive words prompt "delete or replace with non-sensitive expressions, and pass the security review", and the detection log is recorded.
[0056] The policy conflict detection submodule is configured to retrieve relevant policies through RAG technology to verify the logical consistency of the content. The RAG technology retrieves relevant policies in the knowledge graph and external policy database to verify the logical consistency of the official document content, ensuring that the content meets the policy requirements. When a policy conflict is detected, the system prompts the user to make corrections.
[0057] The format specification checking submodule is used to automatically check whether the format of each element of the document conforms to the standard. The format specification checking module defines the format requirements of elements such as title, body, and attachments according to the document format standard; performs format checking on the title, body, and attachments of the document; when a format error is detected, the system prompts the user to correct it.
[0058] The writing assistance module includes a real-time suggestion submodule, an intelligent optimization submodule, and a content marking submodule.
[0059] The real-time suggestion submodule is used to provide real-time modification suggestions in the form of annotations displayed in the document sidebar. By analyzing the content of the document, combined with the knowledge graph and large language model, modification suggestions are generated and displayed in the form of annotations in the document sidebar for user reference.
[0060] The intelligent optimization submodule is used to automatically adjust the expression of sentences and the structure of paragraphs to improve the readability of the document. Through natural language processing algorithms, the content of the document is optimized, including sentence fluency checking and paragraph structure adjustment.
[0061] The content marking submodule is used to highlight suspicious content for easy user review. Set rules and thresholds to identify suspicious content and mark and highlight it for easy user review.
[0062] Embodiment Two
[0063] When the user inputs text in the writing interface, the system captures these input contents in real time and passes them to the associative filling submodule. The associative filling submodule first preprocesses the input text, including word segmentation, removal of stop words, etc., to reduce noise interference. Then, a pre-trained large language model is used to encode the processed text into a high-dimensional vector representation. Through vector capture, the semantic information and structural features of the text are captured, providing a basis for subsequent analysis.
[0064] After obtaining the vector representation of the text, the associative filling submodule further analyzes the internal relationship between each vector to understand the semantics and structure of the text. Through clustering, topic modeling, and other techniques, the module can identify key themes, sentiment tendencies, and logical relationships between paragraphs in the text. For example, if the user inputs a report on project progress, the module can identify time nodes, key achievements, and existing problems in the report, and construct a semantic framework of the text based on these elements.
[0065] Based on the results of semantic analysis, the module deeply understands the context of the current writing. This includes identifying the type of document the user is writing (such as a request, report, or notice), the theme of the paragraph, and the user's possible writing intentions. By building a context model, the module can dynamically adjust its prediction strategy to more accurately match the user's writing needs.
[0066] Based on the understanding of the context, the module utilizes the generative capabilities of large language models to predict subsequent paragraphs that the user might continue to write. In this process, the module not only considers the semantic coherence of the text, but also takes into account the language style and format specifications of official documents. For example, when predicting a paragraph about a project application, the module will refer to common expressions and structures in similar official documents to generate predicted text that conforms to specifications and is semantically coherent.
[0067] The generated predicted paragraphs are displayed in a list next to the user's writing interface, each with a brief description or label to help quickly understand their content. At the same time, the system also provides a confidence score for the predicted paragraphs to reflect the model's judgment of its accuracy.
[0068] The user can choose to accept or reject the predicted paragraphs according to their needs. If the user chooses to accept a predicted paragraph, the paragraph will be automatically inserted into the user's writing text; if the user chooses to reject, the context prediction sub-module will continue to provide other prediction options until the user finds a satisfactory paragraph.
[0069] Embodiment Three
[0070] The intelligent optimization sub-module uses word segmentation algorithms (such as rule-based word segmentation, conditional random field CRF word segmentation, or deep learning word segmentation models) to process each sentence in the official document and label the part of speech of each word (such as nouns, verbs, adjectives, etc.), providing basic data for subsequent grammar and semantic analysis.
[0071] The intelligent optimization sub-module uses dependency syntax analysis or phrase structure tree analysis to analyze the grammatical structure of the sentence. By identifying the core components of the sentence such as subject, predicate, and object, as well as their modification relationships, the system can determine whether the sentence conforms to grammatical specifications and discover potential grammatical errors such as subject-verb inconsistency, verb tense errors, etc.
[0072] The intelligent optimization sub-module uses semantic role labeling or semantic similarity calculation techniques to understand the meaning of the sentence. By identifying entities, events, and their relationships in the sentence, it can determine whether the sentence is clearly expressed and logically reasonable, and discover potential semantic ambiguities or unclear expressions.
[0073] Based on the discovered grammatical and semantic problems, specific optimization suggestions are generated. For example, for the problem of subject-verb inconsistency, the system will suggest adjusting the subject or predicate form; for the problem of semantic ambiguity, the system will suggest replacing ambiguous words or adjusting the sentence structure. The above suggestions will be displayed in the form of annotations in the document sidebar for reference and selection.
[0074] The application embodiment also provides a document content generation and compliance verification method based on a large language model.
[0075] Embodiment four
[0076] An intention-aware model for dynamic writing is constructed, and a core intention library of different types of documents is constructed by a document extraction module, which is used to store typical intention prototype vectors in the field of document writing, and each intention corresponds to a vector representation. The core intentions include request for approval, report feedback, and execution notification.
[0077] When the user writes, the content generation module dynamically predicts the user's most likely writing intention by real-time analysis of the user's input content, cursor position, deletion and modification behavior sequence, using a lightweight neural network model (such as LSTM or a small version of Transformer). In this embodiment, the user's behavior sequence is used as a key feature for intention judgment, rather than just judging by text.
[0078] Specifically, the content generation module captures the user's text in real time to capture the user's behavior data in real time, including text input sequence, cursor movement trajectory, editing operation behavior and time interval data; and converts the behavior data into a multi-dimensional feature vector; uses a lightweight time series neural network model to encode the behavior sequence and classify the intention.
[0079] In this embodiment, the lightweight time series neural network model uses an improved double-layer LSTM structure with a hidden layer dimension ≤128; or a small-sized Transformer structure with a number of heads ≤4 and a number of layers ≤2.
[0080] The text input feature extraction formula is as follows:
[0081]
[0082] wherein, is the word frequency, is the document frequency, is the total number of documents.
[0083] The cursor behavior encoding uses Fourier transform on the trajectory sequence:
[0084]
[0085] wherein, and represent the two-dimensional coordinates of the cursor in the document interface at the nth sampling point; n is the summation index, representing the sequence number of the trajectory sampling point, used to traverse all cursor trajectory sampling points in the sliding window; represents the total number of trajectory sampling points in the sliding window. represents the frequency component index; represents the complex value of the i th frequency component; i is the imaginary unit, satisfying i 2 =-1.
[0086] The process of predicting the writing intention vector by the content generation module is as follows:
[0087] Set a sliding time window to collect the behavior sequence In this embodiment, the sliding time window is set to 200 ms.
[0088] Generate the context representation through the encoder :
[0089]
[0090] wherein, represents the model parameters.
[0091] Calculate the intention similarity distribution to determine the dominant writing intention of the current writing:
[0092]
[0093] wherein, the softmax transformation converts the similarity scores of multiple intentions into a mutually exclusive probability distribution; is the intention prototype matrix, T represents the temperature parameter, when tends to 0, the probability distribution tends to the maximum difference, and when tends to , the probability distribution tends to the uniform distribution.
[0094] The content generation module takes the predicted writing intention vector as a conditional control parameter, ensuring that the generated subsequent paragraphs or expanded content serve the core intention in terms of style and content. For example, when the intention is “request for approval”, the generated text will automatically strengthen the necessity, compliance, and proposed solutions.
[0095] The compliance verification module is also used to receive the predicted writing intention vector and perform pre-verification based on the writing intention vector. For example, for “request for approval” type documents, the system will preferentially and strictly verify whether the cited policy provisions are up-to-date, whether they have approval authority, whether the attached materials are usually required, etc.
[0096] The writing assistance module is also used to receive the predicted writing intention vector and provide anticipatory prompts in the sidebar based on the writing intention vector (e.g., “You are writing a request, usually you need to attach the XX file, please confirm whether it has been prepared”), realizing the transition from error alert to writing guidance.
[0097] The technical solution upgrades the system from a passive text completion tool to an active writing intelligent navigation, solving the problem that the generated content may be inconsistent with the user's real goal.
[0098] Embodiment five
[0099] The current way of adjusting the generation parameter to control the style is relatively rough, and may only adjust the formality of the vocabulary, making it difficult to generate text that truly reflects the deep differences in the writing style of different departments.
[0100] In this embodiment, the official document extraction module includes a variational autoencoder (VAE) model, which is used to decouple the semantic content and writing style of the official document in the latent space to obtain separate content encoding vectors and style encoding vectors. Through training on a large amount of official document data from different sources, it is ensured that the model can learn to separate the core content of the official document from the solemn style of the superior organ or the warm style of the grassroots unit.
[0101] The variational autoencoder (VAE) model includes an encoder, a latent space, and a decoder. The encoder is used to map the input official document text to the latent space to generate content encoding vectors and style encoding vectors; the decoder is used to regenerate the text according to the vectors in the latent space.
[0102] During the training process, the VAE model learns to decouple the semantic content and writing style of the official document text in the latent space by learning a large amount of official document data.
[0103] The encoder outputs two vectors: a content encoding vector representing the core content of the official document, and a style encoding vector representing the writing style of the official document.
[0104] In the content generation module, when receiving the content encoding vector, a content-neutral draft is first generated, the user selects the target style (such as the community residents' committee style or the city committee office style), and the content generation module calls the corresponding style encoding vector from the knowledge base.
[0105] The content generation module includes a generative adversarial network (GAN), a generator for fusing the draft and the target style encoding vector to generate text of the target style, and a discriminator for determining whether the generated text is truly consistent with the target style. Through adversarial training, the final generator can output text that maintains the correctness of the content and has different styles.
[0106] In addition, the user can input or import a sample document, and the system will extract the style vector of the sample document in real time and apply it to the current writing content to achieve one-key style migration. The technical solution meets the user's deep demand for fine and personalized control of the style of official documents.
[0107] This application embodiment also provides an electronic device 500 that utilizes the aforementioned method for generating and verifying official document content based on a large language model. The device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps of the aforementioned method for generating and verifying official document content based on a large language model. In this application embodiment, the processor is the control center of the computer method and can be a physical machine processor or a virtual machine processor.
[0108] Reference Figure 2 The electronic device 500 includes at least one processor 501, at least one communication interface 502, at least one memory 503, and at least one bus 504. The bus 504 is used for communication between these components, the communication interface 502 is used for signaling or data communication with other node devices, and the memory 503 stores machine-readable instructions executable by the processor 501. When the electronic device 500 is running, the processor 501 communicates with the memory 503 via the bus 504. When the machine-readable instructions are invoked by the processor 501, the steps of the document content generation and compliance verification method based on the large language model described above are executed.
[0109] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor of an electronic device, can implement the steps of the above-described method and apparatus for generating and verifying official document content based on a large language model.
[0110] Those of ordinary skill in the art can understand that all or part of the processes in the method and device for generating official document content based on a large language model and checking compliance can be completed by a computer program instructing related hardware. The program can be stored in a non-volatile computer readable storage medium. When the program is executed, it can include the processes of each embodiment of the method and device for generating official document content based on a large language model and checking compliance. Any reference to memory, storage, databases, or other media in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0111] The above is only an embodiment of the present application, and common knowledge such as specific structures and characteristics in the scheme is not described in detail. Those of ordinary skill in the art know all ordinary technical knowledge in the field of the present application before the filing date or the priority date, can know all prior art in the field, and have the ability to apply conventional experimental means before that date. Those of ordinary skill in the art can improve and implement the present scheme based on their own ability and the disclosure given in the present application. Some typical known structures or known systems should not be an obstacle for those of ordinary skill in the art to implement the present application. It should be noted that those of ordinary skill in the art can make several modifications and improvements without departing from the structure of the present application, which should be considered as the protection scope of the present application. The protection scope of the present application should be subject to the content of its claims, and the specific implementation in the specification can be used to explain the content of the claims.
Claims
1. A system for government document content generation and compliance checking based on large language models, characterized in that, Comprise: Document extraction module, for analyzing uploaded documents by large language model, extracting writing style and fixed sentence of different document types, building document writing knowledge graph, storing format specification, common expression and logical structure of various documents; Through the document extraction module, the core intent library of different document types is constructed, which is used to store the typical intent prototype vector in the field of document writing, and each intent corresponds to a vector representation; Content generation module, for generating subsequent paragraphs based on the input content context; based on keyword expansion, extract keywords from user input, retrieve information related to keywords in knowledge graph and external policy database; Integrate the retrieved information into supplementary content by combining the text generation capability of the large language model; display the supplementary content to the user for reference and editing; for analyzing behavior data, using a lightweight neural network model to predict the writing intent vector, which is used as a conditional control parameter; Compliance verification module, for real-time warning of inappropriate word use; verify the logical consistency of the content by RAG technology to retrieve related policies; Automatically check whether the format of each element of the document meets the standard; pre-check based on the writing intent vector; Writing assistance module, for providing real-time modification suggestions in the form of annotations displayed in the document sidebar; Based on the writing intent vector, provide forward-looking suggestions.
2. The big language model based official document content generation and compliance checking system according to claim 1, characterized in that, Analysis of behavior data includes the following: Text input feature extraction formula is as follows: wherein, tfis the term frequency, dfis the document frequency, N is the total number of documents; Cursor behavior coding, using Fourier transform to reduce the dimensionality of trajectory sequence: wherein and denotes the n two-dimensional coordinate of the cursor in the document interface at the n is a summation index representing the sequence number of the trajectory sample point; denotes the total number of trajectory sample points within the sliding window; denotes the frequency component index; denotes the complex value of the frequency component; i is the imaginary unit.
3. The big language model based official document content generation and compliance checking system according to claim 1, characterized in that, The document extraction module inputs the uploaded document into the pre-trained large language model; identifies the document type by text classification algorithm; analyzes the writing style of the document, including sentence structure, word usage, paragraph layout, extracts fixed sentence and style features; stores the extracted document type and writing style features in the database for subsequent template construction.
4. The big language model based official document content generation and compliance checking system according to claim 1, characterized in that, The document extraction module integrates document and format specification data from multiple channels; Use natural language processing technology to analyze the semantic relationship and structural information in the document; based on Neo4j graph database, store the parsed knowledge as nodes and edges to form a document writing knowledge graph, where nodes represent document elements and edges represent the relationship between elements; update the knowledge graph regularly to include the latest document format and expression.
5. The big language model based official document content generation and compliance checking system according to claim 1, characterized in that, The content generation module is used to input the input content into the large language model for coding and analysis; the model understands the current writing context by analyzing the semantics and structure of the input content; Based on the context understanding, the model generates relevant subsequent paragraph suggestions; display the predicted paragraphs to the user in the form of a list, and the user can accept or reject the suggestions.
6. The big language model based official document content generation and compliance checking system according to claim 1, characterized in that, The content generation module is also used to extract keywords from the input; retrieve information related to the keywords in the knowledge graph and external policy database; integrate the retrieved information into supplementary content by combining the text generation capability of the large language model; display the supplementary content to the user for reference and editing.
7. The big language model based official document content generation and compliance checking system according to claim 1, characterized in that, The content generation module adjusts the generation parameters of the large language model to control the style of the generated text; based on the adjusted parameters, the model generates multiple versions of the document content; display multiple versions of the document content side by side.
8. The big language model based official document content generation and compliance checking system according to claim 7, characterized in that, The official document extraction module includes a variational auto-encoding model, which is used to decouple the semantic content and writing style of the official document in a hidden space to obtain separated content encoding vectors and style encoding vectors; The content generation module generates a content-neutral draft according to the content encoding vectors; and further includes a generative adversarial network, which is used to fuse the draft and the style encoding vectors to generate a target style text, and to determine whether the generated text is real and consistent with the target style by using a discriminator.
9. The big language model based official document content generation and compliance checking system according to claim 1, characterized in that, The compliance verification module is used to store a sensitive word library in a database, to perform real-time detection on the official document content by using a string matching algorithm, to perform word-by-word scanning on the official document text by using a multi-mode matching algorithm, to identify accurately matched sensitive words, to expand the sensitive word detection range based on the synonym relationship in a knowledge graph, to convert the official document text and the sensitive words into semantic vectors respectively, to calculate the similarity, to identify sensitive expressions with similar semantics, to perform real-time detection when the official document content is input, to highlight the sensitive words, and to pop up a warning box in a sidebar to display the sensitive level, the sensitive word interpretation, and to provide differentiated suggestions for different levels of sensitive words.
10. The big language model based official document content generation and compliance checking system according to claim 1, characterized in that, The writing assistance module identifies, marks and highlights the suspicious content by setting rules and thresholds.
Citation Information
Patent Citations
Manuscript writing auxiliary method and system, terminal and storage medium
CN116432611A
Intelligent creation method based on NLP intention recognition
CN119047468A