Intelligent question and answer method, device and equipment based on retrieval enhancement large model and medium

Through the intelligent question-answering method based on retrieval-enhanced large models, the problem of inaccurate responses from natural speech models in the financial and insurance industries has been solved, achieving more accurate and comprehensive responses.

CN120653759APending Publication Date: 2025-09-16PING AN TECH (SHENZHEN) CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510730206.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-30
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Existing natural speech models in the financial and insurance industries suffer from lagging knowledge updates and deviations in understanding professional knowledge, leading to inaccurate responses.

Method used

An intelligent question-answering method based on a retrieval-enhanced large model is adopted to optimize the response content through feature extraction, knowledge base matching and combined information input into a large language model.

Benefits of technology

The accuracy and comprehensiveness of response information have been improved to meet the professional consulting needs of the financial and insurance industries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653759A_ABST
    Figure CN120653759A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of artificial intelligence, the scheme can be applied to the fields of finance and medical treatment, and the invention provides an intelligent question and answer method, device, equipment and medium based on a retrieval enhanced large model.The method comprises the steps that feature extraction is conducted on question information according to an enhanced retrieval strategy to obtain question feature information, and matching knowledge data in a knowledge base according to the question feature information to obtain target knowledge data, combining the target knowledge data and the question information to obtain combined information, and inputting the combined information into a pre-trained large language model to obtain corresponding reply information. According to the embodiment of the invention, the question feature information can be obtained through the enhanced retrieval strategy so as to perform enhanced retrieval on the knowledge base, the target knowledge data is obtained, and the target knowledge data and the question information are combined and then input into the large language model, so that the reply content is optimized, and the accuracy and comprehensiveness of obtaining the reply information are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an intelligent question-answering method, device, equipment and medium based on a retrieval-enhanced large model. Background Art

[0002] In the financial and insurance industries, customer inquiries are complex and diverse, covering interpretations of insurance product terms, claims processing inquiries, and risk assessment questions. Traditional human customer service, constrained by limited expertise and work schedules, is inefficient in responding to customer inquiries. Existing intelligent customer service teams struggle to provide comprehensive and accurate responses to complex insurance questions. While large models are emerging in the field of natural language processing, their application in the insurance industry suffers from lags in knowledge updates and discrepancies in understanding industry expertise. Consequently, existing natural speech models often suffer from inaccurate responses to expert knowledge. Summary of the Invention

[0003] The embodiments of the present invention provide an intelligent question-answering method, apparatus, device and medium based on a retrieval-enhanced large model, aiming to solve the problem of inaccurate responses of natural speech models in the prior art when answering professional knowledge.

[0004] In a first aspect, an embodiment of the present invention provides an intelligent question answering method based on a retrieval-enhanced large model, the method comprising:

[0005] Receive input question information, perform feature extraction on the question information according to a preset retrieval enhancement strategy, and obtain corresponding question feature information;

[0006] Matching the question feature information with knowledge data in a preset knowledge base according to preset search matching rules to obtain target knowledge data that matches the question feature information;

[0007] Combining the target knowledge data with the question information to obtain corresponding combination information;

[0008] The combined information is input into a pre-trained large language model to obtain response information output by the large language model.

[0009] In a second aspect, an embodiment of the present invention further provides an intelligent question-answering device based on a retrieval-enhanced large model, the device comprising:

[0010] A feature extraction unit is used to receive the input question information, perform feature extraction on the question information according to a preset retrieval enhancement strategy, and obtain corresponding question feature information;

[0011] a matching unit, configured to match the question feature information with knowledge data in a preset knowledge base according to preset search matching rules to obtain target knowledge data that matches the question feature information;

[0012] a combination information acquisition unit, configured to combine the target knowledge data with the question information to obtain corresponding combination information;

[0013] The reply information acquisition unit is used to input the combined information into a pre-trained large language model to obtain reply information output by the large language model.

[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0015] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the method described in the first aspect can be implemented.

[0016] The present invention provides an intelligent question-answering method, apparatus, device, and medium based on a retrieval-enhanced large model. The method comprises: extracting features from question information according to an enhanced retrieval strategy to obtain question feature information; matching knowledge data in a knowledge base according to the question feature information to obtain target knowledge data; combining the target knowledge data and question information to obtain combined information; and inputting the combined information into a pre-trained large language model to obtain corresponding reply information. In an embodiment of the present invention, question feature information can be obtained through an enhanced retrieval strategy to perform an enhanced retrieval of the knowledge base to obtain target knowledge data. The target knowledge data is combined with the question information and then input into the large language model, thereby optimizing the reply content to improve the accuracy and comprehensiveness of the reply information obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. 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 any creative work.

[0018] Figure 1 A flowchart of an intelligent question-answering method based on a retrieval-enhanced large model provided by an embodiment of the present invention;

[0019] Figure 2 A schematic block diagram of an intelligent question-answering device based on a retrieval-enhanced large model provided by an embodiment of the present invention;

[0020] Figure 3 A schematic block diagram of an electronic device provided in an embodiment of the present invention;

[0021] Figure 4 Schematic diagram of the application environment of the intelligent question-answering method based on the retrieval-enhanced large model provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0022] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0023] It will be understood that when used in this specification and the appended claims, the terms “comprises” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof.

[0024] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in the specification and appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms unless the context clearly indicates otherwise.

[0025] It should be further understood that the term "and / or" used in the present specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. The embodiment of the present invention provides an intelligent question answering method, apparatus, device and medium based on a retrieval-enhanced large model. The intelligent question answering method based on a retrieval-enhanced large model can be found in Figure 4 , Figure 4 Schematic diagram of the application environment of the intelligent question answering method based on the retrieval enhancement model provided by the embodiment of the present invention. The intelligent question answering method based on the retrieval enhancement model is applied in the following Figure 4In an application environment, a computer device communicates with at least one host device through a network; the computer device can be a server or a personal computer, wherein the server can be implemented as an independent server or a server cluster composed of multiple servers, and the host device can be, but is not limited to, a server, a smart phone, a tablet computer, a desktop computer and other electronic devices. The host device executes an intelligent question-answering method based on a retrieval-enhanced large model, and the server obtains question information from the host device and obtains corresponding reply information and feeds it back to the host device to implement reply processing for the question information from the host device. In addition to being applied to the financial and insurance fields, the intelligent question-answering method in the embodiment of the present application can also be applied to the medical field, such as building a medical question-answering system to reply to users' medical question information. The present invention is described in detail below through specific embodiments.

[0026] Figure 1 The flowchart of the intelligent question answering method based on the retrieval enhanced large model provided by the embodiment of the present invention is as follows. Figure 1 As shown, the method includes the following steps S110-S140.

[0027] S110: Receive input question information, perform feature extraction on the question information according to a preset search enhancement strategy, and obtain corresponding question feature information.

[0028] The user can enter a question, which can be about insurance products or medical products. After receiving the question, the query is extracted using a search enhancement strategy to obtain corresponding question feature information. This question feature information can be used to characterize the characteristics of the question.

[0029] In one embodiment, step S110 includes: converting the question information into a corresponding question feature vector according to the text conversion model in the retrieval enhancement strategy; performing feature word parsing on the question information according to the feature word parsing model in the retrieval enhancement strategy to obtain corresponding feature word parsing information; and combining the question feature vector and the feature word parsing information into the question feature information.

[0030] Specifically, the question information can be converted through the text conversion model in the retrieval enhancement strategy. The question information is a text content composed of multiple characters. The computer cannot directly recognize the text content, so the text content can be converted into a question feature vector through the text conversion model. Specifically, the question information can first be converted through a preset mapping dictionary to obtain the character vector corresponding to each character. The character vector is a one-dimensional vector composed of multiple numerical values. The mapping dictionary includes the mapping relationship between characters and corresponding character vectors. The characters can be converted in sequence through the mapping relationship in the mapping dictionary. The character vectors of each character are combined according to the order of the characters in the question information to obtain a two-dimensional vector matrix. Further, the obtained two-dimensional vector matrix is ​​input into the text conversion model. The text conversion model can be a Sentence-BERT model based on the Transformer architecture. The text conversion model can convert the two-dimensional vector matrix into a high-dimensional vector that can reflect the semantic features of the text. The high-dimensional vector is a one-dimensional vector with a fixed length. Then any question information can be converted into a high-dimensional vector with a fixed length, which can be used as a question feature vector.

[0031] For example, for the insurance product clause "[Specific insurance product name] pays 100% of the insured amount when the insured dies due to an accident", after Sentence-BERT processing, a high-dimensional vector such as [0.12, -0.34, 0.56, ...] is obtained and used as the question feature vector corresponding to the question information.

[0032] Furthermore, the question information can be parsed for feature words according to the feature word parsing model in the retrieval enhancement strategy. The feature word parsing model is configured with multiple feature words, and each feature word includes a corresponding part of speech and entity type label. The phrases in the question information can be matched with the feature words included in the feature word parsing model, thereby determining the feature words included in the question information and the part of speech and entity type labels of each feature word in the question information. The feature words included in the question information and the corresponding part of speech and entity type labels can be used as the feature word parsing information corresponding to the question information. The part of speech and entity type labels may include information such as the question type (such as product consultation, claim questions, etc.), the insurance categories involved (such as life insurance, property insurance, etc.), and key terms (such as insurance amount, deductible, etc.).

[0033] By combining the obtained question feature vector with the feature word analysis information, question feature information corresponding to the question information can be obtained.

[0034] S120: Match the question feature information with knowledge data in a preset knowledge base according to preset search matching rules to obtain target knowledge data that matches the question feature information.

[0035] The knowledge base includes knowledge data. Question feature information can be matched with the knowledge data according to retrieval matching rules, thereby enabling retrieval of knowledge data in the knowledge base using the question feature information to obtain knowledge data matching the question feature information as the corresponding target knowledge data. The knowledge base includes multiple knowledge statements, each of which is converted into a high-dimensional vector for representation. Knowledge statements can be text fragments such as insurance clauses and claims cases. An inverted index structure is constructed using the knowledge statements and their corresponding high-dimensional vectors. Specifically, the high-dimensional vector is used as the index key, and the corresponding text data storage location or unique identifier is used as the value. For example, for the vector [0.12, -0.34, 0.56, ...], it is associated with the file path, paragraph number, and other information storing the insurance clause. Thus, a piece of knowledge data includes a knowledge statement and the high-dimensional vector, file path, and paragraph number associated with the knowledge statement. Furthermore, knowledge graph technology can be used to preprocess the knowledge statements, and the preprocessed data can be constructed into a semantically closely related insurance knowledge base. For example, different insurance product terms are linked to corresponding insurance companies, insurance categories, and relevant regulations; claims cases are linked to the insurance products involved, claims reasons, processing results, etc. to build a knowledge graph, and a graph database (such as Neo4j) is used to store the constructed knowledge graph to achieve efficient retrieval; the knowledge graph includes the corresponding triple data structure of the graph node (subject (insured)-relationship (insured)-object (insurance type)), and each piece of knowledge data corresponds to one or more graph nodes.

[0036] In one embodiment, step S120 includes: calculating the similarity value between the question feature vector in the question feature information and the feature vector of each of the knowledge data; obtaining knowledge data whose similarity value is not less than the similarity threshold set in the retrieval matching rule as alternative knowledge data; matching the graph nodes corresponding to the knowledge data according to the feature word parsing information in the question feature information to obtain node information corresponding to the graph nodes matching the feature word parsing information; and combining the alternative knowledge data and the node information into the target knowledge data.

[0037] The high-dimensional vector of the knowledge data serves as the feature vector of each piece of knowledge data. Specifically, the similarity between the question feature vector in the question feature information and the feature vector of each piece of knowledge data can be calculated. The similarity can be cosine similarity. Each piece of knowledge data then corresponds to a similarity value. It is determined whether the similarity value of the knowledge data is not less than the similarity threshold set in the search matching rule, and the knowledge data whose similarity value is greater than the similarity threshold is obtained as the candidate knowledge data. The graph nodes of the knowledge data are further matched based on the feature word parsing information in the question feature information. The knowledge graph is efficiently searched using the feature word parsing information to obtain the node information corresponding to the graph nodes that match the feature word parsing information. The obtained candidate knowledge data is combined with the node information to obtain the target knowledge data that matches the question feature information.

[0038] In one embodiment, before step S120, the following steps are also included: if new knowledge data is received, the new knowledge data is converted to obtain a new knowledge vector; the new knowledge vector and the feature vector of each knowledge data are calculated according to the local sensitive hashing algorithm to obtain knowledge data matching the new knowledge data as similar knowledge data; the similar knowledge data is compared with the new knowledge data, and the similar knowledge data is updated according to the comparison result.

[0039] Furthermore, in order to update the knowledge base, when new knowledge data (such as new product terms, new claims cases) is received, the knowledge base can be updated with the new knowledge data without having to rebuild the entire knowledge base. Specifically, the new knowledge data can be preprocessed and vectorized to obtain the corresponding new knowledge vector; the local sensitive hashing (LSH) algorithm is used to calculate the hash value between the new knowledge vector and the feature vector of each knowledge data. The smaller the hash value, the closer the new knowledge data is to the existing knowledge data; based on the hash value, the existing knowledge data with similar semantics in the knowledge base is quickly found as similar knowledge data. By comparing the differences between the new knowledge data and the similar knowledge data, only the parts with differences are updated and indexed. For example, if the new insurance terms and existing terms have some modifications in some content, the LSH algorithm can quickly locate the relevant terms vector, and then update the storage location and related metadata of the terms in the index, greatly improving the updating efficiency of the knowledge base.

[0040] S130: Combine the target knowledge data with the question information to obtain corresponding combination information.

[0041] The target knowledge data and the question information are combined and formatted to obtain combined information, and the format of the combined information can adapt to the large language model.

[0042] S140: Input the combined information into a pre-trained large language model to obtain response information output by the large language model.

[0043] The resulting combined information is input into a pre-trained large language model, which analyzes the combined information to generate the corresponding response information. This response information can then be fed back to the user. The large model can be a DeepSeek model. The large language model is trained before use. For example, a large speech model is trained with a large amount of insurance data to provide it with strong natural language understanding and generation capabilities in the insurance field. The large language model can then generate accurate, clear, and natural responses based on the input context, combined with its learned language patterns and insurance knowledge. For example, after receiving relevant documents on the life insurance claims process as input, the large speech model can systematically describe each step of the claims process, covering the reporting time requirements, required documents, and the claims review cycle.

[0044] In one embodiment, before step S140 , the method further includes: training the large language model according to preset training rules and training data sets to obtain the trained large language model.

[0045] Before using the large language model, it can also be trained specifically using training rules and specific training data sets to obtain a trained large language model.

[0046] In one embodiment, the training of the large language model according to preset training rules and training data sets to obtain the trained large language model includes: sequentially obtaining training data from the training data sets and inputting them into the large language model to obtain corresponding training output information; obtaining reward information between the training output information and the training data according to the reward function set in the training rules; optimizing and adjusting model parameters in the large language model according to the objective function set in the training rules and the reward information to obtain the adjusted large language model; and returning to execute the step of sequentially obtaining training data from the training data sets and inputting them into the large language model until all the training data in the training data sets are used for training, then stopping the training and obtaining the trained large language model.

[0047] The training data in the training dataset can be sequentially obtained and input into the large language model for training. Each piece of training data can be used to train the large language model. Each piece of training data contains input information and a target result. The input information is used to input the large language model, and the target result is used to compare the training output information output by the large language model. The training output information obtained by the large language model after analyzing a piece of training data is obtained. The large language model is then trained according to the training rules, combining the training output information and the target result in the training data.

[0048] Specifically, the training rules include a reward function, which can be used to calculate the reward information between the training output information and the target result of the training data, and define a refined reward function R(s t ,a t ,s t+1 ), where s t represents the state of the model at time step t (including the input question information and the retrieved target knowledge data), a t is the response information generated by the model in this state, s t+1 is the new state after answering (such as user feedback information). For accurate answers to user questions, positive rewards are given. The specific formula can be shown as formula (1):

[0049] R correct =α×completeness(a t )+β×accuracy(a t ) (1);

[0050] Among them, completeness (a t ) measures whether the answer covers all the key points of the question, with a value range of [0,1]. t ) represents the accuracy of the answer content, and its value range is also [0,1]. α and β are weight coefficients, which are adjusted according to the actual training effect. Usually α+β=1 and α and β∈(0,1).

[0051] If the answer is wrong or inaccurate, a negative reward is given, which is represented by R incorrect =-γ, γ is a preset penalty value.

[0052] The training rules also set an objective function. Based on the objective function and reward information, the model parameters in the large language model are optimized and adjusted to obtain the large language model after one training. The policy parameters of the model can be optimized based on the proximal policy optimization (PPO) algorithm. The PPO algorithm updates the model parameters θ by maximizing the objective function, where the optimization direction and optimization range of the model parameters θ correspond to the reward information. The objective function can be expressed using formula (2):

[0053]

[0054] θ is the policy parameter to be optimized, πθ(at|st) is the probability of taking action at in state st (determined by policy θ), π θold (a t |s t ) is the action probability under the old policy, Is the estimated value of the advantage function, indicating that action a t The value advantage relative to the average action.

[0055] The large language model is trained sequentially using the training data in the training dataset until all the training data in the training dataset has been used for training. Through multiple iterations of optimization, the large language model gradually learns to generate answers that better meet user needs based on different user questions and knowledge base information inputs.

[0056] During the training process, a supervised fine-tuning strategy (SFT) can also be introduced to perform cross-training and verification on the large language model. Specifically, first, the model is preliminarily trained with SFT using a well-labeled high-quality insurance question-and-answer dataset, so that the model can master the answering patterns of insurance questions to a certain extent. During the RL training process (reinforcement learning training, that is, the process of training with the training dataset mentioned above), the generation results of the model in the simulation environment are regularly compared and verified with the reference answers obtained by SFT training. If the answer generated by RL has a high degree of consistency with the SFT reference answer in key information and semantics, an additional reward will be given, otherwise a penalty will be imposed. Through this cross-training and verification mechanism, the learning direction of the model in RL training is continuously calibrated to improve the accuracy and reliability of the model's answers. For example, in the SFT training set, there is a detailed and accurate labeled answer to the question "Claim conditions for critical illness insurance". During RL training, the answer generated by the model is compared with the labeled answer. If the key claim conditions are covered and expressed accurately, the reward score will be increased. ×

[0057] During the training process, low-rank adaptation (LoRA) technology can also be used to speed up model training. In the Transformer architecture of the model, some trainable parameter matrices are decomposed into low rank. For example, for the linear layer weight matrix W in the model, it is decomposed into W = W1 × W2, where W1 and W2 are two low-rank matrices. During the training process, only these two low-rank matrices W1× and W2 are updated instead of the entire weight matrix W, which greatly reduces the number of parameters that need to be trained. At the same time, combined with distillation technology, the knowledge of the pre-trained large-scale general language model is transferred to the LoRA-based insurance model, further accelerating the training convergence speed, enabling the model to achieve better performance in a shorter time without affecting the model's ability to learn and answer insurance domain knowledge.

[0058] In one embodiment, after step S140, the method further includes: obtaining corresponding feedback reward information based on user feedback information of the user to the reply information; and performing fusion training on the large language model based on the training rules, the reply information and the feedback reward information.

[0059] Specifically, large language models can be optimized and trained based on user feedback from viewing responses. A user feedback mechanism can be established to collect user satisfaction with the model's responses and suggestions for improvement. A feedback button can be set up in the user interface, allowing users to provide feedback on unsatisfactory responses by describing their questions and desired answers. This information is then recorded and used to generate user feedback. Based on this user feedback, model issues can be thoroughly analyzed and targeted optimization strategies can be implemented, such as adjusting retrieval algorithms and improving model input formats, to further improve the quality of the model's responses during inference.

[0060] In addition to rewarding answers based on accuracy and completeness, multimodal information can also be incorporated into the reward function. For example, when a model's answer involves explaining complex insurance charts (such as claims process diagrams), if the user stays on the answer for a long time after viewing it, or clicks on the relevant chart area again, this is considered approval of the answer. This approval information is recorded as user feedback and an additional reward is given. Incorporating this multimodal reward information into the reward function further enhances the model's ability to generate diverse, high-quality answers.

[0061] To sum up, the embodiments of the present invention can obtain question feature information through enhanced retrieval strategies to perform enhanced retrieval on the knowledge base, obtain target knowledge data, combine the target knowledge data with the question information, and input the data into a large language model, thereby optimizing the reply content to improve the accuracy and comprehensiveness of the obtained reply information.

[0062] Figure 2 This is a schematic block diagram of an intelligent question-answering device based on a retrieval-enhanced large model provided by an embodiment of the present invention. Figure 2 As shown, corresponding to the above intelligent question answering method based on retrieval enhancement model, the present invention also provides an intelligent question answering device based on retrieval enhancement model, the device is configured as follows Figure 4 In an application environment, a computer device communicates with at least one host device via a network; the computer device may be a server or a personal computer, wherein the server may be implemented as an independent server or a server cluster consisting of multiple servers; the host device may be, but is not limited to, a server, a smart phone, a tablet computer, a desktop computer, or other electronic device. Figure 2 The intelligent question-answering device 700 based on the retrieval-enhanced large model includes:

[0063] The feature extraction unit 701 is configured to receive input question information, perform feature extraction on the question information according to a preset search enhancement strategy, and obtain corresponding question feature information.

[0064] The matching unit 702 is configured to match the question feature information with knowledge data in a preset knowledge base according to preset search matching rules to obtain target knowledge data that matches the question feature information.

[0065] The combined information acquisition unit 703 is configured to combine the target knowledge data with the question information to obtain corresponding combined information.

[0066] The reply information acquisition unit 704 is configured to input the combined information into a pre-trained large language model to obtain reply information output by the large language model.

[0067] In some embodiments, when the feature extraction unit 701 extracts features from the question information according to a preset search enhancement strategy to obtain corresponding question feature information, it is specifically configured to:

[0068] Converting the question information into a corresponding question feature vector according to the text conversion model in the retrieval enhancement strategy;

[0069] Performing feature word parsing on the question information according to the feature word parsing model in the retrieval enhancement strategy to obtain corresponding feature word parsing information;

[0070] The question feature vector and the feature word analysis information are combined into the question feature information.

[0071] In some embodiments, when the matching unit 702 performs the step of matching the question feature information with knowledge data in a preset knowledge base according to a preset search matching rule to obtain target knowledge data that matches the question feature information, it is specifically configured to:

[0072] Calculating similarity values ​​between the question feature vector in the question feature information and the feature vectors of each of the knowledge data;

[0073] Acquire knowledge data having a similarity value not less than a similarity threshold set in the search matching rule as candidate knowledge data;

[0074] Matching the graph nodes corresponding to the knowledge data according to the feature word parsing information in the question feature information to obtain node information corresponding to the graph nodes that match the feature word parsing information;

[0075] The candidate knowledge data and node information are combined into the target knowledge data.

[0076] In some embodiments, before performing the step of matching the question feature information with knowledge data in a preset knowledge base according to preset search matching rules to obtain target knowledge data that matches the question feature information, the matching unit 702 is further configured to:

[0077] If new knowledge data is received, converting the new knowledge data to obtain a new knowledge vector;

[0078] Calculating the newly added knowledge vector and the feature vector of each of the knowledge data according to a local sensitive hashing algorithm to obtain knowledge data that matches the newly added knowledge data as similar knowledge data;

[0079] A difference comparison is performed between the similar knowledge data and the newly added knowledge data, and the similar knowledge data is updated according to the comparison result.

[0080] In some embodiments, before executing the step of inputting the combined information into a pre-trained large language model to obtain the reply information output by the large language model, the reply information obtaining unit 704 is further configured to:

[0081] The large language model is trained according to preset training rules and training data sets to obtain the trained large language model.

[0082] In some embodiments, when the reply information acquisition unit 704 performs the step of training the large language model according to the preset training rules and training data set to obtain the trained large language model, it is configured to:

[0083] Sequentially obtaining training data from the training data set and inputting it into the large language model to obtain corresponding training output information;

[0084] Obtaining reward information between the training output information and the training data according to the reward function set in the training rule;

[0085] Optimizing and adjusting the model parameters in the large language model according to the objective function set in the training rule and the reward information to obtain an adjusted large language model;

[0086] Return to the step of sequentially acquiring the training data in the training data set and inputting them into the large language model until all the training data in the training data set are used for training, then stop the training and obtain the trained large language model.

[0087] In some embodiments, after executing the step of inputting the combined information into a pre-trained large language model to obtain the reply information output by the large language model, the reply information obtaining unit 704 is further configured to:

[0088] Obtaining corresponding feedback reward information according to user feedback information of the user to the reply information;

[0089] The large language model is subjected to fusion training according to the training rules, the response information and the feedback reward information.

[0090] It should be noted that technical personnel in the relevant field can clearly understand that the specific implementation process of the above-mentioned intelligent question-answering device based on the retrieval enhanced large model and each unit can refer to the corresponding description in the aforementioned method embodiment. For the convenience and conciseness of the description, it will not be repeated here.

[0091] The intelligent question answering device based on the retrieval enhancement model can be implemented in the form of a computer program. Figure 3 Runs on the electronic devices shown.

[0092] See also Figure 3 , Figure 3 8 is a schematic block diagram of an electronic device provided by an embodiment of the present invention. The electronic device 800 can be a terminal or a server, wherein the terminal can be an electronic device with communication functions. The server can be a standalone server or a server cluster consisting of multiple servers.

[0093] See Figure 3 The electronic device 800 includes a processor 802 , a memory, and a network interface 805 connected via a system bus 801 , wherein the memory may include a non-volatile storage medium 803 and an internal memory 804 .

[0094] The non-volatile storage medium 803 can store an operating system 8031 ​​and a computer program 8032. The computer program 8032 includes program instructions, which, when executed, can enable the processor 802 to execute an intelligent question answering method based on a retrieval-enhanced large model.

[0095] The processor 802 is used to provide computing and control capabilities to support the operation of the entire electronic device 800.

[0096] The internal memory 804 provides an environment for the operation of the computer program 8032 in the non-volatile storage medium 803. When the computer program 8032 is executed by the processor 802, the processor 802 can execute an intelligent question-answering method based on a retrieval-enhanced large model.

[0097] The network interface 805 is used to communicate with other devices over the network. Figure 3 The structure shown in the figure is merely a block diagram of a portion of the structure related to the solution of the present invention, and does not constitute a limitation on the electronic device 800 to which the solution of the present invention is applied. The specific electronic device 800 may include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0098] The processor 802 is configured to execute a computer program 8032 stored in the memory to implement the following steps:

[0099] Receive input question information, perform feature extraction on the question information according to a preset retrieval enhancement strategy, and obtain corresponding question feature information;

[0100] Matching the question feature information with knowledge data in a preset knowledge base according to preset search matching rules to obtain target knowledge data that matches the question feature information;

[0101] Combining the target knowledge data with the question information to obtain corresponding combination information;

[0102] The combined information is input into a pre-trained large language model to obtain response information output by the large language model.

[0103] In some embodiments, when the processor 802 extracts features from the question information according to a preset search enhancement strategy to obtain corresponding question feature information, the processor 802 specifically implements the following steps:

[0104] Converting the question information into a corresponding question feature vector according to the text conversion model in the retrieval enhancement strategy;

[0105] Performing feature word parsing on the question information according to the feature word parsing model in the retrieval enhancement strategy to obtain corresponding feature word parsing information;

[0106] The question feature vector and the feature word analysis information are combined into the question feature information.

[0107] In some embodiments, when the processor 802 implements the step of matching the question feature information with knowledge data in a preset knowledge base according to a preset search matching rule to obtain target knowledge data that matches the question feature information, the processor 802 specifically implements the following steps:

[0108] Calculating similarity values ​​between the question feature vector in the question feature information and the feature vectors of each of the knowledge data;

[0109] Acquire knowledge data having a similarity value not less than a similarity threshold set in the search matching rule as candidate knowledge data;

[0110] Matching the graph nodes corresponding to the knowledge data according to the feature word parsing information in the question feature information to obtain node information corresponding to the graph nodes that match the feature word parsing information;

[0111] The candidate knowledge data and node information are combined into the target knowledge data.

[0112] In some embodiments, before matching the question feature information with the knowledge data in the preset knowledge base according to the preset search matching rules, the processor 802 further implements the following steps:

[0113] If new knowledge data is received, converting the new knowledge data to obtain a new knowledge vector;

[0114] Calculating the newly added knowledge vector and the feature vector of each of the knowledge data according to a local sensitive hashing algorithm to obtain knowledge data that matches the newly added knowledge data as similar knowledge data;

[0115] A difference comparison is performed between the similar knowledge data and the newly added knowledge data, and the similar knowledge data is updated according to the comparison result.

[0116] In some embodiments, before implementing the step of inputting the combined information into the pre-trained large language model, the processor 802 further implements the following steps:

[0117] The large language model is trained according to preset training rules and training data sets to obtain the trained large language model.

[0118] In some embodiments, when the processor 802 implements the step of training the large language model according to the preset training rules and training data set to obtain the trained large language model, it specifically implements the following steps:

[0119] Sequentially obtaining training data from the training data set and inputting it into the large language model to obtain corresponding training output information;

[0120] Obtaining reward information between the training output information and the training data according to the reward function set in the training rule;

[0121] Optimizing and adjusting the model parameters in the large language model according to the objective function set in the training rule and the reward information to obtain an adjusted large language model;

[0122] Return to the step of sequentially acquiring the training data in the training data set and inputting them into the large language model until all the training data in the training data set are used for training, then stop the training and obtain the trained large language model.

[0123] In some embodiments, after implementing the step of inputting the combined information into a pre-trained large language model to obtain the response information output by the large language model, the processor 802 further implements the following steps:

[0124] Obtaining corresponding feedback reward information according to user feedback information of the user to the reply information;

[0125] The large language model is subjected to fusion training according to the training rules, the response information and the feedback reward information.

[0126] It should be understood that in the embodiment of the present invention, the processor 802 may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0127] Those skilled in the art will appreciate that all or part of the steps in the method of the above-described embodiment can be implemented by instructing the relevant hardware through a computer program. The computer program includes program instructions, which can be stored in a storage medium that is computer-readable. The program instructions are executed by at least one processor in the computer system to implement the steps in the method of the above-described embodiment.

[0128] Therefore, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When the program instructions are executed by a processor, the processor performs the following steps:

[0129] Receive input question information, perform feature extraction on the question information according to a preset retrieval enhancement strategy, and obtain corresponding question feature information;

[0130] Matching the question feature information with knowledge data in a preset knowledge base according to preset search matching rules to obtain target knowledge data that matches the question feature information;

[0131] Combining the target knowledge data with the question information to obtain corresponding combination information;

[0132] The combined information is input into a pre-trained large language model to obtain response information output by the large language model.

[0133] In one embodiment, when the processor executes the program instructions to extract features from the question information according to a preset search enhancement strategy to obtain corresponding question feature information, the processor specifically implements the following steps:

[0134] Converting the question information into a corresponding question feature vector according to the text conversion model in the retrieval enhancement strategy;

[0135] Performing feature word parsing on the question information according to the feature word parsing model in the retrieval enhancement strategy to obtain corresponding feature word parsing information;

[0136] The question feature vector and the feature word analysis information are combined into the question feature information.

[0137] In one embodiment, when the processor executes the program instructions to implement the step of matching the question feature information with knowledge data in a preset knowledge base according to preset search matching rules to obtain target knowledge data that matches the question feature information, the processor specifically implements the following steps:

[0138] Calculating similarity values ​​between the question feature vector in the question feature information and the feature vectors of each of the knowledge data;

[0139] Acquire knowledge data having a similarity value not less than a similarity threshold set in the search matching rule as candidate knowledge data;

[0140] Matching the graph nodes corresponding to the knowledge data according to the feature word parsing information in the question feature information to obtain node information corresponding to the graph nodes that match the feature word parsing information;

[0141] The candidate knowledge data and node information are combined into the target knowledge data.

[0142] In one embodiment, before executing the program instructions to implement the step of matching the question feature information with knowledge data in a preset knowledge base according to preset search matching rules, the processor further implements the following steps:

[0143] If new knowledge data is received, converting the new knowledge data to obtain a new knowledge vector;

[0144] Calculating the newly added knowledge vector and the feature vector of each of the knowledge data according to a local sensitive hashing algorithm to obtain knowledge data that matches the newly added knowledge data as similar knowledge data;

[0145] A difference comparison is performed between the similar knowledge data and the newly added knowledge data, and the similar knowledge data is updated according to the comparison result.

[0146] In one embodiment, before executing the program instructions to implement the step of inputting the combined information into a pre-trained large language model, the processor further implements the following steps:

[0147] The large language model is trained according to preset training rules and training data sets to obtain the trained large language model.

[0148] In one embodiment, when the processor executes the program instructions to implement the step of training the large language model according to preset training rules and training data sets to obtain the trained large language model, the processor specifically implements the following steps:

[0149] Sequentially obtaining training data from the training data set and inputting it into the large language model to obtain corresponding training output information;

[0150] Obtaining reward information between the training output information and the training data according to the reward function set in the training rule;

[0151] Optimizing and adjusting the model parameters in the large language model according to the objective function set in the training rule and the reward information to obtain an adjusted large language model;

[0152] Return to the step of sequentially acquiring the training data in the training data set and inputting them into the large language model until all the training data in the training data set are used for training, then stop the training and obtain the trained large language model.

[0153] In one embodiment, after the processor executes the program instructions to implement the step of inputting the combined information into a pre-trained large language model to obtain response information output by the large language model, the processor further implements the following steps:

[0154] Obtaining corresponding feedback reward information according to user feedback information of the user to the reply information;

[0155] The large language model is subjected to fusion training according to the training rules, the response information and the feedback reward information.

[0156] The storage medium may be any computer-readable storage medium that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk.

[0157] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the composition and steps of each example according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0158] In the several embodiments provided herein, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the various units is merely a logical functional division, and actual implementation may employ other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not implemented.

[0159] The steps in the methods of the embodiments of the present invention may be adjusted in order, combined, or deleted as needed. The units in the devices of the embodiments of the present invention may be combined, divided, or deleted as needed. Furthermore, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit.

[0160] If this integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the existing technology, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes a number of instructions for causing an electronic device (such as a personal computer, terminal, or network device) to execute all or part of the steps of the method described in various embodiments of the present invention.

[0161] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. An intelligent question answering method based on a retrieval-enhanced large model, characterized in that: The method comprises: Receive input question information, perform feature extraction on the question information according to a preset retrieval enhancement strategy, and obtain corresponding question feature information; Matching the question feature information with knowledge data in a preset knowledge base according to preset search matching rules to obtain target knowledge data that matches the question feature information; Combining the target knowledge data with the question information to obtain corresponding combination information; The combined information is input into a pre-trained large language model to obtain response information output by the large language model.

2. The intelligent question answering method based on the retrieval enhanced large model according to claim 1 is characterized in that: The feature extraction of the question information according to the preset search enhancement strategy to obtain corresponding question feature information includes: Converting the question information into a corresponding question feature vector according to the text conversion model in the retrieval enhancement strategy; Performing feature word parsing on the question information according to the feature word parsing model in the retrieval enhancement strategy to obtain corresponding feature word parsing information; The question feature vector and the feature word analysis information are combined into the question feature information.

3. The intelligent question answering method based on retrieval-enhanced large model according to claim 1 is characterized in that: The step of matching the question feature information with knowledge data in a preset knowledge base according to preset search matching rules to obtain target knowledge data that matches the question feature information includes: Calculating similarity values ​​between the question feature vector in the question feature information and the feature vectors of each of the knowledge data; Acquire knowledge data having a similarity value not less than a similarity threshold set in the search matching rule as candidate knowledge data; Matching the graph nodes corresponding to the knowledge data according to the feature word parsing information in the question feature information to obtain node information corresponding to the graph nodes that match the feature word parsing information; The candidate knowledge data and node information are combined into the target knowledge data.

4. The intelligent question answering method based on retrieval-enhanced large model according to claim 1 is characterized in that: Before matching the question feature information with the knowledge data in the preset knowledge base according to the preset search matching rules, the method further includes: If new knowledge data is received, converting the new knowledge data to obtain a new knowledge vector; Calculating the newly added knowledge vector and the feature vector of each of the knowledge data according to a local sensitive hashing algorithm to obtain knowledge data that matches the newly added knowledge data as similar knowledge data; A difference comparison is performed between the similar knowledge data and the newly added knowledge data, and the similar knowledge data is updated according to the comparison result.

5. The intelligent question answering method based on retrieval-enhanced large model according to claim 1 is characterized in that: Before inputting the combined information into the pre-trained large language model, the method further includes: The large language model is trained according to preset training rules and training data sets to obtain the trained large language model.

6. The intelligent question answering method based on retrieval-enhanced large model according to claim 5 is characterized in that: The step of training the large language model according to preset training rules and training data sets to obtain the trained large language model includes: Sequentially obtaining training data from the training data set and inputting it into the large language model to obtain corresponding training output information; Obtaining reward information between the training output information and the training data according to the reward function set in the training rule; Optimizing and adjusting the model parameters in the large language model according to the objective function set in the training rule and the reward information to obtain an adjusted large language model; Return to the step of sequentially acquiring the training data in the training data set and inputting them into the large language model until all the training data in the training data set are used for training, then stop the training and obtain the trained large language model.

7. The intelligent question answering method based on the retrieval-enhanced large model according to claim 5 or 6, characterized in that: After inputting the combined information into a pre-trained large language model to obtain the response information output by the large language model, the method further includes: Obtaining corresponding feedback reward information according to user feedback information of the user to the reply information; The large language model is subjected to fusion training according to the training rules, the response information and the feedback reward information.

8. An intelligent question-answering device based on a retrieval-enhanced large model, characterized in that: The device is used to execute the intelligent question answering method based on the retrieval enhanced large model according to any one of claims 1 to 7, and the device includes: A feature extraction unit is used to receive the input question information, perform feature extraction on the question information according to a preset retrieval enhancement strategy, and obtain corresponding question feature information; a matching unit, configured to match the question feature information with knowledge data in a preset knowledge base according to preset search matching rules to obtain target knowledge data that matches the question feature information; a combination information acquisition unit, configured to combine the target knowledge data with the question information to obtain corresponding combination information; The reply information acquisition unit is used to input the combined information into a pre-trained large language model to obtain reply information output by the large language model.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the intelligent question answering method based on the retrieval enhanced large model as described in any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that The storage medium stores a computer program, which includes program instructions. When the program instructions are executed by the processor, the processor executes the intelligent question-answering method based on the retrieval-enhanced large model as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Question and answer interaction method and device for instrument, equipment and storage medium

    CN121920510A