Retrieval enhanced domain adaptive question and answer model construction method and system, terminal and medium
By combining knowledge from general and professional fields and using self-training methods to optimize the question-and-answer model, the problem of the lack of rapid adaptability of the question-and-answer system in the professional field is solved, and high accuracy and reliability in the professional field is achieved.
Patent Information
- Application Number
- CN202411716969.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-04-29
AI Technical Summary
Existing Q&A systems lack fast adaptability in professional fields, and their accuracy and reliability in cross-domain Q&A tasks are limited, mainly due to their dependence on fixed data sets and model weights, making it difficult to obtain high-quality large-scale annotated data.
By combining knowledge from common and professional fields, we use self-training methods to continuously optimize the Q&A performance of the model in the professional fields. The specific steps include preprocessing general domain knowledge, constructing general domain question-and-answer pairs, and fine-tuning instructions on large language models; then extracting answer content from professional domain knowledge, generating corresponding questions, and constructing professional domain question-and-answer pairs; repeating the above steps until the model performance meets the evaluation criteria.
Without the need for a large number of label samples, improve the rapid adaptability of the Q&A system to the professional field and improve the accuracy and reliability of the professional field in the Q&A task.
Smart Images

Figure CN119903139A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of large models, and in particular to a method, system, terminal and medium for constructing a retrieval-enhanced domain-adaptive question-answering model. Background Art
[0002] As a bridge between human and machine intelligence, the question-answering system aims to understand users' questions and retrieve or generate accurate answers from large amounts of text data. Traditional question-answering systems often rely on a large amount of annotated data to train models, and rely on fixed data sets and model weights. For specific professional fields, high-quality, large-scale annotated data is often difficult to obtain, which limits the application of question-answering systems in professional fields and makes question-answering systems lack the ability to quickly adapt to new domain knowledge.
[0003] To solve this problem, researchers began to explore the use of transfer learning and domain adaptation techniques to improve the performance of question answering systems in professional fields. Transfer learning allows the model to transfer knowledge learned from one field (source field) to another field (target field), while domain adaptation technology focuses on enabling the model to adapt to new domain data distributions. However, most existing methods focus on improving the model structure or training in a single field, lacking strategies for effectively integrating general domain knowledge with professional domain knowledge, resulting in limited accuracy and reliability of the model in cross-domain question answering tasks. Summary of the invention
[0004] To solve the above problems, the present invention provides a retrieval-enhanced domain-adaptive question-answering model construction method, system, terminal and medium, which combine general fields and professional fields, continuously optimize the model's question-answering performance in professional fields through self-training, improve the ability to quickly adapt to professional fields without the need for a large number of labeled samples, and improve the accuracy and reliability of question-answering tasks in professional fields.
[0005] In a first aspect, the technical solution of the present invention provides a method for constructing a retrieval-enhanced domain-adaptive question-answering model, comprising the following steps: S1, preprocessing general domain knowledge and professional domain knowledge, and using the preprocessed general domain knowledge to construct general domain question-answer pairs; S2, use general domain question-answer pairs to fine-tune the large language model to obtain a fine-tuned large language model; S3, extracts answer content from professional domain knowledge through a fine-tuned large language model; S4, using the fine-tuned large language model to generate corresponding questions based on the answer content and construct professional field question-answer pairs; S5: Combine the general domain question-answer pairs and the professional domain question-answer pairs as a training set, fine-tune the fine-tuned large language model again, and repeat steps S3 to S5 until the performance of the large language model meets the evaluation criteria.
[0006] In an optional implementation, after step S3 extracts the answer content from the professional domain knowledge through the large language model, the following steps are further included: S3.1, calculate the matching degree between each answer content and the document to which it belongs; S3.2, calculating the extraction probability of each answer content in the document to which it belongs according to each matching degree; S3.3, filter out one or more answer contents with the highest extraction probability as the answer contents that are finally retained for the corresponding document.
[0007] In an optional implementation, step S3.2 calculates the extraction probability of each answer content in the document to which it belongs according to each matching degree, specifically including: The extraction probability is calculated by the following formula,
[0008] In the formula, For the Documents Middle Answer content The extraction probability of For the Answer content and its related documents The similarity of is the indicator function.
[0009] In an optional implementation, in step S3.1, the matching degree between each answer content and its corresponding document is calculated by using cosine similarity.
[0010] In an optional implementation, step S4 generates corresponding questions based on the answer content using the fine-tuned large language model, and after constructing the professional field question-answer pair, further includes the following steps: S4.1, for each question, calculate the similarity between the question and each document, and build the document set most relevant to the question; S4.2, detect whether the answer content corresponding to the question is in the document collection. If so, retain the question-answer pair; otherwise, do not retain the question-answer pair.
[0011] In an optional embodiment, the fine-tuning training process of the large language model uses a cross entropy loss function to optimize the model parameters.
[0012] In an optional implementation, the preprocessing of general domain knowledge and professional domain knowledge in step S1 includes text cleaning, word segmentation, part-of-speech tagging and entity recognition.
[0013] In a second aspect, the technical solution of the present invention provides a retrieval-enhanced domain-adaptive question-answering model construction system, comprising: The knowledge preprocessing module is used to preprocess general domain knowledge and professional domain knowledge, and use the preprocessed general domain knowledge to construct general domain question-answer pairs; An instruction fine-tuning module is used to perform instruction fine-tuning on a large language model using general domain question-answer pairs to obtain a fine-tuned large language model. The answer extraction module is used to extract answer content from professional domain knowledge through a fine-tuned large language model; The question-answer pair generation module is used to generate corresponding questions based on the answer content using a fine-tuned large language model to construct professional field question-answer pairs; The model fine-tuning module is used to combine general-domain question-answer pairs and professional-domain question-answer pairs as a training set, fine-tune the fine-tuned large language model again, and repeatedly execute the answer extraction module, question-answer pair generation module and model fine-tuning module until the performance of the large language model meets the evaluation criteria.
[0014] In a third aspect, the technical solution of the present invention provides a terminal, including: A memory for storing a retrieval-enhanced domain-adapted question-answering model building program; A processor is used to implement the steps of the retrieval-enhanced domain-adaptive question-answering model construction method as described in any of the above items when executing the retrieval-enhanced domain-adaptive question-answering model construction program.
[0015] In a fourth aspect, the technical solution of the present invention provides a computer-readable storage medium, on which a retrieval-enhanced domain-adaptive question-answering model construction program is stored. When the retrieval-enhanced domain-adaptive question-answering model construction program is executed by a processor, the steps of the retrieval-enhanced domain-adaptive question-answering model construction method as described in any of the above items are implemented.
[0016] The method, system, terminal and medium for constructing a retrieval-enhanced domain-adaptive question-answering model provided by the present invention have the following beneficial effects relative to the prior art: first, a general-domain question-answering pair is used to fine-tune the large language model, so that the large language model has the ability to understand the context, and at the same time, the content extraction function of the large language model is used to extract the answer content from the professional domain knowledge, and questions about the answer content are generated based on the large language model after the instruction fine-tuning, and then professional domain question-answering pairs can be constructed from unlabeled professional domain knowledge, and then the large language model is trained based on the general-domain and professional-domain question-answering pairs to adapt it to the question-answering tasks in the professional field. The present invention combines the general domain with the professional domain, continuously optimizes the question-answering performance of the model in the professional field through self-training, improves the ability to quickly adapt to the professional field without a large number of labeled samples, and improves the accuracy and reliability of the professional field in the question-answering tasks. BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 It is a flowchart of a method for constructing a retrieval-enhanced domain-adaptive question-answering model provided by an embodiment of the present invention.
[0018] Figure 2 It is a schematic diagram of the process architecture of a specific embodiment of a method for building a retrieval-enhanced domain-adaptive question-answering model provided by the present invention.
[0019] Figure 3 It is a schematic block diagram of the structure of a retrieval-enhanced domain-adaptive question-answering model construction system provided by an embodiment of the present invention.
[0020] Figure 4 It is a schematic diagram of the structure of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0021] In order to enable those skilled in the art to better understand the scheme of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0022] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.
[0023] The key terms appearing in the present invention are explained below.
[0024] LLM: Large Language Model, large language model.
[0025] In view of the problem that the current question-answering system relies on fixed data sets and model weights, which makes the question-answering system lack the ability to quickly adapt to new domain knowledge, resulting in limited accuracy and reliability of the model in cross-domain question-answering tasks, the present invention provides a retrieval-enhanced domain adaptation question-answering model construction method. First, general domain question-answer pairs are used to fine-tune the instructions of a large language model, so that the large language model has the ability to understand the context. At the same time, the content extraction function of the large language model is used to construct professional domain question-answer pairs from unlabeled professional domain knowledge. Then, based on the general domain and professional domain question-answer pairs, the large language model is trained to adapt to question-answering tasks in professional fields, thereby improving the question-answering system's ability to quickly adapt to professional fields without the need for a large number of labeled samples, and improving the accuracy and reliability of question-answering tasks in professional fields.
[0026] Figure 1 : is a flowchart of a method for constructing a retrieval-enhanced domain-adaptive question-answering model provided by an embodiment of the present invention. Figure 1 The execution subject may be a retrieval-enhanced domain-adaptive question-answering model construction system. The retrieval-enhanced domain-adaptive question-answering model construction method provided in the embodiment of the present invention is executed by a computer device, and accordingly, the retrieval-enhanced domain-adaptive question-answering model construction system runs in the computer device. According to different requirements, the order of the steps in the flowchart can be changed, and some can be omitted.
[0027] like Figure 1 As shown, the method includes the following steps.
[0028] S1, preprocess general domain knowledge and professional domain knowledge, and use the preprocessed general domain knowledge to construct general domain question-answer pairs.
[0029] The purpose of this step is to preprocess the dataset to ensure that the data can be used in a structured form in subsequent steps. At the same time, the preprocessed general domain knowledge is used to construct general domain question-answer pairs to achieve fine-tuning of instructions for large language models.
[0030] S2, use general domain question-answer pairs to fine-tune the large language model to obtain the fine-tuned large language model.
[0031] This step is the first stage of fine-tuning. Using the instruction-fine-tuned Large Language Model (LLM) as a basis, the model is fine-tuned in the first stage based on general domain question-answer pairs, so that it can perform instruction following, question answering, and question generation tasks in general domains.
[0032] S3 extracts answer content from professional domain knowledge through a fine-tuned large language model.
[0033] S4 uses a fine-tuned large language model to generate corresponding questions based on the answer content and construct professional question-answer pairs.
[0034] The purpose of step S3 and step S4 is to use the unlabeled professional domain corpus to generate high-quality question-answer pairs related to the professional domain. First, the content extraction function of the large language model is used to extract candidate answers from the professional domain corpus, and then based on these answers and related documents, and based on the large language model with understandable context information fine-tuned by the instructions, candidate questions are generated, and then professional domain question-answer pairs are generated without labels.
[0035] S5: Combine the general domain question-answer pairs and the professional domain question-answer pairs as a training set, fine-tune the fine-tuned large language model again, and repeat steps S3 to S5 until the performance of the large language model meets the evaluation criteria.
[0036] This step is the second stage of parameter adjustment. It uses the capabilities of the large language model itself to iteratively optimize the generated synthetic data through self-training, thereby achieving effective adaptation to professional fields.
[0037] Figure 2 This is a schematic diagram of the process architecture of a specific embodiment of a method for constructing a retrieval-enhanced domain-adaptive question-answering model provided by the present invention. First, the large language model is fine-tuned for instruction following, question answering, and searching for relevant data, so that it has basic instruction understanding and context utilization skills. Then, the unlabeled professional domain corpus is used to prompt the same large language model to generate high-quality question-answer pairs related to the domain. The quality of the synthetic question-answer pairs is further improved by adopting multi-task types and round-trip consistency filtering technology. These pseudo-labeled (question, paragraph, answer) tuples generated by the large language model are used to continuously fine-tune the model so that the large language model gradually optimizes its performance on the synthetic pairs, thereby adapting to the question-answering application in a specific field. The retrieval-enhanced domain-adaptive question-answering model construction method of this specific embodiment has the advantages of strong adaptability, high efficiency, and low cost, and can effectively adapt the general domain large language model to the question-answering task in a specific field. This specific embodiment includes the following steps.
[0038] SS1, preprocesses general domain knowledge and professional domain knowledge, and uses the preprocessed general domain knowledge to construct general domain question-answer pairs.
[0039] The input unstructured text data is cleaned and normalized to prepare structured data for model training. Specifically, the preprocessing of general domain knowledge and professional domain knowledge includes text cleaning (removing invalid characters, blank lines, etc.), word segmentation, part-of-speech tagging, and entity recognition.
[0040] This step ensures that the question can be processed in a structured form by subsequent processes, while extracting key information. For example, "Can antibiotics cure colds?" can extract "antibiotics" and "colds."
[0041] In an optional implementation, the dataset of general domain knowledge is a public question-answering dataset, including Squad and NarrativeQA datasets, which provide rich contextual information and question-answer pairs for fine-tuning the model.
[0042] SS2, uses general domain question-answer pairs to fine-tune the large language model and obtain the fine-tuned large language model.
[0043] First, the instruction-tuned Large Language Model (LLM) is used as a basis for the first stage of fine-tuning the model, so that it can perform instruction following, question answering, and question generation tasks in the general domain. In this stage, LLM lays the foundation for subsequent domain-specific tasks by learning instruction following and context utilization skills. Exemplarily, this stage of fine-tuning uses the LoRA fine-tuning algorithm, which can efficiently fine-tune the large language model to adapt it to specific tasks in the general domain.
[0044] SS3 extracts answer content from professional domain knowledge through a fine-tuned large language model, and uses the fine-tuned large language model to generate corresponding questions based on the answer content to construct professional domain question-answer pairs.
[0045] To leverage the unlabeled domain corpus and enable LLM to generate high-quality domain-relevant question-answer pairs, additional training data is synthesized through a two-step process: first, LLM extracts candidate answers from the corpus; then, based on these answers and related documents, LLM generates candidate questions.
[0046] As the first step, a large model is used to extract valid information from the professional field corpus as candidate answers (for example, there is a lot of medical data, but no labels. For example, if there is information about a disease in the medical data, then the information about a disease can be used as an answer). The second step is to generate candidate questions based on the answers. That is, if the answers are available, how should the questions be asked? The answers can be used to answer them.
[0047] To ensure the validity of the extracted answers, this specific embodiment implements answer screening through the following steps.
[0048] Step 1: Calculate the matching degree between each answer content and the document to which it belongs.
[0049] This step can be calculated through cosine similarity to represent the matching degree between each answer content and the document to which it belongs.
[0050] Step 2: Calculate the extraction probability of each answer content in its corresponding document according to each matching degree.
[0051] The extraction probability is calculated by the following formula,
[0052] In the formula, For the Documents Middle Answer content The extraction probability of For the Answer content and its related documents The similarity of is the indicator function. The above formula ensures the normalization of probability.
[0053] Step 3: Filter out one or more answer contents with the highest extraction probability as the answer contents that are finally retained for the corresponding document.
[0054] Finally, the most correct answers are selected from the extracted answers.
[0055] This specific embodiment uses an additional filtering strategy to retain high-quality professional field question-answer pairs, which specifically includes the following steps.
[0056] Step 1: For each question, calculate the similarity between the question and each document, and build the document set most relevant to the question.
[0057] Step 2: Check whether the answer content corresponding to the question is in the document collection. If so, the question-answer pair is retained; otherwise, the question-answer pair is not retained.
[0058] Based on the generated questions Retrieve the most relevant set of documents , for each question-answer pair ( ), check the generated answer Whether it appears in the retrieved document set :The formula is:
[0059] Keep those question-answer pairs whose answers appear in the search results, i.e.
[0060] This specific embodiment uses a retriever to retrieve each question, obtain the most relevant documents, and check whether the generated answers are consistent with these documents. Only those question-answer pairs whose answers are consistent with the retrieval results will be retained to ensure the accuracy and reliability of the information.
[0061] SS4: Combine the general domain question-answer pairs and the professional domain question-answer pairs as a training set, fine-tune the fine-tuned large language model again, and repeat steps SS3-SS4 until the performance of the large language model meets the evaluation criteria.
[0062] The system then uses a two-stage fine-tuning model to conduct in-depth analysis of the question. In the first stage, the model is fine-tuned on general question-answering data to obtain basic question-answering capabilities. In the second stage, the model is self-trained using unlabeled corpora from specialized fields (such as medicine) to adapt to the specific context and terminology of the specialized field.
[0063] In the two-stage fine-tuning phase, the cross entropy loss function is used to optimize the model parameters. The formula is as follows:
[0064] in, is the cross entropy loss, It is The true label of each category (0 or 1), The model predicts The formula measures the difference between the probability distribution predicted by the model and the probability distribution of the true label.
[0065] An optional implementation method uses a series of evaluation indicators, such as precision, recall, and F1 score, to quantify the performance of the model on professional domain questions. The evaluation results will be used to further optimize and adjust the model to improve the question-answering system's ability to answer questions in professional domains.
[0066] An embodiment of a method for constructing a retrieval-enhanced domain-adaptive question-answering model is described in detail above. Based on the method for constructing a retrieval-enhanced domain-adaptive question-answering model described in the above embodiment, an embodiment of the present invention also provides a retrieval-enhanced domain-adaptive question-answering model construction system corresponding to the method.
[0067] Figure 3is a schematic block diagram of the structure of a retrieval-enhanced domain-adaptive question-answering model construction system provided in an embodiment of the present invention. In this embodiment, the retrieval-enhanced domain-adaptive question-answering model construction system 300 can be divided into multiple functional modules according to the functions it performs, such as Figure 3 The module referred to in the present invention refers to a series of computer program segments that can be executed by at least one processor and can complete fixed functions, and is stored in a memory.
[0068] The knowledge preprocessing module 310 is used to preprocess general domain knowledge and professional domain knowledge, and use the preprocessed general domain knowledge to construct general domain question-answer pairs.
[0069] The instruction fine-tuning module 320 is used to use the general domain question-answer pairs to perform instruction fine-tuning on the large language model to obtain a fine-tuned large language model.
[0070] The answer extraction module 330 is used to extract answer content from professional domain knowledge through a fine-tuned large language model.
[0071] The question-answer pair generation module 340 is used to generate corresponding questions according to the answer content using the fine-tuned large language model to construct professional field question-answer pairs.
[0072] The model fine-tuning module 350 is used to combine the general domain question-answer pairs and the professional domain question-answer pairs into a training set, fine-tune the fine-tuned large language model again, and repeatedly execute the answer extraction module 330, the question-answer pair generation module 340 and the model fine-tuning module 350 until the performance of the large language model meets the evaluation criteria.
[0073] The retrieval-enhanced domain-adaptive question-answering model construction system of the present embodiment is used to implement the aforementioned retrieval-enhanced domain-adaptive question-answering model construction method. Therefore, the specific implementation method of the system can be seen in the implementation example part of the basic retrieval-enhanced domain-adaptive question-answering model construction method in the previous text. Therefore, its specific implementation method can refer to the description of the corresponding embodiments of each part, which will not be elaborated here.
[0074] In addition, since the retrieval-enhanced domain-adaptive question-answering model construction system of this embodiment is used to implement the aforementioned retrieval-enhanced domain-adaptive question-answering model construction method, its function corresponds to that of the aforementioned method and will not be repeated here.
[0075] Figure 4 A schematic diagram of the structure of a terminal 400 provided in an embodiment of the present invention includes: a processor 410, a memory 420 and a communication unit 430. The processor 410 is used to implement the following steps when implementing the retrieval-enhanced domain-adaptive question-answering model construction program stored in the memory 420: S1, preprocessing general domain knowledge and professional domain knowledge, and using the preprocessed general domain knowledge to construct general domain question-answer pairs; S2, use general domain question-answer pairs to fine-tune the large language model to obtain a fine-tuned large language model; S3, extracts answer content from professional domain knowledge through a fine-tuned large language model; S4, using the fine-tuned large language model to generate corresponding questions based on the answer content and construct professional field question-answer pairs; S5: Combine the general domain question-answer pairs and the professional domain question-answer pairs as a training set, fine-tune the fine-tuned large language model again, and repeat steps S3 to S5 until the performance of the large language model meets the evaluation criteria.
[0076] The present invention also provides a computer storage medium, wherein the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM).
[0077] The computer storage medium stores a retrieval-enhanced domain-adaptive question-answering model construction program, and when the retrieval-enhanced domain-adaptive question-answering model construction program is executed by a processor, the following steps are implemented: S1, preprocessing general domain knowledge and professional domain knowledge, and using the preprocessed general domain knowledge to construct general domain question-answer pairs; S2, use general domain question-answer pairs to fine-tune the large language model to obtain a fine-tuned large language model; S3, extracts answer content from professional domain knowledge through a fine-tuned large language model; S4, using the fine-tuned large language model to generate corresponding questions based on the answer content and construct professional field question-answer pairs; S5: Combine the general domain question-answer pairs and the professional domain question-answer pairs as a training set, fine-tune the fine-tuned large language model again, and repeat steps S3 to S5 until the performance of the large language model meets the evaluation criteria.
[0078] The above disclosure is only a preferred embodiment of the present invention, but the present invention is not limited thereto. Any non-creative changes that can be thought of by a person skilled in the art, as well as several improvements and modifications made without departing from the principle of the present invention, should fall within the protection scope of the present invention.
Claims
1. A method for constructing a retrieval-enhanced domain-adaptive question-answering model, characterized in that: The following steps are involved: S1, preprocessing general domain knowledge and professional domain knowledge, and using the preprocessed general domain knowledge to construct general domain question-answer pairs; S2, use general domain question-answer pairs to fine-tune the large language model to obtain a fine-tuned large language model; S3, extracts answer content from professional domain knowledge through a fine-tuned large language model; S4, using the fine-tuned large language model to generate corresponding questions based on the answer content and construct professional field question-answer pairs; S5: Combine the general domain question-answer pairs and the professional domain question-answer pairs as a training set, fine-tune the fine-tuned large language model again, and repeat steps S3 to S5 until the performance of the large language model meets the evaluation criteria.
2. The method for constructing a retrieval-enhanced domain-adaptive question-answering model according to claim 1, characterized in that: After step S3 extracts the answer content from the professional domain knowledge through the large language model, it also includes the following steps: S3.1, calculate the matching degree between each answer content and the document to which it belongs; S3.2, calculating the extraction probability of each answer content in the document to which it belongs according to each matching degree; S3.3, filter out one or more answer contents with the highest extraction probability as the answer contents to be retained at the end for the corresponding document.
3. The method for constructing a retrieval-enhanced domain-adaptive question-answering model according to claim 2, characterized in that: Step S3.2 calculates the extraction probability of each answer content in its corresponding document according to each matching degree, specifically including: The extraction probability is calculated by the following formula, In the formula, For the Documents Middle Answer content The extraction probability of For the Answer content and its related documents The similarity of is the indicator function.
4. The method for constructing a retrieval-enhanced domain-adaptive question-answering model according to claim 2 or 3, characterized in that: In step S3.1, the matching degree between each answer content and the document to which it belongs is calculated by cosine similarity.
5. The method for constructing a retrieval-enhanced domain-adaptive question-answering model according to claim 1, characterized in that: Step S4 uses the fine-tuned large language model to generate corresponding questions according to the answer content. After constructing professional field question-answer pairs, the following steps are also included: S4.1, for each question, calculate the similarity between the question and each document, and build the document set most relevant to the question; S4.2, detect whether the answer content corresponding to the question is in the document collection. If so, retain the question-answer pair; otherwise, do not retain the question-answer pair.
6. The method for constructing a retrieval-enhanced domain-adaptive question-answering model according to claim 1, characterized in that: The fine-tuning training process for large language models uses the cross-entropy loss function to optimize the model parameters.
7. The method for constructing a retrieval-enhanced domain-adaptive question-answering model according to claim 1, characterized in that: The preprocessing of general domain knowledge and professional domain knowledge in step S1 includes text cleaning, word segmentation, part-of-speech tagging and entity recognition.
8. A retrieval-enhanced domain-adaptive question-answering model construction system, characterized in that: include: The knowledge preprocessing module is used to preprocess general domain knowledge and professional domain knowledge, and use the preprocessed general domain knowledge to construct general domain question-answer pairs; An instruction fine-tuning module is used to perform instruction fine-tuning on a large language model using general domain question-answer pairs to obtain a fine-tuned large language model. The answer extraction module is used to extract answer content from professional domain knowledge through a fine-tuned large language model; The question-answer pair generation module is used to generate corresponding questions based on the answer content using a fine-tuned large language model to construct professional field question-answer pairs; The model fine-tuning module is used to combine general-domain question-answer pairs and professional-domain question-answer pairs as a training set, fine-tune the fine-tuned large language model again, and repeatedly execute the answer extraction module, question-answer pair generation module and model fine-tuning module until the performance of the large language model meets the evaluation criteria.
9. A terminal, characterized in that: include: A memory for storing a retrieval-enhanced domain-adapted question-answering model building program; A processor, used to implement the steps of the retrieval-enhanced domain-adaptive question-answering model construction method as described in any one of claims 1 to 7 when executing the retrieval-enhanced domain-adaptive question-answering model construction program.
10. A computer-readable storage medium, characterized in that: The readable storage medium stores a retrieval-enhanced domain-adaptive question-answering model construction program, and when the retrieval-enhanced domain-adaptive question-answering model construction program is executed by the processor, the steps of the retrieval-enhanced domain-adaptive question-answering model construction method as described in any one of claims 1-7 are implemented.
Citation Information
Cited By
Industrial chain large model construction method and system based on domain knowledge enhancement
CN120851201A
Electric power knowledge retrieval system based on large language model
CN120910228A
Retrieval enhancement generation method and device for domain questions and answers, equipment and medium
CN121543725A