Intelligent writing method and device
By integrating an intranet knowledge base and a deep learning model into word processing software, the integration and security issues of intelligent writing in an intranet environment are solved, achieving efficient and accurate intelligent writing functions, shortening the writing cycle and ensuring document security.
Patent Information
- Application Number
- CN202511054503.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-30
- Publication Date
- 2025-11-21
AI Technical Summary
Existing word processing software such as Microsoft Word and WPS lacks intelligent writing support, especially in intranet environments where deep integration is not possible. Furthermore, the knowledge base has weak access control capabilities, making it difficult to achieve integrated operations of retrieval, generation, and editing.
By connecting to the intranet knowledge base based on network protocols and authentication mechanisms, semantic retrieval and deep learning models are used for text generation and verification. A vector database is constructed, and the generation strategy is optimized by combining reinforcement learning mechanisms to provide template recommendation and integrated operation.
It achieves efficient, secure, and accurate intelligent writing in an intranet environment, shortening the writing cycle by more than 50%, ensuring the professionalism and security of the text, and reducing the learning cost for users.
Smart Images

Figure CN120996005A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the field of natural language processing (NLP) and office software integration, and particularly provides an intelligent writing method and device. BACKGROUND
[0002] Mainstream word processing software includes Microsoft Word and WPS, Word lacks intelligent writing support, WPS has intelligent writing functions but does not support use under pure intranet office conditions and does not support combination with intranet knowledge creation.
[0003] Current popular intelligent writing tools (such as Kimi) mainly provide services in the form of browser web pages, are not deeply integrated with document processing tools, have weak text layout capabilities, and need to frequently switch interfaces when used with Word and WPS. The provided knowledge base function has weak permission control capabilities.
[0004] Current RAG technology is mainly used in independent question answering systems and has not been combined with document processing tools to form a closed-loop workflow, making it difficult to realize integrated operation of "retrieval-generation-editing". SUMMARY
[0005] The application provides an intelligent writing method with strong practicability.
[0006] The further technical task of the application is to provide an intelligent writing device with reasonable design and safety.
[0007] The application adopts the technical scheme to solve the technical problems:
[0008] An intelligent writing method has the following steps:
[0009] S1, based on a network protocol and an authentication mechanism, connect with various knowledge base systems in an intranet to realize integration and unified management of knowledge data;
[0010] S2, adopt an advanced semantic retrieval algorithm to perform semantic understanding on a query or writing context input by a user and convert the query or writing context into a semantic vector;
[0011] S3, based on a deep learning sequence generation model, customize training for different text processing tasks;
[0012] S4, collect and organize various commonly used official documents, reports and other text templates and store the templates according to a certain classification system.
[0013] Further, in step S1, the metadata structure of the knowledge base is established, the data changes in the intranet knowledge base are monitored in real time or periodically, the local cache or index is automatically updated, and it is ensured that the knowledge content used by the writing engine is always up-to-date and accurate.
[0014] Further, in step S2, the knowledge content in the intranet knowledge base is vectorized to construct a vector database. In the retrieval process, the similarity between the query vector and the knowledge base vector is calculated to locate the most relevant content to the user's demand.
[0015] Further, the similarity between the query vector q and the knowledge base vector d is:
[0016]
[0017] The similarity value is in the range of (0, 1], the higher the similarity, the closer the value to 0;
[0018] In combination with the retrieved knowledge content and the user's writing intention, a generative pre-training model is used for text generation;
[0019] In the generation process, the retrieved knowledge fragments are integrated into the generation model as context information. Through specific fusion strategies, the generated text not only meets the user's writing style and logical requirements, but also fully utilizes the accurate information in the knowledge base, realizing the deep integration of RAG technology and writing generation.
[0020] Further, in step S3, in the generation process, the model dynamically adjusts the generation strategy according to the semantic features and logical structure of the original text, ensuring that the generated text is consistent with the original text in style and logic;
[0021] At the same time, a reinforcement learning mechanism is introduced, and the fluency r fluency , relevance r relevance , correctness r correctness and novelty r novelty of the text are comprehensively considered. The reward function r total is designed as follows:
[0022] r total = w1·r fluency + w2·r relevance + w3·r correctness + w4·r novelty .
[0023] A grammar rule base, a spelling dictionary, a punctuation usage specification, and a logical relationship pattern base are constructed, and a method combining pattern matching and machine learning is used to comprehensively check the text.
[0024] Further, when performing comprehensive checking, firstly, common syntax errors, spelling errors and misuse of punctuation are found through rule matching; then, a text quality evaluation model based on deep learning is used to analyze and judge the logical coherence and semantic accuracy of the text, and a detailed checking report is automatically generated, and corresponding modification suggestions are provided to assist the user to improve the text content.
[0025] Further, in step S4, each template contains a basic structure framework, fixed format requirements and fillable content area identification, while associating the corresponding industry specifications and writing guidelines, so that the user can grasp the writing points and format specifications when using the template.
[0026] Further, according to the writing task type, theme keyword and historical use record of the user, a machine learning algorithm is used to intelligently recommend the most suitable template for the user;
[0027] During the recommendation process, the use frequency of the template, user evaluation and relevance to the current writing scene are comprehensively considered to ensure the accuracy and practicality of the recommended results;
[0028] At the same time, the user can search and filter the template to locate the required template.
[0029] An intelligent writing device, comprising at least one memory and at least one processor;
[0030] The at least one memory is used to store a machine readable program;
[0031] The at least one processor is used to call the machine readable program and execute an intelligent writing method.
[0032] Compared with the prior art, the intelligent writing method and device of the present application has the following outstanding beneficial effects:
[0033] The present application can complete time-consuming operations such as retrieval, rewriting and proofreading automatically through AI, shorten the writing cycle by more than 50%. The content checking function can correct grammar and logic errors to ensure the professionalism of the text. The generated results driven by the knowledge base are more accurate and scenario-adaptive. Deeply embedded in the WPS interface, users can call AI functions without switching platforms, reducing learning costs. The knowledge base access mechanism based on permissions ensures the security of enterprise documents. BRIEF DESCRIPTION OF DRAWINGS
[0034] In order to make the technical scheme of the present application or the prior art clearer, the accompanying drawings needed in the description of the embodiments or the prior art will be briefly described. Obviously, the accompanying drawings described are only some embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0035] Figure 1 It is a flowchart of an intelligent writing method. DETAILED DESCRIPTION
[0036] In order to make the technical scheme of the present application or the prior art clearer, the accompanying drawings needed in the description of the embodiments or the prior art will be briefly described. Obviously, the accompanying drawings described are only some embodiments of the present application, rather than all the embodiments. Based on the embodiments of the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0037] A preferred embodiment is given below:
[0038] As shown in Figure 1 , the intelligent writing method in the embodiment has the following steps:
[0039] S1, based on network protocol and authentication mechanism, connect with various knowledge base systems (such as document management system, database, knowledge graph, etc.) in the intranet, realize the integration and unified management of knowledge data; establish the metadata structure of the knowledge base, including document type, topic classification, permission information, etc., so as to realize subsequent accurate retrieval and access control.
[0040] Real-time or periodic monitoring of data changes in the intranet knowledge base, automatic updating of local cache or index, ensuring that the knowledge content used by the writing engine is always the latest and accurate, avoiding errors caused by outdated knowledge.
[0041] S2, using advanced semantic retrieval algorithm, semantic understanding of user input query or writing context, converting it into semantic vector;
[0042] At the same time, the knowledge content in the intranet knowledge base is also vectorized, and an efficient vector database is constructed. In the retrieval process, by calculating the similarity of the query vector and the knowledge base vector, the most relevant content to the user's demand is quickly located, and the accuracy and recall rate of retrieval are improved. The similarity of the query vector q and the knowledge base vector d is:
[0043]
[0044] The similarity value is in the range of (0, 1], the higher the similarity, the closer the value to 0.
[0045] In combination with the retrieved knowledge content and the user's writing intention, a generative pre-training model (such as the GPT series model or its variants) is used for text generation. During the generation process, the retrieved knowledge fragments are integrated into the generation model as context information, and through specific fusion strategies (such as attention mechanism guided feature fusion), the generated text not only conforms to the user's writing style and logical requirements, but also fully utilizes the accurate information in the knowledge base, realizing the deep integration of RAG technology and writing generation.
[0046] S3, a sequence generation model based on deep learning, such as recurrent neural network (RNN), long short-term memory network (LSTM), Transformer, etc., is customized and trained for different text processing tasks;
[0047] During the generation process, the model dynamically adjusts the generation strategy according to the semantic features and logical structure of the original text, ensuring that the generated text is consistent with the original text in style and logic. At the same time, a reinforcement learning mechanism is introduced, which comprehensively considers the fluency (r fluency ), relevance (r relevance ), correctness (r correctness ) and novelty (r novelty ) of the text to design the following reward function r total to evaluate and optimize the quality of the generated text, and continuously improve the generation effect, and the function is as follows:
[0048] r total = w1·r fluency + w2·r relevance + w3·r correctness + w4·r novelty .
[0049] Multiple knowledge bases are constructed, including grammar rule library, spelling dictionary, punctuation usage specification, and logical relationship pattern library, etc. Pattern matching and machine learning are combined to comprehensively check the text.
[0050] First, common grammar errors, spelling errors and punctuation misuse are quickly found through rule matching; then, a deep learning-based text quality evaluation model is used to analyze and judge the logical coherence and semantic accuracy of the text, and a detailed checking report is automatically generated, providing corresponding modification suggestions to assist users in improving the text content.
[0051] S4, collect and organize various commonly used official documents (such as notices, requests, reports, letters, etc.), reports (such as work summary reports, market research reports, project feasibility research reports, etc.) and other text templates, and store them according to a certain classification system.
[0052] Each template contains a basic structural framework, fixed format requirements, and fillable content area identification, while associating relevant industry specifications, writing guidelines, and other auxiliary information to facilitate users in accurately grasping writing points and format specifications when using templates.
[0053] According to the user's writing task type, topic keywords, and historical usage records, etc. information, machine learning algorithms (such as collaborative filtering-based recommendation algorithms or content-based recommendation algorithms) are used to intelligently recommend the most suitable templates for users. During the recommendation process, multiple factors such as template usage frequency, user evaluation, and relevance to the current writing scenario are considered to ensure the accuracy and practicality of the recommendation results. At the same time, users can search and filter templates to quickly locate the required templates.
[0054] Among them, it is installed and run in the form of WPS add-on in WPS client, realizes the integration of "search-generation-edit", is compatible with domestic and non-domestic terminals, and supports version adaptive detection.
[0055] The running steps are:
[0056] (1) Install the add-on: open the WPS add-on installation page in the browser and click the install button.
[0057] (2) Open the add-on: open the WPS document editor and click "AI writing assistant" to open the add-on window.
[0058] (3) Login to the knowledge base: enter the intranet knowledge base account password and click the login button.
[0059] (4) Use rich functions such as intelligent search, smart Q&A, one-key generation, content continuation, content expansion, content abbreviation, outline generation, outline extraction, content review, and template library.
[0060] (5) Log out (optional);
[0061] (6) Close the add-on.
[0062] Based on the above method, an intelligent writing device in the embodiment includes at least one memory and at least one processor.
[0063] The at least one memory is configured to store machine-readable programs.
[0064] The at least one processor is configured to call the machine-readable programs and execute an intelligent writing method.
[0065] The above specific embodiments are only specific cases of the present application, the patent protection scope of the present application includes but is not limited to the above specific embodiments, any technical solution meeting the above specific embodiments of the present application and any appropriate changes or replacements made by the ordinary skilled person in the art shall fall within the patent protection scope of the present application.
[0066] Although embodiments of the present application have been shown and described, it is to be understood that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the present application, the scope of which is defined by the appended claims and their equivalents.
Claims
1. An intelligent writing method, characterized in that, It has the following steps: S1. Based on network protocols and authentication mechanisms, it connects with various knowledge base systems in the intranet to achieve the integration and unified management of knowledge data; S2. Employ advanced semantic retrieval algorithms to semantically understand the user's input query or writing context and transform it into a semantic vector; S3. A deep learning-based sequence generation model, which is customized for different text processing tasks; S4. Collect and organize various commonly used official documents, reports and other document templates, and store them according to a certain classification system.
2. The intelligent writing method according to claim 1, characterized in that, In step S1, the metadata structure of the knowledge base is established, and data changes in the intranet knowledge base are monitored in real time or periodically. The local cache or index is automatically updated to ensure that the knowledge content used by the writing engine is always up-to-date and accurate.
3. The intelligent writing method according to claim 2, characterized in that, In step S2, the knowledge content in the intranet knowledge base is vectorized to construct a vector database. During the retrieval process, the similarity between the query vector and the knowledge base vector is calculated to locate the content most relevant to the user's needs.
4. The intelligent writing method according to claim 3, characterized in that, The similarity between the query vector q and the knowledge base vector d is: The similarity value is in the range (0,1], and the higher the similarity, the closer the value is to 0; By combining the retrieved knowledge content with the user's writing intent, a generative pre-trained model is used to generate text; During the generation process, retrieved knowledge fragments are incorporated into the generation model as contextual information. Through specific fusion strategies, the generated text not only conforms to the user's writing style and logical requirements, but also makes full use of accurate information in the knowledge base, achieving a deep integration of RAG technology and writing generation.
5. The intelligent writing method according to claim 4, characterized in that, In step S3, during the generation process, the model dynamically adjusts the generation strategy based on the semantic features and logical structure of the original text to ensure that the generated text maintains consistency with the original text in style and logic. Simultaneously, a reinforcement learning mechanism is introduced to comprehensively consider the fluency r of the text. fluency Correlation r relevance Correctness correctness and novelty r novelty Design the following reward function r total The function for evaluating and optimizing the quality of the generated text is as follows: r total =w1·r fluency +w2·r relevance +w3·r correctness +w4·r novelty .; We construct a grammar rule base, a spelling dictionary, punctuation usage guidelines, and a logical relationship pattern library, and use a combination of pattern matching and machine learning to comprehensively verify the text.
6. The intelligent writing method according to claim 5, characterized in that, During a comprehensive review, firstly, common grammatical errors, spelling mistakes, and punctuation misuses are identified through rule matching. Then, a deep learning-based text quality assessment model is used to analyze and judge the text's logical coherence and semantic accuracy, automatically generating a detailed review report and providing corresponding modification suggestions to help users improve the text content.
7. The intelligent writing method according to claim 6, characterized in that, In step S4, each template includes a basic structural framework, fixed format requirements, and fillable content area identifiers, while also being associated with relevant industry standards and writing guidelines, so that users can grasp the key points of writing and format specifications when using the template.
8. The intelligent writing method according to claim 7, characterized in that, Based on the user's writing task type, topic keywords, and historical usage records, machine learning algorithms are used to intelligently recommend the most suitable template for the user. During the recommendation process, factors such as template usage frequency, user reviews, and relevance to the current writing scenario are comprehensively considered to ensure the accuracy and practicality of the recommendation results. At the same time, it supports users to search and filter templates to locate the template they need.
9. An intelligent writing device, characterized in that, include: At least one memory and at least one processor; The at least one memory is used to store a machine-readable program; The at least one processor is configured to invoke the machine-readable program to perform the method according to any one of claims 1 to 8.