Method, apparatus and computer program product for processing data
By gradually and iteratively removing low-quality samples from the chatbot model training data and automating dialogue data cleaning, the problem of low accuracy of the chatbot model is solved and the model performance and applicability are improved.
Patent Information
- Application Number
- CN202310239990.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-10
- Publication Date
- 2024-09-10
AI Technical Summary
Existing chatbot model training data is often dirty, resulting in poor model accuracy. Conventional dialogue data cleaning methods cannot be generalized and rely on manual labor, resulting in increased costs and low accuracy.
By gradually and iteratively identifying and removing sample subsets with matching probabilities lower than a specific threshold from the initial sample set, the model is trained, and the model accuracy is gradually improved. An automated dialogue data cleaning method is adopted, which is suitable for various types of dialogue data.
It improves the sample quality, improves the performance of the chatbot model, realizes efficient and automated cleaning of dialogue data, reduces labor costs, and is suitable for different types of data.
Smart Images

Figure CN118626599A
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate generally to the field of computers, and more particularly to methods, devices, and computer program products for processing data. Background Art
[0002] A chatbot is a computer software that can converse verbally or through text. Chatbots are built in a way that allows them to be integrated with messengers and utilize artificial intelligence (AI) technology.
[0003] Chatbots offer businesses a new perspective on communication. Providing chatbot-based services to customers, such as responding to queries and fulfilling orders without time constraints, will save costs for businesses. Summary of the invention
[0004] Embodiments of the present disclosure provide a solution for processing data.
[0005] In a first aspect of the present disclosure, a method for processing data is provided, the method comprising: determining, by an initial model based on an initial sample set, a first sample subset in an initial sample set, wherein the initial sample set includes a plurality of question-answer pairs, each of the plurality of question-answer pairs including a question and an answer; generating a first model by training the initial model with the first sample subset; determining, by the first model based on the first sample subset, a second sample subset in the first sample subset; generating a second model by training the first model with the second sample subset; determining, by the second model based on the initial sample set, a third sample subset of the initial sample set in response to at least one of the second sample subset and the second model satisfying a corresponding predetermined condition; and generating a third model by training the second model with the third sample subset.
[0006] In another aspect of the present disclosure, a device for processing data is provided, the device comprising a processor, and a memory, the memory being coupled to the processor and having instructions stored thereon, which, when executed by the processor, cause the device to perform the following actions: determining, by an initial model, a first sample subset in an initial sample set based on an initial sample set, wherein the initial sample set comprises a plurality of question-answer pairs, each of the plurality of question-answer pairs comprising a question and an answer; generating a first model by training the initial model with the first sample subset; determining, by the first model, a second sample subset in the first sample subset based on the first sample subset; generating a second model by training the first model with the second sample subset; determining, by the second model, a third sample subset of the initial sample set based on the initial sample set in response to at least one of the second sample subset and the second model satisfying a corresponding predetermined condition; and generating a third model by training the second model with the third sample subset.
[0007] In another aspect of the present disclosure, a computer program product is provided, which is tangibly stored on a non-transitory computer-readable storage medium and includes computer-executable instructions, which, when executed, cause a computer to perform a method or process according to an embodiment of the present disclosure.
[0008] Please note that the invention summary is provided to introduce a series of concepts in a simplified form, which will be further described in the detailed description below. The invention summary is not intended to identify key features or essential features of the present disclosure, nor is it intended to limit the scope of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other purposes, features and advantages of the present disclosure will become more clearly understood by describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings, in which:
[0010] Figure 1 A schematic diagram illustrating an example environment in which methods and / or processes according to embodiments of the present disclosure may be implemented;
[0011] Figure 2 A flow chart illustrating a method for processing data of an embodiment of the underlying disclosure;
[0012] Figure 3 is a diagram illustrating a framework of a data processing model according to an embodiment of the present disclosure;
[0013] Figure 4 is a diagram illustrating an exemplary process of data cleaning according to an embodiment of the present disclosure;
[0014] Figure 5 illustrates an example process for determining a sample set of results; and
[0015] Figure 6 Schematic block diagram of an example device that may be used to implement embodiments according to the present disclosure.
[0016] Throughout the drawings, same or similar reference numbers generally refer to same or similar elements. Specific embodiments
[0017] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0018] In the description of the embodiments of the present disclosure, the term "including" and its variations should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The terms "first", "second", etc. may refer to different or the same objects, unless explicitly indicated to be different.
[0019] As mentioned above, a chatbot is a computer software that uses artificial intelligence (AI) technology to converse verbally or through text. By utilizing chatbots, support staff can be relieved from questions such as "How do I purchase this product?" If the question is too complex for the chatbot, support staff can also answer the call in a timely manner.
[0020] However, there is no chatbot that can have a perfect conversation. In actual applications, there is often a mismatch between the user's questions and the chatbot's answers, which causes the public's expectations of chatbots to decline. One of the reasons for the deterioration of chatbots is that the conversation data used to train the chatbot model is always "dirty". Uncleaned conversation data deteriorates the training of the chatbot model, resulting in poor accuracy.
[0021] Some conventional conversation data cleaning methods are specific to a certain field or task and cannot be generalized. Other conventional conversation data cleaning methods rely heavily on manual work and cannot be automated, resulting in increased labor costs and poor accuracy.
[0022] In order to solve at least some of the above and other potential problems, an embodiment of the present disclosure proposes a scheme for processing data. The scheme includes: determining a first sample subset in the initial sample set by an initial model based on an initial sample set, wherein the initial sample set includes multiple question-answer pairs, each of the multiple question-answer pairs includes a question and an answer; generating a first model by training the initial model with the first sample subset; determining a second sample subset in the first sample subset by the first model based on the first sample subset; generating a second model by training the first model with the second sample subset; determining a third sample subset of the initial sample set by the second model based on the initial sample set in response to at least one of the second sample subset and the second model meeting a corresponding predetermined condition; and generating a third model by training the second model with the third sample subset. In this way, an automated conversation data cleaning approach is provided, which is applicable to various different types of conversation data. In this way, the sample quality can be improved, thereby improving the performance of the chatbot model.
[0023] Reference below Figures 1 to 6It should be understood that these exemplary embodiments are provided only to enable those skilled in the art to better understand and implement the embodiments of the present disclosure, and are not intended to limit the scope of the present disclosure in any way.
[0024] Figure 1 A schematic diagram of an example environment 100 in which the method and / or process according to an embodiment of the present disclosure can be implemented is shown. In the example environment 100, an initial sample set can be input as input 110 into a data processing model 120 according to an embodiment of the present disclosure at a computing device. The data processing model 120 performs corresponding calculations (e.g., the data processing process described below) at the computing device to implement conversation data cleaning according to an embodiment of the present disclosure. The cleaned conversation data is input into a chatbot model 130 for training the model.
[0025] For input 110, the initial sample set includes multiple question-answer pairs as samples, each of which includes a question (hereinafter, referred to as Q) and an answer (hereinafter, referred to as A). According to an embodiment of the present disclosure, the initial sample set may also include a predetermined number of randomly generated negative samples. The samples included in the initial sample set may be preprocessed, and the preprocessing process will be described in detail below. It should be understood that the questions in these question-answer pairs may correspond to multiple answers (such as Q, A, B, C, C, D, etc.). 1 -A 1 and Q 1 -A 2 ), and the answers to these questions may correspond to multiple questions (such as, Q 1 -A 1 and Q 2 -A 1 ),like Figure 1 As shown in . Here, the data cleaning process according to the embodiment of the present disclosure is described by taking conversation data (such as multiple question-answer pairs) as an example. However, it should be understood that the present disclosure is not limited to conversation data, and the method for processing data according to the embodiment of the present disclosure can also realize the cleaning of other different types of data.
[0026] At the computing device, the data processing model 120 according to an embodiment of the present disclosure receives the input 110, and executes the method for processing data according to an embodiment of the present disclosure to clean the input 110. According to an embodiment of the present disclosure, the data processing model 120 according to an embodiment of the present disclosure may include a model based on a bidirectional encoder representation from a converter (BERT). It should be understood that the present disclosure is not limited to a model based on BERT, and may also include other different models. The computing device may be any device with computing capabilities. Examples of computing devices may include smartphones, tablet computers, personal computers, laptop computers, server computers, multi-processor systems, wearable electronic devices, multimedia players, personal digital assistants (PDAs), smart home devices, consumer electronics, and the like. Examples of computing devices may also include a distributed computing environment including any one of the above systems or devices, and the like.
[0027] The conversation data cleaned by the data processing model 120 according to an embodiment of the present disclosure is input to the chatbot model 130 for training the model. According to an embodiment of the present disclosure, the chatbot model 130 may include a model based on long short-term memory (LSTM). It should be understood that the present disclosure is not limited to LSTM-based models, and may also include other different models. It should also be understood that the chatbot model 130 and the data processing model 120 according to an embodiment of the present disclosure may be deployed at the same computing device, or may be distributedly deployed at different computing devices.
[0028] Combined with the above Figure 1 A schematic diagram of an example environment 100 is depicted in which methods and / or processes according to embodiments of the present disclosure may be implemented. Figure 2 1. A flowchart of a method 200 for processing data according to an embodiment of the present disclosure is described. As described above with respect to a computing device, the method 200 for processing data according to an embodiment of the present disclosure can be executed at an edge device with computing capabilities, or at a cloud server, and the present disclosure does not limit this.
[0029] Figure 2 The flowchart of the method 200 for processing data according to the fundamentally disclosed embodiment is shown. The application of chatbots, for example, provides convenience for both enterprises and customers. For enterprises, chatbots can free employees from the heavy customer consultation, and enterprises can focus more on product design and manufacturing. For customers, chatbots can be used at any time, such as to make inquiries or place orders.
[0030] In order to ensure the accuracy of the chatbot model, the samples used to train the chatbot model are cleaned. To this end, a method 200 for image processing according to an embodiment of the present disclosure is proposed.
[0031] At 210, the initial model determines a first sample subset in the initial sample set based on the initial sample set, wherein the initial sample set includes a plurality of question-answer pairs, each of which includes a question and an answer. According to an embodiment of the present disclosure, the remaining samples in the initial sample set can be obtained as the first sample subset by removing samples whose matching probability is lower than a first matching probability threshold in the initial sample set. Compared with the original sample set, the reliability of the first sample subset is higher.
[0032] Optionally, according to an embodiment of the present disclosure, the first sample subset can be obtained by removing samples whose matching probability is lower than a first matching probability threshold and higher than a first lower limit matching probability threshold from the initial sample set, and the first lower limit matching probability threshold is less than the first matching probability threshold. In this way, it is possible to prevent excessive samples from being removed during one cleaning process.
[0033] At 220, the first model is generated by training the initial model with the first sample subset. After obtaining the first sample subset in the initial sample set determined at 210, according to an embodiment of the present disclosure, the first model can be generated by training the initial model with the determined first sample subset. In the process of generating the first model, a predetermined number of randomly generated negative samples can also be used. In other words, after the initial model is trained with the first sample subset, its parameter set can be adjusted to generate an updated first model. In this way, the accuracy of the generated first model is better than the accuracy of the initial model.
[0034] At 230, the first model determines the second sample subset in the first sample subset based on the first sample subset. According to an embodiment of the present disclosure, the first model generated at 220 can determine the second sample subset in the first sample subset based on the first sample subset determined at 210, wherein the process of determining the second sample subset can be similar to the process of determining the first sample subset described above, that is, by removing samples whose matching probability is lower than the second matching probability threshold in the first sample subset, the remaining samples in the first sample subset are obtained as the second sample subset. However, it should be noted that the second matching probability threshold is greater than the first matching probability threshold. In other words, the condition for determining the second sample subset is stricter than the condition for determining the first sample subset. Similarly, compared with the first sample subset, the reliability of the second sample subset is higher.
[0035] At 240, the second model is generated by training the first model with the second sample subset. After obtaining the second sample subset in the first sample subset determined at 230, according to an embodiment of the present disclosure, the first model generated at 220 can be trained with the determined second sample subset to generate the second model. In the process of generating the second model, a predetermined number of randomly generated negative samples can also be used. In other words, after the first model is trained with the second sample subset, its parameter set can be adjusted to generate an updated second model. Similarly, the accuracy of the generated second model is better than that of the first model.
[0036] At 250, in response to at least one of the second sample subset and the second model satisfying the corresponding predetermined condition, the second model determines a third sample subset of the initial sample set based on the initial sample set. According to an embodiment of the present disclosure, when the second sample subset determined at 230 satisfies its predetermined condition, or the second model generated at 240 satisfies its predetermined condition, or both the second sample subset and the second model satisfy the corresponding predetermined condition, the second model determines a third sample subset of the initial sample set based on the initial sample set, wherein the process of determining the third sample subset may be similar to the process of determining the first sample subset described above, but the third matching probability threshold is greater than the second matching probability threshold.
[0037] According to an embodiment of the present disclosure, at least one of the second sample subset and the second model satisfying the corresponding predetermined condition may include: the number of samples removed to obtain the second sample subset is less than a second number threshold, and the accuracy of the second model reaches a second accuracy threshold.
[0038] At 260, the third model is generated by training the second model with the third sample subset. After obtaining the third sample subset of the initial sample set determined at 250, according to an embodiment of the present disclosure, the second model generated at 240 can be trained with the determined third sample subset to generate the third model. In the process of generating the third model, a predetermined number of randomly generated negative samples can also be used. In other words, after the second model is trained with the third sample subset, its parameter set can be adjusted to generate an updated third model. Similarly, the accuracy of the generated third model is better than that of the second model. By performing data cleaning according to the method 200 for processing data according to an embodiment of the present disclosure, unreliable samples can be iteratively removed, thereby improving the quality of the sample set.
[0039] Figure 3 1 is a diagram illustrating a framework of a data processing model 120 according to an embodiment of the present disclosure. Figure 3 As shown in , the data processing model 120 according to an embodiment of the present disclosure may include a pre-processing module 310 , a cleaning module 320 and a traversal module 330 .
[0040] According to an embodiment of the present disclosure, the samples included in the initial sample set may be preprocessed. The preprocessing performed by the preprocessing module 310 may include: tokenizing the original data (such as the collected conversation data) to obtain tokens for the original data. Taking the conversation data as an example, the token may be a word, a sentence, or a paragraph.
[0041] The preprocessing performed by the preprocessing module 310 also includes: standardizing the obtained tokens to obtain standardized tokens. In some example embodiments, standardization may include standardizing uppercase and lowercase (for languages such as English) and removing punctuation so that the machine can identify identical words. In some example embodiments, standardization may include secondary stem extraction, that is, determining the basic form of different forms of a word (such as, in the case of languages such as English, singular and plural, different forms of verbs, etc.). In some example embodiments, standardization may include converting non-text tokens, such as converting "6" into "six" or "six". In some example embodiments, standardization may also include filtering stop words such as articles, prepositions, adverbs, or conjunctions.
[0042] The preprocessing performed by the preprocessing module 310 also includes: obtaining an initial sample set by adjusting the standardized tokens. In response to errors (such as typos or abbreviations, etc.) found in the standardized tokens, the preprocessing module 310 can adjust the standardized tokens, such as deleting the found errors.
[0043] As mentioned above, using unreliable data to train a model will lead to model degradation, for example, causing the chatbot to be unable to give accurate answers to users' questions. To this end, data cleaning according to an embodiment of the present disclosure is proposed, using a trained model to remove the most unreliable data, then using the remaining data to train a new model, and then using the new model to remove the most unreliable data from the remaining data, and so on until the model achieves high accuracy on the training set. However, the remaining data after screening may be relatively small. In order to recall some data that was incorrectly filtered out by the early model, we apply the latest model to the initial full amount of data, so that removing the most unreliable data will leave more data for the next iteration.
[0044] According to an embodiment of the present disclosure, the cleaning module 320 may perform data cleaning according to an embodiment of the present disclosure on the initial sample set obtained from the preprocessing module 310. Figure 2In addition to the description made above, the method for processing data according to an embodiment of the present disclosure performed by the cleaning module 320 may further include: in response to the Nth sample subset and the Nth model not satisfying the corresponding predetermined condition, the Nth model determines the N+1th sample subset in the Nth sample subset based on the Nth sample subset, N is a positive integer greater than or equal to 2; and generates the N+1th model by training the Nth model with the N+1th sample subset. According to an embodiment of the present disclosure, determining the N+1th sample subset in the Nth sample subset may include: removing samples whose matching probability is lower than the Nth matching probability threshold in the Nth sample subset, obtaining the remaining samples in the Nth sample subset as the N+1th sample subset, and the Nth matching probability threshold is greater than the N-1th matching probability threshold.
[0045] Optionally, according to an embodiment of the present disclosure, the N+1th sample subset can be obtained by removing samples whose matching probability is lower than the Nth matching probability threshold and higher than the Nth lower limit matching probability threshold from the Nth sample subset, and the Nth lower limit matching probability threshold is less than the Nth matching probability threshold. In this way, it is possible to prevent excessive samples from being removed in one cleaning process.
[0046] The method for processing data according to an embodiment of the present disclosure performed by the cleaning module 320 may also include: in response to at least one of the N+1th sample subset and the N+1th model satisfying corresponding predetermined conditions, the N+1th model determines the N+2th sample subset of the initial sample set based on the initial sample set; and generates the N+2th model by training the N+1th model with the N+2th sample subset.
[0047] According to an embodiment of the present disclosure, at least one of the N+1th sample subset and the N+1th model satisfies the corresponding predetermined conditions, which may include: the number of samples removed to obtain the N+1th sample subset is less than the N+1th number threshold, and the accuracy of the N+1th model reaches the N+1th accuracy threshold.
[0048] In addition, the method for processing data according to an embodiment of the present disclosure performed by the cleaning module 320 may also include: in response to the Mth sample subset being determined, determining the Mth sample subset as a result sample set, where M is a predetermined iteration number threshold, and M is a positive integer greater than or equal to 1; and inputting the result sample set as input data into the chatbot model based on long short-term memory. Figure 4 A method for processing data according to an embodiment of the present disclosure is further described.
[0049] According to an embodiment of the present disclosure, the result sample set from the cleaning module 320 may be traversed to determine whether there are degraded samples in the result sample set, and in response to determining that there are degraded samples in the result sample set, the result sample set is updated. According to an embodiment of the present disclosure, updating the result sample set may include deleting the determined degraded samples in the result sample set. In an exemplary embodiment, the degraded samples may include samples that are obviously erroneous.
[0050] Figure 4 4 is a diagram illustrating an exemplary process 400 of data cleaning according to an embodiment of the present disclosure. Figure 4 As shown in , the initial model 402 determines the first sample subset 410 in the initial sample set 401 based on the initial sample set 401. According to an embodiment of the present disclosure, determining the first sample subset 410 may include: removing samples 410' whose matching probability is lower than a first matching probability threshold in the initial sample set 401, and obtaining the remaining samples in the initial sample set 401 as the first sample subset 410. In an example, the first matching probability threshold may be 0.5. Since the first sample subset 410 is determined by removing samples with lower reliability (such as samples 410' with lower matching probability) in the initial sample set 401, the quality of the first sample subset 410 is higher than that of the initial sample set 401, because the reliability of the first sample subset 410 is higher.
[0051] The first model 411 is generated by training the initial model 402 with the first sample subset 410. Since the first sample subset 410 is determined by removing unreliable samples (such as the sample 410' with a low matching probability) from the initial sample set 401, the first model 411 generated by training the initial model 402 with the first sample subset 410 has improved accuracy compared with the initial model 402.
[0052] The first model 411 determines the second sample subset 420 in the second sample subset 420 based on the first sample subset 410. According to an embodiment of the present disclosure, determining the second sample subset 420 may include: removing the sample 420' whose matching probability is lower than the second matching probability threshold in the first sample subset 410, and obtaining the remaining samples in the first sample subset 410 as the second sample subset 420. In the example, the second matching probability threshold may be 0.6, which is higher than the first matching probability threshold in the above example. Since the second sample subset 420 is determined by removing the sample 420' with a lower matching probability on the basis of the first sample subset 410, and the condition for determining the second sample subset 420 is stricter than the condition for determining the first sample subset 410 (i.e., the second matching probability threshold is greater than the first matching probability threshold), the quality of the second sample subset 420 is higher than the quality of the first sample subset 410.
[0053] The second model 420 is generated by training the first model 411 with the second sample subset 420. According to an embodiment of the present disclosure, a more preferred second sample subset 420 is used to train the first model 411, such as adjusting its parameters, to generate a second model 420 with higher accuracy.
[0054] In response to the second sample subset 420 satisfying a predetermined condition therefor (for example, the number of samples 420' removed to obtain the second sample subset 420 is less than the second number threshold), or in response to the second model 421 satisfying a predetermined condition therefor (for example, the accuracy of the second model 421 reaches the second accuracy threshold), or both conditions are satisfied, the second model 421 determines a third sample subset 430 of the initial sample set 401 based on the initial sample set 401. According to an embodiment of the present disclosure, determining the third sample subset 430 may include: removing samples 430' having a matching probability lower than a third matching probability threshold in the initial sample set 401, and obtaining the remaining samples in the initial sample set 401 as the third sample subset 430. In the example, the third matching probability threshold may be 0.7, which is higher than the first matching probability threshold and the second matching probability threshold in the above example. That is, as the number of iterations increases, the conditions for obtaining the sample subset become more and more stringent.
[0055] The third model 431 is generated by training the second model 421 with the third sample subset 430. According to an embodiment of the present disclosure, a more preferred third sample subset 430 is used to train the second model 421, for example, to adjust its parameters, so as to generate a third model 431 with higher accuracy.
[0056] After several iterations, the quality of the determined sample subsets is getting higher and higher, and the accuracy of the generated model is also getting higher and higher. In response to the Nth sample subset 440 and the Nth model 441 not satisfying the corresponding predetermined conditions, the Nth model 441 determines the N+1th sample subset 450 in the Nth sample subset 440 based on the Nth sample subset 440, where N is a positive integer greater than or equal to 2. According to an embodiment of the present disclosure, determining the N+1th sample subset 450 in the Nth sample subset 440 may include: removing samples 440' whose matching probabilities are lower than the Nth matching probability threshold in the Nth sample subset 440, and obtaining the remaining samples in the Nth sample subset 440 as the N+1th sample subset 450, where the Nth matching probability threshold is greater than the N-1th matching probability threshold.
[0057] The N+1th model 451 is generated by training the N-th model 441 through the N+1-th sample subset 450. According to an embodiment of the present disclosure, determining the N+1-th sample subset in the N-th sample subset may include: removing samples whose matching probabilities are lower than an N-th matching probability threshold in the N-th sample subset, obtaining the remaining samples in the N-th sample subset as the N+1-th sample subset, and the N-th matching probability threshold is greater than the N-1-th matching probability threshold.
[0058] In response to at least one of the N+1th sample subset 450 and the N+1th model 451 satisfying the corresponding predetermined condition, the N+1th model 451 determines the N+2th sample subset 460 of the initial sample set 401 based on the initial sample set 401. According to an embodiment of the present disclosure, at least one of the N+1th model 450 and the N+1th sample subset 451 satisfying the corresponding predetermined condition includes: the number of samples 450' removed to obtain the N+1th sample subset 450 is less than the N+1th number threshold, and the accuracy of the N+1th model 451 reaches the N+1th accuracy threshold.
[0059] The N+1th model 451 is trained by the N+2th sample subset 460 to generate the N+2th model 461. According to an embodiment of the present disclosure, the N+1th model 451 is trained using the more preferred N+2th sample subset 460, for example, by adjusting its parameters, so that a more accurate N+2th model 461 can be generated. Further iterations can be performed, for example, unreliable samples 460' in the N+2th sample subset 460 can be removed to obtain the remaining samples in the N+2th sample subset 460 as the N+3th sample subset, and so on.
[0060] In response to the Mth sample subset 470 being determined, the Mth sample subset 470 is determined as a result sample set, where M is a predetermined iteration number threshold, and M is a positive integer greater than or equal to 1. The determined result sample set is input as input data to a chatbot model (such as, Figure 1 The chatbot model 130 shown in FIG. 1 is shown in FIG. 130 . It should be noted that Figure 4 The number of iterations performed and the number of models generated shown in are merely exemplary, and a greater or lesser number of iterations may be performed and a greater or lesser number of models may be generated. Figure 5 The process of determining the result sample set is further described.
[0061] Figure 5 An example process 500 for determining a result sample set is illustrated. Figure 5As described in , at 510, an iteration number threshold M is set, and M can be a positive integer greater than or equal to 1. At 520, it is determined whether the number of iterations for data cleaning reaches the set iteration number threshold M, that is, whether the Mth sample subset is determined. If it is yes at 520, then proceed to 530, stop iteration, output the determined Mth sample subset as a result sample set, and output it to the chatbot model for training. If it is no at 520, then proceed to 540, continue iteration until the Mth sample subset is determined.
[0062] According to the embodiments of the present disclosure, a data cleaning solution is implemented, which overcomes the difficulty of generalization and extensive manual determination in traditional methods. Through the method for processing data according to the embodiments of the present disclosure, a variety of different types of data can be cleaned, and the data cleaning process is efficient and automated. The framework for data cleaning of the embodiments of the present disclosure also reduces the computing requirements. In this way, the sample quality is improved, thereby improving the performance of the chatbot model.
[0063] Figure 6 Schematic block diagram of an example device 600 that can be used to implement some embodiments of the present disclosure is shown. Figure 6 As shown in FIG. 6 , device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 602 or loaded from a storage unit 608 into a random access memory (RAM) 603. In RAM 603, various programs and data required for the operation of device 600 can also be stored. CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to bus 604.
[0064] A number of components in the device 600 are connected to the I / O interface 605, including: an input unit 606, such as a keyboard, a mouse, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0065] The various processes and processing described above, such as method 200, may be performed by processing unit 601. For example, in some embodiments, method 200 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 603 and executed by CPU 601, one or more actions of method 200 described above may be performed.
[0066] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for executing various aspects of the present disclosure.
[0067] Computer readable storage medium can be a tangible device that can hold and store instructions used by an instruction execution device. Computer readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive lists) of computer readable storage medium include: portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), static random access memories (SRAM), portable compact disk read-only memories (CD-ROM), digital versatile disks (DVD), memory sticks, floppy disks, mechanical encoding devices, such as punch cards or convex structures in grooves on which instructions are stored, and any suitable combination thereof. Computer readable storage medium used herein is not interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagated by waveguides or other transmission media (e.g., light pulses by optical fiber cables), or electrical signals transmitted by wires.
[0068] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0069] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0070] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0071] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0072] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0073] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0074] The embodiments of the present disclosure are described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for processing data, include: Determining, by the initial model based on the initial sample set, a first sample subset in the initial sample set, wherein the initial sample set includes a plurality of question-answer pairs, each of the plurality of question-answer pairs including a question and an answer; Generate a first model by training the initial model with the first sample subset; Determining, by the first model and based on the first sample subset, a second sample subset in the first sample subset; Generate a second model by training the first model with the second sample subset; In response to at least one of the second sample subset and the second model satisfying a corresponding predetermined condition, determining, by the second model, a third sample subset of the initial sample set based on the initial sample set; and The second model is trained by the third sample subset to generate a third model.
2. The method according to claim 1, further comprising: include: In response to the Nth sample subset and the Nth model not satisfying corresponding predetermined conditions, the Nth model determines an N+1th sample subset in the Nth sample subset based on the Nth sample subset, where N is a positive integer greater than or equal to 2; as well as The N+1th model is generated by training the Nth model with the N+1th sample subset.
3. The method according to claim 2, in: Determining the first sample subset in the initial sample set includes: removing samples whose matching probability is lower than a first matching probability threshold in the initial sample set, obtaining remaining samples in the initial sample set as the first sample subset; and Determining the N+1th sample subset in the Nth sample subset includes: removing samples whose matching probabilities are lower than an Nth matching probability threshold in the Nth sample subset, obtaining the remaining samples in the Nth sample subset as the N+1th sample subset, and the Nth matching probability threshold is greater than the N-1th matching probability threshold.
4. The method according to claim 3, in: The first sample subset is further obtained by removing samples whose matching probabilities are lower than the first matching probability threshold and higher than a first lower matching probability threshold from the initial sample set, wherein the first lower matching probability threshold is smaller than the first matching probability threshold; and The N+1th sample subset is further obtained by removing samples whose matching probabilities are lower than the Nth matching probability threshold and higher than the Nth lower limit matching probability threshold from the Nth sample subset, and the Nth lower limit matching probability threshold is smaller than the Nth matching probability threshold.
5. The method according to claim 2, further comprising: include: In response to at least one of the N+1th sample subset and the N+1th model satisfying a corresponding predetermined condition, the N+1th model determines an N+2th sample subset of the initial sample set based on the initial sample set; as well as The N+2 model is generated by training the N+1 model with the N+2 sample subset.
6. The method according to claim 5, wherein At least one of the second sample subset and the second model satisfies a corresponding predetermined condition include: The number of samples removed to obtain the second sample subset is less than a second number threshold, and the accuracy of the second model reaches a second accuracy threshold; and At least one of the N+1th sample subset and the N+1th model satisfies corresponding predetermined conditions, including: the number of samples removed to obtain the N+1th sample subset is less than the N+1th number threshold, and the accuracy of the N+1th model reaches the N+1th accuracy threshold.
7. The method according to claim 5, further comprising: include: In response to the Mth sample subset being determined, determining the Mth sample subset as a result sample set, where M is a predetermined iteration number threshold, and M is a positive integer greater than or equal to 1; as well as The result sample set is input as input data into a chatbot model based on long short-term memory.
8. The method according to claim 1, in: The initial model is a model based on a bidirectional encoder representation from a transformer; and The samples in the initial sample set are preprocessed.
9. The method according to claim 8, wherein the pretreatment include: By tokenizing the original data, a token specific to the original data is obtained; normalizing said token; obtaining the standardized token; as well as The initial sample set is obtained by adjusting the standardized tokens.
10. The method according to claim 7, further comprising: include: By traversing the result sample set, determining whether there is a degraded sample in the result sample set; as well as In response to determining that the degraded sample exists in the result sample set, the result sample set is updated.
11. A device for processing data, include: processor; as well as A memory is coupled to the processor and stores instructions, which, when executed by the processor, cause the device to perform the following actions: Determining, by the initial model based on the initial sample set, a first sample subset in the initial sample set, wherein the initial sample set includes a plurality of question-answer pairs, each of the plurality of question-answer pairs including a question and an answer; Generate a first model by training the initial model with the first sample subset; Determining, by the first model and based on the first sample subset, a second sample subset in the first sample subset; Generate a second model by training the first model with the second sample subset; In response to at least one of the second sample subset and the second model satisfying a corresponding predetermined condition, determining, by the second model, a third sample subset of the initial sample set based on the initial sample set; and The second model is trained by the third sample subset to generate a third model.
12. The device according to claim 11, wherein the action further include: In response to the Nth sample subset and the Nth model not satisfying corresponding predetermined conditions, the Nth model determines an N+1th sample subset in the Nth sample subset based on the Nth sample subset, where N is a positive integer greater than or equal to 2; as well as The N+1th model is generated by training the Nth model with the N+1th sample subset.
13. The device according to claim 12, in: Determining the first sample subset in the initial sample set includes: removing samples whose matching probability is lower than a first matching probability threshold in the initial sample set, obtaining remaining samples in the initial sample set as the first sample subset; and Determining the N+1th sample subset in the Nth sample subset includes: removing samples whose matching probabilities are lower than an Nth matching probability threshold in the Nth sample subset, obtaining the remaining samples in the Nth sample subset as the N+1th sample subset, and the Nth matching probability threshold is greater than the N-1th matching probability threshold.
14. The device according to claim 13, in: The first sample subset is further obtained by removing samples whose matching probabilities are lower than the first matching probability threshold and higher than a first lower matching probability threshold from the initial sample set, wherein the first lower matching probability threshold is smaller than the first matching probability threshold; and The N+1th sample subset is further obtained by removing samples whose matching probabilities are lower than the Nth matching probability threshold and higher than the Nth lower limit matching probability threshold from the Nth sample subset, and the Nth lower limit matching probability threshold is smaller than the Nth matching probability threshold.
15. The device according to claim 12, wherein the action further include: In response to at least one of the N+1th sample subset and the N+1th model satisfying a corresponding predetermined condition, the N+1th model determines an N+2th sample subset of the initial sample set based on the initial sample set; as well as The N+2th model is generated by training the N+1th model through the N+2th sample subset.
16. The device according to claim 15, in: At least one of the second sample subset and the second model satisfies the corresponding predetermined condition, including: the number of samples removed to obtain the second sample subset is less than a second number threshold, and the accuracy of the second model reaches a second accuracy threshold; and At least one of the N+1th sample subset and the N+1th model satisfies corresponding predetermined conditions, including: the number of samples removed to obtain the N+1th sample subset is less than the N+1th number threshold, and the accuracy of the N+1th model reaches the N+1th accuracy threshold.
17. The device according to claim 15, wherein the action further include: In response to the Mth sample subset being determined, determining the Mth sample subset as a result sample set, where M is a predetermined iteration number threshold, and M is a positive integer greater than or equal to 1; as well as The result sample set is input as input data into a chatbot model based on long short-term memory.
18. The device according to claim 11, in: The initial model is a model based on a bidirectional encoder representation from a transformer; and The samples in the initial sample set are preprocessed.
19. The device according to claim 17, wherein the action further include: By traversing the result sample set, determining whether there is a degraded sample in the result sample set; as well as In response to determining that the degraded sample exists in the result sample set, the result sample set is updated.
20. A computer program product tangibly stored on a non-transitory computer readable storage medium and comprising computer executable instructions that, when executed, cause a computer to: Determining, by the initial model based on the initial sample set, a first sample subset in the initial sample set, wherein the initial sample set includes a plurality of question-answer pairs, each of the plurality of question-answer pairs including a question and an answer; Generate a first model by training the initial model with the first sample subset; Determining, by the first model and based on the first sample subset, a second sample subset in the first sample subset; Generate a second model by training the first model with the second sample subset; In response to at least one of the second sample subset and the second model satisfying a corresponding predetermined condition, determining, by the second model, a third sample subset of the initial sample set based on the initial sample set; and The second model is trained by the third sample subset to generate a third model.
