Official document generation method and system based on artificial intelligence

Through the artificial intelligence-based official document generation method, the problem of difficulty in generating official document texts that meet special specifications and requirements in the existing technology is solved, and high-quality and accurate official document generation is achieved.

CN119886100AInactive Publication Date: 2025-04-25BOTSMART
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510360920.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-26
Publication Date
2025-04-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

It is difficult for existing official document generation technology to generate texts that meet special specifications and requirements, and it is prone to inaccurate words and irregular formats.

Method used

The artificial intelligence-based official document generation method is adopted to receive and verify official document generation requests, perform identity verification and semantic recognition, combine natural language processing technology to generate primary official document text, and ensure the accuracy and standardization of the text through dictionary matching algorithms and content polishing technology.

Benefits of technology

It realizes the generation of official document texts that meet the standards, improves the quality and accuracy of the text, and meets the special needs of official document generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119886100A_ABST
    Figure CN119886100A_ABST
Patent Text Reader

Abstract

The invention discloses an official document generation method based on artificial intelligence, and relates to the field of official document generation, and the method comprises the steps: receiving an official document generation request; performing paging verification and character verification on the official document generation request; performing identity verification on the target user, and outputting a target text material; generating a primary official document text; performing content auditing on the primary official document text; and performing content polishing on the primary official document text to obtain a target official document text. According to the method, the text with special specifications and special requirements can be effectively generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of official document generation, and in particular to an official document generation method and system based on artificial intelligence. Background Art

[0002] Artificial intelligence is an interdisciplinary subject based on computer science, involving computer science, psychology, philosophy and other disciplines. It studies and develops theories, methods, technologies and application systems for simulating, extending and expanding artificial intelligence, and is widely used in various industries, such as the financial industry and manufacturing industry. With the rapid development of science and technology, artificial intelligence has entered our lives, such as using artificial intelligence to generate images, identify objects, translate texts, generate texts, etc. In particular, the use of artificial intelligence to generate texts has been widely used by practitioners in various industries, such as using artificial intelligence to generate shooting scripts and using artificial intelligence to generate advertising copy.

[0003] Existing text generation technology can generate corresponding texts based on user input, such as essays, chat content, etc., which can meet the needs of most users to a certain extent. However, it is precisely because the existing official document generation technology can generate a variety of different types of texts that it lacks specificity while being universal. This is mainly manifested in that when using existing text generation technology to generate copy materials such as official documents with special specifications and requirements, the universal text generation rules are obviously difficult to apply to texts with specific special generation rules such as official documents. The official document texts generated using existing text generation technology may have problems such as inaccurate wording and non-standard formatting. Summary of the invention

[0004] The embodiments of the present application provide a method and system for generating official documents based on artificial intelligence, which are used to solve the problem that it is difficult to accurately generate texts with special specifications and special requirements in the prior art.

[0005] To achieve the above objectives, the embodiments of the present application adopt the following technical solutions: In a first aspect, a method for generating official documents based on artificial intelligence is provided, the method comprising: Receive a document generation request from a target user; Performing page check and character check on the document generation request, and when the page check and character check of the document generation request pass, obtaining the user information of the target user; Performing identity verification on the target user according to the user information, and if the identity verification of the target user passes, performing semantic recognition on the official document generation request, and outputting target text material according to the semantic recognition result; Combining the target text material with the official document generation request and using natural language processing technology to generate a primary official document text; Performing content review on the primary official document text based on a dictionary matching algorithm to obtain a content review result of the primary official document text; If the content review result shows that the content review of the primary official document text has passed, the content of the primary official document text is polished based on natural language processing technology to obtain the target official document text.

[0006] Optionally, performing paging check and character check on the document generation request includes the following steps: Extracting paging parameters of the document generation request, performing paging verification on the paging parameters, and updating parameters of the document generation request according to the paging verification result; Calculating the number of text characters of the document generation request after completing parameter update, and if the number of text characters is less than or equal to a preset character threshold, determining that the character verification of the document generation request has passed; If the number of text characters is greater than the character threshold, it is determined that the character verification of the document generation request has failed.

[0007] Optionally, the performing identity verification on the target user according to the user information comprises the following steps: Perform identity encryption encoding on the target user according to the user information to obtain a user code; Performing a user review on the user code based on a pre-stored user database, determining whether the user code exists in the user database according to the user review result, and if the user code exists in the user database, retrieving the user authority information of the target user from the user database; Performing authority verification on the target user according to the user authority information, and if the authority verification passes, determining that the identity verification of the target user passes; If the user code does not exist in the user database or the authority verification fails, it is determined that the target user identity verification fails.

[0008] Optionally, performing semantic recognition on the document generation request and outputting the target text material according to the semantic recognition result comprises the following steps: Performing text cleaning on the document generation request; Using a word segmentation algorithm to perform word segmentation processing on the official document generation request after the text cleaning is completed, to obtain an official document request word set; Extracting official document keywords from the official document request word set using a keyword extraction algorithm; Performing context semantic recognition on the official document keywords, performing text type matching on the official document keywords according to the semantic recognition result, and obtaining the official document generation type of the official document generation request; The document generation type and the document keyword are combined to perform text association matching on the pre-built document generation material library, and the target text material is output according to the text association matching result.

[0009] Optionally, the step of combining the target text material and the document generation request and using natural language processing technology to generate a primary document text comprises the following steps: Using regular expressions to identify numeric words in the document request word set; Generate an official document constraint condition according to the digital word and the official document generation type; According to the document generation type, retrieve the document generation template of the corresponding type in the document generation material library; Using the official document keywords and the target text material as seed text; Based on the official document generation template, a primary official document text is generated according to the official document constraint conditions and the seed text and using natural language processing technology.

[0010] Optionally, performing content review on the primary official document text based on a dictionary matching algorithm to obtain a content review result of the primary official document text comprises the following steps: Performing text cleaning on the primary official document text; Based on the pre-built sensitive word library, a dictionary matching algorithm is used to match sensitive words on the primary official document text that has completed text cleaning; If there are sensitive words in the primary official document text, the sensitive words are marked and the primary official document text is determined to have failed the content review; If there are no sensitive words in the primary official document text, it is determined that the content of the primary official document text has passed the review.

[0011] Optionally, polishing the primary official document text based on natural language processing technology to obtain the target official document text includes the following steps: Using natural language processing technology to identify contextual relationships in the primary official document text, and classifying the primary official document text according to the contextual relationships to obtain a primary text type of the primary official document text; According to the primary text type, a target official document sample of a corresponding type is retrieved from the official document generation material library; The target official document text is obtained by combining the official document model and the contextual relationship and performing overall and partial polishing on the primary official document text.

[0012] Optionally, after polishing the primary official document text based on natural language processing technology to obtain the target official document text, the following steps may also be performed: Calculating the number of characters in the target official document to obtain a target number of characters; Acquire the maximum number of requests of the target user according to the user information of the target user; The maximum number of requests is deducted according to the target number of characters to obtain the current number of requests of the target user.

[0013] In a second aspect, the present application provides a machine-readable storage medium, characterized in that instructions are stored on the machine-readable storage medium, and the instructions are used to enable a machine to execute a method for generating official documents based on artificial intelligence according to any one of the first aspects.

[0014] In a third aspect, the present application provides an official document generation system based on artificial intelligence, characterized in that it includes: a memory configured to store instructions; and A processor is configured to call the instructions from the memory and to implement a method for generating official documents based on artificial intelligence according to any one of the first aspects when executing the instructions.

[0015] Through the above technical scheme, the present application first performs paging check and character check on the official document generation request of the target user to ensure that the official document generation request meets the specifications, so as to facilitate the subsequent more accurate identification of the semantics of the official document generation request. At the same time, by extracting the official document keywords and official document generation type of the official document generation request, the target text material of the corresponding type and theme is obtained, so that the text generated subsequently can meet the needs of the target user while being rich in content. In addition, according to the official document generation type, the official document generation template of the corresponding type is retrieved, which can ensure that the generated primary official document text is more standardized. After the primary official document text is generated according to the official document generation template, the target text material and the official document keywords, the primary official document text is polished using the official document model of the same type, which can effectively improve the text quality of the primary official document text. In summary, the present application can accurately generate a standard official document text.

[0016] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A flowchart of an artificial intelligence-based document generation method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0019] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), such directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0020] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0021] Figure 1 The flowchart of a method for generating official documents based on artificial intelligence according to an embodiment of the present application is schematically shown. Figure 1 As shown, the embodiment of the present application provides a method for generating official documents based on artificial intelligence, which may include the following steps: S101, receiving a document generation request from a target user.

[0022] In this embodiment, the official document generation request refers to the target user's descriptive language for the official document text that needs to be generated, for example: Help me generate a work report of no less than 500 words. The report needs to include... The more detailed the official document generation request is, the more the target official document text generated in the end will meet the needs of the target user.

[0023] S102: Perform page check and character check on the document generation request. When the page check and character check of the document generation request pass, obtain user information of the target user.

[0024] In this embodiment, the main purpose of the paging check is to check whether the page number of the official document generation request meets the specifications. If it does not meet the specifications, the page number needs to be adjusted until the page number of the official document generation request meets the specifications. For example, under normal circumstances, the page number generally starts with an integer 1. If a negative number less than 1 or 0 appears, it means that the page number may be wrong. Continuing to use the wrong page number may cause the page number to be incoherent, which is not conducive to subsequent text storage and management. The character check is to review the number of characters in the official document generation request. If the official document generation request exceeds the preset character threshold (which can be 2500 characters), it is determined that the character check fails and the official document cannot be generated. An empty set will be output to remind the target user to modify the official document generation request. If the official document generation request is less than or equal to the character threshold, it is determined that the character check fails, and the subsequent steps of the official document generation will continue. The reason for checking the number of characters in the document generation request is that a lot of computing power is required in the text generation process. An overly long document generation request will increase the computing power of document generation, resulting in a longer document generation time. In addition, there may be some malicious users who try to enter overly long texts, maliciously consuming document generation resources and causing resource waste. Therefore, it is necessary to limit the number of characters in the document generation request to save computing power while increasing the speed of text generation.

[0025] S103, verify the identity of the target user according to the user information. If the identity of the target user passes the verification, perform semantic recognition on the document generation request, and output the target text material according to the semantic recognition result.

[0026] In this embodiment, user information includes the user name and login password used by the user when logging in. Identity verification of the target user can prevent unauthorized access and data leakage. At the same time, the target user's usage rights can be identified based on the user information. Only after the authority verification is passed can the text generation system continue to be used. Methods that can be used for semantic recognition of official document generation requests include support vector machines, BERT (pre-trained language representation model), latent semantic analysis (LSA), etc. By performing semantic analysis on the official document generation request, the official document keywords and official document generation types in the official document generation request can be extracted. According to the official document keywords and official document generation types, the corresponding type of target text materials can be accurately extracted. The target text materials mainly refer to famous quotes. By quoting famous quotes, the content of the target official document model finally generated can be enriched.

[0027] S104, combining the target text material and the document generation request and using natural language processing technology to generate a primary document text.

[0028] In this embodiment, the target text material can enrich the text content of the primary official document text and improve the text quality of the primary official document text. The official document generation request specifies the official document type, number of characters, official document subject, etc. of the generated text. Official document types include approvals, regulations, bulletins, minutes, etc., and official document subjects include work reports on the progress of a certain work, meeting reports of a certain meeting, lecture reports of a certain lecture, etc. Natural language processing (NLP) is an important research direction in the field of artificial intelligence. It integrates knowledge from multiple disciplines such as linguistics, computer science, machine learning, mathematics, cognitive psychology, etc. It is an interdisciplinary subject integrating computer science, artificial intelligence and linguistics. It includes two main aspects: natural language understanding and natural language generation. The research content includes multiple levels such as characters, words, phrases, sentences, paragraphs and chapters. Natural language processing technology can be used in different fields such as information analysis, language translation, and text generation.

[0029] S105. Perform content review on the primary official document text based on a dictionary matching algorithm to obtain a content review result of the primary official document text.

[0030] In this embodiment, the dictionary matching algorithm is a commonly used technology in text processing, which is mainly used to find a character string that matches an entry in a dictionary in a given text. The core idea of ​​this algorithm is to compare the text with the entries in the dictionary one by one to determine whether there is a match. The dictionary matching algorithm includes the forward maximum matching method (FMM), the reverse maximum matching method (BMM) and the bidirectional maximum matching method. The dictionary matching algorithm can be used to review the sensitive words of the primary official document text. If there are sensitive words in the primary official document text, it is determined that the content review of the primary official document text has not passed, and the sensitive words need to be deleted and modified. The sensitive word review can ensure the compliance, accuracy and professionalism of the official document content, while avoiding potential risks and disputes. Especially for important texts such as official documents that are oriented to the public, it is more necessary to review sensitive words to enhance the persuasiveness and credibility of the official document. The content review results of the primary official document text include whether the primary official document text has passed the content review.

[0031] S106. If the content review result shows that the content of the primary official document text has passed the content review, the primary official document text is polished based on natural language processing technology to obtain the target official document text.

[0032] In this embodiment, when the content of the primary official document text is reviewed and approved, the natural language processing technology is used to polish the content of the primary official document text. The main method is to extract the contextual relationship and primary text type of the primary official document text, retrieve the corresponding target official document model according to the primary text type, and use the contextual relationship and the target official document model to polish the primary official document text as a whole and in part, so that the generated target official document text not only conforms to the official document specifications, but also has clearer and more explicit semantics, thereby improving the text quality of the target official document text.

[0033] In one embodiment, performing page verification and character verification on a document generation request includes the following steps: Extract the paging parameters of the document generation request, perform paging verification on the paging parameters, and update the parameters of the document generation request according to the paging verification result; Calculate the number of text characters of the document generation request that has completed parameter update, and if the number of text characters is less than or equal to a preset character threshold, determine that the character verification of the document generation request has passed; If the number of text characters is greater than the character threshold, it is determined that the character check of the document generation request has failed.

[0034] In this embodiment, the main purpose of paging verification is to verify whether the page number of the document generation request meets the specification. If it does not meet the specification, the page number needs to be adjusted until the page number of the document generation request meets the specification. For example, under normal circumstances, the page number generally starts with an integer 1. If a negative number less than 1 or 0 appears, it means that the page number may be wrong. Continuing to use the wrong page number may cause the page number to be incoherent, which is not conducive to subsequent text storage and management. The methods that can be used to identify page numbers include regular expressions, OCR (optical character recognition), rule matching algorithms, etc. Taking the rule matching algorithm as an example, the matching rules are defined according to the common position and format of the page number. For example, the page number is usually at the bottom of the page. The text of the document generation request is scanned line by line or paragraph by paragraph, and the rules are applied to identify the possible page number position, and context recognition is performed to verify whether the identified page number position meets the requirements.

[0035] The character check is to review the number of characters in the document generation request. The document generation request is traversed and each character is counted one by one to obtain the number of text characters. If the document generation request exceeds the preset character threshold (which can be 2500 characters), the character check is judged to have failed and the document cannot be generated. An empty set will be output to remind the target user to modify the document generation request. If the document generation request is less than or equal to the character threshold, the character check is judged to have failed and the subsequent steps of document generation will continue. The number of characters in the document generation request is checked because a lot of computing power is required in the text generation process. Too long document generation requests will increase the computing power of document generation, resulting in a longer time for document generation. In addition, there may be some malicious users who try to enter too long texts, maliciously consume resources for document generation, and cause resource waste. Therefore, it is necessary to limit the number of characters in the document generation request to save computing power and increase the speed of text generation.

[0036] In one embodiment, performing identity verification on a target user according to user information includes the following steps: Encrypt and encode the identity of the target user according to the user information to obtain the user code; Perform user review on the user code based on the pre-stored user database, determine whether the user code exists in the user database according to the user review result, and if the user code exists in the user database, retrieve the user authority information of the target user from the user database; Perform authority verification on the target user according to the user authority information. If the authority verification passes, it is determined that the target user identity verification has passed; If the user code does not exist in the user database or the permission verification fails, it is determined that the target user identity verification fails.

[0037] In this embodiment, the user information includes the user name and login password used by the user when logging in. The user database stores the codes of all logged-in users and the corresponding user authority information. The user authority information determines which resources the user can access and which operations the user can perform. For example, some users do not have the authority to generate official documents, but have the authority to search for official document materials and polish official documents. Methods that can be used to encrypt and encode the identity information of the target user include hash algorithms, ASCII codes, Unicode codes, etc. Taking the hash algorithm as an example, the hash algorithm can convert user information into a hash value of fixed length, which can ensure that even if the original information is leaked, the original information cannot be restored through the hash value. While ensuring that the user information will not be leaked, it is convenient to authenticate the identity of the target user. The generated user code is matched with the code in the pre-stored user database. If the user code of the target user exists in the user database, it means that the identity authentication of the target user is passed. Then, the user authority information of the target user is retrieved from the user database through the user code of the target user. If the user authority information has the authority to generate official documents, it means that the target user authority verification is passed. However, when both the identity authentication and authority verification of the target user are passed, the official document generation system can continue to perform subsequent official document generation steps according to the official document generation request of the target user. If the user code does not exist in the user database or the authority verification fails, in any of the above cases, the target user's identity verification is deemed to have failed, and the document generation service cannot be provided to the target user.

[0038] In one embodiment, performing semantic recognition on a document generation request and outputting a target text material according to the semantic recognition result includes the following steps: Perform text cleaning on official document generation requests; The word segmentation algorithm is used to perform word segmentation processing on the official document generation request after the text cleaning is completed, and the official document request word set is obtained; The keyword extraction algorithm is used to extract the official document keywords in the official document request word set; Perform context semantic recognition on the official document keywords, perform text type matching on the official document keywords according to the semantic recognition results, and obtain the official document generation type of the official document generation request; Combine the document generation type and the document keywords to perform text association matching on the pre-built document generation material library, and output the target text material according to the text association matching results.

[0039] In this embodiment, the text cleaning of the official document generation request is mainly to remove redundant spaces, punctuation marks, special characters, etc., to ensure the neatness of the text, and to avoid the special characters in the official document generation request from affecting the subsequent word segmentation and semantic recognition steps. The word segmentation algorithms that can be used to segment the official document generation request include Unigram (unary word segmentation) word segmentation algorithm, WordPiece (word piece segmentation) word segmentation algorithm, BPE (subword segmentation) word segmentation algorithm, etc. Taking the BPE word segmentation algorithm as an example, the official document generation request is first decomposed into basic characters, and the frequency of all character pairs is counted, and the most frequently occurring adjacent character pairs are iteratively found and merged. After each merger, the character pair frequency table is updated, and the above steps are repeated until the preset number of mergers is reached, and all the words obtained are integrated to obtain the official document request word set. Then, the official document keywords in the official document request word set are extracted using the keyword extraction algorithm. This step is to save the computing power for subsequent type matching and improve the accuracy of text classification and clustering. Common keyword extraction algorithms include TF-IDF (term frequency-inverse document frequency) algorithm, TextRank (text ranking) algorithm, LDA (linear discriminant analysis) algorithm, etc. Taking TF-IDF algorithm as an example, the importance of a word to the document generation request is evaluated by term frequency (TF) and inverse document frequency (IDF). Term frequency (TF) refers to the frequency of a word appearing in the document generation request, while inverse document frequency (IDF) refers to the reciprocal of the frequency of a word appearing in the historical document generation request. After identifying the official document keywords, the keyword context of the official document keywords is searched, and the semantic recognition algorithm is used to combine the keywords to perform semantic recognition on the keyword context. Common semantic recognition algorithms include dependency syntactic analysis, context-free grammar, statistical syntactic analysis, word embedding, etc. Taking word embedding as an example, each word is mapped to a continuous vector space, so that words with similar semantics are closer in the vector space, thereby better expressing the semantic relationship between words. According to the semantic relationship, the official document keywords are matched with the text type. The cosine similarity, Jaccard similarity, Levenshtein edit distance, etc. can be used to calculate the similarity between the semantic relationship, the official document keywords and the descriptive text of the text type. According to the similarity, the official document generation request is classified to obtain the official document generation type of the official document generation request. The official document generation type refers to the official document type and the official document subject. The official document types include approvals, regulations, bulletins, minutes, etc. The official document subjects include progress reports on a certain project, meeting reports on student education, lecture reports on environmental protection, etc. The text materials in the official document generation material library are stored in categories, such as education material storage units, environmental protection material storage units, etc. Therefore, the storage unit of the corresponding type is retrieved according to the official document generation type, and then the text material containing the official document keywords is retrieved to obtain the target text material.

[0040] In one embodiment, combining the target text material and the document generation request and using natural language processing technology to generate the primary document text includes the following steps: Use regular expressions to identify numeric words in the document request word set; Generate document constraints based on digital words and document generation types; According to the document generation type, retrieve the document generation template of the corresponding type in the document generation material library; Use official document keywords and target text materials as seed texts; Based on the official document generation template, primary official document text is generated according to the official document constraints and seed text and using natural language processing technology.

[0041] In this embodiment, a regular expression is a powerful text processing tool used to match, search, replace or extract specific patterns in a string. It consists of common characters and special characters (metacharacters), which have special meanings and are used to define matching rules. Regular expressions can be used to identify numeric words in the official document request word set, such as three hundred, one thousand, etc., and semantic recognition is performed on adjacent characters or words of numeric words, such as words, above, etc. This step is used as an example to identify the target user's requirements for the number of words required to generate official documents. Official document constraints are generated based on numeric words and official document generation types. Official document constraints refer to the number of words and types required by the target user, such as environmental protection theme conference reports within 500 words. Since the official document generation templates in the official document generation material library are stored in categories, they are divided into report template storage units, notification module storage units, notification template storage units, etc., so the official document generation template of the corresponding type can be directly called according to the official document type in the official document generation type. The reason for calling the document generation template is that most documents have fixed formats and specifications, so the generated documents need to comply with the corresponding formats and specifications. The use of pre-stored templates can ensure that the generated primary document text complies with the corresponding formats and specifications. The official document keywords and target text materials are used as the basic text, i.e., the seed text. Based on the document generation template, the primary document text is generated according to the document constraints and seed text and natural language processing technology. The principle of generating text using natural language processing technology is a complex and sophisticated process that relies on a large amount of text data, advanced machine learning algorithms, and deep learning models to learn and generate natural language text.

[0042] In one embodiment, performing content review on the primary official document text based on a dictionary matching algorithm to obtain the content review result of the primary official document text includes the following steps: Carry out text cleaning on primary official documents; Based on the pre-built sensitive word library, the dictionary matching algorithm is used to match sensitive words in the primary official document text that has completed text cleaning; If there are sensitive words in the primary official document text, the sensitive words will be marked and the primary official document text will be judged as failing the content review; If there are no sensitive words in the primary official document text, the primary official document text is deemed to have passed the content review.

[0043] In this embodiment, redundant spaces, punctuation marks, special characters, etc. in the primary official document text are removed. The sensitive word library contains sensitive words that cannot appear in a variety of official documents and words with similar semantics to sensitive words. These sensitive words have certain potential risks and disputes. In order to avoid unnecessary disputes, the generated primary official document text needs to be strictly reviewed. The primary official document text is scanned word by word using a dictionary matching algorithm. If a sensitive word is found, its position and content are recorded. The sensitive word can be replaced or deleted later according to the recorded position and content. The dictionary matching algorithm is a commonly used technology in text processing, which is mainly used to find a string that matches an entry in a dictionary in a given text. The core idea of ​​this algorithm is to compare the text with the entries in the dictionary one by one to determine whether there is a match. The use of a dictionary matching algorithm can ensure that no sensitive words are missed and all sensitive words can be identified. For primary official document texts with sensitive words, it will be judged that the content review fails, and the sensitive words need to be replaced or deleted until there are no sensitive words in the primary official document text. If there are no sensitive words in the primary official document text, the primary official document text is judged to have passed the content review and the primary official document text can be polished.

[0044] In one embodiment, polishing the primary official document text based on natural language processing technology to obtain the target official document text includes the following steps: Using natural language processing technology to identify contextual relationships in primary official document texts, and classifying the primary official document texts according to the contextual relationships to obtain primary text types of the primary official document texts; According to the primary text type, the target official document sample of the corresponding type is retrieved from the official document generation material library; Combine the official document model with the contextual relationship and polish the primary official document text as a whole and in part to obtain the target official document text.

[0045] In this embodiment, the dependency parsing technology in NLP (natural language processing technology) is used to identify the dependency relationship between words in the official document text, such as the subject-predicate relationship, the verb-object relationship, etc., to obtain the context relationship in the primary official document text, and the primary official document text is classified according to the context relationship by using methods such as random forest and K nearest neighbor. Taking the K nearest neighbor algorithm as an example, the primary text type of the primary official document text is obtained by calculating the similarity between the context relationship and the text type. Since all the official document templates in the official document generation material library are stored in the template module, and different types of templates in the template module are also stored in different units, such as report template units, notice template units, etc. Therefore, the corresponding target official document template can be retrieved according to the primary text type. Polishing refers to modifying, optimizing and improving the existing text to make it clearer, more accurate, vivid and fluent. The overall polishing mainly adjusts the paragraph layout of the primary official document text, and the local polishing mainly replaces some words or phrases in the primary official document text with synonyms, so that the replaced words or phrases are more concise and clear. The specific method is to perform semantic recognition on the primary official document text and the target official document model respectively, and replace the words or phrases with similar semantics between the target official document model and the primary official document text, so as to achieve the purpose of content polishing.

[0046] In one embodiment, after the primary official document text is polished based on natural language processing technology to obtain the target official document text, the following steps are further included: Calculate the number of characters in the target official document text to obtain the target number of characters; Get the maximum number of requests of the target user according to the user information of the target user; The maximum number of requests is deducted according to the target number of characters to obtain the current number of requests of the target user.

[0047] In this embodiment, since the maximum number of requests for each target user is limited, it is necessary to record the number of requests for the target user and deduct the corresponding number of requests from the maximum number of requests. Specifically, the number of characters in the target official document is calculated to obtain the target number of characters. If the target number of characters is greater than or equal to the preset number threshold, the current number of requests is increased by one, and the number of characters exceeding the number threshold is continued to be calculated. If the number of characters is still greater than the number threshold, the current number of requests is increased by one again until the number of characters is less than the preset number threshold to obtain the final number of requests. According to the user information of the target user, the corresponding maximum number of requests is retrieved from the user database, and the maximum number of requests is deducted according to the final number of requests to obtain the current number of requests for the target user.

[0048] An embodiment of the present application also provides a machine-readable storage medium, characterized in that instructions are stored on the machine-readable storage medium, and the instructions are used to enable the machine to execute the above-mentioned method of generating official documents based on artificial intelligence.

[0049] An official document generation system based on artificial intelligence, characterized by comprising: a memory configured to store instructions; and The processor is configured to call instructions from the memory and implement the above-mentioned method of document generation based on artificial intelligence when executing the instructions.

[0050] Among them, the processor can adopt a central processing unit (CPU). Of course, according to actual usage, other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. can also be adopted. The general-purpose processor can adopt a microprocessor or any conventional processor, etc., and this application does not impose any restrictions on this.

[0051] Among them, the memory can be an internal storage unit of a computer device, such as a hard disk or memory of a computer device, or an external storage device of a computer device, such as a plug-in hard disk, a smart memory card (SMC), a secure digital card (SD) or a flash memory card (FC) equipped on the computer device, and the memory can also be a combination of an internal storage unit and an external storage device of a computer device. The memory is used to store computer programs and other programs and data required by the computer device. The memory can also be used to temporarily store data that has been output or is to be output, and this application does not impose any restrictions on this.

[0052] An embodiment of the present application also provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the above-mentioned method of generating official documents based on artificial intelligence.

[0053] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0054] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0055] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0056] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0057] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0058] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0059] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0060] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0061] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A method for generating official documents based on artificial intelligence, characterized in that: The method comprises the following steps: Receive a document generation request from a target user; Performing page check and character check on the document generation request, and when the page check and character check of the document generation request pass, obtaining the user information of the target user; Performing identity verification on the target user according to the user information, and if the identity verification of the target user passes, performing semantic recognition on the official document generation request, and outputting target text material according to the semantic recognition result; Combining the target text material with the official document generation request and using natural language processing technology to generate a primary official document text; Performing content review on the primary official document text based on a dictionary matching algorithm to obtain a content review result of the primary official document text; If the content review result shows that the content review of the primary official document text has passed, the content of the primary official document text is polished based on natural language processing technology to obtain the target official document text.

2. The method according to claim 1, characterized in that The paging check and character check of the document generation request comprises the following steps: Extracting paging parameters of the document generation request, performing paging verification on the paging parameters, and updating parameters of the document generation request according to the paging verification result; Calculating the number of text characters of the document generation request after completing parameter update, and if the number of text characters is less than or equal to a preset character threshold, determining that the character verification of the document generation request has passed; If the number of text characters is greater than the character threshold, it is determined that the character verification of the document generation request has failed.

3. The method according to claim 1, characterized in that The identity verification of the target user according to the user information comprises the following steps: Perform identity encryption encoding on the target user according to the user information to obtain a user code; Performing user review on the user code based on a pre-stored user database, judging whether the user code exists in the user database according to the user review result, and if the user code exists in the user database, retrieving user authority information of the target user from the user database; Performing authority verification on the target user according to the user authority information, and if the authority verification passes, determining that the identity verification of the target user passes; If the user code does not exist in the user database or the authority verification fails, it is determined that the target user identity verification fails.

4. The method according to claim 1, characterized in that: The performing semantic recognition on the document generation request and outputting the target text material according to the semantic recognition result comprises the following steps: Performing text cleaning on the document generation request; Using a word segmentation algorithm to perform word segmentation processing on the official document generation request after the text cleaning is completed, to obtain an official document request word set; Extracting official document keywords from the official document request word set using a keyword extraction algorithm; Performing context semantic recognition on the official document keywords, performing text type matching on the official document keywords according to the semantic recognition result, and obtaining the official document generation type of the official document generation request; The document generation type and the document keyword are combined to perform text association matching on the pre-built document generation material library, and the target text material is output according to the text association matching result.

5. The method according to claim 4, characterized in that The step of combining the target text material and the document generation request and using natural language processing technology to generate a primary document text comprises the following steps: Using regular expressions to identify numeric words in the document request word set; Generate an official document constraint condition according to the digital word and the official document generation type; According to the document generation type, retrieve the document generation template of the corresponding type in the document generation material library; Using the official document keywords and the target text material as seed text; Based on the official document generation template, a primary official document text is generated according to the official document constraint conditions and the seed text and using natural language processing technology.

6. The method according to claim 1, characterized in that The step of performing content review on the primary official document text based on a dictionary matching algorithm to obtain a content review result of the primary official document text comprises the following steps: Performing text cleaning on the primary official document text; Based on the pre-built sensitive word library, a dictionary matching algorithm is used to match sensitive words on the primary official document text that has completed text cleaning; If there are sensitive words in the primary official document text, the sensitive words are marked and the primary official document text is determined to have failed the content review; If there are no sensitive words in the primary official document text, it is determined that the content of the primary official document text has passed the review.

7. The method according to claim 1, characterized in that The step of polishing the primary official document text based on natural language processing technology to obtain the target official document text comprises the following steps: Using natural language processing technology to identify contextual relationships in the primary official document text, and classifying the primary official document text according to the contextual relationships to obtain a primary text type of the primary official document text; According to the primary text type, a target official document sample of a corresponding type is retrieved from the official document generation material library; The target official document text is obtained by combining the official document model and the contextual relationship and performing overall and partial polishing on the primary official document text.

8. The method according to claim 1, characterized in that After polishing the primary official document text based on natural language processing technology to obtain the target official document text, the following further comprises: Calculating the number of characters in the target official document to obtain a target number of characters; Acquire the maximum number of requests of the target user according to the user information of the target user; The maximum number of requests is deducted according to the target number of characters to obtain the current number of requests of the target user.

9. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions for enabling a machine to execute a method for generating official documents based on artificial intelligence according to any one of claims 1 to 8.

10. An official document generation system based on artificial intelligence, characterized in that: include: a memory configured to store instructions; as well as A processor is configured to call the instructions from the memory and to implement a method for generating official documents based on artificial intelligence according to any one of claims 1 to 8 when executing the instructions.

Citation Information

Patent Citations

  • Text creation method, device, equipment, and storage medium

    CN111832275A

  • Article automatic generation method and device, equipment and storage medium

    CN117744620A

  • Method for generating article content and electronic equipment

    CN117875274A

  • Bid text generation method and system based on large language model and storage medium

    CN118982007A

  • Text auditing method

    CN119293201A