Question and answer model training method and device, answer generation method and device, equipment, medium and product
By constructing question-answer pairs and training a question-answer generation model using a knowledge graph, the problem of insufficient semantic understanding in complex question-answering models is solved, thereby improving the accuracy of answer generation and user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA MOBILE GRP GUANGDONG CO LTD
- Filing Date
- 2025-12-18
- Publication Date
- 2026-04-24
AI Technical Summary
Existing question-answering models struggle to fully understand the background and context of questions when dealing with complex issues such as long user conversations, leading to inaccurate answer generation and impacting user experience.
By acquiring sample data from multiple data sources, constructing multiple question-answer pairs and establishing a knowledge graph, indicating the relationships between question-answer pairs from multiple key dimensions, training the question-answer generation model, and using a retrieval augmented generation model (RAG) combined with the knowledge graph to improve the model's semantic understanding ability.
The question-answer generation model has been improved to understand the contextual information of the question-answer text more comprehensively, thereby improving the accuracy of handling complex problems and the user experience.
Smart Images

Figure CN121920483A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the technical field of large-scale models, and more specifically, to a method, apparatus, device, medium, and product for training a question-answering model and generating answers. Background Technology
[0002] With the rapid development of big data and artificial intelligence technologies, users' demand for online services is also increasing. A question-answering model refers to a large language model used for answer generation. The training process of a question-answering model aims to improve the semantic relevance between the answers generated by the model and the user's question.
[0003] In related technologies, there are limitations when dealing with complex issues such as long user conversations. They may fail to fully understand the background and context of the problem, resulting in an inaccurate answer to the complex question and affecting the user experience. Summary of the Invention
[0004] This disclosure is made in view of the above-mentioned problems. This disclosure provides a method, apparatus, device, medium, and product for training a question-answering model and generating answers.
[0005] According to one aspect of this disclosure, a method for training a question-answering model is provided, comprising: Obtain sample data from multiple data sources; wherein, the sample data includes multiple question and answer texts; Extract question statements from each of the question-and-answer texts, determine the answer statements for the question statements, and construct multiple first target question-and-answer pairs based on the question statements and their corresponding answer statements; wherein, the question statement is the statement containing the target vocabulary in the question-and-answer text, and the target vocabulary is the vocabulary that appears the required number of times in the sample data; A knowledge graph is constructed based on the first target question-answer pair; wherein the knowledge graph is used to indicate the association between the first target question-answer pair from multiple key dimensions; Based on the first target question-answer pair and the knowledge graph, the question-answer generation model is trained to obtain the trained question-answer generation model.
[0006] Furthermore, according to one aspect of this disclosure, extracting question statements from each of the question-and-answer texts and determining answer statements for the question statements includes: The sample data is segmented to obtain multiple words; A target matrix is constructed based on the aforementioned words; wherein, the target matrix is used to indicate the number of times any two words appear simultaneously in the same question-and-answer text; Based on the target matrix, the question statement is extracted from each question-and-answer text, and the statement following the question statement in the question-and-answer text is determined to be the answer statement.
[0007] Furthermore, according to one aspect of this disclosure, extracting the question statement from each of the question-and-answer texts based on the target matrix includes: Identify multiple target words in the target matrix that meet the frequency requirement; In each of the question-and-answer texts, statements that match the plurality of target words are identified as question statements.
[0008] Furthermore, according to one aspect of this disclosure, determining a statement in each of the question-and-answer text that matches the plurality of target words as a question statement includes: Based on the mapping relationship between the multiple target words and semantic elements in the question template, a regular expression is established; wherein, each semantic element in the question template corresponds to multiple target words, and the regular expression is used to indicate the matching order of multiple target words belonging to the same semantic element; The regular expression is matched with each of the question and answer texts to determine the question statement corresponding to each of the target words.
[0009] Furthermore, according to one aspect of this disclosure, constructing a knowledge graph based on the first target question-answer pair includes: Feature extraction is performed on each of the first target question-answer pairs from multiple key dimensions to obtain multiple first key features; Based on the aforementioned multiple first key features, determine the first association relationship between any two first target question-answer pairs; The knowledge graph is constructed based on the first target question-answer pair and the first association relationship.
[0010] Furthermore, according to one aspect of this disclosure, after constructing a knowledge graph based on the first target question-answer pair, the method includes: Obtain new question-and-answer text and determine the question-and-answer pair corresponding to the new question-and-answer text to obtain the second target question-and-answer pair; The features of the second target question-answer pair are extracted from the multiple key dimensions to obtain the second key features; If the multiple first key features and at least one second key feature do not match, the knowledge graph is updated to obtain an updated knowledge graph.
[0011] Furthermore, according to one aspect of this disclosure, when the plurality of first key features and at least one second key feature do not match, the knowledge graph is updated to obtain an updated knowledge graph, including: When there are multiple second target question-answer pairs, a second association relationship between any two second target question-answer pairs is determined based on the second key feature of each second target question-answer pair. The knowledge graph is updated based on the second target question-answer pair and the second association relationship to obtain the updated knowledge graph.
[0012] Furthermore, according to one aspect of this disclosure, training a question-answering generation model based on the first target question-answer pair and the knowledge graph includes: In the knowledge graph, candidate answers are determined for the question statements in each of the first target question-answer pairs, resulting in multiple first candidate answers; The question-and-answer generation model generates a second candidate answer to the question statement. The question-and-answer generation model is trained based on the first candidate answer, the second candidate answer, and the answer statement to the question.
[0013] Furthermore, according to one aspect of this disclosure, training the question-answering generation model based on the first candidate answer, the second candidate answer, and the answer statement of the question statement includes: Calculate the semantic similarity between each of the first candidate answers and the question statement; The first candidate answer whose semantic similarity meets the threshold requirement is determined as the third candidate answer; The question-and-answer generation model is trained based on the second candidate answer, the third candidate answer, and the answer statement to the question.
[0014] According to another aspect of this disclosure, an answer generation method is provided, comprising: Obtain query data from the target user; wherein the query data includes at least one target question; The query data is processed by a question-answering generation model to obtain the answer generation result for each target question; wherein the question-answering generation model is trained using the training method described above. The results of generating the answers to each of the target questions are summarized to obtain the query results of the query data.
[0015] According to another aspect of this disclosure, a training apparatus for a question-answering model is provided, comprising: The first data acquisition unit is used to acquire sample data from multiple data sources; wherein, the sample data includes multiple question and answer texts; A text processing unit is configured to extract question statements from each of the question-and-answer texts, determine answer statements for the question statements, and construct multiple first target question-and-answer pairs based on the question statements and corresponding answer statements; wherein, the question statement is the statement containing the target vocabulary in the question-and-answer text, and the target vocabulary is a word in the sample data whose frequency of occurrence meets the requirements; A construction unit is configured to construct a knowledge graph based on the first target question-answer pair; wherein the knowledge graph is used to indicate the association relationships between the first target question-answer pair from multiple key dimensions; The training unit is used to train the question-answer generation model based on the first target question-answer pair and the knowledge graph to obtain the trained question-answer generation model.
[0016] According to another aspect of this disclosure, an answer generation apparatus is provided, comprising: The second data acquisition unit is used to acquire query data from the target user; wherein the query data includes at least one target question; The second data processing unit is used to process the query data through a question-answering generation model to obtain the answer generation result for each target question; wherein the question-answering generation model is trained using the above-mentioned question-answering model training method; The summarization unit is used to summarize the answer generation results of each target question to obtain the query results of the query data.
[0017] According to another aspect of this disclosure, an electronic device is provided, comprising: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is in operation, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps in the above-described question-answering model training method or answer generation method are performed.
[0018] According to another aspect of this disclosure, a computer-readable storage medium is provided that stores a computer program, which, when executed by a processor, performs the steps in the training method or answer generation method of the above-described question-answering model.
[0019] According to another aspect of this disclosure, a computer program product is provided, which is stored in a storage medium and executed by at least one processor to implement the steps in the above-described question-answering model training method or answer generation method.
[0020] As will be described in detail below, the question-answering model training, answer generation method, apparatus, device, medium, and product according to embodiments of this disclosure can acquire multiple question-answering texts from multiple data sources and determine the phrase containing words that appear a certain number of times in each question-answering text, i.e., the question phrase. Multiple first target question-answer pairs are constructed based on the question phrases and their corresponding answer phrases. A knowledge graph can then be constructed based on the relationships between the first target question-answer pairs across multiple key dimensions. The question-answering model is trained using the first target question-answer pairs and the knowledge graph. By constructing multiple first question-answer pairs and determining the correspondence between question phrases and answer phrases, the question-answering model learns the relationships between questions and answers. Furthermore, by utilizing the constructed knowledge graph to understand the relationships between the first question-answer pairs, the question-answering model can comprehensively understand the contextual information of the question-answering text. This allows the trained question-answering model to handle more complex questions, effectively improving user experience and the accuracy of generating answers to complex questions.
[0021] It should be understood that both the foregoing general description and the following detailed description are exemplary and intended to provide further illustration of the claimed technology. Attached Figure Description
[0022] The above and other objects, features, and advantages of this disclosure will become more apparent from the more detailed description of the embodiments thereof in conjunction with the accompanying drawings. The drawings are provided to further illustrate the embodiments of this disclosure and form part of the specification. They are used together with the embodiments of this disclosure to explain the disclosure and do not constitute a limitation thereof. In the drawings, the same reference numerals generally represent the same components or steps.
[0023] Figure 1 This is a flowchart illustrating a training method for a question-answering model according to an embodiment of the present disclosure.
[0024] Figure 2 This is a flowchart illustrating an answer generation method according to an embodiment of the present disclosure.
[0025] Figure 3 This is a flowchart illustrating the overall training process of the question-answering model in the training method of the question-answering model according to an embodiment of the present disclosure.
[0026] Figure 4 This is a block diagram illustrating a training apparatus for a question-and-answer model according to an embodiment of the present disclosure.
[0027] Figure 5 This is a block diagram illustrating an answer generation apparatus according to an embodiment of the present disclosure.
[0028] Figure 6 This is a hardware block diagram illustrating an electronic device according to an embodiment of the present disclosure.
[0029] Figure 7 This is a schematic diagram illustrating a computer program product according to an embodiment of the present disclosure. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of this disclosure more apparent, exemplary embodiments according to this disclosure will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of this disclosure, and not all embodiments of this disclosure. It should be understood that this disclosure is not limited to the exemplary embodiments described herein.
[0031] To facilitate understanding of this embodiment, a training method for a question-answering model disclosed in this disclosure will first be described in detail. The execution entity of the question-answering model training method provided in this disclosure is generally an electronic device with a certain computing power, such as a terminal device, a server, or other processing device. In some possible implementations, the question-answering model training method can be implemented by a processor calling computer-readable instructions stored in memory.
[0032] See Figure 1 The diagram shows a flowchart of a training method for a question-answering model provided in this embodiment of the present disclosure. The method includes steps S101 to S104, wherein: Step S101: Obtain sample data from multiple data sources; wherein the sample data includes multiple question and answer texts.
[0033] Here, the data sources include user logs, forums, emails, and online documents. The process of obtaining sample data is not user-facing, nor does it require user input; rather, it involves multiple data sources.
[0034] The sample data can include various data types such as text. After obtaining the sample data, it is preprocessed, such as data denoising and stop word removal, so that text mining can be performed on the sample data after the preprocessing process.
[0035] Step S102: Extract question statements from each of the question-and-answer texts, determine the answer statements for the question statements, and construct multiple first target question-and-answer pairs based on the question statements and the corresponding answer statements; wherein, the question statement is the statement containing the target vocabulary in the question-and-answer text, and the target vocabulary is the vocabulary that appears the required number of times in the sample data.
[0036] Since the correspondence between questions and answers cannot be known from the question-and-answer text, this disclosure can count the number of times each word appears and compare the number of times with the frequency threshold to determine whether the number of times meets the requirements, thereby identifying the target word from the sample data. The target word can be understood as a high-frequency word.
[0037] It is worth noting that since the target vocabulary is used to identify the corresponding question statements, the target vocabulary is vocabulary related to the question; that is, the target vocabulary is the question words that appear the required number of times.
[0038] Furthermore, the statement containing the target vocabulary can be identified as the question statement, and the process of determining the answer statement for the question statement will be described exemplarily later.
[0039] In this embodiment of the disclosure, the question-answering system can extract high-frequency target words from sample data and determine the question statement corresponding to the target words, thereby determining the answer statement corresponding to the question statement, so as to construct a first target question-answer pair using the question statement and the corresponding answer statement.
[0040] Step S103: Construct a knowledge graph based on the first target question-answer pair; wherein the knowledge graph is used to indicate the association between the first target question-answer pair from multiple key dimensions.
[0041] Because the questions and answers focus on different aspects, this disclosure allows for setting multiple question dimensions for the question statements in the first target question-answer pair, and multiple answer dimensions for the answer statements in the first target question-answer pair. Both question and answer dimensions can be set according to the actual application scenario, which will be described exemplarily below.
[0042] Here, knowledge graphs can be used not only to describe the relationships between primary question-answer pairs, but also to describe the relationships between different key dimensions. A knowledge graph is a structured information system that represents knowledge in the form of a graph, abstractly representing the relationships between data to support complex queries and reasoning.
[0043] In the above implementation, the question-answering system can analyze the relationship between the first target question-answer pair from multiple key dimensions to effectively enrich the structure of the knowledge graph, form a systematic knowledge base, and facilitate the subsequent addition of dimensions for question answering.
[0044] Step S104: Based on the first target question-answer pair and the knowledge graph, train the question-answer generation model to obtain the trained question-answer generation model.
[0045] Here, the question-answering generation model is the generative model in the Retrieval-Augmented Generation (RAG) model. This question-answering generation model can be integrated into a question-answering system. The RAG model also includes a retrieval model, and further examples of the model training process will be provided later.
[0046] RAG is a technology that combines information retrieval with generative models. It aims to retrieve relevant information from large-scale datasets and generate natural language answers through generative models. RAG technology has significant advantages in enhancing the accuracy and richness of model output.
[0047] In this embodiment of the disclosure, the question-answering system uses a first target question-answer pair to provide the question-answering generation model with knowledge of the relationship between questions and answers, and uses a knowledge graph to provide the question-answering generation model with knowledge of the relationship between the first target question-answer pair from multiple key dimensions. This allows the question-answering generation model to learn knowledge from multiple dimensions, thereby improving the accuracy of the model training process and facilitating the generation of accurate answers by the question-answering generation model after training.
[0048] In the above implementation scheme, by constructing multiple first question-answer pairs, the correspondence between question statements and answer statements is determined. This helps the question-answer generation model learn the relationship between questions and answers, and utilizes the constructed knowledge graph to understand the relationship between the first question-answer pairs. This allows the question-answer generation model to fully understand the contextual information of the question-answer text, thereby enabling the trained question-answer generation model to handle more complex questions and effectively improve the user experience and the accuracy of generating answers to complex questions.
[0049] In an optional implementation, the above steps of extracting question statements from each of the question-and-answer texts and determining the answer statements for the question statements specifically include the following steps: The sample data is segmented to obtain multiple words; A target matrix is constructed based on the aforementioned words; wherein, the target matrix is used to indicate the number of times any two words appear simultaneously in the same question-and-answer text; Based on the target matrix, the question statement is extracted from each question-and-answer text, and the statement following the question statement in the question-and-answer text is determined to be the answer statement.
[0050] This disclosure can segment sample data into sentences, label the sentences, and further segment the sentences into words or phrases to obtain multiple vocabulary words, thereby realizing sentence segmentation and word segmentation operations on the data. Here, the multiple vocabulary words can refer only to question-related words, or they can include answer-related words.
[0051] However, when multiple words are involved, including question and answer terms, the constructed target matrix can be used to identify the question and answer statements, but further identification of the correspondence between the question and answer statements is needed. To address this, this disclosure calculates the similarity between the question and answer statements to distinguish their correspondence.
[0052] Therefore, when constructing the target matrix, an initial matrix can be created first. The rows of the initial matrix represent words arbitrarily selected from multiple words, and the columns represent the co-occurrence of those selected words. Then, multiple words are filled into this initial matrix, recording the number of times each pair of words appears simultaneously in the question-and-answer text, that is, the number of times any two words appear together in the same question-and-answer text.
[0053] In this context, any two words can be combined into a pair. For example, if multiple words include word a, word b, and word c, then word a and word b, word a and word c, and word b and word c can each be considered as a pair.
[0054] This disclosure utilizes Conditional Random Field (CRF) to extract question statements from each question-and-answer text. When locating the answer, the sentence or paragraph following the question statement can be extracted as the answer, i.e., the answer statement to the question statement, based on the position of the question statement in the question-and-answer text.
[0055] CRF is a probabilistic graphical model that is often used for sequence labeling problems, such as part-of-speech tagging and entity recognition in natural language processing. CRF performs well in handling pattern recognition and serialization problems in text.
[0056] After determining the answer statement to the question statement, the question statement and the corresponding answer statement can be evaluated using preset evaluation metrics. Evaluation metrics may include precision, recall, and F1 score. The evaluation results are used to measure the accuracy of finding the answer statement corresponding to the question statement.
[0057] Among them, precision indicates the proportion of answer statements that correspond to the question statement out of all answer statements, recall indicates the proportion of answer statements that correspond to the question statement out of all answer statements that correspond to the question statement, and F1 score is the harmonic mean of precision and recall.
[0058] Furthermore, user satisfaction feedback on answer statements can be collected through the user interface, enabling further optimization of the answer statement determination process and question-and-answer system from both evaluation results and satisfaction feedback perspectives.
[0059] In the above implementation, the constructed target matrix can be used to count the number of times word pairs appear in the same question and answer text, and the target matrix can be used to determine the question statement, thereby accurately finding the answer statement of the question statement, which makes it easier for the question and answer generation model to learn the relationship between the question statement and the answer statement.
[0060] In an optional implementation, the above steps, which extract the question statement from each question-and-answer text based on the target matrix, specifically include the following steps: Identify multiple target words in the target matrix that meet the frequency requirement; In each of the question-and-answer texts, statements that match the plurality of target words are identified as question statements.
[0061] Here, we can first initially filter out words related to the question in the target matrix to obtain the filtering results, and then further filter out the question words that meet the frequency requirements from the filtering results to obtain multiple target words.
[0062] Since the target matrix describes the number of times any two words appear in the same question and answer text, the process of selecting target words includes two methods. The first method is that if any two words are related to the question and the number of times both words meet the requirements, then both words are selected target words. The second method is that if any one of the words is related to the question and the number of times that word meets the requirements, then that word is determined to be a selected target word.
[0063] For the process of further filtering from the screening results, a corresponding frequency threshold can be set. When there are words in the screening results that appear in the same question and answer text more than the frequency threshold, the word is identified as the target word that meets the frequency requirement.
[0064] After identifying the target vocabulary, the sentence containing the target vocabulary is located in each question-and-answer text to obtain the question sentence.
[0065] In the above implementation, multiple frequently occurring target words are identified through the target matrix, and the question statement is determined based on the target words. This reduces the amount of computation required to process the entire question and answer text, thereby effectively improving processing efficiency.
[0066] In an optional implementation, the above steps, which identify statements in each of the question-and-answer texts that match the plurality of target words as question statements, specifically include the following steps: Based on the mapping relationship between the multiple target words and semantic elements in the question template, a regular expression is established; wherein, each semantic element in the question template corresponds to multiple target words, and the regular expression is used to indicate the matching order of multiple target words belonging to the same semantic element; The regular expression is matched with each of the question and answer texts to determine the question statement corresponding to each of the target words.
[0067] Here, a question template typically includes a trigger word and multiple semantic elements. The trigger word is the first word in the question template used to identify the question, such as how or why. Semantic elements are used to describe the relationship between target words. Specifically, semantic elements can be the action to be performed, the object to be performed, or the background information of the object to be performed, and each semantic element will correspond to multiple target words.
[0068] Based on this, target words can be added to the corresponding semantic elements to create regular expressions. The regular expression treats multiple target words of the same semantic element as a semantic set. The regular expression includes multiple semantic sets. If the target word is located at the beginning of the corresponding semantic set, it will be matched with the question and answer text first.
[0069] In this embodiment of the disclosure, regular expressions can be defined based on a question template and multiple target words, and then used to match the question and answer text to search for question statements corresponding to each target word, thereby effectively improving the accuracy and efficiency of the matching process.
[0070] In an optional implementation, the above steps involve constructing a knowledge graph based on the first target question-answer pair, specifically including the following steps: Feature extraction is performed on each of the first target question-answer pairs from multiple key dimensions to obtain multiple first key features; Based on the aforementioned multiple first key features, determine the first association relationship between any two first target question-answer pairs; The knowledge graph is constructed based on the first target question-answer pair and the first association relationship.
[0071] As mentioned above, key dimensions can include setting multiple question dimensions for the question statements in the first target question-answer pair, and setting multiple answer dimensions for the answer statements in the first target question-answer pair.
[0072] Specifically, the question dimension can be set as question category, related products, or business process steps; the answer dimension can be set as answer type, related products, or solution. It is clear that the question and answer dimensions can share the same dimensions. The settings for the question and answer dimensions can be flexibly adjusted according to the application scenario, and this disclosure does not impose any requirements on this.
[0073] Here, the first key feature refers to the entity corresponding to each key dimension in the first target question-answer pair, such as an actual cloud product or actual solution. The first key feature of each first target question-answer pair may be the same or different, that is, each first key feature corresponds to one or more first target question-answer pairs.
[0074] Furthermore, a knowledge graph can be constructed based on the first target question-answer pair and the first association relationship. The nodes of the knowledge graph represent the first target question-answer pair, and the edges of the knowledge graph represent the first association relationship, such as belonging to or involving.
[0075] After constructing the knowledge graph, the first target question-and-answer pair can be cleaned and formatted, and converted into a knowledge graph format. The processed first target question-and-answer pair can then be imported into a graph database to integrate the first target question-and-answer pair with the knowledge graph.
[0076] By using the above processing method, multiple key dimensions can be determined by combining the actual application scenario and the first target question-answer pair. This allows the determination of the first association relationship between any two first target question-answer pairs using multiple key dimensions. Based on the first target question-answer pairs and the first association relationship, a knowledge graph can be constructed to form a systematic knowledge base. This enriches the results of the knowledge graph and increases the answer dimension of the questions.
[0077] In an optional implementation, after constructing the knowledge graph based on the first target question-answer pair, the above steps specifically include the following steps: Obtain new question-and-answer text and determine the question-and-answer pair corresponding to the new question-and-answer text to obtain the second target question-and-answer pair; The features of the second target question-answer pair are extracted from the multiple key dimensions to obtain the second key features; If the multiple first key features and at least one second key feature do not match, the knowledge graph is updated to obtain an updated knowledge graph.
[0078] This disclosure provides an exemplary description of the knowledge graph updating process.
[0079] An inverted index can be built based on the relationship between key features and text identifiers. The inverted index includes the relationship between the first key feature and the text identifier of the question and answer text, as well as the relationship between the second key feature and the text identifier of the new question and answer text.
[0080] Once new question-and-answer text is obtained, the second target question-and-answer pair can be determined using the above method. This second target question-and-answer pair can then be preprocessed and its features extracted to obtain multiple second key features. The second key features of each second target question-and-answer pair may be the same or different; that is, each second key feature corresponds to one or more second target question-and-answer pairs.
[0081] When the first key feature and the second key feature match, the inverted index can be used to retrieve the question and answer text corresponding to the first key feature. The question and answer text corresponding to the first key feature and the new question and answer text are then merged to obtain the merged text. This allows the question and answer generation model to learn contextual information around the merged text, effectively improving the contextual understanding ability of the question and answer generation model.
[0082] When the first key feature and the second key feature do not match, the nodes and edges of the knowledge graph need to be dynamically updated. That is, the knowledge graph needs to be updated when multiple first key features and at least one second key feature do not match.
[0083] In this embodiment of the disclosure, new question-and-answer text can be collected in real time, and features can be extracted from the second target question-and-answer pair from multiple key dimensions to obtain multiple second key features. The first key features and the second key features are matched to identify newly added key features, and the knowledge graph is updated around the newly added key features.
[0084] In an optional implementation, the above steps involve updating the knowledge graph when the plurality of first key features and at least one second key feature do not match, to obtain an updated knowledge graph. Specifically, this includes the following steps: When there are multiple second target question-answer pairs, a second association relationship between any two second target question-answer pairs is determined based on the second key feature of each second target question-answer pair. The knowledge graph is updated based on the second target question-answer pair and the second association relationship to obtain the updated knowledge graph.
[0085] In the case where multiple first key features and at least one second key feature do not match, the second target question-answer pair here is a newly added node in the knowledge graph. Furthermore, in this case, the second association determined based on the second key feature of the second target question-answer pair is a newly added edge in the knowledge graph.
[0086] In this embodiment of the disclosure, nodes in the knowledge graph can be added using the second target question-and-answer pair, and edges in the knowledge graph can be added using the second association relationship, thereby expanding the structure of the knowledge graph. For existing nodes and edges in the knowledge graph, the relationship weights of the existing nodes and edges can also be adjusted according to the new question-and-answer text to update the existing nodes and edges in the knowledge graph.
[0087] In the above implementation, new question-and-answer text can be used to update existing nodes and edges in the knowledge graph, and new nodes and edges can be added to the knowledge graph. This allows for continuous dynamic updates to the knowledge graph based on new data, ensuring the timeliness and accuracy of the content in the knowledge graph.
[0088] In an optional implementation, the above steps, based on the first target question-answer pair and the knowledge graph, train the question-answer generation model, specifically including the following steps: In the knowledge graph, candidate answers are determined for the question statements in each of the first target question-answer pairs, resulting in multiple first candidate answers; The question-and-answer generation model generates a second candidate answer to the question statement. The question-and-answer generation model is trained based on the first candidate answer, the second candidate answer, and the answer statement to the question.
[0089] As can be seen, the first target question-answer pair includes the question statement and the answer statement for that question statement. The knowledge graph can indicate the relationship between the first target question-answer pairs from multiple key dimensions. Therefore, during the training of the question-answer generation model, the question statement can be input into the question-answer generation model.
[0090] Furthermore, by using the retrieval model in the RAG model to search for candidate answers to the question statement in the knowledge graph, multiple first candidate answers are obtained. Then, a second candidate answer to the question statement is generated using the question-answering generation model (i.e., the generation model in the RAG model). The question-answering generation model can be trained using the first candidate answers, the second candidate answers, and the answer statement to the question statement.
[0091] In the above implementation, a combination of retrieval and generation models can be used to enable the trained question-answer generation model to have flexibility and semantic understanding capabilities while ensuring the accuracy of the answers.
[0092] In an optional implementation, the above steps train the question-and-answer generation model based on the first candidate answer, the second candidate answer, and the answer statement to the question statement, specifically including the following steps: Calculate the semantic similarity between each of the first candidate answers and the question statement; The first candidate answer whose semantic similarity meets the threshold requirement is determined as the third candidate answer; The question-and-answer generation model is trained based on the second candidate answer, the third candidate answer, and the answer statement to the question.
[0093] Here, the first candidate answer can be ranked by calculating the semantic similarity between it and the question statement. The higher the semantic similarity, the more relevant the first candidate answer is to the question statement. A third candidate answer relevant to the question statement is then determined based on a threshold requirement. This threshold requirement can be adjusted according to the actual application scenario; no further specific requirements are imposed.
[0094] This disclosure may also introduce a bias correction mechanism to compare the second candidate answer with the answer statement of the question. If a bias occurs, correction measures will be taken by revising the training data and dynamically adjusting the model.
[0095] In the above implementation, by calculating semantic similarity and using a bias correction mechanism, the accuracy of the answers output by the question-answering generation model can be improved, ensuring that the generated answers match the user's expectations.
[0096] Since the third candidate answer is the first candidate answer whose semantic similarity meets the threshold requirement, that is, the third candidate answer is at least one, in order to further find the optimal candidate answer among the third candidate answers, this disclosure is described exemplarily herein.
[0097] This disclosure allows users to query historical data, including query content, query time, query frequency, and other information. It calculates the query frequency for each question and analyzes the frequency of user queries. Then, based on the query frequency, it identifies frequently asked questions that users are highly interested in and selects the optimal candidate answer from the third-ranked candidate answers.
[0098] In the process of selecting the optimal candidate answer, the query frequency of the question statement and the semantic similarity between the third candidate answer and the question statement can be determined. The first processing result is obtained by combining the query frequency and semantic similarity. The third candidate answer is then sorted according to the first processing result, and the third candidate answer with the highest first processing result is taken as the optimal candidate answer.
[0099] Furthermore, this disclosure can identify frequently queried questions by users through the query frequency of each question in historical data, i.e., hot questions, and determine the hot answers corresponding to the hot questions from historical data, so as to increase the weight of hot answers in the third candidate answers, thereby increasing the proportion of the hot answer being the optimal candidate answer.
[0100] Based on this, this disclosure can combine the weight of hot answers, query frequency and semantic similarity to obtain a second processing result, and then sort the third candidate answers according to the second processing result, and determine the third candidate answer with the highest second processing result as the optimal candidate answer.
[0101] In the above implementation, the frequency analysis and candidate answer selection process can identify hot topics of high user interest and prioritize the selection of hot answers corresponding to these hot topics. Furthermore, by combining query frequency and semantic similarity, the optimal candidate answer can be selected. This helps to optimize the answer selection process of the question-and-answer system, thereby effectively improving the accuracy and usability of the system.
[0102] This disclosure integrates technologies such as natural language processing, deep learning, knowledge graphs, RAG technology, and cloud services to construct a comprehensive, efficient, and intelligent question-answering system. This system provides personalized and accurate question-answering services while prioritizing user privacy and data security.
[0103] The system architecture design of the question-and-answer system is as follows: (1) User interface: Design a user interface that supports multiple input methods such as text and voice, and can provide multilingual support to meet the needs of different users.
[0104] (2) Cloud service platform: Build a flexible cloud service architecture, dynamically adjust resource allocation according to user load, and ensure high availability and data security of the system.
[0105] (3) Data processing layer: Natural language processing is used to preprocess the sample data (word segmentation, noise reduction, etc.), and deep learning models are used to perform intent recognition and question sentence extraction in order to understand user needs.
[0106] (4) Knowledge graph: Construct a structured knowledge base to store question-answer pairs in different scenarios, which can be used for fast retrieval and to describe the relationship between different question-answer pairs.
[0107] (5) Intelligent question answering engine: integrates large models for text generation and polishing; combined with RAG technology, it realizes intelligent question answering with enhanced retrieval.
[0108] See Figure 2 The diagram shows a flowchart of an answer generation method provided in this embodiment of the present disclosure. The method includes steps S201 to S203, wherein: Step S201: Obtain the query data of the target user; wherein the query data includes at least one target question.
[0109] Step S202: Process the query data using a question-answering generation model to obtain the answer generation result for each target question; wherein the question-answering generation model is trained using the above-mentioned question-answering model training method.
[0110] Step S203: Summarize the answer generation results for each target question to obtain the query results for the query data.
[0111] In the above implementation, multiple target questions are processed by the question-answering generation model to obtain the answer generation result for each target question. The answer generation result is then summarized to obtain the query result for the query data, enabling the trained question-answering generation model to handle more complex questions.
[0112] The following is combined Figure 3The training process of the above question-answering model is described in detail below: S301: Obtain sample data from multiple data sources.
[0113] The sample data includes multiple question and answer texts.
[0114] S302: Extract the question statement from each question-and-answer text and determine the answer statement for the question statement.
[0115] Among them, the question statement is the statement containing the target word in the question and answer text, and the target word is the word that appears in the sample data with a required frequency.
[0116] S303: Construct multiple first-target question-answer pairs based on question statements and corresponding answer statements.
[0117] S304: Extract features from each first target question-answer pair from multiple key dimensions to obtain multiple first key features.
[0118] S305: Determine the first association relationship between any two first target question-answer pairs based on multiple first key features.
[0119] S306: Construct a knowledge graph based on the first target question-answer pair and the first association relationship.
[0120] Among them, knowledge graphs are used to indicate the relationships between the first target question-answer pairs from multiple key dimensions.
[0121] S307: Based on the first target question-answer pair and the knowledge graph, the question-answer generation model is trained to obtain the trained question-answer generation model.
[0122] As can be seen from the above description, the technical solution disclosed herein has the following advantages: (1) Improved user experience and problem-solving efficiency: The question-and-answer system can answer users' questions more accurately and quickly, can quickly locate user problems and give accurate answers, effectively shorten the time users spend looking for answers, improve the efficiency of problem-solving, and can also provide automated customer service without waiting for human intervention, thereby effectively improving the response speed and coverage of customer service.
[0123] (2) Improve the accuracy of information retrieval: By combining retrieval and generation models, the intelligent question-answering system can quickly and accurately retrieve relevant information from the knowledge graph and generate precise answers. This disclosure also uses big data analysis of user query frequency and hot issues to better understand user needs and market trends, thereby improving decision-making efficiency and agility.
[0124] Based on the same inventive concept, this disclosure also provides a training device for a question-answering model corresponding to the training method of the question-answering model. Since the principle of the device in this disclosure for solving problems is similar to the training method of the question-answering model described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0125] Reference Figure 4 The diagram shown is a schematic of a training device for a question-answering model provided in an embodiment of this disclosure. The device includes: a first data acquisition unit 40, a text processing unit 41, a construction unit 42, and a training unit 43; wherein: The first data acquisition unit is used to acquire sample data from multiple data sources; wherein, the sample data includes multiple question and answer texts; A text processing unit is configured to extract question statements from each of the question-and-answer texts, determine answer statements for the question statements, and construct multiple first target question-and-answer pairs based on the question statements and corresponding answer statements; wherein, the question statement is the statement containing the target vocabulary in the question-and-answer text, and the target vocabulary is a word in the sample data that appears multiple times to meet the requirements; A construction unit is configured to construct a knowledge graph based on the first target question-answer pair; wherein the knowledge graph is used to indicate the association relationships between the first target question-answer pair from multiple key dimensions; The training unit is used to train the question-answer generation model based on the first target question-answer pair and the knowledge graph to obtain the trained question-answer generation model.
[0126] In one possible implementation, the device is also used for: The sample data is segmented to obtain multiple words; A target matrix is constructed based on the aforementioned words; wherein, the target matrix is used to indicate the number of times any two words appear simultaneously in the same question-and-answer text; Based on the target matrix, the question statement is extracted from each question-and-answer text, and the statement following the question statement in the question-and-answer text is determined to be the answer statement.
[0127] In one possible implementation, the device is also used for: Identify multiple target words in the target matrix that meet the frequency requirement; In each of the question-and-answer texts, statements that match the plurality of target words are identified as question statements.
[0128] In one possible implementation, the device is also used for: Based on the mapping relationship between the multiple target words and semantic elements in the question template, a regular expression is established; wherein, each semantic element in the question template corresponds to multiple target words, and the regular expression is used to indicate the matching order of multiple target words belonging to the same semantic element; The regular expression is matched with each of the question and answer texts to determine the question statement corresponding to each of the target words.
[0129] In one possible implementation, the device is also used for: Feature extraction is performed on each of the first target question-answer pairs from multiple key dimensions to obtain multiple first key features; Based on the aforementioned multiple first key features, determine the first association relationship between any two first target question-answer pairs; The knowledge graph is constructed based on the first target question-answer pair and the first association relationship.
[0130] In one possible implementation, the device is also used for: Obtain new question-and-answer text and determine the question-and-answer pair corresponding to the new question-and-answer text to obtain the second target question-and-answer pair; The features of the second target question-answer pair are extracted from the multiple key dimensions to obtain the second key features; If the multiple first key features and at least one second key feature do not match, the knowledge graph is updated to obtain an updated knowledge graph.
[0131] In one possible implementation, the device is also used for: When there are multiple second target question-answer pairs, a second association relationship between any two second target question-answer pairs is determined based on the second key feature of each second target question-answer pair. The knowledge graph is updated based on the second target question-answer pair and the second association relationship to obtain the updated knowledge graph.
[0132] In one possible implementation, the device is also used for: In the knowledge graph, candidate answers are determined for the question statements in each of the first target question-answer pairs, resulting in multiple first candidate answers; The question-and-answer generation model generates a second candidate answer to the question statement. The question-and-answer generation model is trained based on the first candidate answer, the second candidate answer, and the answer statement to the question.
[0133] In one possible implementation, the device is also used for: Calculate the semantic similarity between each of the first candidate answers and the question statement; The first candidate answer whose semantic similarity meets the threshold requirement is determined as the third candidate answer; The question-and-answer generation model is trained based on the second candidate answer, the third candidate answer, and the answer statement to the question.
[0134] Based on the same inventive concept, this disclosure also provides an answer generation device corresponding to the answer generation method. Since the principle of the device in this disclosure for solving the problem is similar to the answer generation method described above, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0135] Reference Figure 5 The diagram shown is a schematic representation of an answer generation device provided in an embodiment of this disclosure. The device includes: a second data acquisition unit 50, a data processing unit 51, and a summarization unit 52; wherein: The second data acquisition unit is used to acquire query data from the target user; wherein the query data includes at least one target question; A data processing unit is used to process the query data through a question-answering generation model to obtain the answer generation result for each target question; wherein the question-answering generation model is trained using the above-mentioned question-answering model training method; The summarization unit is used to summarize the answer generation results of each target question to obtain the query results of the query data.
[0136] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.
[0137] Corresponding to Figure 1 Training methods for question-answering models in China and Figure 2 In addition to the answer generation method in the present disclosure, this embodiment also provides an electronic device 60, such as... Figure 6 The diagram shown is a structural schematic of an electronic device 60 provided in an embodiment of this disclosure, including: The system includes a processor 61, a memory 62, and a bus 63. The memory 62 stores execution instructions and includes main memory 621 and external memory 622. The main memory 621, also called internal memory, temporarily stores the computational data in the processor 61, as well as data exchanged with external memory such as a hard disk. The processor 61 exchanges data with the external memory 622 through the main memory 621. When the electronic device 60 is running, the processor 61 communicates with the memory 62 through the bus 63, causing the processor 61 to execute the following instructions: Obtain sample data from multiple data sources; wherein, the sample data includes multiple question and answer texts; Extract question statements from each of the question-and-answer texts, determine the answer statements for the question statements, and construct multiple first target question-and-answer pairs based on the question statements and their corresponding answer statements; wherein, the question statement is the statement containing the target vocabulary in the question-and-answer text, and the target vocabulary is the vocabulary that appears the required number of times in the sample data; A knowledge graph is constructed based on the first target question-answer pair; wherein the knowledge graph is used to indicate the association between the first target question-answer pair from multiple key dimensions; Based on the first target question-answer pair and the knowledge graph, the question-answer generation model is trained to obtain the trained question-answer generation model.
[0138] Alternatively, follow these steps: Obtain query data from the target user; wherein the query data includes at least one target question; The query data is processed by a question-answering generation model to obtain the answer generation result for each target question; wherein the question-answering generation model is trained using the training method described above. The results of generating the answers to each of the target questions are summarized to obtain the query results of the query data.
[0139] This disclosure also provides a computer-readable storage medium storing a computer program. When a processor runs the computer program, it executes the steps of the question-answering model training method and answer generation method described in the above method embodiments. The storage medium can be a volatile or non-volatile computer-readable storage medium.
[0140] This disclosure also provides a computer program product 70, such as... Figure 7 The diagram shown is a schematic diagram of the structure of a computer program product 70 provided in an embodiment of this disclosure. The computer program product 70 carries a computer program 71. The program included in the computer program 71 can be used to execute the steps of the question-answering model training method and answer generation method described in the above method embodiments. For details, please refer to the above method embodiments, which will not be repeated here.
[0141] The above description, with reference to the accompanying drawings, outlines a method, apparatus, device, medium, and product for training and generating answers using a question-answering model according to embodiments of the present disclosure. First, sample data from multiple data sources is acquired; wherein the sample data includes multiple question-answer texts. Then, question statements are extracted from each question-answer text, and answer statements are determined. Multiple first target question-answer pairs are constructed based on the question statements and their corresponding answer statements; wherein the question statements are statements containing target words in the question-answer texts, and the target words are words in the sample data whose frequency of occurrence meets a requirement. Second, a knowledge graph is constructed based on the first target question-answer pairs; wherein the knowledge graph is used to indicate the relationships between the first target question-answer pairs from multiple key dimensions. Finally, the question-answering generation model is trained based on the first target question-answer pairs and the knowledge graph to obtain a trained question-answering generation model. By constructing multiple first question-answer pairs, the correspondence between question statements and answer statements is determined. This helps the question-answer generation model learn the relationship between questions and answers, and utilizes the constructed knowledge graph to understand the relationship between the first question-answer pairs. This allows the question-answer generation model to fully understand the contextual information of the question-answer text, thereby enabling the trained question-answer generation model to handle more complex questions and effectively improve user experience and the accuracy of generating answers to complex questions.
[0142] The basic principles of this disclosure have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.
[0143] The block diagrams of devices, apparatuses, devices, and systems disclosed herein are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0144] Additionally, as used herein, the "or" used in a list of items beginning with "at least one" indicates a separate list, such that a list of, for example, "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not imply that the described example is preferred or better than other examples.
[0145] It should also be noted that in the systems and methods of this disclosure, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions to this disclosure.
[0146] Various changes, substitutions, and modifications can be made to the technology described herein without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of this disclosure is not limited to the specific aspects of the processes, machines, manufactures, events, means, methods, and actions described above. Currently existing or later-developed processes, machines, manufactures, events, means, methods, or actions that perform substantially the same function or achieve substantially the same result as the corresponding aspects described herein can be utilized. Therefore, the appended claims include such processes, machines, manufactures, events, means, methods, or actions within their scope.
[0147] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of this disclosure. Therefore, this disclosure is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0148] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this disclosure to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A training method for a question-answering model, characterized in that, include: Obtain sample data from multiple data sources; wherein, the sample data includes multiple question and answer texts; Extract question statements from each of the question-and-answer texts, determine the answer statements for the question statements, and construct multiple first target question-and-answer pairs based on the question statements and their corresponding answer statements; wherein, the question statement is the statement containing the target vocabulary in the question-and-answer text, and the target vocabulary is the vocabulary that appears the required number of times in the sample data; A knowledge graph is constructed based on the first target question-answer pair; wherein the knowledge graph is used to indicate the association between the first target question-answer pair from multiple key dimensions; Based on the first target question-answer pair and the knowledge graph, the question-answer generation model is trained to obtain the trained question-answer generation model.
2. The method according to claim 1, characterized in that, The step of extracting question statements from each of the question-and-answer texts and determining the answer statements for the question statements includes: The sample data is segmented to obtain multiple words; A target matrix is constructed based on the aforementioned words; wherein, the target matrix is used to indicate the number of times any two words appear simultaneously in the same question-and-answer text; Based on the target matrix, the question statement is extracted from each question-and-answer text, and the statement following the question statement in the question-and-answer text is determined to be the answer statement.
3. The method according to claim 2, characterized in that, The step of extracting the question statement from each question-and-answer text based on the target matrix includes: Identify multiple target words in the target matrix that meet the frequency requirement; In each of the question-and-answer texts, statements that match the plurality of target words are identified as question statements.
4. The method according to claim 3, characterized in that, The step of determining the statement that matches the plurality of target words in each of the question-and-answer texts as the question statement includes: Based on the mapping relationship between the multiple target words and semantic elements in the question template, a regular expression is established; wherein, each semantic element in the question template corresponds to multiple target words, and the regular expression is used to indicate the matching order of multiple target words belonging to the same semantic element; The regular expression is matched with each of the question and answer texts to determine the question statement corresponding to each of the target words.
5. The method according to claim 1, characterized in that, The construction of the knowledge graph based on the first target question-answer pair includes: Feature extraction is performed on each of the first target question-answer pairs from multiple key dimensions to obtain multiple first key features; Based on the aforementioned multiple first key features, determine the first association relationship between any two first target question-answer pairs; The knowledge graph is constructed based on the first target question-answer pair and the first association relationship.
6. The method according to claim 5, characterized in that, After constructing a knowledge graph based on the first target question-answer pair, the process includes: Obtain new question-and-answer text and determine the question-and-answer pair corresponding to the new question-and-answer text to obtain the second target question-and-answer pair; The features of the second target question-answer pair are extracted from the multiple key dimensions to obtain the second key features; If the multiple first key features and at least one second key feature do not match, the knowledge graph is updated to obtain an updated knowledge graph.
7. The method according to claim 6, characterized in that, The step of updating the knowledge graph when the multiple first key features and at least one second key feature do not match, to obtain an updated knowledge graph, includes: When there are multiple second target question-answer pairs, a second association relationship between any two second target question-answer pairs is determined based on the second key feature of each second target question-answer pair. The knowledge graph is updated based on the second target question-answer pair and the second association relationship to obtain the updated knowledge graph.
8. The method according to claim 1, characterized in that, The step of training the question-answer generation model based on the first target question-answer pair and the knowledge graph includes: In the knowledge graph, candidate answers are determined for the question statements in each of the first target question-answer pairs, resulting in multiple first candidate answers; The question-and-answer generation model generates a second candidate answer to the question statement. The question-and-answer generation model is trained based on the first candidate answer, the second candidate answer, and the answer statement to the question.
9. The method according to claim 8, characterized in that, The step of training the question-and-answer generation model based on the first candidate answer, the second candidate answer, and the answer statement to the question statement includes: Calculate the semantic similarity between each of the first candidate answers and the question statement; The first candidate answer whose semantic similarity meets the threshold requirement is determined as the third candidate answer; The question-and-answer generation model is trained based on the second candidate answer, the third candidate answer, and the answer statement to the question.
10. A method for generating answers, characterized in that, include: Obtain query data from the target user; wherein the query data includes at least one target question; The query data is processed by a question-answering generation model to obtain an answer generation result for each target question; wherein the question-answering generation model is trained by the training method of the question-answering model according to any one of claims 1 to 9. The results of generating the answers to each of the target questions are summarized to obtain the query results of the query data.
11. A training device for a question-answering model, characterized in that, include: The first data acquisition unit is used to acquire sample data from multiple data sources; wherein, the sample data includes multiple question and answer texts; A text processing unit is configured to extract question statements from each of the question-and-answer texts, determine answer statements for the question statements, and construct multiple first target question-and-answer pairs based on the question statements and corresponding answer statements; wherein, the question statement is the statement containing the target vocabulary in the question-and-answer text, and the target vocabulary is a word in the sample data whose frequency of occurrence meets the requirements; A construction unit is configured to construct a knowledge graph based on the first target question-answer pair; wherein the knowledge graph is used to indicate the association relationships between the first target question-answer pair from multiple key dimensions; The training unit is used to train the question-answer generation model based on the first target question-answer pair and the knowledge graph to obtain the trained question-answer generation model.
12. An answer generation device, characterized in that, include: The second data acquisition unit is used to acquire query data from the target user; wherein the query data includes at least one target question; A data processing unit is configured to process the query data using a question-answering generation model to obtain an answer generation result for each target question; wherein the question-answering generation model is trained using the training method for the question-answering model described in any one of claims 1 to 9. The summarization unit is used to summarize the answer generation results of each target question to obtain the query results of the query data.
13. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the training method for the question-answering model as described in any one of claims 1 to 9; or perform the steps of the answer generation method as described in claim 10.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the training method for the question-answering model as described in any one of claims 1 to 9; or performs the steps of the answer generation method as described in claim 10.
15. A computer program product, characterized in that, The computer program product is stored in a storage medium, and the program product is executed by at least one processor to implement the steps of the training method for the question-answering model as described in any one of claims 1 to 9; or to implement the steps of the answer generation method as described in claim 10.