Intelligent compiling method and system based on retrieval enhancement generation
Through intelligent writing methods and systems based on retrieval enhancement generation, the problem of insufficient confidentiality and auxiliary writing capabilities of existing AI products during file processing is solved, and the files are rewrite and privatized under the premise of high confidentiality is realized, and user experience and data security are improved.
Patent Information
- Application Number
- CN202411712034.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-21
AI Technical Summary
The existing search enhancement generated AI products lack confidentiality and efficient auxiliary writing capabilities when processing files, and cannot directly rewrite files and are not very private.
It provides an intelligent writing method and system based on search enhancement generation. By obtaining user input instructions, searching pre-stored text databases, generating results and processing them in a local or private cloud environment, ensuring the confidentiality and privatization of results.
It realizes that files are rewritten and privatized through auxiliary writing capabilities while improving the degree of confidentiality, improving user convenience and data security.
Smart Images

Figure CN119669432A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information processing technology, and in particular to an intelligent writing method and system based on retrieval-enhanced generation. Background Art
[0002] With the popularization of the Internet and the development of Internet of Things technology, a huge amount of data has been generated. Through the training of massive data, artificial intelligence technology has also emerged. Artificial Intelligence (AI) refers to the intelligent behavior exhibited by computer systems. Most AI products are application systems with retrieval enhancement technology as the core framework, which can provide accurate answers based on operations such as query processing and data retrieval, but most of these AI products rely on web interface terminals. When files need to be processed, there are many inconveniences when using AI products.
[0003] The existing implementation methods of search enhancement generation mainly include software platforms deployed on cloud servers, which input query information into the search engine, and use the large language model of the industrial brain to perform search and generate search results. Or, the document can be rewritten through a document-assisted writing system. The search content is generated through a software platform applied to a cloud server, and the search result data generated cannot be directly privatized, lacking confidentiality. Such data usually cannot directly rewrite the file, and the privacy is not high; however, the auxiliary writing ability of using only the document-assisted writing system is not high.
[0004] How to improve the degree of confidentiality while achieving file rewriting and privatization through auxiliary writing capabilities is an urgent problem to be solved by the present invention. Summary of the invention
[0005] The present application provides an intelligent writing method and system based on retrieval enhanced generation, which is used to solve the problem of improving the degree of confidentiality while achieving file rewriting through auxiliary writing capabilities.
[0006] In a first aspect, the present application provides an intelligent writing method based on retrieval enhancement generation, the method is applied to an intelligent writing device based on retrieval enhancement generation, and the method includes:
[0007] Obtaining a first input instruction from a user, and obtaining an input text and a user intention according to the first input instruction from the user; wherein the user intention is used to indicate the user's intention to perform material retrieval or content generation;
[0008] According to the input text, multiple historical documents in a pre-stored text database are searched to obtain search results; wherein the search results include multiple sorted search texts and original position information of each search text;
[0009] According to the user intention and the search result, a generated result is obtained; wherein, when the user intention indicates material search, the generated result is the same as the search result; when the user intention indicates content generation, the generated result includes a first generated text generated according to a plurality of search texts of the search result;
[0010] The generated results are displayed in the pre-stored display window.
[0011] In one possible design, when user intent indicates content generation, user intent is also used to indicate knowledge questions and answers generated based on retrieval enhancement and questions and answers based on historical conversation information;
[0012] When user intent indicates content generation and knowledge questions and answers generated based on retrieval enhancement, the generated results are obtained according to user intent and retrieval results, including:
[0013] Integrate multiple search texts into a collection text;
[0014] Generate a first generated text based on the set text by using a pre-stored text generation model; wherein the text generation model is deployed in a local or private cloud environment;
[0015] The first generated text is processed for rationality to obtain a generated result.
[0016] In a possible design, when the user intention indicates content generation and question-answering based on historical conversation information, the generation results are obtained according to the user intention and the retrieval results, including:
[0017] Generate a second generated text based on the input text and the set text by using a large text generation model;
[0018] The second generated text is processed for rationality to obtain a generated result.
[0019] In a possible design, the input text and the user intention are obtained according to the user's first input instruction, including:
[0020] Extracting input text from the user's first input instruction using a pre-stored text information extraction algorithm;
[0021] The user intent is parsed based on the input text through a pre-stored natural language processing algorithm; wherein the natural language processing algorithm includes: an intent recognition algorithm based on a large language model and small sample learning, or an intent recognition algorithm based on user data and a dedicated pre-trained model.
[0022] In a possible design, multiple historical documents in a pre-stored text database are retrieved according to the input text to obtain retrieval results, including:
[0023] Extracting a plurality of first historical texts and a historical vector corresponding to each first historical text from a plurality of historical documents in a text database by using a pre-stored text information extraction algorithm; wherein the historical documents are uploaded to the text database and are converted into vectors;
[0024] The input text is vectorized through the pre-stored word vector encoding model to obtain the input vector corresponding to the input text;
[0025] Calculate the similarity between the input vector and each historical vector using a pre-stored similarity calculation algorithm;
[0026] According to the similarity corresponding to each historical vector, the retrieval result is obtained.
[0027] In a possible design, according to the similarity corresponding to each history vector, the retrieval results are obtained, including:
[0028] According to the similarity corresponding to each history vector, a plurality of search texts are screened out from the plurality of first history texts;
[0029] Calculate the relevance score between the input text and each search text respectively through the pre-stored semantic relevance re-ranking model;
[0030] According to the relevance score corresponding to each search text, multiple search texts are sorted, and each search text is traced back to obtain the original location information of each search text;
[0031] The search results are obtained based on the sorted multiple search texts and the original position information of each search text.
[0032] In a possible design, before obtaining the first input instruction from the user, the method further includes:
[0033] Obtaining a third input instruction from the user, wherein the third input instruction from the user refers to an instruction from the user to perform the first screening condition;
[0034] Extracting the first screening condition from the third input instruction of the user through a text information extraction algorithm;
[0035] A plurality of first historical texts are extracted from a plurality of historical documents in a text database according to a first screening condition through a text information extraction algorithm.
[0036] In a possible design, after displaying the generated result on a pre-stored display window, the method further includes:
[0037] Obtaining a fourth input instruction from the user, wherein the fourth input instruction from the user refers to an instruction from the user to perform a second screening condition;
[0038] Extracting a second screening condition from the fourth input instruction of the user through a text information extraction algorithm;
[0039] By using a text information extraction algorithm, a plurality of second historical texts are extracted from a plurality of historical documents in the text database according to the second screening condition, so as to update the generation result according to the plurality of second historical texts.
[0040] In a possible design, when the fifth input instruction of the user is obtained, after displaying the generated result in a pre-stored display window, the method further includes:
[0041] Get user documentation;
[0042] Insert multiple search texts, or first generated texts, into a user document; wherein the fifth user input instruction refers to an instruction for quickly filling in the user document.
[0043] In a second aspect, the present application provides an intelligent writing system based on retrieval-enhanced generation, comprising:
[0044] A display device, and an intelligent writing device based on retrieval enhancement generation, which is communicatively connected to the display device and is used to implement an intelligent writing method based on retrieval enhancement generation; wherein a first display interface and a second display interface are arranged on the display device;
[0045] The user intention acquired by the intelligent writing device based on retrieval enhancement generation refers to the user's intention to search for materials. The intelligent writing device based on retrieval enhancement generation displays the generated result through the first display interface;
[0046] When the user intention acquired by the intelligent writing device based on retrieval-enhanced generation refers to the user's intention to generate content, the intelligent writing device based on retrieval-enhanced generation displays the generation result through the second display interface.
[0047] In a third aspect, the present application provides an intelligent writing device based on retrieval-enhanced generation, comprising:
[0048] An acquisition module is used to acquire a first input instruction from a user, and obtain an input text and a user intention according to the first input instruction from the user; wherein the user intention is used to indicate the user's intention to perform material retrieval or content generation;
[0049] A retrieval module is used to retrieve multiple historical documents in a pre-stored text database according to the input text to obtain retrieval results; wherein the retrieval results include multiple sorted retrieval texts and original position information of each retrieval text;
[0050] A result module is used to obtain a generated result according to the user intention and the search result; wherein, when the user intention indicates material search, the generated result is the same as the search result; when the user intention indicates content generation, the generated result includes a first generated text generated according to multiple search texts of the search result;
[0051] The display module is used to display the generated results on a pre-stored display window.
[0052] In a fourth aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor;
[0053] Memory stores computer-executable instructions;
[0054] The processor executes the computer-executable instructions stored in the memory to implement an intelligent writing method based on retrieval-enhanced generation according to the first aspect of the invention.
[0055] In a fifth aspect, the present application provides a computer-readable storage medium, which stores computer execution instructions. When the computer execution instructions are executed by a processor, they are used to implement an intelligent writing method based on retrieval-enhanced generation of the invention content of the first aspect.
[0056] In a sixth aspect, the present application provides a computer program product, including: a computer program, which, when executed by a processor, is used to implement an intelligent writing method based on retrieval-enhanced generation of the invention content of the first aspect.
[0057] The present application provides an intelligent writing method and system based on retrieval-enhanced generation, which obtains the user's first input instruction, and obtains the input text and user intention according to the user's first input instruction; retrieves multiple historical documents in a pre-stored text database according to the input text to obtain the retrieval result; obtains the generation result according to the user intention and the retrieval result; when the user intention indicates content generation, the generation result includes the first generation text generated according to multiple retrieval texts of the retrieval result; and displays the generation result on a pre-stored display window. The following technical effects are achieved: according to the recognized user intention and the user input text, the input text is rewritten or assisted in writing, which brings great convenience to the user; the user's intention is divided into two types, namely retrieval and content generation, and commands are executed according to the two intentions to obtain results. These operations are implemented based on the internal implementation of the document editor, have a high degree of confidentiality, and reduce the probability of data leakage; the generation result is displayed in the pre-stored display window, and the user can choose whether to insert it into the original file according to the displayed generation result, which can achieve the rewriting of the file and realize privatization. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0059] Figure 1 A schematic diagram of the system architecture of the intelligent writing method based on retrieval-enhanced generation provided in an embodiment of the present application;
[0060] Figure 2 A framework diagram of an application scenario of the intelligent writing method based on retrieval-enhanced generation provided in an embodiment of the present application;
[0061] Figure 3 Schematic diagram of the process of the intelligent writing method based on retrieval enhanced generation provided in the embodiment of the present application Figure 1 ;
[0062] Figure 4 Schematic diagram of the process of the intelligent writing method based on retrieval enhanced generation provided in the embodiment of the present application Figure 2 ;
[0063] Figure 5 Schematic diagram of the process of the intelligent writing method based on retrieval enhanced generation provided in the embodiment of the present application Figure 3 ;
[0064] Figure 6 A schematic diagram of the structure of an intelligent writing device based on search-enhanced generation provided by an embodiment of the present application;
[0065] Figure 7 A schematic diagram of the structure of the electronic device hardware provided in an embodiment of the present application.
[0066] Reference numerals:
[0067] 130 - intelligent writing system based on retrieval enhancement generation; 100 - display device; 110 - first display interface; 120 - second display interface;
[0068] 111-user input module; 112-condition screening module; 113-data retrieval result module;
[0069] 121-user dialogue module; 122-condition filtering module; 123-tracing result module;
[0070] 200-Document Editor; 300-Computer; 400-User;
[0071] 600-intelligent writing device based on search enhancement generation; 610-acquisition module; 620-search module; 630-result module; 640-display module;
[0072] 700 - electronic device; 710 - processor; 720 - memory; 730 - communication component; 740 - bus. DETAILED DESCRIPTION
[0073] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0074] In the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same functions and effects. Those skilled in the art will understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference. It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design schemes. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more.
[0075] It should be noted that the "at..." in the embodiments of the present application can be the instant when a certain situation occurs, or can be a period of time after a certain situation occurs, and the embodiments of the present application do not specifically limit this. In addition, the intelligent writing method based on retrieval-enhanced generation provided in the embodiments of the present application is only used as an example, and the intelligent writing method based on retrieval-enhanced generation can also include more or less content.
[0076] In order to clearly describe the technical solutions of the embodiments of the present application, some terms and technologies involved in the embodiments of the present application are briefly introduced below:
[0077] Retrieval-Augmented Generation: Retrieval-Augmented Generation (RAG) is an artificial intelligence technology, especially a method for natural language processing tasks. It combines the advantages of information retrieval technology and generative models, enabling machines to use information from external knowledge bases to enhance the quality and accuracy of their output when generating content.
[0078] Document editor: A document editor is a software tool used to create, view, edit, and manage electronic documents. It can handle various types of text files, from simple notes to complex reports, papers, etc. Common document editors include Microsoft Word, etc.
[0079] Natural Language Processing Algorithms: Natural language processing is a branch of computer science that is dedicated to enabling computers to understand, interpret, and generate human language. Natural language processing technology covers a range of algorithms and techniques designed to process text and voice data. In this application, it can be understood as identifying user intent and needs through natural language processing algorithms.
[0080] Large Language Model: Large Language Model (LLM) refers to deep learning models that are trained with large amounts of text data and are able to generate natural language text or understand the meaning of language text. Such models are characterized by their large size, with millions to billions or even more parameters, which enables them to perform well in a wide range of natural language processing tasks, such as text generation, text classification, question answering, dialogue, etc.
[0081] Small-sample learning: Small-sample learning refers to a field in machine learning that focuses on how to enable models to effectively complete tasks with only a small amount of labeled data.
[0082] Word vector encoding model: The word vector encoding model is a key technology in natural language processing, which maps words into a numerical vector so that computers can process and understand text data. These vectors are not just simple numerical codes, but are designed to capture the position of words in the semantic space, reflecting the meaning of words and the relationship between them. The word vector encoding model helps machine learning and deep learning algorithms better understand and process text data.
[0083] Node association: Node association can have different meanings in different contexts, but generally refers to the process of determining the relationships between nodes in some kind of graph structure.
[0084] Cosine similarity algorithm: Cosine similarity is a measure of the angle between two non-zero vectors and is often used to calculate the similarity between them. In natural language processing, cosine similarity is often used to compare the similarity between documents or text fragments. Its core idea is to compare the direction of two vectors rather than their magnitude, which makes cosine similarity unaffected by the length of the vectors and only focuses on the angle between the vectors. The value range is [-1, 1].
[0085] Semantic relevance reranking: Semantic relevance reranking refers to the process of re-ranking search results based on the semantic relevance between documents or text fragments and queries in information retrieval or natural language processing tasks. This process usually occurs after the initial search, and the search results are re-evaluated to optimize the search results list that is finally returned to the user.
[0086] Text information extraction algorithm: Text information extraction is the process of automatically extracting structured information from unstructured or semi-structured text data. This information can be entities (such as names, places, organizations, etc.), relationships (such as who did what, when and where something happened), events (such as mergers and acquisitions, earthquakes, etc.) or other meaningful data. Text information extraction technology has a wide range of applications in search engine optimization, data analysis, automatic question-answering systems, intelligent customer service and other fields.
[0087] Prompt word: In the present application, it can be understood as an instruction issued to the system, such as sorting this paragraph, wherein "sorting this paragraph" is the instruction, which can be understood as the prompt word of this instruction.
[0088] External Application Programming Interface: An external application programming interface (API) is an interface provided by a software system that allows other systems or applications to interact with it. API (Application Programming Interface) is a set of rules and protocols that define how software components should interact. It allows developers to use a service or function without having to understand the underlying implementation details. External API interfaces are usually used for data exchange and service calls across systems or applications.
[0089] Reasonableness processing: In this application, the generated text is subjected to quality control, that is, sensitive information detection, desensitization processing, grammar detection, and sentence coherence detection are performed on the generated text.
[0090] With the development of artificial intelligence technology, more and more AI products are coming out, and users have higher and higher demands for the user experience of AI products. They not only require them to have powerful retrieval capabilities, but also require them to have auxiliary writing capabilities to enhance the user experience.
[0091] In the prior art, the user's search generation needs are generally met through search enhancement generation technology. For example, the search enhancement generation method implemented through the industrial brain includes:
[0092] Submit query information to the search engine and get search results;
[0093] Secondly, the search results are cleaned and divided into sentences, and sorted to obtain candidate documents;
[0094] Finally, candidate documents are retrieved and generated through the large model.
[0095] Or directly retrieve and process the files and generate content through a large model. Most of these methods are based on large models or web page interfaces, and there are some technical problems:
[0096] First, the method of searching and generating results based on a web page interface can only display the generated content on the web page interface, which is not applicable to situations with high confidentiality, and the generated content cannot be quickly privatized;
[0097] Secondly, by searching and generating files, the search scope and generated content are restricted, but the actual files are not rewritten or assisted in writing, and only the user's search generation instructions are implemented;
[0098] Thirdly, such methods can achieve the purpose of enhanced retrieval generation, but for corporate users with high confidentiality requirements, privatization cannot be achieved quickly, and assisted writing of documents cannot be achieved.
[0099] Considering the popularity of large models and retrieval-enhanced generation technology, this application also adopts this method to achieve intelligent writing.
[0100] Therefore, how to improve the degree of confidentiality while achieving file rewriting and privatization through auxiliary writing capabilities is a problem that the present invention urgently needs to solve.
[0101] Based on this, the embodiments of the present application provide an intelligent writing method and system based on retrieval enhanced generation, which can be used in the field of information processing technology, aiming to solve the above technical problems of the prior art.
[0102] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0103] Figure 1A schematic diagram of the system architecture of the intelligent writing method based on search-enhanced generation provided in the embodiment of the present application. It should be noted that: Figure 1 What is shown is merely an example of a system architecture to which the embodiments of the present application can be applied, in order to help those skilled in the art understand the technical content of the present application, but it does not mean that the embodiments of the present application cannot be used in other devices, systems, environments or scenarios.
[0104] like Figure 1 , a system architecture of an intelligent writing method based on retrieval enhancement generation is shown. The system architecture, an intelligent writing system 130 based on retrieval enhancement generation includes: a display device 100 , a first display interface 110 and a second display interface 120 .
[0105] The display device 100 is used to implement the input of user instructions and the display of subsequent search enhancement generation results. The display device 100 may include a first display interface 110 and a second display interface 120 .
[0106] The first display interface 110 is used to display the user's instruction for material search, process the user's instruction, and perform material search and generation according to the user's instruction. The first display interface 110 also includes a user input module 111, a condition screening module 112 and a material search result module 113. The user input module 111 allows the user to input instructions through this input interface. The condition screening module 112 allows the user to perform condition screening on the search scope or search content through this module. The material search result module 113 can display the result material after processing the user's input instruction and the condition screening instruction.
[0107] When the second display interface 120 displays the user's instructions for content generation, the user's instructions are processed, and content is generated according to the user's instructions and dialogue information. The second display interface 120 also includes a user dialogue module 121, a conditional filtering module 122, and a traceability result module 123. The user dialogue module 121 receives all the user's instructions and saves all the user's dialogue information. The conditional filtering module 122 allows the user to limit the search scope or search content, as well as the conditions for content generation. The traceability result module 123 can display the result data after processing the user's input instructions and conditional filtering instructions, as well as the traceability information of the result data.
[0108] Figure 2 The application scenario framework diagram of the intelligent writing method based on retrieval enhancement generation provided in the embodiment of the present application can be used in the various application scenarios described below, and can also be used in other application scenarios not specified.
[0109] In the embodiment of the present application, the intelligent writing system 130 based on retrieval-enhanced generation is applied to the document editor 200 and is implemented based on the functions of the document editor 200.
[0110] The document editor 200 represents a commercially available software tool for creating, viewing, editing and managing electronic documents.
[0111] When the user 400 processes the document in the document editor 200 through the computer 300, the intelligent writing system 130 based on retrieval enhancement generation performs intent recognition based on the instructions of the user 400, and performs retrieval processing and content generation processing according to the user's intent.
[0112] Figure 3 Schematic diagram of the process of the intelligent writing method based on retrieval enhanced generation provided in the embodiment of the present application Figure 1 .like Figure 3 As shown, the method includes:
[0113] S301: Obtain a first input instruction from a user, and obtain input text and user intention according to the first input instruction from the user.
[0114] Among them, user intent is used to indicate the user's intention to retrieve materials or generate content.
[0115] Specifically, the user's first input instruction is acquired, and based on the user's first input instruction, the user's input text information is obtained, as well as the user's intention to perform material retrieval or the user's intention to perform content generation.
[0116] S302: According to the input text, multiple historical documents in a pre-stored text database are searched to obtain search results.
[0117] The search results include a plurality of sorted search texts and the original position information of each search text.
[0118] Specifically, according to the text information input by the user, historical document information or other information in the pre-stored text database is searched to obtain the search results.
[0119] S303: Obtain a generated result according to the user intention and the search result.
[0120] Among them, when the user intends to indicate material retrieval, the generated result is the same as the retrieval result; when the user intends to indicate content generation, the generated result includes a first generated text generated based on multiple retrieval texts of the retrieval result.
[0121] Specifically, when the user intends to instruct material retrieval, a retrieval result is obtained. When the user intends to instruct content generation, the retrieval result is processed, and content generation is performed based on the processed retrieval result to obtain a generation result.
[0122] S304: Display the generated result in a pre-stored display window.
[0123] Specifically, the generated results are displayed on a pre-stored display window.
[0124] The present application provides an intelligent writing method based on retrieval-enhanced generation, which obtains the user's first input instruction, and obtains the input text and the user's intention according to the user's first input instruction; retrieves multiple historical documents in a pre-stored text database according to the input text to obtain the retrieval result; obtains the generation result according to the user's intention and the retrieval result; when the user's intention indicates content generation, the generation result includes the first generation text generated according to multiple retrieval texts of the retrieval result; and displays the generation result on a pre-stored display window. The following technical effects are achieved: according to the recognized user intention and the user's input text, the input text is rewritten or assisted in writing, which brings great convenience to the user; the user's intention is divided into two types, namely retrieval and content generation, and commands are executed according to the two intentions to obtain results. These operations are implemented based on the internal implementation of the document editor, have a high degree of confidentiality, and reduce the probability of data leakage; the generation result is displayed in the pre-stored display window, and the user can choose whether to insert it into the original file according to the displayed generation result, which can achieve the rewriting of the file and realize privatization.
[0125] Figure 4 Schematic diagram of the process of the intelligent writing method based on retrieval enhanced generation provided in the embodiment of the present application Figure 2 In this embodiment Figure 3 Based on the embodiment, the intelligent writing method based on retrieval enhancement generation is described in detail, such as Figure 4 As shown, this embodiment provides an intelligent writing method based on retrieval enhanced generation, including:
[0126] S401: Obtain a first input instruction from a user.
[0127] Specifically, a first input instruction input by the user is obtained.
[0128] S402: extracting input text from the user's first input instruction using a pre-stored text information extraction algorithm.
[0129] Specifically, according to the user's first input instruction, the input text and the user's intention are obtained, wherein the user's intention is used to indicate the user's intention to retrieve materials or generate content. The user's input text is extracted through a pre-stored text information extraction algorithm.
[0130] S403: Analyze the user's intention based on the input text using a pre-stored natural language processing algorithm.
[0131] Among them, natural language processing algorithms include: algorithms for intent recognition based on large language models and small sample learning, or algorithms for intent recognition based on user data and dedicated pre-trained models.
[0132] Specifically, the user's input is parsed through a pre-stored natural language processing algorithm to identify the user's intention and needs. Intention identification here means obtaining the display interface selected by the user.
[0133] S404: extracting a plurality of first historical texts and a historical vector corresponding to each first historical text from a plurality of historical documents in a text database using a pre-stored text information extraction algorithm.
[0134] Among them, the historical documents are all uploaded to the text database and converted into vectors.
[0135] Specifically, according to the input text, multiple historical documents in the pre-stored text database are retrieved to obtain the search results; wherein the search results include the sorted multiple search texts and the original position information of each search text. The historical documents are uploaded to the text database, and after vector conversion, the vectors corresponding to the historical texts are obtained; through the pre-stored text information extraction algorithm, the first historical text is selected from the multiple historical documents in the text database, and the historical vector corresponding to the first historical text is used as the basis for the implementation of the subsequent steps.
[0136] In the embodiment of the present application, the text database here is the basis for similarity calculation in subsequent steps. The text database here can be documents and knowledge reserves uploaded by users themselves, or search materials uploaded by developers.
[0137] S405. Perform vector conversion on the input text using a pre-stored word vector encoding model to obtain an input vector corresponding to the input text.
[0138] Specifically, the user's input text is converted into a vector form through a pre-stored word vector encoding model to obtain an input vector corresponding to the user's input text.
[0139] S406: Calculate the similarity between the input vector and each historical vector using a pre-stored similarity calculation algorithm.
[0140] Specifically, the similarity between the input vector and each history vector is calculated by a pre-stored similarity calculation algorithm, that is, the semantic similarity between the user's input text and the first history text selected from the text database is calculated by the similarity calculation algorithm.
[0141] The similarity calculation algorithm may be a cosine similarity algorithm or other similarity measurement algorithms commonly used in the art.
[0142] Taking the cosine similarity algorithm as an example, for the two input vectors (V1, V2)
[0143] The calculation formula is
[0144]
[0145] S407 , selecting multiple search texts from the multiple first historical texts according to the similarity corresponding to each historical vector.
[0146] Specifically, the search results are obtained according to the similarity corresponding to each historical vector. According to the similarity corresponding to each historical vector, the search texts with high similarity are screened out from multiple historical texts to obtain the most relevant search texts. The threshold of high similarity is determined according to the user's input or conditional screening.
[0147] S408: Calculate the relevance score between the input text and each search text respectively through the pre-stored semantic relevance re-ranking model.
[0148] Specifically, the search results are node-associated, and the relevance score between the user's input text and the search text is calculated through a pre-stored semantic relevance ranking model.
[0149] The semantic relevance re-ranking model here is obtained through training. The semantic relevance re-ranking model here is
[0150]
[0151] Then the calculation formula of the correlation score can be obtained through this model:
[0152]
[0153] Among them, Query is the text information input by the user; Sentence is the document text information whose relevance is to be calculated, that is, the search text in this embodiment.
[0154] S409: Sort the multiple search texts according to the relevance score corresponding to each search text, and trace the source of each search text to obtain the original location information of each search text.
[0155] Specifically, according to the relevance score corresponding to each search text, multiple search texts are reordered, and each search text is traced, that is, the original document and basic information of each search text are obtained, and the position of each search text in the original historical text is located.
[0156] S410: Obtain search results based on the sorted multiple search texts and the original position information of each search text.
[0157] Specifically, the search results are obtained based on the sorted multiple search texts, as well as the original document text and location information corresponding to each search text.
[0158] S411. Obtain generation results based on user intent and search results.
[0159] The principles of S411 and S303 are the same and will not be described again here.
[0160] In combination with the user intention identified above, when the user intention indicates material retrieval, S412 is executed; when the user intention indicates content generation, S413 is executed.
[0161] It is worth noting that the user intention is the result of the identification of the above steps. When the user intention is different, the corresponding display interface is also different, and the above steps are executed in different display interfaces. However, in the case of two user intentions, the steps corresponding to the two intentions are the same, but are displayed in different display interfaces. That is, when the user intention indicates material retrieval, the executed steps are in the first display interface, and the results are also displayed in the first display interface; when the user intention indicates content generation, the executed steps are in the second display interface, and the results are also displayed in the second display interface.
[0162] S412. When the user intends to indicate a material search, the generated result is the same as the search result.
[0163] When the user's intention is to retrieve materials, the retrieval results of the above steps for reordering and obtaining information are the generated results of the user's material retrieval intention.
[0164] S413: When the user intends to instruct content generation, the generated result includes a first generated text generated according to a plurality of search texts of the search result.
[0165] When the user instructs content generation, it is ultimately necessary to process the search results to obtain a final first generated text.
[0166] S414. Display the generated result in a pre-stored display window.
[0167] The principle of S414 is the same as that of S304, and will not be described in detail in this embodiment.
[0168] In a possible design, before obtaining the first input instruction from the user, the method further includes:
[0169] Obtaining a third input instruction from the user, wherein the third input instruction from the user refers to an instruction from the user to perform the first screening condition;
[0170] Extracting the first screening condition from the third input instruction of the user through a text information extraction algorithm;
[0171] A plurality of first historical texts are extracted from a plurality of historical documents in a text database according to a first screening condition through a text information extraction algorithm.
[0172] Specifically, before obtaining the user's first input instruction, condition screening can be implemented. Through a text information extraction algorithm, the user's first screening conditions are screened from the user's third input instruction, and the scope of the text database can be limited according to these screening conditions.
[0173] In this application, conditional filtering can not only filter the scope of the text database, but also has the following filtering conditions: restrictions can be placed on knowledge sources, knowledge types, output formats, and time ranges.
[0174] In a possible design, after displaying the generated result on a pre-stored display window, the method further includes:
[0175] Obtaining a fourth input instruction from the user, wherein the fourth input instruction from the user refers to an instruction from the user to perform a second screening condition;
[0176] Extracting a second screening condition from the fourth input instruction of the user through a text information extraction algorithm;
[0177] By using a text information extraction algorithm, a plurality of second historical texts are extracted from a plurality of historical documents in the text database according to the second screening condition, so as to update the generation result according to the plurality of second historical texts.
[0178] Specifically, after the display result is generated, conditional screening can also be performed. The user input instruction is extracted through a text information extraction algorithm to obtain a second screening condition; and the text database or other screening conditions are restricted according to the second screening condition, and the generated result is updated to obtain a new generated result after conditional screening.
[0179] In a possible design, when the fifth input instruction of the user is obtained, after displaying the generated result in a pre-stored display window, the method further includes:
[0180] Get user documentation;
[0181] Insert multiple search texts, or first generated texts, into a user document; wherein the fifth user input instruction refers to an instruction for quickly filling in the user document.
[0182] Specifically, the user document and the search result or the first generated text generated by the user's fifth input are obtained, and according to the user's fifth instruction, the user document is inserted, filled or further supplemented.
[0183] The present application provides an intelligent writing method based on retrieval enhanced generation, which obtains the user's first input instruction, and obtains the input text and the user's intention according to the user's first input instruction; retrieves multiple historical documents in a pre-stored text database according to the input text to obtain the retrieval result; obtains the generation result according to the user's intention and the retrieval result; when the user's intention indicates content generation, the generation result includes the first generation text generated according to multiple retrieval texts of the retrieval result; and displays the generation result on a pre-stored display window. The following technical effects are achieved: according to the recognized user intention and the user input text, the input text is rewritten or assisted in writing, which brings great convenience to the user. The user's intention is divided into two types, namely retrieval and content generation, and commands are executed respectively according to the two intentions to obtain results. These operations are implemented based on the internal implementation of the document editor, have a high degree of confidentiality, and reduce the probability of data leakage. The generation result is displayed in the pre-stored display window, and the user can choose whether to insert it into the original file according to the displayed generation result, so that the file can be rewritten and privatized. Through the conditional screening function, the search range or other conditions can be screened, so that the search range can be determined according to the user, and the search time can be greatly reduced. The generated results can be directly filled or rewritten in the user document based on the user's inserted request. The large model improves the auxiliary writing ability, and the document can be rewritten through the user's inserted request. A rapid tracing mechanism for search data in the document editor is built. By locating the source of relevant search data, the traceability of related data search can be achieved, which greatly improves the interpretability of the large language model application. The internal dialogue function of the document editor based on the large language model capability realizes direct dialogue communication, rewriting and polishing, and text reuse in the document editor through the large language model.
[0184] Figure 5 Schematic diagram of the process of the intelligent writing method based on retrieval enhanced generation provided in the embodiment of the present application Figure 3 In this embodiment Figure 4 Based on the embodiment, when the user intention is to generate content, the specific steps of obtaining the generated result according to the user intention and the search result are described in detail, such as Figure 5 As shown, this embodiment provides an intelligent writing method based on retrieval enhanced generation, including:
[0185] When user intent indicates content generation, user intent is also used to indicate knowledge questions and answers generated based on retrieval enhancement and questions and answers based on historical conversation information.
[0186] S501, obtaining a generated result according to the user intention and the search result;
[0187] The principles of S501 and S303 are the same and will not be described again here.
[0188] S501: Determine whether the user's intention is to generate an indicated question and answer based on retrieval enhancement.
[0189] Specifically, when the user indicates the intention and the knowledge question and answer is generated based on the retrieval enhancement, steps S503-S505 are executed; when the user indicates the intention of content generation and the question and answer is based on the historical dialogue information, steps S506-S507 are executed.
[0190] S503, integrating multiple search texts into a collection text.
[0191] Specifically, multiple search texts are integrated into a context collection text according to the prompt words.
[0192] S504. Generate a first generated text by using a pre-stored text generation model and based on the set text; wherein the text generation model is deployed locally or in a private cloud environment.
[0193] Specifically, a large model is generated through pre-stored text, and preliminary text content is generated based on the collection text. It is worth noting that the large model here is a large model deployed locally or in a private cloud environment, and no external API interface is called.
[0194] S505: Perform rationality processing on the first generated text to obtain a generated result.
[0195] Specifically, the first generated text will go through a quality control process, that is, the generated text will be processed by sensitive information detection, desensitization, grammar detection, and sentence coherence detection to obtain the generated result.
[0196] S506: Generate a large model through text, and generate a second generated text according to the input text and the set text.
[0197] Specifically, the input text information includes the historical dialogue information of all commands input by the user. The second generated text is generated by combining the historical dialogue information and the set text through the text generation large model.
[0198] S507: Perform rationality processing on the second generated text to obtain a generated result.
[0199] Specifically, the second generated text will also go through a quality control process to obtain a generated result.
[0200] The present application provides an intelligent writing method based on retrieval-enhanced generation, which divides the content generation into two cases according to the user's intention, so that the execution according to the user's intention is more accurate. The generation of text content is achieved by generating a large model through pre-stored text, without contact with the outside world and without the risk of leakage.
[0201] The embodiment of the present invention can divide the electronic device or the main control device into functional modules according to the above method example. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the embodiment of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0202] exist Figure 1 Based on the schematic diagram of the intelligent writing system based on retrieval enhancement generation, the intelligent writing system based on retrieval enhancement generation is described. Figure 1 As shown, the intelligent writing system based on retrieval enhancement generation includes: a display device 100 , a first display interface 110 and a second display interface 120 .
[0203] A display device 100, and an intelligent writing device based on retrieval enhancement generation for implementing an intelligent writing method based on retrieval enhancement generation, which is communicatively connected to the display device; wherein a first display interface and a second display interface are arranged on the display device;
[0204] When the user intention acquired by the intelligent writing device based on search enhancement generation refers to the user's intention to search for materials, the intelligent writing device based on search enhancement generation displays the generated result through the first display interface 110;
[0205] When the user intention acquired by the intelligent writing device based on retrieval-enhanced generation refers to the user's intention to generate content, the intelligent writing device based on retrieval-enhanced generation displays the generation result through the second display interface 120 .
[0206] The intelligent writing system based on retrieval-enhanced generation is used to implement an intelligent writing method based on retrieval-enhanced generation in the above-mentioned embodiment. Its implementation principle and technical effects are similar, and this embodiment will not be repeated here.
[0207] Figure 6 A schematic diagram of the structure of an intelligent writing device based on search enhancement generation provided by an embodiment of the present application. Figure 6As shown, the intelligent writing device 600 based on retrieval-enhanced generation includes: an acquisition module 610 , a retrieval module 620 , a result module 630 and a display module 640 .
[0208] The acquisition module 610 is used to acquire the first input instruction of the user, and obtain the input text and the user intention according to the first input instruction of the user; wherein the user intention is used to indicate the user's intention to perform material retrieval or content generation;
[0209] The search module 620 is used to search multiple historical documents in a pre-stored text database according to the input text to obtain search results; wherein the search results include multiple sorted search texts and original location information of each search text;
[0210] A result module 630 is used to obtain a generated result according to the user intention and the search result; wherein, when the user intention indicates material search, the generated result is the same as the search result; when the user intention indicates content generation, the generated result includes a first generated text generated according to multiple search texts of the search result;
[0211] The display module 640 is used to display the generated result in a pre-stored display window.
[0212] In one possible design, when user intent indicates content generation, user intent is also used to indicate knowledge questions and answers generated based on retrieval enhancement and questions and answers based on historical conversation information;
[0213] When the user intent indicates content generation and knowledge questions and answers generated based on retrieval enhancement, the result module 630 includes:
[0214] An integration module is used to integrate multiple search texts into a collection text;
[0215] A first text module is used to generate a large model through pre-stored texts and generate a first generated text according to the set texts; wherein the text generation large model is deployed locally or in a private cloud environment;
[0216] The first processing module is used to perform rationality processing on the first generated text to obtain a generated result.
[0217] In one possible design, when the user intends to indicate content generation and question-answering based on historical conversation information, the result module 630 includes:
[0218] A second text module, used for generating a large model through text, and generating a second generated text according to the input text and the set text;
[0219] The second processing module is used to perform rationality processing on the second generated text to obtain a generated result.
[0220] In one possible design, the acquisition module 610 includes:
[0221] An input text module, used to extract input text from the user's first input instruction by using a pre-stored text information extraction algorithm;
[0222] The intent parsing module is used to parse the user intent based on the input text through a pre-stored natural language processing algorithm; wherein the natural language processing algorithm includes: an intent recognition algorithm based on a large language model and small sample learning, or an intent recognition algorithm based on user data and a dedicated pre-trained model.
[0223] In one possible design, the retrieval module 620 includes:
[0224] An extraction module, used to extract a plurality of first historical texts and a historical vector corresponding to each first historical text from a plurality of historical documents in a text database by using a pre-stored text information extraction algorithm; wherein the historical documents are uploaded to the text database and subjected to vector conversion;
[0225] A conversion module is used to perform vector conversion on the input text through a pre-stored word vector encoding model to obtain an input vector corresponding to the input text;
[0226] A calculation module, used to calculate the similarity between the input vector and each historical vector respectively by using a pre-stored similarity calculation algorithm;
[0227] The vector result module is used to obtain the search results according to the similarity corresponding to each historical vector.
[0228] In one possible design, the vector result module includes:
[0229] A retrieval text module, used for screening out a plurality of retrieval texts from a plurality of first historical texts according to the similarity corresponding to each historical vector;
[0230] A relevance module, used for calculating the relevance score between the input text and each search text respectively through a pre-stored semantic relevance re-ranking model;
[0231] A source tracing module is used to sort multiple search texts according to the relevance score corresponding to each search text, and trace the source of each search text to obtain the original location information of each search text;
[0232] The search result module is used to obtain the search result based on the sorted multiple search texts and the original position information of each search text.
[0233] In a possible design, the intelligent writing device 600 based on retrieval-enhanced generation further includes:
[0234] A third instruction module, used to obtain a third input instruction from a user, wherein the third input instruction from a user refers to an instruction for the user to perform the first screening condition;
[0235] A first screening module, used to extract a first screening condition from a third input instruction of a user through a text information extraction algorithm;
[0236] The first extraction module is used to extract a plurality of first historical texts from a plurality of historical documents in a text database according to a first screening condition by using a text information extraction algorithm.
[0237] In a possible design, the intelligent writing device 600 based on retrieval-enhanced generation further includes:
[0238] A fourth instruction module, used to obtain a fourth input instruction from a user, wherein the fourth input instruction from a user refers to an instruction for the user to perform a second screening condition;
[0239] A second screening module, used to extract a second screening condition from the fourth input instruction of the user through a text information extraction algorithm;
[0240] The second extraction module is used to extract multiple second historical texts from multiple historical documents in the text database according to the second screening condition through a text information extraction algorithm, so as to update the generated result according to the multiple second historical texts.
[0241] In a possible design, the intelligent writing device 600 based on retrieval enhancement generation further includes:
[0242] The document acquisition module is used to acquire user documents;
[0243] The inserting module is used to insert multiple search texts, or the first generated text, into the user document; wherein the user's fifth input instruction refers to an instruction for quickly filling the user document.
[0244] The present embodiment provides an intelligent writing device based on retrieval-enhanced generation, which can execute the intelligent writing method based on retrieval-enhanced generation of the above-mentioned embodiment. Its implementation principle and technical effects are similar, and this embodiment will not be repeated here.
[0245] In the specific implementation of the aforementioned intelligent writing method based on retrieval-enhanced generation, each module can be implemented as a processor, and the processor can execute computer-executable instructions stored in the memory, so that the processor executes the aforementioned intelligent writing method based on retrieval-enhanced generation.
[0246] Figure 7 This is a schematic diagram of the structure of the electronic device hardware provided in the embodiment of the present application. Figure 7As shown, the electronic device 700 includes: at least one processor 710 and a memory 720. The electronic device 700 also includes a communication component 730. The processor 710, the memory 720 and the communication component 730 are connected via a bus 740.
[0247] In the specific implementation process, at least one processor 710 executes the computer execution instructions stored in the memory 720, so that at least one processor 710 executes an intelligent writing method based on retrieval enhanced generation as performed by the electronic device side as above.
[0248] The specific implementation process of the processor 710 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0249] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented by a hardware processor or implemented by a combination of hardware and software modules in the processor.
[0250] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk storage.
[0251] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.
[0252] The above-mentioned functions implemented by the electronic device and the main control device introduce the scheme provided by the embodiment of the present invention. It can be understood that in order to implement the above-mentioned functions, the electronic device or the main control device includes a hardware structure and / or software module corresponding to the execution of each function. In combination with the units and algorithm steps of each example described in the embodiment disclosed in the embodiment of the present invention, the embodiment of the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present invention.
[0253] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above-mentioned intelligent writing method based on retrieval-enhanced generation.
[0254] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof.
[0255] Such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (ErasableProgrammable
[0256] Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special purpose computer.
[0257] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as ASIC). Of course, the processor and the readable storage medium can also exist as discrete components in an electronic device or a main control device.
[0258] The present application also provides a computer program product, which includes: a computer program, which is stored in a readable storage medium. At least one processor of an electronic device can read the computer program from the readable storage medium. When the computer program is executed by the processor, it is used to implement the above-mentioned intelligent writing method based on retrieval-enhanced generation.
[0259] Those skilled in the art can understand that all or part of the steps of the above method embodiments can be completed by hardware related to program instructions. The above program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above method embodiments are executed; and the above storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0260] So far, the technical solution of the present application has been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments, and the above embodiments are only used to illustrate the technical solution of the present application rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. An intelligent writing method based on retrieval-enhanced generation, characterized in that: The method is applied to an intelligent writing device based on retrieval enhancement generation, and the method includes: Obtaining a first input instruction from a user, and obtaining an input text and a user intention according to the first input instruction from the user; wherein the user intention is used to indicate the user's intention to perform material retrieval or content generation; According to the input text, multiple historical documents in a pre-stored text database are searched to obtain search results; wherein the search results include multiple sorted search texts and original position information of each search text; According to the user intention and the search result, a generated result is obtained; wherein, when the user intention indicates the material search, the generated result is the same as the search result; when the user intention indicates the content generation, the generated result includes a first generated text generated according to a plurality of search texts of the search result; The generated result is displayed on a pre-stored display window.
2. The method according to claim 1, characterized in that When the user intention indicates the content generation, the user intention is also used to indicate the knowledge questions and answers generated based on retrieval enhancement and the questions and answers based on historical dialogue information; When the user intention indicates the content generation and the knowledge question and answer generated based on the retrieval enhancement, the generation result is obtained according to the user intention and the retrieval result, including: Integrate the plurality of search texts into a collection text; Generate a first generated text according to the set text by using a pre-stored text generation model; wherein the text generation model is deployed in a local or private cloud environment; The first generated text is processed for rationality to obtain the generated result.
3. The method according to claim 2, characterized in that When the user intention indicates the content generation and the question and answer based on the historical conversation information, the generation result is obtained according to the user intention and the search result, including: Generate a second generated text according to the input text and the set text by using the text generation model; The second generated text is processed for rationality to obtain the generated result.
4. The method according to claim 1, characterized in that: The obtaining of input text and user intention according to the first input instruction of the user includes: Extracting the input text from the first input instruction of the user by using a pre-stored text information extraction algorithm; The user intent is parsed based on the input text through a pre-stored natural language processing algorithm; wherein the natural language processing algorithm includes: an intent recognition algorithm based on a large language model and small sample learning, or an intent recognition algorithm based on user data and a dedicated pre-trained model.
5. The method according to claim 1, characterized in that The step of searching a plurality of historical documents in a pre-stored text database according to the input text to obtain search results includes: Extracting a plurality of first historical texts and a historical vector corresponding to each of the first historical texts from the plurality of historical documents in the text database by using a pre-stored text information extraction algorithm; wherein the historical documents are uploaded to the text database and converted into vectors; Performing vector conversion on the input text through a pre-stored word vector encoding model to obtain an input vector corresponding to the input text; Calculating the similarity between the input vector and each of the historical vectors using a pre-stored similarity calculation algorithm; The search result is obtained according to the similarity corresponding to each of the historical vectors.
6. The method according to claim 5, characterized in that The obtaining of the search result according to the similarity corresponding to each of the history vectors includes: Filtering out a plurality of the search texts from a plurality of the first historical texts according to the similarity corresponding to each of the historical vectors; Calculating the relevance score between the input text and each of the search texts respectively by using a pre-stored semantic relevance re-ranking model; According to the relevance score corresponding to each of the search texts, the plurality of search texts are sorted, and each of the search texts is traced back to its source to obtain the original location information of each of the search texts; The search result is obtained according to the sorted multiple search texts and the original position information of each search text.
7. The method according to claim 5, characterized in that Before obtaining the first input instruction from the user, the method further includes: Obtaining a third input instruction from a user, wherein the third input instruction from a user refers to an instruction from a user to perform a first screening condition; Extracting the first screening condition from the third user input instruction by using the text information extraction algorithm; By using the text information extraction algorithm, a plurality of the first historical texts are extracted from the plurality of the historical documents in the text database according to the first screening condition.
8. The method according to any one of claims 5 to 7, characterized in that: After displaying the generated result on the pre-stored display window, the method further includes: Obtaining a fourth input instruction from the user, wherein the fourth input instruction from the user refers to an instruction from the user to perform a second screening condition; Extracting the second screening condition from the fourth user input instruction by using the text information extraction algorithm; By using the text information extraction algorithm, according to the second screening condition, a plurality of second historical texts are extracted from the plurality of historical documents in the text database, so as to update the generation result according to the plurality of second historical texts.
9. The method according to claim 1, characterized in that: When the fifth input instruction of the user is obtained, after displaying the generated result in the pre-stored display window, the method further includes: Get user documentation; Inserting a plurality of the search texts, or the first generated texts, into the user document; wherein the fifth user input instruction refers to an instruction for quickly filling in the user document.
10. An intelligent writing system based on retrieval-enhanced generation, characterized in that: The system comprises: A display device, and a smart writing device based on retrieval-enhanced generation, which is communicatively connected to the display device and is used to implement the smart writing method based on retrieval-enhanced generation according to any one of claims 1 to 9; wherein the display device is arranged with a first display interface and a second display interface; When the user intention acquired by the intelligent writing device based on retrieval enhancement generation refers to the user's intention to search for materials, the intelligent writing device based on retrieval enhancement generation displays the generated result through the first display interface; When the user intention acquired by the intelligent writing device based on retrieval-enhanced generation refers to the user's intention to generate content, the intelligent writing device based on retrieval-enhanced generation displays the generation result through the second display interface.