Retrieval enhancement method and device based on domain term enhancement, equipment and storage medium
By extracting and vectorizing domain knowledge, combined with prediction of large language models, the problem that universal embedded vectors in vertical fields is difficult to capture professional information, and more accurate and professional search results are achieved.
Patent Information
- Application Number
- CN202411367199.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-10
- Estimated Expiration
- 2044-09-29
AI Technical Summary
In vertical fields, traditional search enhancement generation methods rely on general embedding vectors to difficult to capture domain-specific information, resulting in inaccurate search results, especially when highly specialized content, which cannot accurately reflect nuances and affect the search effect.
Extract specific domain knowledge and other domain knowledge in the domain knowledge base, convert it into vectors and store it in a vector database, train a large language model to obtain a search flag prediction model, predict the search flag type based on the query statement, and select the appropriate knowledge source to answer. Including direct use of large language models, domain-specific knowledge, or a combination of both.
It improves the ability of embedded vectors to capture domain-specific information, reduces search misunderstandings, improves the accuracy and professionalism of the search answers, and can flexibly select knowledge sources according to needs, which enhances the accuracy and completeness of the answers.
Smart Images

Figure CN119293210A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of natural language processing, and in particular to a retrieval enhancement method, device, equipment and storage medium based on domain term enhancement. Background Art
[0002] In the field of information retrieval and generation, the Retrieval-Augmented Generation (RAG) method has become an important tool for solving complex problems. The RAG method combines the advantages of retrieval systems and generative models by first retrieving relevant information from a large-scale document library and then using a generative model to generate accurate answers. However, although the RAG method performs well in many applications, especially in open domains and general knowledge retrieval tasks, its performance still has certain limitations in some vertical applications.
[0003] In vertical fields, traditional RAG methods usually rely on general embedding vectors to represent documents and queries. However, such general embedding vectors are difficult to fully capture domain-specific information. Vertical fields usually contain a large amount of specialized knowledge and specific terminology, which are often not fully represented in general embedding models. Therefore, the relevance evaluation in the retrieval process is not accurate enough, resulting in a deviation between the final generated results and the actual needs of users. This phenomenon is particularly evident when it comes to highly specialized content, such as medicine, law, engineering and other fields. General embedding vectors cannot accurately reflect the nuances in these fields, thus affecting the retrieval effect. Summary of the invention
[0004] In order to help improve the retrieval effect of highly specialized content, the present application provides a retrieval enhancement method, device, equipment and storage medium based on domain terminology enhancement.
[0005] In a first aspect, the present application provides a retrieval enhancement method based on domain term enhancement, which adopts the following technical solution: the method comprises: extracting specific domain knowledge and other domain knowledge from a domain knowledge base respectively, wherein the specific domain knowledge includes professional terms of a specific domain; Converting the specific domain knowledge and other domain knowledge into vectors and storing them in a vector database; The large language model is trained to obtain a retrieval token prediction model, which is used to predict the retrieval token type corresponding to the query statement when the query statement is received. ; When a query statement is received, the retrieval token prediction model obtained by training is used to predict the retrieval token type corresponding to the query statement. ; Based on the search flag type The large language model and the specific domain knowledge and other domain knowledge stored in the vector data are used to make an answer corresponding to the query statement.
[0006] In a specific implementation scheme, the converting of the specific domain knowledge and other domain knowledge into vectors and storing them in a vector database includes: converting the specific domain knowledge into vectors and storing them in a vector database; converting the other domain knowledge into the form of question-answer pairs; converting the other domain knowledge converted into the form of question-answer pairs into vectors and storing them in a vector database.
[0007] In a specific implementation scheme, the training of the large language model to obtain the retrieval token prediction model includes: using a loss function to train the large language model to obtain the retrieval token prediction model; the loss function is:
[0008] in, and is the real label based on the real probability of real data, and Predict probabilities for the model.
[0009] In a specific implementation scheme, the retrieval token prediction model obtained by training predicts the retrieval token type corresponding to the query statement. Including: the search mark type The predicted probability for:
[0010] in, For the query statement, For query statements The hidden representation of and is the model parameter.
[0011] In a specific embodiment, the search mark type ; The search based on the flag type Using the large language model and the specific domain knowledge and other domain knowledge stored in the vector data to make an answer corresponding to the query statement includes: if the search mark type is 0, the processing capability of the large language model itself is directly used to make an answer corresponding to the query statement; if the search flag type is 1, the specific domain knowledge in the vector database is used to search and make answers corresponding to the query statement; if the search flag type If it is 2, the specific domain knowledge and other domain knowledge in the vector database are used to retrieve and make an answer corresponding to the query statement.
[0012] In a specific implementation scheme, the retrieval token prediction model is also used to predict the query statement and the retrieved content Predicting contextual token types , the context flag type ; The context flag The predicted probability for:
[0013] in, For the query statement, For the retrieved content, Is a query statement and the retrieved content The joint statement and is a model parameter; after using the specific domain knowledge and other domain knowledge in the vector database to retrieve and make an answer corresponding to the query statement, it also includes: using the trained retrieval mark prediction model to predict the context mark corresponding to the query statement ; If the context flag is 0, then directly output the answer corresponding to the query statement; if the context flag If it is 1, the answer corresponding to the query statement is further searched in the vector database and expanded, and the expanded answer is output.
[0014] In a specific implementation scheme, further searching the vector database to expand the answer corresponding to the query statement includes: further searching the vector database for specific domain knowledge and other domain knowledge to obtain expanded information :
[0015] in, It is the joint representation of the query and preliminary retrieval content and the similarity between the candidate document paragraphs.
[0016] In a second aspect, the present application provides a retrieval enhancement device based on domain term enhancement, which adopts the following technical solution: the device comprises: A domain knowledge extraction module is used to extract specific domain knowledge and other domain knowledge from the domain knowledge base, wherein the specific domain knowledge includes professional terms in a specific domain; A vector conversion storage module, used to convert the specific domain knowledge and other domain knowledge into vectors and store them in a vector database; The language model training module is used to train the large language model to obtain a retrieval token prediction model. The retrieval token prediction model is used to predict the retrieval token type corresponding to the query statement when the query statement is received. ; The retrieval token prediction module is used to predict the retrieval token type corresponding to the query statement using the trained retrieval token prediction model when receiving the query statement. ; A query statement answering module is used to answer the query based on the search token type. The large language model and the specific domain knowledge and other domain knowledge stored in the vector data are used to make an answer corresponding to the query statement.
[0017] In a third aspect, the present application provides a computer device, which adopts the following technical solution: it includes a memory and a processor, and the memory stores a computer program that can be loaded by the processor and execute any of the above-mentioned retrieval enhancement methods based on domain terminology enhancement.
[0018] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution: storing a computer program that can be loaded by a processor and execute any of the above-mentioned retrieval enhancement methods based on domain terminology enhancement.
[0019] In summary, this application has at least the following beneficial technical effects: The present application scheme first pre-processes the data in the domain knowledge base, extracts the specific domain knowledge containing the professional terms in the specific domain and other domain knowledge, effectively improving the ability of the embedded vector to capture domain-specific information, so that when faced with highly specialized query retrieval, the present application can provide targeted professional answers based on the extracted specific domain knowledge, reducing the possibility of misunderstanding or ignoring important information in the retrieval process, and improving the accuracy of document retrieval and the accuracy of retrieval answers; at the same time, when receiving a query statement, first query the retrieval flag type corresponding to the query statement , and then according to the search mark type Different corresponding retrieval outputs different answers; that is, the system can flexibly select the most appropriate knowledge source to supplement according to the different needs of the query statement, thereby further improving the accuracy and professionalism of the answer. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 It is a flowchart of a retrieval enhancement method based on domain term enhancement in an embodiment of the present application.
[0021] Figure 2 It is an overall structural diagram of the retrieval enhancement method for domain term enhancement in the embodiment of the present application.
[0022] Figure 3 It is a structural block diagram of a retrieval enhancement device based on domain term enhancement in an embodiment of the present application.
[0023] Attached figure numbers: 301, domain knowledge extraction module; 302, vector conversion storage module; 303, language model training module; 304, retrieval token prediction module; 305, query statement answering module. DETAILED DESCRIPTION
[0024] The following is combined with Figure 1-3 This application is described in further detail.
[0025] In the field of information retrieval and generation, the Retrieval-Augmented Generation (RAG) method has become an important tool for solving complex problems. The RAG method combines the advantages of retrieval systems and generative models by first retrieving relevant information from a large-scale document library and then using a generative model to generate accurate answers. However, although the RAG method performs well in many applications, especially in open domains and general knowledge retrieval tasks, its performance still has certain limitations in some vertical applications.
[0026] First, in vertical fields, traditional RAG methods usually rely on general embedding vectors to represent documents and queries. However, this general embedding vector is difficult to fully capture domain-specific information. Vertical fields usually contain a lot of specialized knowledge and specific terminology, which is often not fully represented in general embedding models. Therefore, the relevance evaluation in the retrieval process is not accurate enough, resulting in a deviation between the final generated results and the actual needs of users. This phenomenon is particularly evident when it comes to highly specialized content, such as medicine, law, engineering and other fields. General embedding vectors cannot accurately reflect the nuances in these fields, thus affecting the retrieval effect.
[0027] Secondly, the large number of abbreviations and professional terms common in vertical fields increase the difficulty of text understanding. The RAG method requires deep matching and understanding of queries and documents, but when it comes to these highly specialized expressions, traditional RAG systems may not be able to effectively decode these abbreviations and terms. Even if the generative model can understand general language, it may still misunderstand or ignore important information when faced with vocabulary specific to these fields. This not only affects the accuracy of document retrieval, but also makes the generative model more prone to errors in the generation process, making it difficult to provide accurate answers.
[0028] In addition, the document structure in vertical fields is usually more complex. These documents not only contain a large number of definitions and terminology descriptions, but may also include specific specifications, operating procedures, technical parameters, and detailed descriptions. When processing these structured documents, traditional RAG methods often fail to effectively identify and utilize the structural information within the document, resulting in the retrieval process being unable to fully utilize the potential value of the document. Especially when dealing with tasks that require accurate positioning and analysis, RAG methods are more likely to get into trouble and have difficulty providing users with high-quality generated content.
[0029] In summary, although the RAG method has broad application potential in the field of information retrieval and generation, in vertical field applications, it has problems such as the difficulty of embedding vectors to capture domain-specific information, limited ability to handle abbreviations and professional terms, and insufficient ability to cope with complex document structures. The existence of these problems limits the widespread application of the RAG method in professional fields.
[0030] Based on the above problems, an embodiment of the present application discloses a retrieval enhancement method based on domain terminology enhancement, which is applied to a data retrieval system.
[0031] like Figure 1 As shown, the method comprises the following steps: S10, extracting specific domain knowledge and other domain knowledge from the domain knowledge base respectively.
[0032] Specifically, the data retrieval system uses ChatGPT-4 to preprocess the original text of the domain knowledge base, and identifies and extracts the professional terms and concepts unique to the domain knowledge base through semantic analysis and context association. That is, specific domain knowledge contains professional terms of specific fields, and the extracted professional terms and concepts are stored as specific domain knowledge in the preset glossary; other non-terminology parts in the domain knowledge base are stored as other domain knowledge.
[0033] S20, converting the specific domain knowledge and other domain knowledge into vectors and storing them in a vector database.
[0034] After extracting specific domain knowledge and other domain knowledge, the data retrieval system converts it into vector form by embedding vectors and stores it in a preset vector database to provide a basis for subsequent retrieval and ensure that in multi-label retrieval tasks, the data retrieval system can quickly locate and extract relevant content.
[0035] In one embodiment, in order to enhance the data retrieval system's ability to understand and retrieve general knowledge, that is, other domain knowledge; the steps of converting specific domain knowledge and other domain knowledge into vectors and storing them in a vector database may be specifically performed as follows: The data retrieval system first converts the specific domain knowledge into vectors and stores them in the vector database; after converting other domain knowledge into question-answer pairs, the other domain knowledge converted into question-answer pairs is converted into vectors and stored in the vector database. This makes it easier for the data retrieval system to quickly and accurately retrieve relevant content based on the specific domain knowledge and other domain knowledge in the form of question-answer pairs, thus enhancing the data retrieval system's ability to understand and retrieve general knowledge, that is, other domain knowledge.
[0036] Specifically, the data retrieval system uses ChatGPT-4 to preprocess the domain knowledge base as shown in Table 1:
[0037] Table 1 By extracting specific domain knowledge and other domain knowledge separately, and converting other domain knowledge into question-answer pairs for embedded vector storage, the data retrieval system can effectively identify and utilize the structural information within the original text of the domain knowledge base, thereby making full use of the potential value of the document and further improving the retrieval effect of the data retrieval system.
[0038] S30, training the large language model to obtain a retrieval token prediction model.
[0039] Specifically, the large language model to be trained can be an existing language model such as Q-wen1.5 and LLama3.1. After training, the large language model obtains a retrieval token prediction model. , retrieval landmark prediction model Mainly used to predict the type of retrieval flag corresponding to the query statement when receiving the query statement , and according to the query statement and the retrieved content Predicting contextual token types ; The search flag type Mainly used to guide retrieval mark prediction model Determine whether a search is needed and to what extent; and the context marker type It is used to guide the retrieval landmark prediction model After obtaining the preliminary search results, determine whether the context information needs to be further expanded.
[0040] Furthermore, the loss function used to train the large language model can be:
[0041] in, and is the real label based on the real probability of real data, and Predict the probability for the model; that is, in the process of training the large language model, ChatGPT-4 uses a large amount of data information labeled based on the real probability in reality to obtain the real label, and then uses the real label and the model prediction probability for continuous training until the prediction accuracy reaches the preset standard, that is, the retrieval mark prediction model is obtained. This enables the large language model to recognize the complexity and information needs of query statements, and then rationally allocate retrieval resources to improve the accuracy and relevance of generated content.
[0042] S40, when receiving a query statement, using the trained retrieval token prediction model to predict the retrieval token type corresponding to the query statement .
[0043] Specifically, after the large language model is trained, when the data retrieval system receives a query statement, it first uses the trained retrieval token prediction model Predict the search flag type corresponding to the query statement .
[0044] Furthermore, the search flag type The predicted probability for:
[0045] in, For the query statement, For query statements The hidden representation of and is the model parameter.
[0046] S50, based on search flag type Use the domain-specific knowledge and other domain knowledge stored in the large language model and vector data to provide answers corresponding to the query.
[0047] Specifically, the type of retrieval token predicted in the data retrieval system After that, based on the flag type The specific domain knowledge and other domain knowledge stored in the large language model and vector data are used to make answers corresponding to the query. In other words, the data retrieval system can flexibly select the most appropriate knowledge source to supplement according to the different needs of the query, thereby further improving the accuracy and professionalism of the answer.
[0048] Furthermore, the search flag type ; Based on the search flag type Using the large language model and the specific domain knowledge and other domain knowledge stored in the vector data to make an answer corresponding to the query statement can be specifically performed as follows: If the search flag type If it is 0, the processing power of the large language model itself is directly used to make an answer corresponding to the query statement; If the search flag type If it is 1, the specific domain knowledge in the vector database is used to retrieve and make an answer corresponding to the query statement. for ,in, Information in a glossary corresponding to domain-specific knowledge.
[0049] If the search flag type If it is 2, the specific domain knowledge and other domain knowledge in the vector database are used to retrieve and make answers corresponding to the query statement. for ; The answer generated at this time needs to be obtained by retrieving specific domain knowledge and other domain knowledge at the same time, information It can be expressed as:
[0050] in, is the similarity score between the query sentence and the document paragraph, is the vector representation of the document paragraph.
[0051] In one embodiment, in order to further improve the coherence and depth of the answer content, and improve the completeness and accuracy of the answer content; after using the specific domain knowledge and other domain knowledge in the vector database to search and make an answer corresponding to the query statement, the trained retrieval mark prediction model can be further used. Predict contextual tokens corresponding to the query ; Context Flags The predicted probability for:
[0052] in, For the query statement, For the retrieved content, Is a query statement and the retrieved content The joint statement and For model parameters, context flag type .
[0053] Furthermore, if the context flag is 0, the data retrieval system directly outputs the answer corresponding to the query statement, that is, the answer output at this time is still ; If the context flag is is 1, the data retrieval system further searches the vector database for the answer corresponding to the query statement, expands it, and outputs the expanded answer; the expanded content can be expressed as :
[0054] in, is the similarity between the joint representation of the query statement and the preliminary retrieval content and the candidate document paragraph; the answer output at this time is ; By further expanding the answer sentences, the large language model can flexibly expand its dependence on the context, thereby ensuring the coherence and depth of the answers and improving the completeness and accuracy of the generated content.
[0055] Reference Figure 2 , the application scheme first pre-processes the data in the domain knowledge base, extracts the specific domain knowledge (glossary) and other domain knowledge (complete documents) containing the professional terms of the specific domain, and then stores the extracted contents in the vector database through embedded vectors, which effectively improves the ability of embedded vectors to capture domain-specific information, so that when faced with highly specialized query retrieval, the application can provide targeted and professional answers based on the extracted specific domain knowledge, reducing the possibility of misunderstanding or ignoring important information in the retrieval process, and improving the accuracy of document retrieval and the accuracy of retrieval answers; at the same time, when receiving a query statement, first query the retrieval mark type corresponding to the query statement, and then output different answers according to the different retrieval mark types; the retrieval mark types mainly include three types , corresponding to no search flag, glossary search and text search respectively; that is, the system can flexibly select the most appropriate knowledge source to supplement according to the different needs of the query statement, thereby further improving the accuracy and professionalism of the answer; and for the search flag type is 2, and the context flag is When the value is 1, that is, the answer needs to be expanded, the present application scheme continues to further search the vector database for specific domain knowledge and other domain knowledge to obtain expanded information, so that the large language model can flexibly expand its dependence on the context, thereby ensuring the coherence and depth of the answer and improving the completeness and accuracy of the generated content.
[0056] Figure 1 FIG. 1 is a flowchart of a search enhancement method based on domain term enhancement in one embodiment. Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but the steps are not necessarily executed in the order indicated by the arrows; unless otherwise specified in this document, there is no strict order restriction for the execution of the steps, and the steps may be executed in other orders; and Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0057] Based on the above method, an embodiment of the present application also discloses a retrieval enhancement device based on domain term enhancement.
[0058] like Figure 3 As shown, the device includes the following modules: The domain knowledge extraction module 301 is used to extract specific domain knowledge and other domain knowledge from the domain knowledge base, wherein the specific domain knowledge includes professional terms in a specific domain; A vector conversion storage module 302 is used to convert specific domain knowledge and other domain knowledge into vectors and store them in a vector database; A language model training module 303 is used to train the large language model to obtain a search token prediction model, where the search token prediction model is used to predict the search token type corresponding to the query statement when a query statement is received; A search token prediction module 304 is used to predict the search token type corresponding to the query statement by using the trained search token prediction model when receiving the query statement; The query statement answering module 305 is used to make an answer corresponding to the query statement based on the search token type using the large language model and the specific domain knowledge and other domain knowledge stored in the vector data.
[0059] In one embodiment, the vector conversion storage module 302 is also used to convert specific domain knowledge into vectors and store them in the vector database; convert other domain knowledge into the form of question-answer pairs; Other domain knowledge converted into question-answer pairs is converted into vectors and stored in a vector database.
[0060] In one embodiment, the language model training module 303 is specifically used to train the large language model using a loss function to obtain a retrieval token prediction model; The loss function is:
[0061] in, and is the real label based on the real probability of real data, and Predict probabilities for the model.
[0062] In one embodiment, the retrieval mark prediction module 304 is specifically used to retrieve the mark type The predicted probability for:
[0063] in, For the query statement, For query statements The hidden representation of and is the model parameter.
[0064] In one embodiment, the search flag type The query statement answering module 305 is specifically used to retrieve the flag type If it is 0, the processing power of the large language model is directly used to make the answer corresponding to the query statement; if the search flag type If the search flag type is 1, the specific domain knowledge in the vector database is used to search and make answers corresponding to the query statement; if the search flag type is If it is 2, the specific domain knowledge and other domain knowledge in the vector database are used to retrieve and make answers corresponding to the query statement.
[0065] In one embodiment, the search token prediction module 304 is further configured to: and the retrieved content Predicting contextual token types , context flag type ; Context flag The predicted probability for:
[0066] in, For the query statement, For the retrieved content, Is a query statement and the retrieved content The joint statement and are model parameters; After using the specific domain knowledge and other domain knowledge in the vector database to retrieve and make answers corresponding to the query, the trained retrieval token prediction model is used to predict the context token corresponding to the query. ; If the context flag If the context flag is 0, the answer corresponding to the query statement is directly output; if If it is 1, the answer corresponding to the query statement is further searched in the vector database and expanded, and the expanded answer is output.
[0067] In one embodiment, the search mark prediction module 304 is further used to further search for specific domain knowledge and other domain knowledge in the vector database to obtain extended information. :
[0068] in, It is the joint representation of the query and preliminary retrieval content and the similarity between the candidate document paragraphs.
[0069] The embodiment of the present application also discloses a computer device.
[0070] Specifically, the computer device includes a memory and a processor, and the memory stores a computer program that can be loaded by the processor and execute the above-mentioned retrieval enhancement method based on domain term enhancement.
[0071] The embodiment of the present application also discloses a computer-readable storage medium.
[0072] Specifically, the computer-readable storage medium stores a computer program that can be loaded by a processor and execute the above-mentioned retrieval enhancement method based on domain terminology enhancement. The computer-readable storage medium includes, for example: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0073] This specific embodiment is merely an explanation of the present invention and is not a limitation of the present invention. After reading this specification, those skilled in the art may make non-creative modifications to the present embodiment as needed. However, as long as they are within the scope of the claims of the present invention, they are protected by the patent law.
Claims
1. A retrieval enhancement method based on domain term enhancement, characterized in that: The method comprises: Extracting specific domain knowledge and other domain knowledge from the domain knowledge base respectively, wherein the specific domain knowledge includes professional terms in a specific domain; Converting the specific domain knowledge and other domain knowledge into vectors and storing them in a vector database; The large language model is trained to obtain a retrieval token prediction model, which is used to predict the retrieval token type corresponding to the query statement when the query statement is received. ; When a query statement is received, the retrieval token prediction model obtained by training is used to predict the retrieval token type corresponding to the query statement. ; Based on the search flag type The large language model and the specific domain knowledge and other domain knowledge stored in the vector data are used to make an answer corresponding to the query statement.
2. The method according to claim 1, characterized in that The converting the specific domain knowledge and other domain knowledge into vectors and storing them in the vector database includes: Converting the specific domain knowledge into vectors and storing them in a vector database; Converting the other domain knowledge into a question-answer pair; Other domain knowledge converted into question-answer pairs is converted into vectors and stored in a vector database.
3. The method according to claim 1, characterized in that The training of the large language model to obtain the retrieval token prediction model includes: The large language model is trained using the loss function to obtain a retrieval token prediction model; The loss function is: in, and is the real label based on the real probability of real data, and Predict probabilities for the model.
4. The method according to claim 1, characterized in that: The retrieval token prediction model obtained by training is used to predict the retrieval token type corresponding to the query statement. include: The search flag type The predicted probability for: in, For the query statement, For query statements The hidden representation of and is the model parameter.
5. The method according to claim 1, characterized in that The search flag type ; The search based on the flag type Using the large language model and the specific domain knowledge and other domain knowledge stored in the vector data to make an answer corresponding to the query statement includes: If the search flag type If it is 0, the processing capability of the large language model itself is directly used to make an answer corresponding to the query statement; If the search flag type If it is 1, the specific domain knowledge in the vector database is used to retrieve and make an answer corresponding to the query statement; If the search flag type If it is 2, the specific domain knowledge and other domain knowledge in the vector database are used to retrieve and make an answer corresponding to the query statement.
6. The method according to claim 5, characterized in that The retrieval token prediction model is also used to predict the query statement and the retrieved content Predicting contextual token types , the context flag type ; The context flag The predicted probability for: in, For the query statement, For the retrieved content, Is a query statement and the retrieved content The joint statement and are model parameters; After the specific domain knowledge and other domain knowledge in the vector database are used to search and make an answer corresponding to the query statement, the method further includes: The trained retrieval token prediction model is used to predict the context token corresponding to the query statement. ; If the context flag If it is 0, the answer corresponding to the query statement is directly output; If the context flag If it is 1, the answer corresponding to the query statement is further searched in the vector database and expanded, and the expanded answer is output.
7. The method according to claim 6, characterized in that The further searching in the vector database to expand the answer corresponding to the query statement includes: Further search for specific domain knowledge and other domain knowledge in the vector database to obtain extended information : in, It is the joint representation of the query and preliminary retrieval content and the similarity between the candidate document paragraphs.
8. A search enhancement device based on domain term enhancement, characterized in that: The device comprises: A domain knowledge extraction module (301) is used to extract specific domain knowledge and other domain knowledge from the domain knowledge base, wherein the specific domain knowledge includes professional terms in a specific domain; A vector conversion storage module (302), used for converting the specific domain knowledge and other domain knowledge into vectors and storing them in a vector database; A language model training module (303) is used to train the large language model to obtain a retrieval token prediction model, wherein the retrieval token prediction model is used to predict the type of retrieval token corresponding to the query statement when the query statement is received; A search token prediction module (304) is used to predict the search token type corresponding to the query statement using the trained search token prediction model when receiving the query statement; The query statement answering module (305) is used to make an answer corresponding to the query statement based on the search tag type using the large language model and the specific domain knowledge and other domain knowledge stored in the vector data.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program which can be loaded by the processor and executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored which can be loaded by a processor and execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Large language model reasoning method and system based on multi-level knowledge retrieval enhancement
CN118036753A
Knowledge management question-answering system construction method and device
CN118446296A
Vector knowledge base-based large-model question-answer dialogue method and system and storage medium
CN118484526A
Cited By
Auxiliary method and auxiliary device for scientific research in medical specialized field
CN120873154A
Retrieval enhancement generation vertical domain optimization method and device based on BGE big language model, equipment and storage medium
CN121786210A