Search enhancement method and device based on domain term reinforcement, equipment and storage medium

By extracting and transforming domain knowledge into vectors, and combining them with retrieval marker prediction trained by a large language model, the problem of insufficient information capture in vertical domains is solved, resulting in more accurate and professional retrieval answers.

CN119293210BActive Publication Date: 2025-11-21Shenzhen Big Data Research Institute Wuxi Innovation Center
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411367199.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-29
Publication Date
2025-11-21
Estimated Expiration
2044-09-29

AI Technical Summary

Technical Problem

Traditional RAG methods struggle to capture domain-specific information in vertical fields, and handle technical terms and complex document structures, leading to a discrepancy between search results and user needs, thus affecting search performance.

Method used

Extract domain-specific knowledge and other domain knowledge from the domain knowledge base, convert them into vectors and store them, train a large language model to predict the type of search terms, and use the vector database to provide accurate answers.

Benefits of technology

It improves the accuracy and professionalism of searches, reduces misunderstandings, ensures the completeness and coherence of answers, and enhances search performance in vertical fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119293210B_ABST
    Figure CN119293210B_ABST
Patent Text Reader

Abstract

The application relates to a retrieval enhancement method and device based on field term reinforcement, equipment and a storage medium, which are applied in the field of natural language processing, wherein the method comprises the following steps: extracting specific field knowledge and other field knowledge in a field knowledge base respectively; converting the specific field knowledge and the other field knowledge into vectors and storing the vectors in a vector database; training a large language model to obtain a retrieval mark prediction model; when a query statement is received, predicting a retrieval mark type by using the trained retrieval mark prediction model; and based on the retrieval mark type, using the large language model and the specific field knowledge and the other field knowledge stored in the vector database to make an answer corresponding to the query statement. The application has the technical effect that the specific field knowledge extracted can be used to make a professional answer, the possibility of misunderstanding or neglecting important information in the retrieval process is reduced, and the accuracy of document retrieval and the precision of retrieval answers are improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of natural language processing, and in particular to a retrieval enhancement method and device based on domain term reinforcement, equipment and storage medium. BACKGROUND

[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 generation models, by first retrieving relevant information from a large-scale document library, and then using a generation model to generate accurate answers. However, although the RAG method performs well in many applications, especially in open-domain and general knowledge retrieval tasks, its performance still has certain limitations in the application of certain vertical fields.

[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 often contain a large amount of specialized knowledge and specific terminology, which is often not adequately represented in general embedding models. Therefore, the relevance evaluation in the retrieval process is not accurate enough, resulting in the final generated results deviating from the actual needs of users. This phenomenon is particularly evident in fields involving highly specialized content, such as medicine, law, engineering, etc., where general embedding vectors cannot accurately reflect the subtle differences in these fields, thereby affecting the retrieval effect. SUMMARY

[0004] In order to help improve the retrieval effect of highly specialized content, the present application provides a retrieval enhancement method and device based on domain term reinforcement, equipment and storage medium.

[0005] In the first aspect, the present application provides a retrieval enhancement method based on domain term reinforcement, which adopts the following technical solution: the method comprises: extracting specific domain knowledge and other domain knowledge from a domain knowledge base respectively, the specific domain knowledge containing professional terms of a specific domain;

[0006] Converting the specific domain knowledge and other domain knowledge into vectors and storing them in a vector database;

[0007] Training a large language model to obtain a retrieval marker prediction model, the retrieval marker prediction model being used to predict a retrieval marker type corresponding to a query statement when receiving the query statement ;

[0008] When receiving a query statement, a trained retrieval marker prediction model is used to predict a retrieval marker type corresponding to the query statement ;

[0009] Based on the retrieval marker type The large language model and the specific domain knowledge and other domain knowledge stored in the vector data are used to make answers corresponding to the query statement.

[0010] In one specific implementation, the conversion of the specific domain knowledge and other domain knowledge into vectors and storage in the vector database includes: converting the specific domain knowledge into vectors and storing in the vector database; converting the other domain knowledge into the form of question and answer pairs; converting the other domain knowledge converted into the form of question and answer pairs into vectors and storing in the vector database.

[0011] In one specific implementation, the training of the large language model to obtain a retrieval marker prediction model includes: training the large language model to obtain a retrieval marker prediction model using a loss function; the loss function is:

[0012]

[0013] Wherein, and is the real label annotated based on the real data probability, and is the model prediction probability.

[0014] In one specific implementation, the trained retrieval marker prediction model is used to predict a retrieval marker type corresponding to the query statement includes: the predicted probability of the retrieval marker type is:

[0015]

[0016] Wherein, is a query statement, is the hidden representation of the query statement , and are model parameters.

[0017] In one specific implementation, the retrieval marker type ;

[0018] Based on the retrieval marker type ​The method of using the large language model and the domain-specific and other domain-specific knowledge stored in the vector data to make an answer corresponding to the query includes: if the retrieval flag type If the value is 0, then the processing power of the large language model itself is used to directly generate an answer corresponding to the query statement; if the retrieval flag type If the value is 1, then the specific domain knowledge within the vector database is used to retrieve and provide an answer corresponding to the query statement; if the retrieval flag type If the value is 2, then the specific domain knowledge and other domain knowledge in the vector database will be used to retrieve and provide an answer corresponding to the query statement.

[0019] In one specific implementation, the retrieval marker prediction model is further used to predict the query statement. and the retrieved content Predict context flag type The context flag type ;

[0020] The context flag Predicted probability for:

[0021]

[0022] in, For query statements, For the retrieved content, It is a query statement and the retrieved content The joint statement, and The parameters are model parameters; after retrieving and providing an answer corresponding to the query statement using specific domain knowledge and other domain knowledge in the vector database, the method further includes: predicting contextual flags corresponding to the query statement using a trained retrieval flag prediction model. If the context flag If the context flag is 0, the answer corresponding to the query statement will be output directly; if the context flag is 0, the answer will be output directly. If the value is 1, then the vector database will be further searched to expand the answer corresponding to the query statement, and the expanded answer will be output.

[0023] In one specific implementation, the step of further retrieving the answer corresponding to the query statement from the vector database includes: further retrieving specific domain knowledge and other domain knowledge from the vector database to obtain extended information. :

[0024]

[0025] wherein, is the similarity between the joint representation of the query and the preliminary search results and the candidate document passage.

[0026] In a second aspect, the application provides a retrieval enhancement device based on field term reinforcement, which adopts the following technical solution: the device comprises:

[0027] a field knowledge extraction module, configured to extract specific field knowledge and other field knowledge from a field knowledge base, wherein the specific field knowledge comprises professional terms in the specific field;

[0028] a vector conversion and storage module, configured to convert the specific field knowledge and the other field knowledge into vectors and store the vectors in a vector database;

[0029] a language model training module, configured to train a large language model to obtain a retrieval mark prediction model, wherein the retrieval mark prediction model is configured to predict a retrieval mark type corresponding to a query statement when the query statement is received ;

[0030] a retrieval mark prediction module, configured to predict a retrieval mark type corresponding to a query statement when the query statement is received by using the trained retrieval mark prediction model ;

[0031] a query statement answering module, configured to make an answer corresponding to the query statement based on the retrieval mark type by using the large language model and the specific field knowledge and the other field knowledge stored in the vector database.

[0032] In a third aspect, the application provides a computer device, which adopts the following technical solution: comprising a memory and a processor, and the memory stores a computer program capable of being loaded and executed by the processor to perform any of the above retrieval enhancement methods based on field term reinforcement.

[0033] In a fourth aspect, the application provides a computer readable storage medium, which adopts the following technical solution: storing a computer program capable of being loaded and executed by a processor to perform any of the above retrieval enhancement methods based on field term reinforcement.

[0034] In summary, the application has at least the following beneficial technical effects:

[0035] This application first preprocesses the data in the domain knowledge base, extracting specific domain knowledge containing domain-specific terminology and other domain knowledge. This effectively improves the embedding vector's ability to capture domain-specific information. Therefore, when faced with highly specialized queries, this application can provide targeted and professional answers based on the extracted specific domain knowledge, reducing the possibility of misunderstandings or overlooking important information during the retrieval process, and improving the accuracy of document retrieval and the precision of the search results. Simultaneously, upon receiving a query, it first queries the retrieval flag type corresponding to the query statement. Then, based on the search flag type Different search results will produce different answers; that is, the system can flexibly select the most suitable knowledge source to supplement according to different needs of the query, thereby further improving the accuracy and professionalism of the answer. Attached Figure Description

[0036] Figure 1 This is a flowchart of the retrieval enhancement method based on domain terminology enhancement in the embodiments of this application.

[0037] Figure 2 This is a general structural diagram of the retrieval enhancement method for domain terminology enhancement in the embodiments of this application.

[0038] Figure 3 This is a structural block diagram of the retrieval enhancement device based on domain terminology enhancement in the embodiments of this application.

[0039] Attached reference numerals: 301, Domain knowledge extraction module; 302, Vector transformation and storage module; 303, Language model training module; 304, Retrieval tag prediction module; 305, Query statement answering module. Detailed Implementation

[0040] The following is in conjunction with the appendix Figures 1-3 This application will be described in further detail.

[0041] In the fields of information retrieval and generation, retrieval-augmented generation (RAG) methods have become important tools for solving complex problems. RAG methods combine the advantages of retrieval systems and generative models, first retrieving relevant information from a large-scale document repository and then using a generative model to generate accurate answers. However, while RAG methods perform well in many applications, especially in open-domain and general knowledge retrieval tasks, their performance still has certain limitations in some vertical applications.

[0042] First, in vertical domains, traditional RAG methods typically rely on generic embedding vectors to represent documents and queries. However, these generic embedding vectors struggle to fully capture domain-specific information. Vertical domains often contain a wealth of specialized knowledge and specific terminology, which are often not adequately represented in generic embedding models. Consequently, relevance assessment during the retrieval process is not precise enough, leading to discrepancies between the final results and the user's actual needs. This phenomenon is particularly pronounced when dealing with highly specialized content, such as in fields like medicine, law, and engineering, where generic embedding vectors fail to accurately reflect the subtle differences within these domains, thus impacting retrieval performance.

[0043] Secondly, the abundance of abbreviations and technical terms common in vertical domains increases the difficulty of text understanding. RAG methods require deep matching and understanding of queries and documents, but traditional RAG systems may fail to effectively decode these highly specialized expressions. Even if the generative model can understand general language, it may still misunderstand or overlook important information when faced with domain-specific vocabulary. This not only affects the accuracy of document retrieval but also makes the generative model more prone to errors during the generation process, making it difficult to provide accurate answers.

[0044] Furthermore, documents in vertical domains are typically quite complex in structure. These documents not only contain numerous definitions and terminology descriptions but may also include specific specifications, operational procedures, technical parameters, and detailed explanations. Traditional RAG methods often fail to effectively identify and utilize the internal structural information of these structured documents, resulting in the retrieval process not fully leveraging the documents' potential value. This is especially true when dealing with tasks requiring precise location and analysis, where RAG methods are more prone to difficulties in providing users with high-quality generated content.

[0045] In summary, while the RAG method has broad application potential in information retrieval and generation, its application in vertical domains suffers from several limitations. These include the difficulty of embedding vectors in capturing domain-specific information, limited ability to handle abbreviations and technical terms, and insufficient capacity to cope with complex document structures. These issues restrict the widespread application of the RAG method in specialized fields.

[0046] To address the aforementioned issues, this application discloses a retrieval enhancement method based on domain terminology enhancement, which is applied to a data retrieval system.

[0047] like Figure 1 As shown, the method includes the following steps:

[0048] S10 extracts specific domain knowledge and other domain knowledge from the domain knowledge base.

[0049] Specifically, the data retrieval system preprocesses the original text of the domain knowledge base using ChatGPT-4, identifies and extracts professional terms and concepts specific to the domain knowledge base through semantic analysis and context association, i.e., the specific domain knowledge contains professional terms specific to the domain, and stores the extracted professional terms and concepts as specific domain knowledge in a preset term table. The other non-terminology parts in the domain knowledge base are stored as other domain knowledge.

[0050] S20, convert the specific domain knowledge and other domain knowledge into vectors and store them in a vector database.

[0051] After extracting the specific domain knowledge and other domain knowledge, the data retrieval system converts them into vector form by embedding vectors and stores them in a preset vector database to provide a basis for subsequent retrieval and ensure that the data retrieval system can quickly locate and extract relevant content in multi-label retrieval tasks.

[0052] In one embodiment, to enhance the understanding and retrieval ability of the data retrieval system for general knowledge, i.e., other domain knowledge, the step of converting the specific domain knowledge and other domain knowledge into vectors and storing them in a vector database can be specifically implemented as:

[0053] The data retrieval system first converts the specific domain knowledge into vectors and stores them in a vector database; converts the other domain knowledge into question-answer pairs, and then converts the other domain knowledge in the form of question-answer pairs into vectors and stores them in a vector database. This allows the data retrieval system to quickly and accurately retrieve relevant content based on specific domain knowledge and other domain knowledge in the form of question-answer pairs when performing retrieval, enhancing the understanding and retrieval ability of the data retrieval system for general knowledge, i.e., other domain knowledge.

[0054] Specifically, the data retrieval system can preprocess the domain knowledge base using ChatGPT-4 as shown in Table 1:

[0055]

[0056] Table 1

[0057] By extracting the specific domain knowledge and other domain knowledge separately and embedding the other domain knowledge in the form of question-answer pairs, the data retrieval system can effectively identify and utilize the structural information within the original text of the domain knowledge base, thereby fully utilizing the potential value of the document and further improving the retrieval effect of the data retrieval system.

[0058] S30, train the large language model to obtain a retrieval mark prediction model.

[0059] Specifically, the large language model being trained can be an existing language model such as Q-wen1.5 or LLama3.1. After training, this large language model yields a retrieval marker prediction model. Retrieval marker prediction model It is mainly used to predict the retrieval flag type corresponding to the query statement when a query statement is received. and according to the query statement and the retrieved content Predict context flag type Among them, the search flag type Primarily used to guide retrieval marker prediction models Determine whether a search is needed, and to what extent; and the context flag type. This is used to guide the retrieval marker prediction model. After obtaining the initial search results, determine whether further contextual information needs to be expanded.

[0060] Furthermore, the loss function used to train a large language model can be:

[0061]

[0062] in, and These are real labels labeled with true probabilities based on real-world data. and The model predicts probabilities; that is, during the training of the large language model, the ChatGPT-4 uses a large amount of data information based on real-world probability annotations to obtain real labels. Then, the model is continuously trained using real labels and predicted probabilities until the prediction accuracy reaches a preset standard, thus obtaining the retrieval label prediction model. This enables large language models to identify the complexity and information requirements of query statements, thereby rationally allocating retrieval resources to improve the accuracy and relevance of generated content.

[0063] S40, Upon receiving a query statement, the trained retrieval indicator prediction model is used to predict the retrieval indicator type corresponding to the query statement. .

[0064] Specifically, after the large language model is trained, when the data retrieval system receives a query, it first uses the trained retrieval marker prediction model. Predict the retrieval flag type corresponding to the query statement .

[0065] Furthermore, the search flag type Predicted probability is:

[0066]

[0067] wherein, is a query statement, is a query statement hidden representation, and are model parameters.

[0068] S50, based on the retrieval flag type using a large language model and the specific domain knowledge and other domain knowledge stored in the vector data to make a corresponding answer to the query statement.

[0069] Specifically, after the data retrieval system obtains the predicted retrieval flag type , based on the flag type using a large language model and the specific domain knowledge and other domain knowledge stored in the vector data to make a corresponding answer to the query statement. That is, the data retrieval system can flexibly select the most suitable knowledge source according to the different needs of the query statement to further improve the accuracy and professionalism of the answer.

[0070] Further, the retrieval flag type ; using a large language model and the specific domain knowledge and other domain knowledge stored in the vector data to make a corresponding answer to the query statement based on the retrieval flag type can be specifically implemented as:

[0071] If the retrieval flag type is 0, directly use the processing power of the large language model itself to make a corresponding answer to the query statement;

[0072] If the retrieval flag type is 1, use the specific domain knowledge in the vector database to retrieve and make a corresponding answer to the query statement, and the generated answer is , wherein, is the information in the term table corresponding to the specific domain knowledge.

[0073] If the retrieval flag type is 2, use the specific domain knowledge and other domain knowledge in the vector database to retrieve and make a corresponding answer to the query statement, and the generated answer is ; the generated answer needs to be obtained by simultaneously retrieving the specific domain knowledge and other domain knowledge, and the information can be represented as:

[0074]

[0075] wherein, is the similarity score of the query statement and the document passage, is the vector representation of the document passage.

[0076] In one embodiment, in order to further improve the coherence and depth of the answer content, improve the completeness and accuracy of the answer content; after the step of retrieving and making an answer corresponding to the query statement using the specific domain knowledge and other domain knowledge in the vector database, the trained retrieval flag prediction model can be further used to predict the context flag corresponding to the query statement ;

[0077] The predicted probability of the context flag is:

[0078]

[0079] wherein, is the query statement, is the retrieved content, is the joint representation of the query statement and the retrieved content , and and are model parameters, and the context flag type .

[0080] Further, if the context flag is 0, the data retrieval system directly outputs an answer corresponding to the query statement, that is, the output answer at this time is still ;

[0081] If the context flag is is 1, the data retrieval system further retrieves in the vector database after expanding the answer corresponding to the query statement, and outputs the expanded answer; wherein the expanded content can be represented as :

[0082]

[0083] wherein, is the similarity between the joint representation of the query statement and the preliminary retrieval content and the candidate document passage; the output answer at this time is ; through further expansion of the answer statement, the large language model can flexibly expand the degree of dependence on the context, thereby ensuring the coherence and depth of the answer, and improving the completeness and accuracy of the generated content.

[0084] Referring to​Figure 2 This application first preprocesses the data in the domain knowledge base, extracting domain-specific knowledge (glossary) containing domain-specific terminology and other domain knowledge (complete documents). The extracted content is then stored in a vector database using embedding vectors, effectively improving the embedding vectors' ability to capture domain-specific information. This allows for targeted, professional answers based on the extracted domain-specific knowledge when faced with highly specialized queries, reducing the possibility of misunderstandings or overlooking important information during the retrieval process and improving the accuracy of document retrieval and the precision of the search results. Simultaneously, upon receiving a query, the application first queries the search flag type corresponding to the query, and then outputs different answers based on the different search flag types. The search flag types mainly include three types. These correspond to no search flags, terminology search, and text search, respectively. In other words, the system can flexibly select the most suitable knowledge source to supplement the query based on different requirements, thereby further improving the accuracy and professionalism of the answer. Regarding search flag types... It is 2, and the context flag is If the answer is 1, meaning the answer needs to be expanded, the proposed solution continues to retrieve specific domain knowledge and other domain knowledge from the vector database to obtain expanded information. This allows the large language model to flexibly expand its dependence on context, thereby ensuring the coherence and depth of the answer and improving the completeness and accuracy of the generated content.

[0085] Figure 1 This is a flowchart illustrating a domain-term-based search enhancement method in one embodiment. It should be understood that, although... Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows; unless explicitly stated otherwise, there is no strict order requirement for the execution of these steps, and they can be executed in other orders; and Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed 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 some of the sub-steps or stages of other steps.

[0086] Based on the above method, this application also discloses a retrieval enhancement device based on domain terminology enhancement.

[0087] like Figure 3 As shown, the device includes the following modules:

[0088] The domain knowledge extraction module 301 is configured to extract specific domain knowledge and other domain knowledge in the domain knowledge base respectively, and the specific domain knowledge includes professional terms in the specific domain.

[0089] The vector conversion and storage module 302 is configured to convert the specific domain knowledge and the other domain knowledge into vectors and store the vectors in a vector database.

[0090] The language model training module 303 is configured to train a large language model to obtain a search mark prediction model, and the search mark prediction model is configured to predict a search mark type corresponding to a query statement when the query statement is received.

[0091] The search mark prediction module 304 is configured to predict the search mark type corresponding to the query statement by using the trained search mark prediction model when the query statement is received.

[0092] The query statement answering module 305 is configured to make an answer corresponding to the query statement by using the large language model and the specific domain knowledge and the other domain knowledge stored in the vector database based on the search mark type.

[0093] In an embodiment, the vector conversion and storage module 302 is further configured to convert the specific domain knowledge into vectors and store the vectors in the vector database, and convert the other domain knowledge into a form of question and answer pairs.

[0094] The other domain knowledge converted into the form of question and answer pairs is converted into vectors and stored in the vector database.

[0095] In an embodiment, the language model training module 303 is specifically configured to train the large language model by using a loss function to obtain the search mark prediction model.

[0096] The loss function is as follows:

[0097]

[0098] wherein, and are real labels based on real probability labels of real data, and are model prediction probabilities.

[0099] In an embodiment, the search mark prediction module 304 is specifically configured to predict the search mark type with a prediction probability as follows:

[0100]

[0101] wherein, is the query statement, is the query statement The hidden representation, and These are the model parameters.

[0102] In one embodiment, the retrieval flag type The query statement answer module 305 is specifically used if the search flag type is... If the value is 0, the processing power of the large language model itself will be used to generate an answer corresponding to the query statement; if the retrieval flag type If the value is 1, then the domain-specific knowledge within the vector database will be used to retrieve and provide an answer corresponding to the query statement; if the retrieval flag type... If the value is 2, then the system will use domain-specific knowledge from the vector database and other domain-specific knowledge to retrieve and provide an answer corresponding to the query statement.

[0103] In one embodiment, the retrieval flag prediction module 304 is further configured to, based on the query statement... and the retrieved content Predict context flag type Context flag type ; Context flags Predicted probability for:

[0104]

[0105] in, For query statements, For the retrieved content, It is a query statement and the retrieved content The joint statement, and These are model parameters;

[0106] After retrieving and providing an answer corresponding to the query statement using domain-specific and other domain-specific knowledge from the vector database, the trained retrieval label prediction model is used to predict the context label corresponding to the query statement. If context flags If the value is 0, the answer corresponding to the query statement will be output directly; if the context flag is 0, the answer will be output directly. If the value is 1, then the vector database will be further searched to expand the answer corresponding to the query statement, and the expanded answer will be output.

[0107] In one embodiment, the retrieval flag prediction module 304 is further configured to retrieve specific domain knowledge and other domain knowledge from the vector database to obtain extended information. :

[0108]

[0109] wherein, is the similarity between the joint representation of the query and the initial retrieved content and the candidate document passage.

[0110] The embodiment of the present application further discloses a computer device.

[0111] Specifically, the computer device comprises a memory and a processor, and the memory stores a computer program capable of being loaded and executed by the processor and implementing the above-mentioned retrieval enhancement method based on field term reinforcement.

[0112] The embodiment of the present application further discloses a computer readable storage medium.

[0113] Specifically, the computer readable storage medium stores a computer program capable of being loaded and executed by the processor and implementing the above-mentioned retrieval enhancement method based on field term reinforcement, and the computer readable storage medium comprises various storage media capable of storing program codes, for example, a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0114] The specific embodiment is only an explanation of the present application, and is not a limitation of the present application, and those skilled in the art can make modifications to the embodiment without creative contribution according to the needs after reading the present specification, but as long as the modifications are within the scope of the claims of the present application, they are protected by the patent law.

Claims

1. A retrieval enhancement method based on domain terminology reinforcement, characterized in that, The method includes: Specific domain knowledge and other domain knowledge are extracted from the domain knowledge base, wherein the specific domain knowledge contains professional terms of the specific domain; The specific domain knowledge and other domain knowledge are transformed into vectors and stored in a vector database; A retrieval marker prediction model is obtained by training a large language model. This model is used to predict the retrieval marker type corresponding to a query statement when a query statement is received. ; Upon receiving a query statement, the trained retrieval marker prediction model is used to predict the retrieval marker type corresponding to the query statement. ; Based on the search flag type The system utilizes the large language model and the domain-specific and other domain-specific knowledge stored in the vector database to generate an answer corresponding to the query statement. The step of converting the specific domain knowledge and other domain knowledge into vectors and storing them in a vector database includes: The domain-specific knowledge is transformed into vectors and stored in a vector database; Transform the knowledge from other domains into question-and-answer pairs; Other domain knowledge, converted into question-and-answer pairs, is transformed into vectors and stored in a vector database; The search flag type ; Based on the search flag type The methods used to generate responses to queries, including leveraging the large language model and the domain-specific and other domain-specific knowledge stored in the vector database, include: If the search flag type If the value is 0, then the processing power of the large language model itself will be used to generate an answer corresponding to the query statement. If the search flag type If the value is 1, then the specific domain knowledge in the vector database will be used to retrieve and provide an answer corresponding to the query statement; If the search flag type If the value is 2, then the specific domain knowledge and other domain knowledge in the vector database will be used to retrieve and provide an answer corresponding to the query statement.

2. The method according to claim 1, characterized in that, The retrieval marker prediction model obtained by training the large language model includes: A retrieval marker prediction model is obtained by training a large language model using a loss function; The loss function is: in, and These are real labels labeled with true probabilities based on real-world data. and Predict probabilities for the model.

3. The method according to claim 1, characterized in that, The trained retrieval marker prediction model predicts the retrieval marker type corresponding to the query statement. include: The search flag type Predicted probability for: in, For query statements, For query statement The hidden representation, and These are the model parameters.

4. The method according to claim 1, characterized in that, The search flag prediction model is also used to predict the query statement. and the retrieved content Predict context flag type The context flag type ; The context flag Predicted probability for: in, For query statements, For the retrieved content, It is a query statement and the retrieved content The joint statement, and These are model parameters; After retrieving and generating an answer corresponding to the query statement using domain-specific and other domain knowledge within the vector database, the process further includes: The trained retrieval flag prediction model is used to predict the context flags corresponding to the query statement. ; If the context flag If the value is 0, the answer corresponding to the query statement will be output directly. If the context flag If the value is 1, then the vector database will be further searched to expand the answer corresponding to the query statement, and the expanded answer will be output.

5. The method according to claim 4, characterized in that, The further retrieval of the answer corresponding to the query statement in the vector database includes: Further retrieval of domain-specific and other domain-specific knowledge from the vector database yields extended information. : in, The similarity between the joint representation of the query and preliminary retrieval content and candidate document paragraphs.

6. A retrieval enhancement device based on domain terminology reinforcement, characterized in that, The device includes: 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 contains professional terms of the specific domain. The vector transformation and storage module (302) is used to transform the specific domain knowledge and other domain knowledge into vectors and store them in the vector database; The language model training module (303) is used to train a large language model to obtain a retrieval marker prediction model. The retrieval marker prediction model is used to predict the retrieval marker type corresponding to the query statement when a query statement is received. The retrieval flag prediction module (304) is used to predict the retrieval flag type corresponding to the query statement by using the trained retrieval flag prediction model when a query statement is received. The query statement answering module (305) is used to make an answer corresponding to the query statement based on the retrieval flag type, using the large language model and the specific domain knowledge and other domain knowledge stored in the vector database; The step of converting the specific domain knowledge and other domain knowledge into vectors and storing them in a vector database includes: The domain-specific knowledge is transformed into vectors and stored in a vector database; Transform the knowledge from other domains into question-and-answer pairs; Other domain knowledge, converted into question-and-answer pairs, is transformed into vectors and stored in a vector database; The search flag type ; Based on the search flag type The methods used to generate responses to queries, including leveraging the large language model and the domain-specific and other domain-specific knowledge stored in the vector database, include: If the search flag type If the value is 0, then the processing power of the large language model itself will be used to generate an answer corresponding to the query statement. If the search flag type If the value is 1, then the specific domain knowledge in the vector database will be used to retrieve and provide an answer corresponding to the query statement; If the search flag type If the value is 2, then the specific domain knowledge and other domain knowledge in the vector database will be used to retrieve and provide an answer corresponding to the query statement.

7. A computer device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program that can be loaded by the processor and executed according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, The computer program is stored that can be loaded by a processor and executed according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • 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