A method for training a question and answer model and related apparatuses

CN115510215BActive Publication Date: 2026-08-18AGRICULTURAL BANK OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211303983.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-24
Publication Date
2026-08-18
Estimated Expiration
2042-10-24

AI Technical Summary

Technical Problem

[0003]相关技术中的问答工具主要是根据用户提供的问题的关键词,先搜索匹配得到一定的结果,然后还需要人工来阅读才能确定最合适的问题答案,这一方面会导致问答效率较低,另一方面会导致问答结果可靠性较低,故如何提供一种能够准确识别用户意图且能够准确回答的问答工具是目前亟需解决的问题

Benefits of technology

[0019]本申请实施例提供了一种问答模型的训练方法,先获取原始问题样本和对应的答案样本,答案样本为原始问题样本的正确答案;再对原始问题样本进行文本增强处理,得到对应的多个扩充问题样本,文本增强处理为改变原始问题样本的文本内容且不改变原始问题样本的文本语义;然后对多个扩充问题样本分别进行意图识别处理,确定多个扩充问题样本对应的问题领域;将多个扩充问题样本、多个扩充问题样本对应的问题领域和答案样本关联存储至问答模型的数据库。基于上述方案,一方面通过文本增强方式能够给问答模型提供大量的训练样本,另一方面通过意图识别方式能够提高问答模型的准确性,即能够得到一种能准确识别用户意图且能准确回答的问答模型。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115510215B_ABST
    Figure CN115510215B_ABST
Patent Text Reader

Abstract

The application provides a training method of a question and answer model and related devices, the method comprising: first obtaining an original question sample and a corresponding answer sample, the answer sample being a correct answer of the original question sample; then performing text enhancement processing on the original question sample to obtain a plurality of expanded question samples, the text enhancement processing being changing the text content of the original question sample without changing the text semantics of the original question sample; then performing intent recognition processing on the plurality of expanded question samples respectively to determine the problem fields corresponding to the plurality of expanded question samples; and storing the plurality of expanded question samples, the problem fields corresponding to the plurality of expanded question samples and the answer sample in a database of the question and answer model. In the above scheme, a large number of training samples can be provided for the question and answer model through the text enhancement method, and the accuracy of the question and answer model can be improved through the intent recognition method, that is, a question and answer model capable of accurately identifying user intent and accurately answering can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of model training, specifically to a training method and related apparatus for a question-answering model. Background Technology

[0002] With the rapid development of internet technology, the amount of information on the internet has exploded, and people need to use question-and-answer tools to obtain the information they need from this massive amount of data.

[0003] Question-answering tools in related technologies mainly rely on keywords provided by users to search and match certain results. However, human review is still required to determine the most appropriate answer. This leads to low efficiency and low reliability of the results. Therefore, providing a question-answering tool that can accurately identify user intent and provide accurate answers is an urgent problem to be solved. Summary of the Invention

[0004] This application provides a training method and related apparatus for a question-answering model, which can produce a question-answering tool that can accurately identify user intent and provide accurate answers.

[0005] In view of this, the first aspect of the embodiments of this application provides a method for training a question-answering model, including:

[0006] Obtain the original question sample and the corresponding answer sample, wherein the answer sample is the correct answer to the original question sample;

[0007] The original question sample is subjected to text enhancement processing to obtain multiple corresponding expanded question samples. The text enhancement processing changes the text content of the original question sample without changing the text semantics of the original question sample.

[0008] The intent recognition process is performed on each of the multiple expanded question samples to determine the question domain corresponding to the multiple expanded question samples;

[0009] The multiple expanded question samples, the corresponding question domains of the multiple expanded question samples, and the answer samples are associated and stored in the database of the question-answering model.

[0010] A second aspect of this application provides a training apparatus for a question-answering model, comprising:

[0011] An acquisition unit is used to acquire an original question sample and a corresponding answer sample, wherein the answer sample is the correct answer to the original question sample;

[0012] The text enhancement unit is used to perform text enhancement processing on the original question sample to obtain multiple corresponding expanded question samples. The text enhancement processing changes the text content of the original question sample without changing the text semantics of the original question sample.

[0013] An intent recognition unit is used to perform intent recognition processing on the plurality of expanded question samples respectively, and to determine the question domain corresponding to the plurality of expanded question samples respectively;

[0014] The storage unit is used to associate and store the plurality of expanded question samples, the question domains corresponding to the plurality of expanded question samples, and the answer samples in the database of the question-answering model.

[0015] A third aspect of this application provides an electronic device, including:

[0016] Memory, used to store executable instructions;

[0017] The processor, when executing executable instructions stored in the memory, implements the training method of the question-answering model provided in the embodiments of this application.

[0018] A fourth aspect of this application provides a computer-readable medium storing executable instructions for implementing a training method for a question-answering model provided in this application when executed by a processor.

[0019] This application provides a training method for a question-answering model. First, original question samples and corresponding answer samples are obtained, where the answer samples are the correct answers to the original question samples. Then, text enhancement processing is performed on the original question samples to obtain multiple expanded question samples. This text enhancement processing modifies the text content of the original question samples without altering their semantics. Next, intent recognition processing is performed on each of the multiple expanded question samples to determine the corresponding question domains. Finally, the multiple expanded question samples, their corresponding question domains, and the answer samples are associated and stored in the question-answering model's database. Based on this approach, on the one hand, text enhancement provides a large number of training samples for the question-answering model; on the other hand, intent recognition improves the accuracy of the question-answering model, resulting in a question-answering model that can accurately identify user intent and provide accurate answers. Attached Figure Description

[0020] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0021] Figure 1 This is a flowchart illustrating a training method for a question-answering model provided in an embodiment of this application;

[0022] Figure 2 A schematic diagram of a data crawling process provided in an embodiment of this application;

[0023] Figure 3 A schematic diagram of a text enhancement process provided for an embodiment of this application;

[0024] Figure 4 A schematic diagram of an intent recognition process provided for an embodiment of this application;

[0025] Figure 5 A schematic diagram of a knowledge extraction process provided for an embodiment of this application;

[0026] Figure 6 This is a schematic diagram of a knowledge fusion process provided in an embodiment of this application;

[0027] Figure 7 This is a schematic diagram of a training device for a question-answering model provided in an embodiment of this application. Detailed Implementation

[0028] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present application.

[0029] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0030] Question-answering tools in related technologies mainly rely on keywords in the question to first match and search for certain results. Then, human review is required to determine the most appropriate answer, which leads to low efficiency and low reliability of the results.

[0031] In view of this, embodiments of this application provide a training method and related apparatus for a question-answering model, which can obtain a question-answering tool that can accurately identify user intent and provide accurate answers.

[0032] The following describes a training method for a question-answering model provided in this application through method embodiments, such as... Figure 1 As shown, Figure 1 This is a flowchart of a training method for a question-answering model provided in an embodiment of this application. The method includes:

[0033] S101. Obtain the original question sample and the corresponding answer sample. The answer sample is the correct answer to the original question sample.

[0034] The original question sample refers to the question sample obtained from public websites, etc. When obtaining the question sample, it is also necessary to obtain the correct answer corresponding to the original question sample as the corresponding answer sample. The original question sample and the answer sample can be used as training samples for the question answering model.

[0035] It's important to note that the demand for question-and-answer tools in vertical fields has increased significantly. "Vertical field" is a relative concept to a general field, referring to a specific, concrete area, such as healthcare, law, military, or customer service. Therefore, when a question-and-answer tool is applied to a vertical field, it can obtain original question samples and corresponding answer samples from relevant institutions within that field. For example, when the vertical field is financial customer service, the original question samples and corresponding answer samples can be obtained from the bank's internal database.

[0036] In some embodiments, the method for obtaining original question samples and corresponding answer samples includes:

[0037] We used a data crawling method to obtain original question samples and corresponding answer samples.

[0038] Specifically, data crawling can be used to scrape raw question and answer samples from public websites, which can then be used as the raw training data for the question-answering model. For example, the Scrapy framework can be used for data crawling, and Redis can be used to deduplicate the crawled data requests. Figure 2 As shown, Figure 2 This application provides a schematic diagram of a data crawling process, the specific steps of which include:

[0039] Step 1: Obtain the original page information from the Internet;

[0040] Step 2: Download the original page into the Scrapy core engine using a downloader;

[0041] Step 3: The task manager stores and schedules the acquired requests through Redis, and stores crawled items for subsequent processing. Redis provides data structures including lists, sets, sorted sets, and hashes, along with methods specifically for manipulating these data structures. The optimizations made to the Scrapy framework are as follows: using Redis's own data types to store the queue of captured URLs avoids duplicate crawling.

[0042] Step 4: Use a web crawler to store the downloaded web pages in a MySQL database.

[0043] S102. Perform text enhancement processing on the original question samples to obtain multiple corresponding expanded question samples. The text enhancement processing changes the text content of the original question samples without changing the text semantics of the original question samples.

[0044] Text augmentation involves changing the text content of the original question without altering the semantics of the original question sample. In other words, by augmenting the text of the original question sample, we can obtain richer, expanded question samples to better train the model.

[0045] In some embodiments, to improve text enhancement processing, the method includes the following steps for obtaining multiple expanded question samples by performing text enhancement processing on the original question sample:

[0046] Based on the text content of the original question sample, text enhancement processing is performed on the original question sample to obtain multiple first expanded question samples;

[0047] Convert the original problem sample into a problem vector sample;

[0048] Based on the vector content of the question vector samples, text enhancement processing is performed on the question vector samples to obtain multiple expanded vector samples;

[0049] Multiple augmented vector samples are converted into second augmented problem samples.

[0050] Specifically, in order to obtain more expanded problem samples and achieve better text enhancement effects, such as Figure 3 As shown, Figure 3This is a flowchart illustrating a text enhancement process provided in an embodiment of this application. On one hand, this application enhances the original text based on the text content of the original question sample to obtain multiple first expanded question samples. On the other hand, it first filters the original question samples through a classifier, converts them into vector form to obtain question vector samples, enhances the question vector samples, and then processes the vectors back into text to obtain multiple second expanded question samples. Both the multiple first expanded question samples and the multiple second expanded question samples can be used for subsequent intent recognition.

[0051] This application integrates text enhancement methods based on vector content and text enhancement methods based on text content. Text enhancement operations are performed at different stages of text-to-vector and text-to-text encoding and decoding. The multi-segment enhancement method is used to make up for the shortcomings of single text enhancement and achieve better text enhancement results.

[0052] In some embodiments, the method includes performing text enhancement processing on the original question sample based on its text content to obtain multiple first expanded question samples:

[0053] Based on the text content of the original question sample, the original question sample is subjected to multiple reverse translation processes to obtain multiple first expanded question samples. The reverse translation process involves translating the text content into a preset language and then translating it back into the original language.

[0054] To obtain more first-level augmented question samples, multiple reverse translation processes can be performed. Reverse translation involves translating the text content of the question sample into another language and then translating it back into the original language to obtain a first-level augmented question sample. Reverse translation can generate multiple interpretations while preserving the semantics of the text, thus significantly improving text augmentation capabilities.

[0055] S103. Perform intent recognition processing on multiple expanded question samples to determine the question domains corresponding to the multiple expanded question samples.

[0056] To improve the accuracy of question-answering models, intent recognition processing can be performed on multiple extended question samples, and these samples can be classified to determine the corresponding question domains. This allows the appropriate question answer to be determined within the corresponding question domain when using the question-answering model, thereby improving the accuracy of the model.

[0057] In some embodiments, the method includes performing intent recognition processing on multiple expanded question samples to determine the question domain corresponding to the multiple expanded question samples, wherein the method comprises:

[0058] Text embedding is performed on the expanded question samples to obtain embedded expanded question samples;

[0059] The embedded augmentation problem samples are encoded to obtain encoded augmentation problem samples;

[0060] Feature extraction is performed on the coded augmentation problem samples to obtain the features corresponding to the augmentation problem samples;

[0061] The features are processed by a fully connected layer to obtain the global features corresponding to the expanded problem samples;

[0062] Intent recognition processing is performed on global features to determine the problem domain corresponding to the expanded problem samples.

[0063] Specifically, such as Figure 4 As shown, Figure 4 This is a schematic diagram of an intent recognition process provided in an embodiment of this application. The intent recognition process includes text embedding, encoding processing, fully connected feature processing, and intent recognition.

[0064] Step 1: Text Embedding

[0065] The extended problem samples processed are natural language text, requiring text embedding. First, the original sentence sequence is segmented into a token sequence through word segmentation. The special character at the beginning of the token sequence is used to store the semantic information of the entire input sequence. Then, using the sequence information, positional embeddings are added to encode the positional information. Finally, the tokens and embeddings are summed to obtain the input embedding result.

[0066] Step 2: Encoding Processing

[0067] In practice, since the Bidirectional Encoder Representations from Transformer (BERT) model can obtain context-related sentence representations through two training tasks: masking the language model and predicting the next sentence, the variable encoder structure of BERT can be used to obtain context-related sequence encodings, and a common pre-trained model can be used as the initial parameters of the encoder.

[0068] Step 3: Feature Extraction

[0069] Most intent recognition models in related technologies are based on BERT models and Bi-directional Long Short-Term Memory (BiLSTM) models. Considering the advantages of capsule networks, this application integrates capsule networks into existing models and proposes an intent recognition model based on pre-training, capsule networks and BiLSTM. For the encoded vector information, the feature extractor provided in this application is used to extract features.

[0070] The feature extractor consists of a capsule network with a dynamic routing mechanism. The main features of the capsule structure are vector input and vector output, while ordinary neurons have vector input and scalar output. Therefore, the vector output from the capsule expresses richer features than the scalar output from the neuron. The capsule network uses a dynamic routing algorithm, the pseudocode of which is: the output of the dynamic routing mechanism is a high-level capsule that preserves important features of the sentence sequence during iteration and continuously adjusts the obtained features using a weight matrix. Finally, a vector output representing the sentence sequence serves as the input to the intent recognizer.

[0071] Furthermore, after feature extraction in this application, a fully connected layer is added to obtain the corresponding global features based on the features of the expanded problem sample. The global features can more comprehensively reflect the features of the expanded problem sample, thereby playing a role in further strengthening the extracted features and making the global features better express the semantics of the expanded problem sample.

[0072] Step 4: Intent Recognition

[0073] This application can use a recurrent neural network (Long Short Term Memory, LSTM) structure for intent recognition. LSTM has a better ability to capture long-term dependencies than recurrent neural networks (RNNs). That is, it can calculate an output vector based on the current input and the output of the previous unit, and then use it as the input of the next unit. The output of the hidden layer is used to perform intent recognition and determine the problem domain corresponding to the expanded problem sample.

[0074] S104. Associate and store multiple extended question samples, the corresponding question domains and answer samples of the multiple extended question samples into the database of the question-answering model.

[0075] After obtaining multiple expanded question samples and determining the corresponding question domains, in order to facilitate the subsequent application of the question-answering model, the multiple expanded question samples, the corresponding question domains, and the answer samples can be associated and stored in the database of the question-answering model so that the question-answering model can be directly applied later.

[0076] In some embodiments, knowledge extraction processing can be performed on the expanded problem sample to obtain multiple entities corresponding to the expanded problem sample, as well as the relationships between the multiple entities, where the entities are semantic words;

[0077] By performing knowledge fusion processing on multiple entities and combining the relationships between them, a simplified expanded problem sample corresponding to the expanded problem sample is obtained. The knowledge fusion processing involves fusing entities with the same semantics.

[0078] The simplified and expanded question samples, the corresponding question domains of the expanded question samples, and the answer samples are associated and stored in the database of the question-answering model.

[0079] Specifically, to extract effective information from the expanded problem samples, knowledge extraction processing can be performed on the expanded problem samples to determine the entities and relationships between them. Entities refer to semantically meaningful words in the text, such as names of people, places, organizations, products, or content with specific meanings within a particular field, such as the names of diseases, drugs, and organisms in the medical field, or specialized terms in law. Relationships refer to the connections between different entities. Entities are not independent of each other; they are often related. For example, "Zhang San" and "Company A" are respectively a person's name and an organization's name within the entity framework, and they have a certain relationship.

[0080] A triple is a tuple consisting of (entity 1, relation, entity 2). In knowledge extraction, when extracting relations between any two entities 1 and 2, if they have a relation, they can be constructed into a triple. For example, the sentence "Zhang San founded Company A" can be constructed into a triple of ("Zhang San", "founded", "Company A").

[0081] like Figure 5 As shown, Figure 5 This is a flowchart illustrating a knowledge extraction process provided in an embodiment of this application. First, it is determined whether the entity is a triple. If the same entity pair appears in many different sentences, it means that there is a certain relationship between the two entities. Then, the relationship is identified. Entities with a relationship can be stored in a temporary database, while entities without a relationship can be removed by a filter.

[0082] After determining the entities and entity relationships in the expanded problem sample, the following steps are still required:

[0083] Step 1: Since each statement may contain multiple entity pairs, after performing named entity recognition, the newly obtained entity pairs need to be matched with the previously extracted triples. If the entity pair exists in the triples, the relation in this sentence is marked as a positive sample.

[0084] Step 2: Use the dataset constructed in the previous step as the training dataset to train the classifier.

[0085] Step 3: Use the classifier obtained in Step 2 for the relation extraction task.

[0086] After knowledge extraction, multiple entities need to undergo knowledge fusion processing. Knowledge fusion processing refers to merging entities with the same semantics, that is, combining similar entities together. This application uses a segmented alignment method for entity alignment, such as... Figure 6 As shown, Figure 6 This is a schematic diagram of a knowledge fusion process provided in an embodiment of this application, and the specific steps include:

[0087] Step 1: Read entity pairs from the database.

[0088] Step 2: Calculate entity similarity using the vector-based similarity calculation method TFIDF.

[0089] Step 3: Filter and remove entities with a similarity greater than 0.8.

[0090] Step 4: Repeat step 3 until all entity pairs in the database have been processed.

[0091] The above processing can yield a concise and expanded problem sample that accurately describes the semantics of the text.

[0092] After knowledge fusion is completed, the knowledge needs to be persisted to facilitate the subsequent use of the question-answering model. Therefore, the simplified and expanded question samples, the question domains corresponding to the expanded question samples, and the answer samples can be associated and stored in the database of the question-answering model.

[0093] It should be noted that the storage format can be set as needed and is not limited to a table format. For example, a graph database can be used to store simplified and expanded question samples, as well as the corresponding question domains and answer samples, that is, the information is stored in the form of graphs instead of tables.

[0094] In some instances, after training the question-answering model is complete, the model can be invoked, including:

[0095] Obtain the target question, which is the question to be answered;

[0096] Perform intent recognition processing on the target question to determine the corresponding problem domain;

[0097] Based on the problem domain and text content of the target question, the target answer corresponding to the target question is determined by querying the database of the problem model.

[0098] After the question-answering model obtains the target question to be answered, it can perform intent recognition processing on the target question to determine the question domain corresponding to the target question, and then automatically determine the target answer based on the question domain and text content.

[0099] In some embodiments, when knowledge extraction and knowledge fusion are used during the training of the question answering model, knowledge extraction and knowledge fusion can also be performed on the target question when the question answering model is called, so as to accurately determine the textual semantics of the target question.

[0100] In summary, this application provides a training method for a question-answering model. The method includes: first, acquiring original question samples and corresponding answer samples, where the answer samples are the correct answers to the original question samples; then, performing text enhancement processing on the original question samples to obtain multiple corresponding expanded question samples, where the text enhancement processing changes the text content of the original question samples without altering their semantics; then, performing intent recognition processing on each of the multiple expanded question samples to determine the corresponding question domains; and finally, associating and storing the multiple expanded question samples, their corresponding question domains, and the answer samples in the database of the question-answering model. Based on this approach, on the one hand, text enhancement can provide a large number of training samples for the question-answering model; on the other hand, intent recognition can improve the accuracy of the question-answering model, resulting in a question-answering model that can accurately identify user intent and provide accurate answers.

[0101] The following describes a training device for a question-answering model provided in this application through a device embodiment. Figure 7 As shown, Figure 7 This is a schematic diagram of a training apparatus for a question-answering model provided in an embodiment of this application. The apparatus includes:

[0102] The acquisition unit 701 is used to acquire the original question sample and the corresponding answer sample, wherein the answer sample is the correct answer to the original question sample;

[0103] The text enhancement unit 702 is used to perform text enhancement processing on the original question sample to obtain multiple corresponding expanded question samples. The text enhancement processing changes the text content of the original question sample without changing the text semantics of the original question sample.

[0104] The intent recognition unit 703 is used to perform intent recognition processing on multiple extended question samples respectively, and determine the question domains corresponding to the multiple extended question samples respectively;

[0105] Storage unit 704 is used to associate and store multiple extended question samples, the question domains corresponding to the multiple extended question samples, and answer samples to the database of the question-answering model.

[0106] In some embodiments, in terms of performing text enhancement processing on the original question sample to obtain multiple corresponding expanded question samples, the text enhancement unit 702 is specifically used to perform text enhancement processing on the original question sample based on the text content of the original question sample to obtain multiple first expanded question samples; convert the original question sample into a question vector sample; perform text enhancement processing on the question vector sample based on the vector content of the question vector sample to obtain multiple expanded vector samples; and convert the multiple expanded vector samples into second expanded question samples.

[0107] In some embodiments, in order to obtain multiple first expanded question samples by performing text enhancement processing on the original question sample based on the text content of the original question sample, the text enhancement unit 702 is specifically used to perform multiple reverse translation processes on the original question sample based on the text content of the original question sample to obtain multiple first expanded question samples. The reverse translation process is to translate the text content into a preset language and then translate it back into the original language.

[0108] In some embodiments, in performing intent recognition processing on the plurality of expanded question samples respectively to determine the question domain corresponding to the plurality of expanded question samples, the intent recognition unit 703 is specifically used to perform text embedding on the expanded question samples to obtain embedded expanded question samples; to perform encoding processing on the embedded expanded question samples to obtain encoded expanded question samples; to perform feature extraction on the encoded expanded question samples to obtain features corresponding to the expanded question samples; to perform fully connected processing on the features to obtain global features corresponding to the expanded question samples; and to perform intent recognition processing on the global features to determine the question domain corresponding to the expanded question samples.

[0109] In some embodiments, in obtaining the original question samples and the corresponding answer samples, the obtaining unit 701 is specifically used to obtain the original question samples and the corresponding answer samples by means of data crawling.

[0110] In some embodiments, the training apparatus for the question-answering model further includes a knowledge unit, used to perform knowledge extraction processing on the expanded question sample to obtain multiple entities corresponding to the expanded question sample, as well as the relationships between the multiple entities, where the entities are words with semantic meaning; to perform knowledge fusion processing on the multiple entities and combine the relationships between the multiple entities to obtain a simplified expanded question sample corresponding to the expanded question sample, where the knowledge fusion processing is to fuse entities with the same semantic meaning; and to associate and store the simplified expanded question sample, the question domain corresponding to the expanded question sample, and the answer sample in the database of the question-answering model.

[0111] In some embodiments, the training apparatus for the question-answering model further includes a calling unit for obtaining a target question, which is a question to be answered; performing intent recognition processing on the target question to determine the question domain corresponding to the target question; and querying the database of the question model to determine the target answer corresponding to the target question based on the question domain and the text content of the target question.

[0112] It should be noted that the specific working process of each module provided in the above embodiments of this application can be referred to the corresponding implementation methods in the above method embodiments, and will not be repeated here.

[0113] Another embodiment of this application provides an electronic device, including:

[0114] Memory, used to store executable instructions;

[0115] A processor, when executing executable instructions stored in memory, implements the method described in the embodiments of this application.

[0116] Another embodiment of this application provides a computer-readable storage medium storing executable instructions for implementing the methods described above in the embodiments of this application when executed by a processor.

[0117] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0118] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A training method for a question-answering model, characterized in that, include: Obtain the original question sample and the corresponding answer sample, wherein the answer sample is the correct answer to the original question sample; The original question sample is subjected to text enhancement processing to obtain multiple expanded question samples corresponding to multiple question domains. The text enhancement processing changes the text content of the original question sample without changing the text semantics of the original question sample. Text embedding is performed on the expanded question sample to obtain the embedded expanded question sample; The embedded augmentation problem sample is encoded to obtain an encoded augmentation problem sample; Feature extraction is performed on the encoded augmentation problem sample to obtain the features corresponding to the augmentation problem sample; The features are processed by a fully connected layer to obtain the global features corresponding to the expanded problem sample; The global features are subjected to intent recognition processing to determine the problem domain corresponding to the expanded problem sample; The expanded question sample is subjected to knowledge extraction processing to obtain multiple entities corresponding to the expanded question sample, as well as the relationships between the multiple entities, wherein the entities are semantic words; The knowledge fusion process is performed on the multiple entities and the relationships between the multiple entities are combined to obtain the simplified expanded problem sample corresponding to the expanded problem sample. The knowledge fusion process is to merge entities with the same semantics. The simplified and expanded question samples, the question domains corresponding to the expanded question samples, and the answer samples are associated and stored in the database of the question-answering model.

2. The method according to claim 1, characterized in that, The text enhancement processing of the original question sample yields multiple corresponding expanded question samples, including: Based on the text content of the original question sample, text enhancement processing is performed on the original question sample to obtain multiple first expanded question samples; Convert the original problem sample into a problem vector sample; Based on the vector content of the question vector sample, text enhancement processing is performed on the question vector sample to obtain multiple expanded vector samples; The multiple augmented vector samples are converted into second augmented problem samples.

3. The method according to claim 2, characterized in that, The text content of the original question sample is used to perform text enhancement processing on the original question sample to obtain multiple first expanded question samples, including: Based on the text content of the original question sample, the original question sample is subjected to multiple reverse translation processes to obtain multiple first expanded question samples. The reverse translation process involves translating the text content into a preset language and then translating it back into the original language.

4. The method according to claim 1, characterized in that, The process of obtaining the original question sample and the corresponding answer sample includes: The original question samples and corresponding answer samples were obtained by crawling data.

5. The method according to claim 1, characterized in that, The method further includes: Obtain the target question, which is the question to be answered; The target question is subjected to intent recognition processing to determine the problem domain corresponding to the target question; Based on the question domain and text content of the target question, the target answer corresponding to the target question is determined by querying the database of the question-answering model.

6. A training device for a question-answering model, characterized in that, include: An acquisition unit is used to acquire an original question sample and a corresponding answer sample, wherein the answer sample is the correct answer to the original question sample; The text enhancement unit is used to perform text enhancement processing on the original question sample to obtain multiple expanded question samples corresponding to multiple question domains. The text enhancement processing changes the text content of the original question sample without changing the text semantics of the original question sample. An intent recognition unit is configured to: embed text into the expanded question sample to obtain an embedded expanded question sample; encode the embedded expanded question sample to obtain an encoded expanded question sample; extract features from the encoded expanded question sample to obtain features corresponding to the expanded question sample; perform fully connected processing on the features to obtain global features corresponding to the expanded question sample; and perform intent recognition processing on the global features to determine the question domain corresponding to the expanded question sample. A storage unit is used to perform knowledge extraction processing on the expanded problem sample to obtain multiple entities corresponding to the expanded problem sample, as well as the relationships between the multiple entities, wherein the entities are semantic words; The storage unit is also used to perform knowledge fusion processing on the multiple entities and combine the relationships between the multiple entities to obtain a simplified expanded problem sample corresponding to the expanded problem sample. The knowledge fusion processing is to merge entities with the same semantics. The storage unit is also used to associate and store the simplified and expanded question samples, the question domains corresponding to the expanded question samples, and the answer samples in the database of the question-answering model.

7. An electronic device, characterized in that, include: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, It stores executable instructions for implementing the method of any one of claims 1 to 5 when executed by a processor.

Citation Information

Patent Citations

  • Dialogue generation and corpus expansion method and device, computer equipment and storage medium

    CN111061847A

  • Dialogue intention recognition model training method and device, computer equipment and medium

    CN112766319A

  • Construction method, construction system, kitchen appliance and computer readable storage medium

    CN114817503A