Data processing method and apparatus
By adjusting the answer detection model based on feedback from the object provider, the training sample dataset is optimized, solving the problems of high manual annotation costs and low model accuracy in existing technologies, and achieving low-cost, high-accuracy answer adjustment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-24
- Publication Date
- 2026-03-31
Smart Images

Figure CN115510200B_ABST
Abstract
Description
Technical Field
[0001] The embodiments in this specification relate to the field of computer technology, and in particular to a data processing method. Background Technology
[0002] For machine learning, especially deep learning, most algorithms require a large amount of sample data to function. The richness and accuracy of the sample data are of great importance to machine learning.
[0003] In the current model training process, due to the subjective factors of human annotation in sample labeling and the large number of training samples, it is impossible to manually filter out some inferior samples one by one, which affects the model training effect and makes the accuracy of the trained model low. Therefore, how to adjust the accuracy of the model output answer while reducing the cost of manual annotation has become an urgent problem to be solved. Summary of the Invention
[0004] In view of the above, embodiments of this specification provide a data processing method. One or more embodiments of this specification also relate to a data processing apparatus, a question-and-answer processing method, a question-and-answer processing device, a computing device, a computer-readable storage medium, and a computer program, to address the technical deficiencies existing in the prior art.
[0005] According to a first aspect of the embodiments of this specification, a data processing method is provided, comprising:
[0006] Obtain the query question submitted by the user for the target object, and obtain the initial document, wherein the initial document contains the initial answer corresponding to the query question;
[0007] The query question and the initial document input answer detection model are processed to obtain the initial answer;
[0008] The query question and the initial answer are sent to the object provider, and the answer usage information generated by the object provider in response to the initial answer is obtained;
[0009] Based on the answer usage information and the initial answer, the target answer to the question to be queried is determined.
[0010] According to a second aspect of the embodiments of this specification, a data processing apparatus is provided, comprising:
[0011] The acquisition module is configured to acquire the query question submitted by the user for the target object and acquire the initial document, wherein the initial document contains the initial answer corresponding to the query question;
[0012] The processing module is configured to process the query question and the initial document input answer detection model to obtain the initial answer;
[0013] The sending module is configured to send the query question and the initial answer to the object provider, and to obtain the answer usage information generated by the object provider for the initial answer;
[0014] The determination module is configured to determine the target answer to the query question based on the answer usage information and the initial answer.
[0015] According to a third aspect of the embodiments of this specification, a question-and-answer processing method is provided, including:
[0016] Obtain the query questions submitted by users regarding the target product through the interactive chat interface;
[0017] Obtain an initial document, and process the query question and the initial document into an answer detection model to obtain the initial answer to the query question contained in the initial document;
[0018] The query question and the initial answer are sent to the product provider, and the answer usage information generated by the product provider in response to the initial answer is obtained;
[0019] Based on the answer usage information and the initial answer, the target answer to the question to be queried is determined.
[0020] According to a third aspect of the embodiments of this specification, a question-and-answer processing apparatus is provided, comprising:
[0021] The acquisition module is configured to acquire query questions submitted by users through the interactive interface for the target product.
[0022] The input module is configured to obtain an initial document and process the query question and the initial document input answer detection model to obtain the initial answer to the query question contained in the initial document;
[0023] The sending module is configured to send the query question and the initial answer to the product provider, and to obtain the answer usage information generated by the product provider in response to the initial answer;
[0024] The determination module is configured to determine the target answer to the query question based on the answer usage information and the initial answer.
[0025] According to a fifth aspect of the embodiments of this specification, a computing device is provided, comprising:
[0026] Memory and processor;
[0027] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement any of the steps of the data processing method.
[0028] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed by a processor, implement the steps of any of the data processing methods described herein.
[0029] According to a seventh aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described data processing method.
[0030] One embodiment of this specification involves obtaining a query question submitted by a user for a target object and obtaining an initial document, wherein the initial document contains an initial answer corresponding to the query question. The query question and the initial document are processed by an input answer detection model to obtain the initial answer. The query question and the initial answer are then sent to an object provider, and answer usage information generated by the object provider for the initial answer is obtained. Based on the answer usage information and the initial answer, the target answer for the query question is determined.
[0031] This specification's embodiments optimize the production method of extractive reading comprehension datasets by leveraging the usage information of the initial answers output by the answer detection model from the project provider. Specifically, it enables the object provider to assist in reviewing the question-answer pairs output by the answer detection model, using the object provider's usage information of the initial answers as feedback to adjust the initial answers output by the answer detection model. This reduces the manual annotation process, which is beneficial for reducing manual review costs and improving the accuracy of the adjusted answers. Attached Figure Description
[0032] Figure 1 This is a schematic diagram illustrating a data processing procedure provided in one embodiment of this specification;
[0033] Figure 2 This is a flowchart illustrating a data processing method provided in one embodiment of this specification;
[0034] Figure 3 This is a schematic diagram of another data processing procedure provided in one embodiment of this specification;
[0035] Figure 4 This is a flowchart illustrating the processing procedure of a data processing method provided in one embodiment of this specification.
[0036] Figure 5This is a schematic diagram of the structure of a data processing apparatus provided in one embodiment of this specification;
[0037] Figure 6 This is a schematic diagram of a question-and-answer processing method provided in one embodiment of this specification;
[0038] Figure 7 This is a schematic diagram of the structure of a question-and-answer processing device provided in one embodiment of this specification;
[0039] Figure 8 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation
[0040] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.
[0041] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0042] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."
[0043] First, the terms and concepts used in one or more embodiments of this specification will be explained.
[0044] FAQ: frequently asked question.
[0045] MRC: Machine Reading Comprehension.
[0046] Question-and-answer pair: consists of one question and one answer.
[0047] Query: In machine reading comprehension, the problem that needs to be solved, i.e., the question to be queried.
[0048] document: In machine reading comprehension, the reference text for the problem to be solved is the initial document.
[0049] span: The range of the answer, that is, the range between the start and end positions of the answer in the document.
[0050] BERT: Bidirectional Encoder Representations from Transformers, a bidirectional encoder representation technology based on transformers.
[0051] PageRank algorithm: An algorithm for predicting the probability of a link being clicked.
[0052] This specification provides a data processing method, and also relates to a data processing apparatus, a question-and-answer processing method, a question-and-answer processing apparatus, a computing device, a computer-readable storage medium, and a computer program, which will be described in detail in the following embodiments.
[0053] Machine reading comprehension models, a prominent research achievement in the field of artificial intelligence, have been developing for many years. Common machine reading comprehension tasks include cloze tests, multiple choice, answer span extraction, and free-response question answering. Among these, extraction tasks, due to their ability to produce longer answers and the strict reliance on a given document, can be applied to interactive intelligent question-answering scenarios, such as intelligent customer service. Given a document and a query, a machine reading comprehension model can find the span of the corresponding answer in the document based on the query. The training sample data for this task is characterized by the need for not only the query and document but also the labeling of the start and end positions of the answer to the current query within the document (or the start position of the answer and its corresponding text). In more complex tasks, it is also necessary to label whether the answer to the current query can be found in the document, i.e., a "cannot be answered" flag. If it can be found, the flag is 1; if it cannot be found, the flag is 0.
[0054] In the field of machine reading comprehension, the annotation process of SQuAD without the "unanswerable flag" can be summarized as follows:
[0055] 1. Use Wikipedia's built-in PageRank algorithm to remove the 10,000 articles with the highest click probability from Wikipedia articles.
[0056] 2. 536 articles were randomly selected from the above articles as the final target articles.
[0057] 3. The sampled articles were processed to remove images, tables, etc., and paragraphs with fewer than 500 characters were discarded, resulting in 526 articles and 23,215 paragraphs.
[0058] 4. Next, the annotators will be asked to spend 4 minutes in each paragraph asking at least five questions and marking the corresponding answers in the appropriate places.
[0059] To address the issue of some models extracting incorrect answers when there are no correct answers in the document, the SQuAD2.0 dataset introduced "unanswerable markers." Specifically, in addition to the dataset itself, annotators created five extra questions for each paragraph. These questions were designed to contain distractor answers (parts that appear to be answers but don't actually address the question) that could be found within that paragraph, resulting in over 50,000 additional unanswerable answers.
[0060] Currently, most publicly available machine reading comprehension datasets are constructed using this manual labeling method, but the problem with the above approach is that:
[0061] 1. It requires a large amount of manual annotation, which results in high annotation costs.
[0062] 2. The articles labeled are relatively fixed, which makes it impossible for the trained model to handle newer data.
[0063] 3. Data quality is highly dependent on the skill level of the annotators. Although cross-validation can reduce this interference to some extent, the problem still exists and further increases labor costs.
[0064] 4. The articles and answers used are relatively generic and cannot be directly transferred to vertical fields.
[0065] 5. It is impossible to process the data with poor model performance and optimize the model accordingly.
[0066] Based on this, the embodiments of this specification obtain a query question submitted by a user for a target object and obtain an initial document, wherein the initial document contains an initial answer corresponding to the query question. The query question and the initial document are processed by an input answer detection model to obtain the initial answer. The query question and the initial answer are sent to the object provider, and the answer usage information generated by the object provider for the initial answer is obtained. Based on the answer usage information and the initial answer, the target answer for the query question is determined.
[0067] This specification's embodiments optimize the production method of extractive reading comprehension datasets by leveraging the usage information of the initial answers output by the answer detection model from the project provider. Specifically, it enables the object provider to assist in reviewing the question-answer pairs output by the answer detection model, using the object provider's usage information of the initial answers as feedback to adjust the initial answers output by the answer detection model. This reduces the manual annotation process, which is beneficial for reducing manual review costs and improving the accuracy of the adjusted answers.
[0068] Figure 1 A schematic diagram of a data processing procedure according to an embodiment of this specification is shown, such as... Figure 1 As shown, the user inputs a query question through a user terminal, which then sends the query question to an object processing platform. The object processing platform obtains an initial document and inputs the initial document and the query question into an answer detection model for processing, outputting corresponding initial answers. These initial answers can be one or at least two, for example, answer 1, answer 2, and answer 3. The initial answers are then sent to the object processing party, which determines whether to use one or at least two of the initial answers as the response to the query question. The object processing platform can obtain information about the object provider's usage of each initial answer, such as whether it was used or not, and can adjust the initial answers based on this information. This allows for auxiliary review of the question-and-answer pairs output by the answer detection model by the object provider. Using the object provider's usage information as feedback adjusts the initial answers output by the answer detection model, reducing the manual annotation process, which helps lower manual review costs and improves the accuracy of the adjusted answers.
[0069] Figure 2 A flowchart of a data processing method according to an embodiment of this specification is shown, which specifically includes the following steps.
[0070] Step 202: Obtain the query question submitted by the user for the target object, and obtain the initial document, wherein the initial document contains the initial answer corresponding to the query question.
[0071] Specifically, the object provider can provide different objects to the user. The target object is any one of the multiple objects provided by the object provider. The object provider includes, but is not limited to, the seller of goods (i.e., the merchant), the insurance company, the logistics company, etc. When the object provider is a merchant, the target object can be a product; when the object provider is an insurance company, the target object can be a financial product; when the object provider is a logistics company, the target object can be an order number, etc.
[0072] When an object provider receives a query submitted by a user for a target object, it can obtain one or at least two pre-stored initial documents. At least one of these initial documents contains an initial answer to the query, allowing the object provider to determine the answer to the query from the one or at least two initial documents and respond to the user's query based on that answer.
[0073] Step 204: Process the query question and the initial document input answer detection model to obtain the initial answer.
[0074] Specifically, after receiving the user's query question and obtaining the initial document, the query question and the initial document can be input into the answer detection model for processing. During the processing, the answer detection model can find at least one initial answer corresponding to the query question in the initial document and output it.
[0075] In addition to outputting the initial answer to the query question, the answer detection model can also output the position information of the initial answer in the initial document. This position information can be the start and end positions of the initial answer in the initial document, or it can be the start position of the initial answer in the document and the length of the initial answer.
[0076] Step 206: Send the query question and the initial answer to the object provider, and obtain the answer usage information generated by the object provider for the initial answer.
[0077] Specifically, after the answer detection model outputs the initial answer to the query question, it can send the initial answer to the object provider, who can then determine whether to use it or which initial answer to use as the answer to the query question based on the content of the query question and the initial answer.
[0078] The answer usage information includes, but is not limited to, whether it is used or not. Use may include two situations: direct use and modified use. Direct use means that the object provider selects a target initial answer from at least one initial answer, does not modify the target initial answer, and directly uses the target initial answer as the reply content to the user. Modified use means that the object provider selects a target initial answer from at least one initial answer, modifies the target initial answer, and uses the modified result as the reply content to the user. Unused means that the object provider does not use any of the at least one initial answer as the reply content, but instead edits a new reply content to reply to the user regarding the query question.
[0079] Step 208: Determine the target answer to the question to be queried based on the answer usage information and the initial answer.
[0080] Specifically, after obtaining the answer usage information generated by the object provider for the initial answer, it is possible to determine whether the initial answer needs to be adjusted to generate the target answer based on the answer usage information. Then, training sample data for the answer detection model can be constructed based on the target answer, so as to achieve iterative updates of the answer detection model through the training sample data.
[0081] In practice, the query question and the initial document input answer detection model are processed to obtain the position information of the initial answer in the initial document;
[0082] Accordingly, after determining the target answer to the query question, the process also includes:
[0083] Training sample data for the answer detection model is constructed based on the query question, the target answer, the initial document, and the location information.
[0084] The answer detection model is iteratively trained using the training sample data.
[0085] Specifically, after inputting the query question and the initial document into the answer detection model, the answer detection model can output not only the initial answer to the query question contained in the initial document, but also the position information of the initial answer in the initial document. Therefore, after determining the answer usage information generated by the object provider for the initial answer, and determining the target answer to the query question based on the answer usage information and the initial answer, training sample data can be constructed based on the query question, the target answer, the initial document, and the position information, and the answer detection model can be iteratively trained using the training sample data.
[0086] In specific implementation, the target answer to the query question is determined based on the answer usage information and the initial answer, including:
[0087] If it is determined that the answer uses information that is being used, the initial answer will be determined as the target answer to the question to be queried;
[0088] Accordingly, training sample data for constructing the answer detection model based on the query question, the target answer, the initial document, and the location information includes:
[0089] The question to be queried, the target answer, the initial document, and the location information are used as training samples, and the answers are used as sample labels to construct the training sample data for the answer detection model.
[0090] Specifically, as mentioned earlier, the information used in the answer can include whether it is used or not, and the use can include two situations: direct use and use after modification.
[0091] In the embodiments of this specification, when the answer usage information is used and is used directly, it means that after the object provider selects a target initial answer from at least one initial answer, it does not modify the target initial answer and directly uses the target initial answer as the reply content to reply to the user. Therefore, the target initial answer can be used as the target answer to the question to be queried. The question to be queried, the target answer, the initial document, and the position information of the target initial answer (target answer) in the initial document are used as training samples, and sample labels with answers are added to the training samples to construct the training sample data of the answer detection model.
[0092] Alternatively, based on the answer usage information and the initial answer, determine the target answer to the query question, including:
[0093] If it is determined that the answer uses information, obtain the intermediate answer used by the object provider, and determine whether the intermediate answer is consistent with the initial answer;
[0094] If not, then the intermediate answer will be determined as the target answer to the question to be queried;
[0095] Accordingly, the training sample data for constructing the answer detection model based on the query question, the target answer, the initial document, and the location information includes:
[0096] The question to be queried, the target answer, the initial document, and the location information are used as training samples, and the answers are used as sample labels to construct the training sample data for the answer detection model.
[0097] Specifically, as mentioned earlier, the information used in the answer can include whether it is used or not, and the use can include two situations: direct use and use after modification.
[0098] In the embodiments of this specification, in addition to including the result of answer usage, i.e., whether the answer was used or not, the answer usage information may also include the answer content used by the object provider, i.e., the response content of the object provider in replying to the query question.
[0099] Based on this, when the answer usage information is "used" and "used after modification," it means that the object provider selects a target initial answer from at least one initial answer, modifies the target initial answer, and uses the modified result as the reply content to reply to the user. Therefore, when it is determined that the answer usage information is "used," the intermediate answer used by the object provider can be obtained from the answer usage information first. Then, it is determined whether the intermediate answer is consistent with any one of the at least one initial answer. If they are inconsistent, it means that the user modifies the initial answer, generates an intermediate answer, and replies with the intermediate answer as the reply content. In this case, the intermediate answer can be determined as the target answer to the query question. The query question, the target answer, the initial document, and the position information of the intermediate answer (target answer) in the initial document are used as training samples. Sample labels with answers are added to the training samples to construct the training sample data for the answer detection model.
[0100] By having the object provider assist in reviewing the question-and-answer pairs output by the answer detection model, and using the object provider's usage information of the initial answers as feedback, the initial answers output by the answer detection model can be adjusted. This reduces the manual annotation process, which is beneficial for reducing the cost of manual review and improving the accuracy of the adjusted answers.
[0101] In practice, the location information includes the first start position and the first end position of the initial answer in the initial document;
[0102] Accordingly, the training sample data for constructing the answer detection model based on the query question, the target answer, the initial document, and the location information includes:
[0103] The first answer length corresponding to the initial answer is determined based on the first start position and the first end position, and the second answer length corresponding to the target answer is determined.
[0104] Determine whether the length of the first answer is equal to the length of the second answer;
[0105] If so, then the training sample data for the answer detection model is constructed based on the query question, the target answer, the initial document, and the location information;
[0106] If not, then the first starting position is determined as the second starting position of the target answer in the initial document;
[0107] Based on the second starting position and the second answer length, determine the second ending position of the target answer in the initial document;
[0108] The training sample data for the answer detection model is constructed based on the query question, the target answer, the initial document, the second start position, and the second end position.
[0109] Specifically, as mentioned earlier, after inputting the query question and the initial document into the answer detection model, the answer detection model can output not only the initial answer to the query question contained in the initial document, but also the position information of the initial answer in the initial document. The position information can include the first starting position and the first ending position of the initial answer in the initial document.
[0110] Therefore, when constructing training sample data based on the query question, target answer, initial document, and location information, the first answer length of the initial answer can be determined based on the first start position and the first end position. This first answer length can be the number of words corresponding to the initial answer. Then, since the answer usage information can contain the answer content used by the object provider, i.e., the answer content of the target answer, the second answer length (the number of words of the target answer) corresponding to the target answer can be determined based on the answer content of the target answer contained in the answer usage information. Then, the first answer length and the second answer length are compared to determine whether the answer lengths of the target answer and the initial answer are consistent.
[0111] If the comparison is consistent, the position information of the question to be queried, the target answer, the initial document, and the initial answer (the target answer and the initial answer may be the same or different) in the initial document can be used as training samples. The sample labels with answers are added to the training samples to construct the training sample data of the answer detection model. Since the answer length of the target answer and the initial answer is the same, the position information of the initial answer in the initial document can also be used as the position information of the target answer in the initial document.
[0112] Additionally, if the lengths of the target answer and the initial answer are inconsistent, it means that the object provider may select a target initial answer from at least one initial answer, modify the target initial answer, and use the modified result as the reply content to the user.
[0113] In this case, since it is necessary to use the position information of the target answer in the initial document to construct training sample data, the first starting position of the target initial answer in the initial document can be determined as the second starting position of the target answer in the initial document. Then, based on the answer length of the target answer, the second ending position of the target answer in the initial document can be determined. The second starting position and the second ending position are used as the position information of the target answer in the initial document. Then, the question to be queried, the target answer, the initial document, and the position information of the target answer in the initial document (the second starting position and the second ending position) are used as training samples, and sample labels with answers are added to the training samples to construct the training sample data of the answer detection model.
[0114] By having the object provider assist in reviewing the question-and-answer pairs output by the answer detection model, and using the object provider's usage information of the initial answers as feedback, the initial answers output by the answer detection model can be adjusted. This reduces the manual annotation process, which is beneficial for reducing the cost of manual review and improving the accuracy of the adjusted answers.
[0115] The training sample data for constructing the answer detection model, based on the query question, the target answer, the initial document, the second start position, and the second end position, includes:
[0116] Based on the second start position and the second end position, the initial answer in the initial document is replaced with the target answer to generate the target document;
[0117] The question to be queried, the target answer, the target document, the second start position, and the second end position are used as training samples, and the answers are used as sample labels to construct the training sample data for the answer detection model.
[0118] Specifically, when the lengths of the target answer and the initial answer are inconsistent, it means that the content of the target answer and the initial answer are inconsistent. In this case, when constructing training sample data based on the query question, the target answer, and the initial document, since the initial document may not contain the content of the target answer, the content of the initial answer in the initial document can be replaced with the content of the target answer. That is, the content of the initial answer in the initial document is deleted first, and then the content of the target answer is inserted from the beginning position of the initial answer to generate the target document. The query question, the target answer, the initial document, and the position information of the target answer in the initial document (the second start position and the second end position) are then used as training samples, and sample labels with answers are added to these training samples to construct the training sample data for the answer detection model.
[0119] By having the object provider assist in reviewing the question-and-answer pairs output by the answer detection model, and using the object provider's usage information of the initial answers as feedback, the initial answers output by the answer detection model can be adjusted. This reduces the manual annotation process, which is beneficial for reducing the cost of manual review and improving the accuracy of the adjusted answers.
[0120] In practice, if it is determined that the information used in the answer is unused, it is then determined whether the accuracy of the initial answer is greater than a preset accuracy threshold.
[0121] If so, the location information of the initial answer in the initial document is determined, and the question to be queried, the initial answer, the initial document and the location information are used as training samples, and the answer is used as the sample label to construct training sample data;
[0122] If not, the question to be queried and the initial document are used as training samples, and the absence of an answer is used as the sample label to construct training sample data.
[0123] Specifically, as mentioned earlier, the information used in the answer can include whether it was used or not.
[0124] In the embodiments of this specification, when the answer usage information is not used, during the construction of training sample data, it is necessary to add labels with or without answers to the training samples. If the object provider does not use the initial answer, it may be because the initial document contains the correct answer range, but the answer detection model discovers the wrong answer range; or the initial document does not contain the correct answer range, but the answer detection model discovers the wrong answer, resulting in the display of the wrong question-answer pair to the object provider; or the initial document contains the correct answer range, and the answer detection model also discovers a relatively correct answer range. However, after displaying the initial answer corresponding to the answer range to the object provider, the object provider determines that the accuracy of the initial answer is low, and therefore does not use the initial answer.
[0125] Therefore, if it is determined that the answer information is unused, the accuracy of the initial answer can be determined based on the content of the question to be queried and the initial answer. It can then be determined whether the accuracy is greater than a preset accuracy threshold. If it is greater, it means that the initial document contains the answer to the question to be queried. When constructing training sample data, the location information of the initial answer in the initial document can be determined first. The question to be queried, the initial answer, the initial document and the location information can be used as training samples, and the answer can be used as the sample label to construct training sample data.
[0126] Alternatively, if the accuracy is less than or equal to the preset accuracy threshold, it means that the answer detection model has output an incorrect answer. In this case, one possibility is that there is no correct answer range in the initial document, but the answer detection model has incorrectly discovered the answer, resulting in the wrong question-answer pair being displayed to the object provider. Therefore, when constructing training sample data, the question to be queried and the initial document can be used as training samples, and the absence of an answer can be used as the sample label to construct training sample data.
[0127] Alternatively, if the initial document contains the correct range of answers, but the answer detection model detects an incorrect range of answers, then the answer to the query question contained in the initial document can be re-determined. The query question, the answer, the initial document, and the position information of the answer in the initial document can be used as training samples, and the answer can be used as the sample label to construct training sample data.
[0128] By having the object provider assist in reviewing the question-and-answer pairs output by the answer detection model, and using the object provider's usage information of the initial answers as feedback, the initial answers output by the answer detection model can be adjusted. This reduces the manual annotation process, which is beneficial for reducing the cost of manual review and improving the accuracy of the adjusted answers.
[0129] In specific implementation, the target answer to the query question is determined based on the answer usage information and the initial answer, including:
[0130] If it is determined that the answer uses information, obtain the intermediate answer used by the object provider, and determine whether the intermediate answer is consistent with the initial answer;
[0131] If not, then determine the semantic similarity between each text fragment in the initial document and the intermediate answer, and determine the target text fragment with a semantic similarity greater than a preset similarity threshold as the target answer to the query question.
[0132] Specifically, as mentioned earlier, the information used in the answer can include whether it is used or not, and the use can include two situations: direct use and use after modification.
[0133] In the embodiments of this specification, if it is determined that the answer uses information, it can be further determined whether the intermediate answer used by the object provider is consistent with the initial answer. If they are inconsistent, it means that the object provider has modified the initial answer and will use the modified result as the reply content.
[0134] Based on this, when the answer information is used and is used after modification, since constructing training sample data requires the location information of the target answer (intermediate answer) in the initial document, and the initial document may not contain the intermediate answer, we can first determine the semantic similarity between each text segment in the initial document and the intermediate answer, and determine the target text segment with a semantic similarity greater than a preset similarity threshold as the target answer to the query question. Then, we use the query question, the target text segment, the initial document, and the location information of the target text segment in the initial document as training samples, and use the answer as the sample label to construct training sample data.
[0135] In addition, if it is determined that the information used in the answer is unused, it is determined whether the accuracy of the initial answer is greater than a preset accuracy threshold.
[0136] If so, the initial answer is adjusted according to the question to be queried to generate the target answer;
[0137] The location information of the initial answer in the initial document is determined, and training sample data for the answer detection model is constructed based on the query question, the target answer, the initial document, and the location information.
[0138] Specifically, if the object provider does not use the initial answer, but the accuracy of the initial answer is relatively high, the initial answer can be further adjusted according to the query question to make the adjusted target answer more accurate, thereby increasing the usage rate of the target answer. Based on this, training sample data can be constructed by using the query question, target answer, initial document, and the position information of the target answer in the initial document as training samples, and adding sample labels with answers to the training samples.
[0139] A schematic diagram of another data processing procedure provided in the embodiments of this specification is shown below. Figure 3 As shown, its application scenario is question-and-answer pair mining in intelligent customer service. It uses near-current replies from human customer service representatives as initial documents and the consumer's question as the query question, extracting relevant and accurate answers from the human customer service replies using an answer detection model. However, in intelligent question-and-answer scenarios, the dialogue content involves a large amount of e-commerce domain knowledge, and the human customer service response data contains a lot of noise (e.g., irrelevant marketing content, no customer service response, excessively long customer service replies, repetitive explanations), making it impossible to train a high-performing answer detection model based on existing public datasets. Furthermore, using the aforementioned human customer service annotation method would incur significant manual annotation costs, and due to the rapid updates of question-and-answer content, continuous dataset production is not possible.
[0140] Based on this, the embodiments in this specification utilize the question-and-answer pairs generated by the merchant's answer detection model for auxiliary review. Using the merchant's adoption, modification of adoption, and deletion actions as feedback, a low-cost dataset construction method is generated. The specific implementation steps are as follows:
[0141] 1. After the answer detection model outputs the results to the merchant, the merchant will perform three operations: accept, modify the accepted answer, or delete the answer.
[0142] 2. If the merchant adopts the answer, the initial document corresponding to the question and answer pair, the question to be queried, and the location of the initial answer in the initial document will be stored in the "Dataset with Answers";
[0143] 3. If the merchant makes a modification to the adoption, the part of the initial document containing the initial answer can be replaced with the merchant's modified answer, and the new document, the question to be queried, and the position of the modified answer in the new document can be stored in the "dataset with answers";
[0144] 4. If the merchant deletes the data, the answer can be re-labeled based on the initial document and the question to be queried. If it is determined that the answer to the question can be found in the initial document, the new corrected data is stored in the "Dataset with Answers". If it is determined that the answer to the question cannot be found in the initial document, the initial document, the question to be queried, and the "Unanswerable Flag" are stored in the "Dataset with No Answers".
[0145] The data processing method provided in the embodiments of this specification is applied to intelligent customer service in the e-commerce field. The main function of intelligent customer service is to automatically, quickly, and accurately resolve consumer-related issues during the purchase process. Machine reading comprehension, as a prominent research achievement in the field of artificial intelligence, is widely used in intelligent question-and-answer dialogues and question-and-answer generation. For example, a machine reading comprehension model can highlight the most relevant parts of the answer based on the consumer's real-time question, reducing the consumer's comprehension cost. Simultaneously, the reading comprehension model can also be used as an answer generation tool, extracting question-and-answer pairs from the dialogue between the consumer and human customer service, automatically improving the problem-solving capabilities of intelligent customer service. However, all of the above applications rely on a high-quality reading comprehension model that depends on a large amount of effective training sample data.
[0146] Based on this, the data processing method provided in the embodiments of this specification aims to generate a high-quality reading comprehension dataset for intelligent customer service scenarios by relying on feedback from merchants on the output results of the answer detection model, while minimizing the cost and error of manual annotation. This dataset is used for iterative optimization and standard evaluation of the answer detection model.
[0147] Because the embodiments in this specification utilize merchants' adoption and modification of the model's output results, a large amount of "answerable" data can be obtained. Furthermore, since each merchant is familiar with the answers to questions related to their respective products and possesses professional background knowledge, their adoption operations are generally quite reliable. Moreover, since the adopted questions and answers are provided online by intelligent customer service under appropriate circumstances, even if there are errors in adoption, they can be detected through routine online screening.
[0148] Furthermore, since the question-and-answer pairs displayed to the object provider are derived from the mining results output in real time by the answer detection model, the data produced through the embodiments of this specification can directly intervene in and improve the performance of the answer detection model, that is, the erroneous parts produced by the model can be corrected in the next batch of data.
[0149] The embodiments in this specification optimize the production method of extractive reading comprehension datasets through front-end merchant adoption actions, continuously producing new datasets with the goal of optimizing the model, forming a data closed loop and reducing manual review costs.
[0150] One embodiment of this specification involves obtaining a query question submitted by a user for a target object and obtaining an initial document, wherein the initial document contains an initial answer corresponding to the query question. The query question and the initial document are processed by an input answer detection model to obtain the initial answer. The query question and the initial answer are then sent to an object provider, and answer usage information generated by the object provider for the initial answer is obtained. Based on the answer usage information and the initial answer, the target answer for the query question is determined.
[0151] This specification's embodiments optimize the production method of extractive reading comprehension datasets by leveraging the usage information of the initial answers output by the answer detection model from the project provider. Specifically, it enables the object provider to assist in reviewing the question-answer pairs output by the answer detection model, using the object provider's usage information of the initial answers as feedback to adjust the initial answers output by the answer detection model. This reduces the manual annotation process, which is beneficial for reducing manual review costs and improving the accuracy of the adjusted answers.
[0152] The following is in conjunction with the appendix Figure 4 Taking the application of the data processing method provided in this specification in the e-commerce field as an example, the data processing method will be further explained. Figure 4 A flowchart illustrating the processing procedure of a data processing method according to an embodiment of this specification is shown, specifically including the following steps.
[0153] Step 402: Obtain the query questions submitted by the user for the target product and obtain the initial document, which contains the initial answers to the query questions.
[0154] Step 404: Process the query question and the initial document input answer detection model to obtain the initial answer and the position information of the initial answer in the initial document.
[0155] Step 406: Send the question to be queried and the initial answer to the merchant, and obtain the adoption result generated by the merchant for the initial answer.
[0156] Step 408: If the adoption result is confirmed, the initial answer is set as the target answer to the query question.
[0157] Step 410: Use the question to be queried, the target answer, the initial document, and the position information of the initial answer in the initial document as training samples, and use the answer as sample labels to construct training sample data for the answer detection model.
[0158] Step 412: If the adoption result is determined to be modified adoption, obtain the intermediate answer used by the merchant and determine the intermediate answer as the target answer for the question to be queried.
[0159] Step 414: Replace the initial answer in the initial document with the target answer to generate the target document.
[0160] Step 416: Use the location information of the question to be queried, the target answer, the target document, and the intermediate answer in the target document as training samples, and use the answers as sample labels to construct training sample data for the answer detection model.
[0161] Step 418: If the adoption result is determined to be unadopted, determine whether the accuracy of the initial answer is greater than the preset accuracy threshold.
[0162] Step 420: If the accuracy of the initial answer is greater than the preset accuracy threshold, determine the position information of the initial answer in the initial document, and use the question to be queried, the initial answer, the initial document and the position information of the initial answer in the initial document as training samples, and use the answer as the sample label to construct training sample data.
[0163] Step 422: If the accuracy of the initial answer is less than or equal to the preset accuracy threshold, then the question to be queried and the initial document are used as training samples, and the absence of an answer is used as the sample label to construct training sample data.
[0164] Step 424: Iteratively train the answer detection model using training sample data.
[0165] This specification's embodiments optimize the production method of extractive reading comprehension datasets by using merchants' usage information on the initial answers output by the answer detection model. Specifically, it enables merchants to assist in the review of the question-answer pairs output by the answer detection model, using the merchants' usage information on the initial answers as feedback to adjust the initial answers output by the answer detection model. This reduces the manual annotation process, which is beneficial for reducing manual review costs and improving the accuracy of the adjusted answers.
[0166] Corresponding to the above method embodiments, this specification also provides data processing apparatus embodiments. Figure 5 A schematic diagram of the structure of a data processing apparatus according to one embodiment of this specification is shown. Figure 5 As shown, the device includes:
[0167] The acquisition module 502 is configured to acquire a query question submitted by a user for a target object and acquire an initial document, wherein the initial document contains an initial answer corresponding to the query question;
[0168] Processing module 504 is configured to process the query question and the initial document input answer detection model to obtain the initial answer;
[0169] The sending module 506 is configured to send the query question and the initial answer to the object provider, and to obtain the answer usage information generated by the object provider for the initial answer;
[0170] The determination module 508 is configured to determine the target answer to the query question based on the answer usage information and the initial answer.
[0171] Optionally, the data processing apparatus further includes:
[0172] The input module is configured to process the query question and the initial document input answer detection model to obtain the position information of the initial answer in the initial document;
[0173] The training module is configured to construct training sample data for the answer detection model based on the query question, the target answer, the initial document, and the location information, and to iteratively train the answer detection model using the training sample data.
[0174] Optionally, the determining module 508 is further configured to:
[0175] If it is determined that the answer uses information that is being used, the initial answer will be determined as the target answer to the question to be queried;
[0176] Accordingly, the training module is further configured as follows:
[0177] The question to be queried, the target answer, the initial document, and the location information are used as training samples, and the answers are used as sample labels to construct the training sample data for the answer detection model.
[0178] Optionally, the determining module 508 is further configured to:
[0179] If it is determined that the answer uses information, obtain the intermediate answer used by the object provider, and determine whether the intermediate answer is consistent with the initial answer;
[0180] If not, then the intermediate answer will be determined as the target answer to the question to be queried;
[0181] Accordingly, the training module is further configured as follows:
[0182] The question to be queried, the target answer, the initial document, and the location information are used as training samples, and the answers are used as sample labels to construct the training sample data for the answer detection model.
[0183] Optionally, the location information includes the first start position and the first end position of the initial answer in the initial document;
[0184] Accordingly, the training module is further configured as follows:
[0185] The first answer length corresponding to the initial answer is determined based on the first start position and the first end position, and the second answer length corresponding to the target answer is determined.
[0186] Determine whether the length of the first answer is equal to the length of the second answer;
[0187] If so, then training sample data for the answer detection model is constructed based on the query question, the target answer, the initial document, and the location information.
[0188] Optionally, if the result of determining whether the lengths of the first answer and the second answer are equal is negative, the device further includes a construction module configured to:
[0189] The first starting position is determined as the second starting position of the target answer in the initial document;
[0190] Based on the second starting position and the second answer length, determine the second ending position of the target answer in the initial document;
[0191] The training sample data for the answer detection model is constructed based on the query question, the target answer, the initial document, the second start position, and the second end position.
[0192] Optionally, the building module is further configured to:
[0193] Based on the second start position and the second end position, the initial answer in the initial document is replaced with the target answer to generate the target document;
[0194] The question to be queried, the target answer, the target document, the second start position, and the second end position are used as training samples, and the answers are used as sample labels to construct the training sample data for the answer detection model.
[0195] Optionally, the data processing device further includes a judgment module, configured to:
[0196] If it is determined that the information used in the answer is unused, determine whether the accuracy of the initial answer is greater than a preset accuracy threshold;
[0197] If so, the location information of the initial answer in the initial document is determined, and the question to be queried, the initial answer, the initial document and the location information are used as training samples, and the answer is used as the sample label to construct training sample data;
[0198] If not, the question to be queried and the initial document are used as training samples, and the absence of an answer is used as the sample label to construct training sample data.
[0199] Optionally, the determining module 508 is further configured to:
[0200] If it is determined that the answer uses information, obtain the intermediate answer used by the object provider, and determine whether the intermediate answer is consistent with the initial answer;
[0201] If not, then determine the semantic similarity between each text fragment in the initial document and the intermediate answer, and determine the target text fragment with a semantic similarity greater than a preset similarity threshold as the target answer to the query question.
[0202] Optionally, the data processing device further includes an adjustment module configured to:
[0203] If it is determined that the information used in the answer is unused, determine whether the accuracy of the initial answer is greater than a preset accuracy threshold;
[0204] If so, the initial answer is adjusted according to the question to be queried to generate the target answer;
[0205] The location information of the initial answer in the initial document is determined, and training sample data for the answer detection model is constructed based on the query question, the target answer, the initial document, and the location information.
[0206] The above is an illustrative scheme of a data processing apparatus according to this embodiment. It should be noted that the technical solution of this data processing apparatus and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the data processing apparatus, please refer to the description of the technical solution of the data processing method described above.
[0207] Figure 6 A schematic diagram of a question-and-answer processing method according to an embodiment of this specification is shown, such as... Figure 6 As shown, the user sends a query question to the transaction processing platform through a dialogue interface. After receiving the query question, the transaction processing platform obtains the initial document, and then inputs the initial document and the query question into the answer detection model for answer detection processing, outputting the corresponding initial answer. The initial answer can be one or at least two, for example, the initial answers are answer 1, answer 2 and answer 3. Then, the initial answer is sent to the product provider (e.g., the merchant or the merchant's customer service), and the product provider determines whether to use one or at least two of the initial answers as the reply content to the query question.
[0208] If the product provider chooses to use answer 1 as the response to the question being asked, then answer 1 can continue to be displayed in the dialogue interface.
[0209] In addition, the commodity trading platform can obtain information on how the commodity provider uses each initial answer, such as whether it has been used or not. It can also adjust the initial answers based on the information on the use of the initial answers. This allows the commodity provider to assist in the review of the question-and-answer pairs output by the answer detection model. By using the information on the use of the initial answers by the commodity provider as feedback, the initial answers output by the answer detection model can be adjusted, thereby reducing the process of manual annotation. This not only helps to reduce the cost of manual review, but also helps to improve the accuracy of the answer adjustment results.
[0210] This specification's embodiments optimize the production method of extractive reading comprehension datasets by using information from product providers regarding the usage of initial answers output by the answer detection model. Specifically, it enables product providers to assist in reviewing the question-answer pairs output by the answer detection model, using the product providers' usage information of the initial answers as feedback to adjust the initial answers output by the answer detection model. This reduces the manual annotation process, which is beneficial for reducing manual review costs and improving the accuracy of the adjusted answers.
[0211] The above is an illustrative scheme of a question-and-answer processing method according to this embodiment. It should be noted that the technical solution of this question-and-answer processing method and the technical solution of the data processing method described above belong to the same concept. For details not described in detail in the technical solution of the question-and-answer processing method, please refer to the description of the technical solution of the data processing method described above.
[0212] Corresponding to the above method embodiments, this specification also provides embodiments of a question-and-answer processing device. Figure 7 A schematic diagram of a question-and-answer processing device according to one embodiment of this specification is shown. Figure 7 As shown, the device includes:
[0213] The acquisition module 702 is configured to acquire the query questions submitted by the user for the target product through the dialogue interaction interface;
[0214] Input module 704 is configured to obtain an initial document and process the query question and the initial document input answer detection model to obtain the initial answer to the query question contained in the initial document;
[0215] The sending module 706 is configured to send the query question and the initial answer to the product provider, and to obtain the answer usage information generated by the product provider in response to the initial answer;
[0216] The determination module 708 is configured to determine the target answer to the query question based on the answer usage information and the initial answer.
[0217] The above is an illustrative scheme of a question-and-answer processing device according to this embodiment. It should be noted that the technical solution of this question-and-answer processing device and the technical solution of the question-and-answer processing method described above belong to the same concept. For details not described in detail in the technical solution of the question-and-answer processing device, please refer to the description of the technical solution of the question-and-answer processing method described above.
[0218] Figure 8 A structural block diagram of a computing device 800 according to one embodiment of this specification is shown. The components of the computing device 800 include, but are not limited to, a memory 810 and a processor 820. The processor 820 is connected to the memory 810 via a bus 830, and a database 850 is used to store data.
[0219] The computing device 800 also includes an access device 840, which enables the computing device 800 to communicate via one or more networks 860. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 840 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) interface, a Wi-MAX interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.
[0220] In one embodiment of this specification, the above-described components of the computing device 800 and Figure 8 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 8 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0221] The computing device 800 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 800 can also be a mobile or stationary server.
[0222] The processor 820 is configured to execute the following computer-executable instructions, which, when executed by the processor, implement the steps of the above-described data processing method or the above-described question-and-answer processing method.
[0223] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device belongs to the same concept as the technical solution of the data processing method or the question-and-answer processing method described above. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the data processing method or the question-and-answer processing method described above.
[0224] An embodiment of this specification also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the above-described data processing method or the above-described question-and-answer processing method.
[0225] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium belongs to the same concept as the technical solution of the data processing method or the question-and-answer processing method described above. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the data processing method or the question-and-answer processing method described above.
[0226] An embodiment of this specification also provides a computer program, wherein when the computer program is executed in a computer, it causes the computer to perform the steps of the above-described data processing method or the above-described question-and-answer processing method.
[0227] The above is an illustrative example of a computer program according to this embodiment. It should be noted that the technical solution of this computer program belongs to the same concept as the data processing method or the question-and-answer processing method described above. Details not described in detail in the computer program's technical solution can be found in the descriptions of the data processing method or the question-and-answer processing method described above.
[0228] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.
[0229] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.
[0230] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.
[0231] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0232] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.
Claims
1. A data processing method, comprising: obtaining a query question submitted by a user for a target object, and obtaining an initial document, wherein the initial document contains an initial answer corresponding to the query question; inputting the query question and the initial document into an answer detection model for processing to obtain the initial answer; sending the query question and the initial answer to an object provider, and obtaining answer usage information generated by the object provider for the initial answer, wherein the object provider is configured to provide the target object for the user, and the usage information includes usage or non-usage, and the usage includes direct usage and modified usage of the initial answer; determining a target answer of the query question according to the answer usage information and the initial answer.
2. The data processing method of claim 1, further comprising: inputting the query question and the initial document into an answer detection model for processing to obtain position information of the initial answer in the initial document; correspondingly, after determining the target answer of the query question, further comprising: constructing training sample data of the answer detection model according to the query question, the target answer, the initial document and the position information; iteratively training the answer detection model through the training sample data.
3. The data processing method of claim 2, wherein the determining the target answer of the query question according to the answer usage information and the initial answer comprises: in a case where the answer usage information is usage, determining the initial answer as the target answer of the query question; correspondingly, the constructing the training sample data of the answer detection model according to the query question, the target answer, the initial document and the position information comprises: taking the query question, the target answer, the initial document and the position information as training samples, and taking the answer as a sample label, to construct the training sample data of the answer detection model.
4. The data processing method of claim 2, wherein the determining the target answer of the query question according to the answer usage information and the initial answer comprises: in a case where the answer usage information is usage, obtaining an intermediate answer used by the object provider, and determining whether the intermediate answer is consistent with the initial answer; if not, determining the intermediate answer as the target answer of the query question; correspondingly, the constructing the training sample data of the answer detection model according to the query question, the target answer, the initial document and the position information comprises: taking the query question, the target answer, the initial document and the position information as training samples, and taking the answer as a sample label, to construct the training sample data of the answer detection model.
5. The data processing method of claim 2, wherein the position information comprises a first start position and a first end position of the initial answer in the initial document. Correspondingly, the training sample data of the answer detection model is constructed according to the query question, the target answer, the initial document and the position information, comprising: determining a first answer length corresponding to the initial answer according to the first start position and the first end position, and determining a second answer length corresponding to the target answer; determining whether the first answer length is equal to the second answer length; if yes, constructing the training sample data of the answer detection model according to the query question, the target answer, the initial document and the position information.
6. The data processing method of claim 5, in the case that the execution result of determining whether the first answer length is equal to the second answer length is no, the method further comprises: determining the first start position as a second start position of the target answer in the initial document; determining a second end position of the target answer in the initial document according to the second start position and the second answer length; constructing the training sample data of the answer detection model according to the query question, the target answer, the initial document, the second start position and the second end position.
7. The data processing method of claim 6, the training sample data of the answer detection model is constructed according to the target answer, the initial document, the second start position and the second end position, comprising: replacing the initial answer in the initial document with the target answer according to the second start position and the second end position to generate a target document; taking the query question, the target answer, the target document, the second start position and the second end position as a training sample, and taking an answer as a sample label to construct the training sample data of the answer detection model.
8. The data processing method of claim 1, further comprising: in the case that it is determined that the answer usage information is not used, determining whether the accuracy of the initial answer is greater than a preset accuracy threshold; if yes, determining the position information of the initial answer in the initial document, and taking the query question, the initial answer, the initial document and the position information as a training sample, and taking an answer as a sample label to construct the training sample data; if no, taking the query question and the initial document as a training sample, and taking no answer as a sample label to construct the training sample data.
9. The data processing method of claim 1, the target answer of the query question is determined according to the answer usage information and the initial answer, comprising: in the case that it is determined that the answer usage information is used, acquiring an intermediate answer used by the object provider, and determining whether the intermediate answer is consistent with the initial answer; if no, determining the semantic similarity between each text segment in the initial document and the intermediate answer, and determining a target text segment with a semantic similarity greater than a preset similarity threshold as the target answer of the query question.
10. The data processing method of claim 1, further comprising: in a case where it is determined that the answer usage information is not used, determining whether the accuracy of the initial answer is greater than a preset accuracy threshold; if yes, adjusting the initial answer according to the to-be-queried question to generate a target answer; determining position information of the initial answer in the initial document, and constructing training sample data of the answer detection model according to the to-be-queried question, the target answer, the initial document, and the position information.
11. A question and answer processing method, comprising: obtaining a to-be-queried question submitted by a user through a dialogue interaction interface for a target commodity; obtaining an initial document, and inputting the to-be-queried question and the initial document into an answer detection model for processing to obtain an initial answer to the to-be-queried question contained in the initial document; sending the to-be-queried question and the initial answer to a commodity provider, and obtaining answer usage information generated by the commodity provider for the initial answer, wherein the commodity provider is configured to provide the target commodity for the user, the usage information includes usage or non-usage, and the usage includes direct usage and modified usage of the initial answer; determining a target answer to the to-be-queried question according to the answer usage information and the initial answer.
12. A data processing apparatus, comprising: an obtaining module configured to obtain a to-be-queried question submitted by a user for a target object, and obtain an initial document, wherein the initial document contains an initial answer corresponding to the to-be-queried question; a processing module configured to input the to-be-queried question and the initial document into an answer detection model for processing to obtain the initial answer; a sending module configured to send the to-be-queried question and the initial answer to an object provider, and obtain answer usage information generated by the object provider for the initial answer, wherein the object provider is configured to provide the target object for the user, the usage information includes usage or non-usage, and the usage includes direct usage and modified usage of the initial answer; a determining module configured to determine a target answer to the to-be-queried question according to the answer usage information and the initial answer.
13. A computing device, comprising: a memory and a processor; the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions, which, when executed by the processor, implement the steps of the data processing method of any one of claims 1 to 10 or the question and answer processing method of claim 11.
14. A computer readable storage medium storing computer executable instructions, which, when executed by a processor, implement the steps of the data processing method of any one of claims 1 to 10 or the question and answer processing method of claim 11.
15. A computer program product, characterised in that, including computer instructions, which, when executed by a processor, implement the steps of the data processing method of any one of claims 1 to 10 or the question and answer processing method of claim 11.
Citation Information
Patent Citations
Method and device for customer services, electronic device and computer readable storage medium
CN110069607A
Question and answer pair extraction method, device and equipment and readable storage medium
CN111966796A