CN116701587A - Question and answer method and device based on machine learning - Google Patents
Question and answer method and device based on machine learning Download PDFInfo
- Publication number
- CN116701587A CN116701587A CN202310648035.5A CN202310648035A CN116701587A CN 116701587 A CN116701587 A CN 116701587A CN 202310648035 A CN202310648035 A CN 202310648035A CN 116701587 A CN116701587 A CN 116701587A
- Authority
- CN
- China
- Prior art keywords
- sample
- question
- answer
- description information
- model
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 48
- 238000010801 machine learning Methods 0.000 title claims abstract description 20
- 238000012549 training Methods 0.000 claims abstract description 44
- 238000004590 computer program Methods 0.000 claims description 15
- 238000003860 storage Methods 0.000 claims description 15
- 230000008569 process Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 8
- 238000002372 labelling Methods 0.000 description 7
- 238000012545 processing Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000000750 progressive effect Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000004075 alteration Effects 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013145 classification model Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000005065 mining Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000002085 persistent effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001052 transient effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/30—Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
- G06F16/33—Querying
- G06F16/332—Query formulation
- G06F16/3329—Natural language query formulation or dialogue systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Artificial Intelligence (AREA)
- Human Computer Interaction (AREA)
- Computational Linguistics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Databases & Information Systems (AREA)
- Computing Systems (AREA)
- Electrically Operated Instructional Devices (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
One or more embodiments of the present specification disclose a machine learning-based question-answering method and apparatus. The method comprises the following steps: object description information corresponding to the target object and a first sample question and a first sample answer related to the object description information corresponding to the target object are acquired. And inputting object description information corresponding to the target object, the first sample question and the first sample answer into a pre-trained first question-answer model to obtain a sample prediction answer corresponding to the first sample question and a sample prediction question corresponding to the first sample answer. And generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer and the sample predicted question. And inputting the object description information and the corresponding first sample questions and answers into a second question and answer model to be trained for model training, and obtaining a trained second question and answer model.
Description
Technical Field
The present disclosure relates to the field of artificial intelligence technologies, and in particular, to a machine learning-based question-answering method and apparatus.
Background
In an intelligent customer service system, a machine (namely intelligent customer service) needs to answer a user's question in the process of interacting with the user, and the correctness of the machine to answer the question directly influences the interaction effect with the user. In practical application, as new scenes are online or old scenes are updated, users can continuously present new questions, and intelligent customer service can hardly respond to the new questions in time to make optimization, so that the answer coverage rate of the intelligent customer service to user questions is reduced. Therefore, how to improve the answer coverage rate of intelligent customer service to user questions to obtain better interaction effect becomes one of the questions to be solved in the current stage.
Disclosure of Invention
In one aspect, one or more embodiments of the present specification provide a machine learning based question-answering method, including: object description information corresponding to a target object is acquired, and a first sample question and a first sample answer related to the object description information are acquired. And inputting the object description information, the first sample questions and the first sample answers into a pre-trained first question-answer model to obtain sample prediction answers corresponding to the first sample questions and sample prediction questions corresponding to the first sample answers. And generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer and the sample predicted question. And inputting the object description information and the first sample question-answer pair into a second question-answer model to be trained for model training, and obtaining a trained second question-answer model.
In another aspect, one or more embodiments of the present disclosure provide a machine learning based question-answering apparatus, including: the acquisition module acquires object description information corresponding to a target object, and a first sample question and a first sample answer related to the object description information. And the prediction module inputs the object description information, the first sample questions and the first sample answers into a pre-trained first question-answer model to obtain sample prediction answers corresponding to the first sample questions and sample prediction questions corresponding to the first sample answers. And the generation module is used for generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample prediction answer, the first sample answer and the sample prediction question. And the first training module is used for inputting the object description information and the first sample question-answer pair into a second question-answer model to be trained for model training, so as to obtain a trained second question-answer model.
In yet another aspect, one or more embodiments of the present specification provide an electronic device comprising a processor and a memory electrically connected to the processor, the memory storing a computer program, the processor configured to invoke and execute the computer program from the memory to implement: object description information corresponding to a target object is acquired, and a first sample question and a first sample answer related to the object description information are acquired. And inputting the object description information, the first sample questions and the first sample answers into a pre-trained first question-answer model to obtain sample prediction answers corresponding to the first sample questions and sample prediction questions corresponding to the first sample answers. And generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer and the sample predicted question. And inputting the object description information and the first sample question-answer pair into a second question-answer model to be trained for model training, and obtaining a trained second question-answer model.
In yet another aspect, the present description provides a storage medium storing a computer program executable by a processor to implement the following flow: object description information corresponding to a target object is acquired, and a first sample question and a first sample answer related to the object description information are acquired. And inputting the object description information, the first sample questions and the first sample answers into a pre-trained first question-answer model to obtain sample prediction answers corresponding to the first sample questions and sample prediction questions corresponding to the first sample answers. And generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer and the sample predicted question. And inputting the object description information and the first sample question-answer pair into a second question-answer model to be trained for model training, and obtaining a trained second question-answer model.
Drawings
In order to more clearly illustrate one or more embodiments of the present specification or the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described, and it is apparent that the drawings in the following description are only some embodiments described in one or more embodiments of the present specification, and other drawings may be obtained according to these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is a schematic flow chart of a machine learning based question-answering method according to one embodiment of the present disclosure;
FIG. 2 is a schematic flow chart of a machine learning based question-answering method according to another embodiment of the present description;
FIG. 3 is a schematic flow chart of a machine learning based question-answering method according to yet another embodiment of the present disclosure;
FIG. 4 is a schematic block diagram of a machine learning based question and answer apparatus according to an embodiment of the disclosure;
fig. 5 is a schematic block diagram of an electronic device according to an embodiment of the present description.
Detailed Description
One or more embodiments of the present disclosure provide a question-answering method and device based on machine learning, so as to solve a problem that an answer coverage rate of an intelligent customer service to a user question is low.
In order to enable a person skilled in the art to better understand the technical solutions in one or more embodiments of the present specification, the technical solutions in one or more embodiments of the present specification will be clearly and completely described below with reference to the drawings in one or more embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which may be made by one of ordinary skill in the art based on one or more embodiments of the present disclosure without departing from the scope of the invention as defined by the claims.
In the intelligent customer service system, the intelligent customer service needs to answer the questions of the user in the process of interacting with the user, and whether the intelligent customer service answers the questions directly influences the interaction effect with the user. In the related technology, the problems of the user are clustered and marked through a supervised algorithm, so that the model can identify the intention of the problems of the user, and then an operator sets answers for the intention to finish the answers of the problems. However, with the online new scenes or the update of the old scenes, the user can continuously present new questions, so that operators are required to label and summarize the new questions, and the intelligent customer service is difficult to optimize the new questions in time due to the large demand of labeling resources, so that the answer coverage rate of the intelligent customer service to the user questions is reduced.
Fig. 1 is a schematic flow chart of a machine learning based question-answering method according to one embodiment of the present disclosure, as shown in fig. 1, the method includes:
s102, acquiring object description information corresponding to a target object, and a first sample question and a first sample answer related to the object description information.
The object description information may be description class information related to the object, such as at least one description content of selling information, using instructions, advantages and disadvantages, detailed using process, fault type analysis, and the like of the object.
The first sample question and the first sample answer match each other, i.e. the first sample answer is the answer provided for the corresponding first sample question. The first sample problem related to the object description information refers to a problem posed based on the object description information. Assuming that the object description information is descriptive of vending information for the target object, the first sample question may include a question related to vending information, e.g., the first sample question is: what is the price of product a?
The first sample answer related to the object description information refers to an answer provided based on the object description information. Optionally, the object description information includes a first sample answer. Assuming that the object description information is a description content of vending information of the target object, including a description of vending price of the target object, the first sample answer matched with the first sample question may include: the price of product A is 5000 yuan.
For example, in a computer sales scenario, the object description information associated with a computer includes sales information for the computer. It is assumed that there are several users who present questions related to the sales information, which may be regarded as first sample questions. The operator can provide a reply (i.e. answer) to the computer for the sales information of the computer:
"QA-how much money: the price of the computer is 5000 yuan.
QA-tim of value: your goods are all strictly satisfied with 30 days of price guarantee, and no reason can be changed within 7 days.
......”
In the above example, the first sample answer includes: the computer price is 5000 yuan and you are good, and the price of the commodity is strictly met for 30 days, and the commodity can be changed without reason within 7 days. The first sample answers may be provided for different question categories, i.e. a plurality of first sample questions correspond to the same question category and a first sample question corresponding to the same question category corresponds to the same first sample answer. Therefore, the question category of "how much money" in the above example may be a price class question, the question category of "valuable tim" may be a price protection class question, "the computer price is 5000 yuan" as the first sample answer corresponding to the price class question, "hello, all of our commodities strictly satisfy 30 days of price protection, and no reason can be given back" as the first sample answer corresponding to the price protection class question within 7 days.
S104, inputting the object description information, the first sample questions and the first sample answers into a pre-trained first question-answer model to obtain sample prediction answers corresponding to the first sample questions and sample prediction questions corresponding to the first sample answers.
The first question-answer model is trained based on a plurality of second sample questions and second sample answers which are matched with each other. Optionally, first obtaining a plurality of second sample question-answer pairs, each second sample question-answer pair including a pair of second sample questions and second sample answers that match each other; and secondly, inputting a plurality of second sample question-answer pairs into a first question-answer model to be trained for model training, so as to obtain a pre-trained first question-answer model.
The second sample question-answer pair used to train the first question-answer model may be a question-answer pair in any scenario. Alternatively, a matching question-answer pair may be captured from any open source search engine data as a second sample question-answer pair. After a plurality of second sample question-answer pairs are input into a first question-answer model to be trained, the first question-answer model to be trained performs feature learning and iterative training based on the second sample question-answer pairs, and accordingly a pre-trained first question-answer model is obtained.
The first question-answer model of the pre-training has the following capabilities: after the object description information and the first sample answer are input, outputting a question corresponding to the first sample answer; and outputting an answer corresponding to the first sample question after inputting the object description information and the first sample question. Therefore, the object description information and the first sample questions are input into the first question-answer model, and the first question-answer model predicts answers corresponding to the first sample questions based on the object description information, so that sample predicted answers corresponding to the first sample questions can be obtained. And inputting the object description information and the first sample answer into a first question-answer model, and predicting the questions corresponding to the first sample answer by the first question-answer model based on the object description information to obtain sample prediction questions corresponding to the first sample answer.
Optionally, the first question-answer model predicts the answer corresponding to the first sample question based on the object description information, and when obtaining a sample predicted answer corresponding to the first sample question, a plurality of candidate answers corresponding to the first sample question can be obtained. In this case, one candidate answer with the highest confidence level may be selected from the plurality of candidate answers, and used as a sample predicted answer corresponding to the first sample question. For example, the multiple answers to be selected are compared with standard answers corresponding to the first sample questions, the similarity between each answer to be selected and the standard answer is determined, and then the confidence corresponding to the answer to be selected with the highest similarity among the multiple answers to be selected is determined to be the highest. That is, the same question may correspond to a plurality of answers, in which case the first question-answering model selects one answer with the highest confidence from the plurality of answers as the answer matching the question. The highest confidence of the answer indicates that the answer has the highest similarity with the predetermined standard answer. The standard answer to which the first sample question corresponds may be predetermined by the user.
S106, generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample prediction answer, the first sample answer and the sample prediction question.
Wherein each first sample question-answer pair may comprise: the first sample question and the sample predicted answer that match each other, or the first sample answer and the sample predicted question that match each other.
S108, inputting the object description information and the first sample questions and answers into a second question and answer model to be trained for model training, and obtaining a trained second question and answer model.
By adopting the technical scheme of one or more embodiments of the present specification, the object description information corresponding to the target object is obtained, and the first sample question and the first sample answer related to the object description information are obtained. And inputting the object description information, the first sample question and the first sample answer into a pre-trained first question-answer model to obtain a sample prediction answer corresponding to the first sample question and a sample prediction question corresponding to the first sample answer. And generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer and the sample predicted question. Further, the object description information and the first sample question and answer pair are input into a second question and answer model to be trained to carry out model training, and a trained second question and answer model is obtained. Therefore, the first sample question-answer pair used for training the second question-answer model is obtained through the prediction of the pre-trained first question-answer model, the user does not need to manually label answers for a large number of questions respectively, only a small number of first sample questions and first sample answers are provided, the first sample questions and the first sample answers are respectively predicted through the pre-trained first question-answer model, a larger number of first sample question-answer pairs can be obtained, a large number of labeling resources are saved for obtaining sample data (namely the first sample question-answer pairs), and the training efficiency of the second question-answer model is improved. In addition, even if more new questions are presented by a user along with the online of a new scene or the update of an old scene, the user does not need to manually mark, only the pre-trained first question-answer model is used for predicting corresponding answers, and then the second question-answer model is optimized based on the prediction results, so that the second question-answer model can timely cope with the new question-answer requirements, and the answer coverage rate of intelligent customer service user questions is improved.
In one embodiment, the first sample question-answer pair includes a target sample question and a target sample answer that match each other. As shown in fig. 2, the training process of the second question-answer model includes the following steps:
s202, inputting the object description information and the first sample question-answer pair into a second question-answer model to be trained, and predicting an answer corresponding to the target sample question based on the object description information through the second question-answer model to be trained to obtain a predicted answer corresponding to the target sample question.
The second question-answer model to be trained can be any existing constructed classification model, and the second question-answer model is used for identifying the problem category so as to output correct answers according to the problem category. And analyzing the second question-answer model to be trained based on the object description information, and mining answers corresponding to the target sample questions, namely predicted answers, from the object description information through analysis.
S204, comparing the predicted answer with a target sample answer corresponding to the target sample question to obtain a comparison result.
S206, training the second question-answer model to be trained according to the comparison result, and obtaining a trained second question-answer model.
The comparison result can be used for representing the similarity (or the difference) between the predicted answer and the target sample answer, and further judging whether the second question-answer model meets the preset iteration stopping condition according to the similarity (or the difference) between the predicted answer and the target sample answer, and stopping iteration if the second question-answer model meets the preset iteration stopping condition, so that the second question-answer model is obtained. If the iteration parameters do not meet the preset iteration stopping conditions, the model parameters are adjusted to enter the iteration of the next round until the preset iteration stopping conditions are met.
In one embodiment, each target sample question corresponds to a respective question category, and target sample questions belonging to the same question category correspond to the same target sample answer.
When the answer corresponding to the target sample question is predicted based on the object description information to obtain the predicted answer corresponding to the target sample question (i.e., when step S202 is executed), the target question category corresponding to the target sample question may be determined based on the object description information. And then, according to the corresponding relation between the preset question category and the answer, determining that the answer corresponding to the target question category is the predicted answer corresponding to the target sample question.
In the corresponding relation between the preset question categories and the answers, each question category corresponds to one answer. Since multiple questions may correspond to the same class of questions, multiple questions may correspond to the same answer. Based on the above, the answer corresponding to each question category can be predetermined, so that in the process of predicting the answer by the model, the question category corresponding to the question can be predicted first, and then the corresponding predicted answer can be output according to the question category. It can be seen that although the present embodiment also needs to determine an answer in advance, the answer is for the question category, and not for each question, a corresponding answer is provided in advance. In the same scenario, the number of question categories is small, which results in a small number of predetermined answers, and does not consume excessive labeling resources.
Along the above examples, assume that the problem categories include price class problems and price protection class problems. The computer price is 5000 yuan and is an answer corresponding to the price class question, the price of the commodity is "hello", the commodity strictly meets 30 days of price protection, and the price class question can be replaced for no reason within 7 days. And when the second question-answer model predicts answers, classifying the target sample questions, and determining that the corresponding predicted answers are 5000 yuan under the assumption that the question category of the target sample questions is price class questions.
In one embodiment, after training to obtain a second question-answer model, the second question-answer model may be put into use. The second question model may be applied to the intelligent customer service so that the intelligent customer service can output a correct answer to the user's question, as shown in fig. 3, and may include the steps of:
s302, acquiring a target problem.
S304, inputting the target questions into a trained second question-answering model, and determining the question types corresponding to the target questions through the trained second question-answering model.
S306, determining that the answer corresponding to the question category corresponding to the target question is the target answer corresponding to the target question according to the corresponding relation between the preset question category and the answer.
Along the above examples, assume that the problem categories include price class problems and price protection class problems. The computer price is 5000 yuan and is an answer corresponding to the price class question, the price of the commodity is "hello", the commodity strictly meets 30 days of price protection, and the price class question can be replaced for no reason within 7 days. And when the second question-answering model predicts answers, classifying the target questions, and determining that the corresponding target answer is ' 5000 yuan ' in computer price ' assuming that the question category of the target questions is determined to be price type questions.
Therefore, in this embodiment, only the answer corresponding to the question category needs to be predetermined, and no corresponding answer needs to be provided for each question, so that the question category corresponding to the target question is predicted through the second question-answer model, and then the answer corresponding to the question category is further determined and used as the target answer corresponding to the target question, thereby greatly saving the labeling resource.
In summary, particular embodiments of the present subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may be advantageous.
The machine learning-based question-answering method provided by the one or more embodiments of the present specification is based on the same thought, and the one or more embodiments of the present specification further provide a machine learning-based question-answering device.
Fig. 4 is a schematic flow chart of a machine learning based question-answering apparatus according to one embodiment of the present disclosure, as shown in fig. 4, the apparatus includes:
an acquisition module 41 that acquires object description information corresponding to a target object, and a first sample question and a first sample answer related to the object description information;
the prediction module 42 inputs the object description information, the first sample question and the first sample answer into a pre-trained first question-answer model to obtain a sample prediction answer corresponding to the first sample question and a sample prediction question corresponding to the first sample answer;
a generating module 43, configured to generate a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer, and the sample predicted question;
the first training module 44 performs model training on the object description information and the first sample question-answer pair input into a second question-answer model to be trained, so as to obtain a trained second question-answer model.
In one embodiment, the prediction module 42 includes:
the first prediction unit is used for inputting the object description information and the first sample question into the first question-answer model, predicting an answer corresponding to the first sample question based on the object description information, and obtaining the sample prediction answer corresponding to the first sample question;
and the second prediction unit is used for inputting the object description information and the first sample answer into the first question-answer model, predicting the question corresponding to the first sample answer based on the object description information, and obtaining the sample prediction question corresponding to the first sample answer.
In one embodiment, the first prediction unit performs the following steps when predicting an answer corresponding to the first sample question based on the object description information to obtain the sample predicted answer corresponding to the first sample question:
predicting an answer corresponding to the first sample question based on the object description information to obtain a plurality of to-be-selected answers corresponding to the first sample question;
and selecting one answer to be selected with highest confidence from the plurality of answers to be selected as the sample predicted answer corresponding to the first sample question.
In one embodiment, when selecting one candidate answer with the highest confidence from the plurality of candidate answers as the sample predicted answer corresponding to the first sample question, the first prediction unit performs the following steps:
comparing the multiple answers to be selected with standard answers corresponding to the first sample questions, and determining the similarity between each answer to be selected and the standard answer;
and determining that the confidence coefficient corresponding to the candidate answer with the highest similarity in the multiple candidate answers is the highest.
In one embodiment, the apparatus further comprises:
the second obtaining module is used for obtaining a plurality of second sample question-answer pairs before the object description information, the first sample questions and the first sample answers are input into a pre-trained first question-answer model to obtain sample prediction answers corresponding to the first sample questions and sample prediction questions corresponding to the first sample answers; the second sample question-answer pair comprises a second sample question and a second sample answer which are matched with each other;
and the second training module is used for carrying out model training on the plurality of second sample question-answer pairs input into the first question-answer model to be trained to obtain the pre-trained first question-answer model.
In one embodiment, the first sample question-answer pair includes a target sample question and a target sample answer that match each other;
the first training module 44 includes:
the third prediction unit is used for inputting the object description information and the first sample question-answer pair into a second question-answer model to be trained, and predicting an answer corresponding to the target sample question based on the object description information through the second question-answer model to be trained to obtain a predicted answer corresponding to the target sample question;
the comparison unit is used for comparing the predicted answer with the target sample answer corresponding to the target sample question to obtain a comparison result;
and the training unit is used for training the second question-answer model to be trained according to the comparison result to obtain the trained second question-answer model.
In one embodiment, each of the target sample questions corresponds to a respective question category; the target sample questions belonging to the same question category correspond to the same target sample answer;
the third prediction unit predicts the answer corresponding to the target sample question based on the object description information, and when obtaining the predicted answer corresponding to the target sample question, the third prediction unit performs the following steps:
Determining a target problem category corresponding to the target sample problem based on the object description information;
and determining that the answer corresponding to the target question category is a predicted answer corresponding to the target sample question according to the corresponding relation between the preset question category and the answer.
In one embodiment, the apparatus further comprises:
the third acquisition module is used for carrying out model training on the object description information and the first sample question-answer pair input into a second question-answer model to be trained, and acquiring a target problem after the trained second question-answer model is obtained;
the first determining module inputs the target problem into the trained second question-answering model, and determines the problem category corresponding to the target problem through the trained second question-answering model;
and the second determining module is used for determining that the answer corresponding to the question category corresponding to the target question is the target answer corresponding to the target question according to the corresponding relation between the preset question category and the answer.
With the apparatus of one or more embodiments of the present specification, by acquiring object description information corresponding to a target object, and a first sample question and a first sample answer related to the object description information. And inputting the object description information, the first sample question and the first sample answer into a pre-trained first question-answer model to obtain a sample prediction answer corresponding to the first sample question and a sample prediction question corresponding to the first sample answer. And generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer and the sample predicted question. Further, the object description information and the first sample question and answer pair are input into a second question and answer model to be trained to carry out model training, and a trained second question and answer model is obtained. Therefore, the first sample question-answer pair used for training the second question-answer model is obtained through the prediction of the pre-trained first question-answer model, the user does not need to manually label answers for a large number of questions respectively, only a small number of first sample questions and first sample answers are provided, the first sample questions and the first sample answers are respectively predicted through the pre-trained first question-answer model, a larger number of first sample question-answer pairs can be obtained, a large number of labeling resources are saved for obtaining sample data (namely the first sample question-answer pairs), and the training efficiency of the second question-answer model is improved. In addition, even if more new questions are presented by a user along with the online of a new scene or the update of an old scene, the user does not need to manually mark, only the pre-trained first question-answer model is used for predicting corresponding answers, and then the second question-answer model is optimized based on the prediction results, so that the second question-answer model can timely cope with the new question-answer requirements, and the answer coverage rate of intelligent customer service user questions is improved.
It should be understood by those skilled in the art that the machine learning-based question and answer device can be used to implement the machine learning-based question and answer method described above, and the detailed description thereof should be similar to that of the method section described above, so that details are not repeated here for avoiding complexity.
Based on the same considerations, one or more embodiments of the present disclosure also provide an electronic device, as shown in fig. 5. The electronic device may vary considerably in configuration or performance and may include one or more processors 501 and memory 502, where the memory 502 may store one or more stored applications or data. Wherein the memory 502 may be transient storage or persistent storage. The application programs stored in memory 502 may include one or more modules (not shown), each of which may include a series of computer-executable instructions for use in an electronic device. Still further, the processor 501 may be configured to communicate with the memory 502 and execute a series of computer executable instructions in the memory 502 on an electronic device. The electronic device may also include one or more power supplies 503, one or more wired or wireless network interfaces 504, one or more input/output interfaces 505, and one or more keyboards 506.
In particular, in this embodiment, an electronic device includes a memory, and one or more programs, where the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the electronic device, and the one or more programs configured to be executed by one or more processors include instructions for:
acquiring object description information corresponding to a target object, and a first sample question and a first sample answer related to the object description information;
inputting the object description information, the first sample questions and the first sample answers into a pre-trained first question-answer model to obtain sample prediction answers corresponding to the first sample questions and sample prediction questions corresponding to the first sample answers;
generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer and the sample predicted question;
and inputting the object description information and the first sample question-answer pair into a second question-answer model to be trained for model training, and obtaining a trained second question-answer model.
By adopting the technical scheme of one or more embodiments of the present specification, the object description information corresponding to the target object is obtained, and the first sample question and the first sample answer related to the object description information are obtained. And inputting the object description information, the first sample question and the first sample answer into a pre-trained first question-answer model to obtain a sample prediction answer corresponding to the first sample question and a sample prediction question corresponding to the first sample answer. And generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer and the sample predicted question. Further, the object description information and the first sample question and answer pair are input into a second question and answer model to be trained to carry out model training, and a trained second question and answer model is obtained. Therefore, the first sample question-answer pair used for training the second question-answer model is obtained through the prediction of the pre-trained first question-answer model, the user does not need to manually label answers for a large number of questions respectively, only a small number of first sample questions and first sample answers are provided, the first sample questions and the first sample answers are respectively predicted through the pre-trained first question-answer model, a larger number of first sample question-answer pairs can be obtained, a large number of labeling resources are saved for obtaining sample data (namely the first sample question-answer pairs), and the training efficiency of the second question-answer model is improved. In addition, even if more new questions are presented by a user along with the online of a new scene or the update of an old scene, the user does not need to manually mark, only the pre-trained first question-answer model is used for predicting corresponding answers, and then the second question-answer model is optimized based on the prediction results, so that the second question-answer model can timely cope with the new question-answer requirements, and the answer coverage rate of intelligent customer service user questions is improved.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the electronic device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments in part.
One or more embodiments of the present specification also propose a storage medium storing one or more computer programs, the one or more computer programs comprising instructions, which when executed by an electronic device comprising a plurality of application programs, enable the electronic device to perform the respective processes of the machine learning based question-answering method embodiments described above, and in particular for performing:
acquiring object description information corresponding to a target object, and a first sample question and a first sample answer related to the object description information;
inputting the object description information, the first sample questions and the first sample answers into a pre-trained first question-answer model to obtain sample prediction answers corresponding to the first sample questions and sample prediction questions corresponding to the first sample answers;
Generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer and the sample predicted question;
and inputting the object description information and the first sample question-answer pair into a second question-answer model to be trained for model training, and obtaining a trained second question-answer model.
By adopting the technical scheme of one or more embodiments of the present specification, the object description information corresponding to the target object is obtained, and the first sample question and the first sample answer related to the object description information are obtained. And inputting the object description information, the first sample question and the first sample answer into a pre-trained first question-answer model to obtain a sample prediction answer corresponding to the first sample question and a sample prediction question corresponding to the first sample answer. And generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer and the sample predicted question. Further, the object description information and the first sample question and answer pair are input into a second question and answer model to be trained to carry out model training, and a trained second question and answer model is obtained. Therefore, the first sample question-answer pair used for training the second question-answer model is obtained through the prediction of the pre-trained first question-answer model, the user does not need to manually label answers for a large number of questions respectively, only a small number of first sample questions and first sample answers are provided, the first sample questions and the first sample answers are respectively predicted through the pre-trained first question-answer model, a larger number of first sample question-answer pairs can be obtained, a large number of labeling resources are saved for obtaining sample data (namely the first sample question-answer pairs), and the training efficiency of the second question-answer model is improved. In addition, even if more new questions are presented by a user along with the online of a new scene or the update of an old scene, the user does not need to manually mark, only the pre-trained first question-answer model is used for predicting corresponding answers, and then the second question-answer model is optimized based on the prediction results, so that the second question-answer model can timely cope with the new question-answer requirements, and the answer coverage rate of intelligent customer service user questions is improved.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for storage medium embodiments, since they are substantially similar to method embodiments, the description is relatively simple, and reference is made to the description of method embodiments in sections.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing one or more embodiments of the present description.
One skilled in the art will appreciate that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
One or more embodiments of the present description are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the specification. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (trans itory media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
One or more embodiments of the present specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is merely one or more embodiments of the present disclosure and is not intended to limit the disclosure. Various modifications and alterations to one or more embodiments of this description will be apparent to those skilled in the art. Any modifications, equivalent substitutions, improvements, or the like, which are within the spirit and principles of one or more embodiments of the present disclosure, are intended to be included within the scope of the claims of one or more embodiments of the present disclosure.
Claims (11)
1. A machine learning based question and answer method comprising:
acquiring object description information corresponding to a target object, and a first sample question and a first sample answer related to the object description information;
inputting the object description information, the first sample questions and the first sample answers into a pre-trained first question-answer model to obtain sample prediction answers corresponding to the first sample questions and sample prediction questions corresponding to the first sample answers;
generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer and the sample predicted question;
and inputting the object description information and the first sample question-answer pair into a second question-answer model to be trained for model training, and obtaining a trained second question-answer model.
2. The method of claim 1, wherein the inputting the object description information, the first sample question and the first sample answer into a pre-trained first question-answer model to obtain a sample predicted answer corresponding to the first sample question and a sample predicted question corresponding to the first sample answer comprises:
Inputting the object description information and the first sample question into the first question-answer model, and predicting an answer corresponding to the first sample question based on the object description information to obtain the sample prediction answer corresponding to the first sample question;
and inputting the object description information and the first sample answer into the first question-answer model, and predicting a question corresponding to the first sample answer based on the object description information to obtain the sample prediction question corresponding to the first sample answer.
3. The method of claim 2, wherein predicting the answer corresponding to the first sample question based on the object description information, to obtain the sample predicted answer corresponding to the first sample question, comprises:
predicting an answer corresponding to the first sample question based on the object description information to obtain a plurality of to-be-selected answers corresponding to the first sample question;
and selecting one answer to be selected with highest confidence from the plurality of answers to be selected as the sample predicted answer corresponding to the first sample question.
4. The method of claim 3, wherein the selecting, from the plurality of answers to be selected, one answer to be selected with highest confidence as the sample predicted answer corresponding to the first sample question comprises:
Comparing the multiple answers to be selected with standard answers corresponding to the first sample questions, and determining the similarity between each answer to be selected and the standard answer;
and determining that the confidence coefficient corresponding to the candidate answer with the highest similarity in the multiple candidate answers is the highest.
5. The method of claim 1, wherein before the inputting the object description information, the first sample question and the first sample answer into the pre-trained first question-answer model to obtain the sample predicted answer corresponding to the first sample question and the sample predicted question corresponding to the first sample answer, further comprises:
obtaining a plurality of second sample question-answer pairs; the second sample question-answer pair comprises a second sample question and a second sample answer which are matched with each other;
and inputting the plurality of second sample question-answer pairs into a first question-answer model to be trained for model training to obtain the pre-trained first question-answer model.
6. The method of claim 1, the first sample question-answer pair comprising a target sample question and a target sample answer that match each other;
the object description information and the first sample question and answer pair are input into a second question and answer model to be trained for model training, and a trained second question and answer model is obtained, and the method comprises the following steps:
Inputting the object description information and the first sample question-answer pair into a second question-answer model to be trained, and predicting an answer corresponding to the target sample question based on the object description information through the second question-answer model to be trained to obtain a predicted answer corresponding to the target sample question;
comparing the predicted answer with the target sample answer corresponding to the target sample question to obtain a comparison result;
and training the second question-answer model to be trained according to the comparison result to obtain the trained second question-answer model.
7. The method of claim 6, each of the target sample questions corresponding to a respective question category; the target sample questions belonging to the same question category correspond to the same target sample answer;
the predicting the answer corresponding to the target sample question based on the object description information to obtain the predicted answer corresponding to the target sample question comprises the following steps:
determining a target problem category corresponding to the target sample problem based on the object description information;
and determining that the answer corresponding to the target question category is a predicted answer corresponding to the target sample question according to the corresponding relation between the preset question category and the answer.
8. The method of claim 1, wherein the model training the object description information and the first sample question-answer pair into the second question-answer model to be trained, after obtaining the trained second question-answer model, further comprises:
acquiring a target problem;
inputting the target problem into the trained second question-answering model, and determining a problem category corresponding to the target problem through the trained second question-answering model;
and determining that the answer corresponding to the question category corresponding to the target question is the target answer corresponding to the target question according to the corresponding relation between the preset question category and the answer.
9. A machine learning based question and answer device comprising:
the acquisition module acquires object description information corresponding to a target object, and a first sample question and a first sample answer related to the object description information;
the prediction module inputs the object description information, the first sample questions and the first sample answers into a pre-trained first question-answer model to obtain sample prediction answers corresponding to the first sample questions and sample prediction questions corresponding to the first sample answers;
The generation module is used for generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample prediction answer, the first sample answer and the sample prediction question;
and the first training module is used for inputting the object description information and the first sample question-answer pair into a second question-answer model to be trained for model training, so as to obtain a trained second question-answer model.
10. An electronic device comprising a processor and a memory electrically connected to the processor, the memory storing a computer program, the processor operable to invoke and execute the computer program from the memory to implement:
acquiring object description information corresponding to a target object, and a first sample question and a first sample answer related to the object description information;
inputting the object description information, the first sample questions and the first sample answers into a pre-trained first question-answer model to obtain sample prediction answers corresponding to the first sample questions and sample prediction questions corresponding to the first sample answers;
generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer and the sample predicted question;
And inputting the object description information and the first sample question-answer pair into a second question-answer model to be trained for model training, and obtaining a trained second question-answer model.
11. A storage medium storing a computer program executable by a processor to implement:
acquiring object description information corresponding to a target object, and a first sample question and a first sample answer related to the object description information;
inputting the object description information, the first sample questions and the first sample answers into a pre-trained first question-answer model to obtain sample prediction answers corresponding to the first sample questions and sample prediction questions corresponding to the first sample answers;
generating a first sample question-answer pair corresponding to the object description information according to the first sample question, the sample predicted answer, the first sample answer and the sample predicted question;
and inputting the object description information and the first sample question-answer pair into a second question-answer model to be trained for model training, and obtaining a trained second question-answer model.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310648035.5A CN116701587A (en) | 2023-06-02 | 2023-06-02 | Question and answer method and device based on machine learning |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310648035.5A CN116701587A (en) | 2023-06-02 | 2023-06-02 | Question and answer method and device based on machine learning |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116701587A true CN116701587A (en) | 2023-09-05 |
Family
ID=87835125
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310648035.5A Pending CN116701587A (en) | 2023-06-02 | 2023-06-02 | Question and answer method and device based on machine learning |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116701587A (en) |
-
2023
- 2023-06-02 CN CN202310648035.5A patent/CN116701587A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110413877B (en) | Resource recommendation method and device and electronic equipment | |
CN110278175A (en) | Graph structure model training, the recognition methods of rubbish account, device and equipment | |
CN114298417A (en) | Anti-fraud risk assessment method, anti-fraud risk training method, anti-fraud risk assessment device, anti-fraud risk training device and readable storage medium | |
CN110688974B (en) | Identity recognition method and device | |
CN110020427B (en) | Policy determination method and device | |
WO2019191266A1 (en) | Object classification method, apparatus, server, and storage medium | |
CN110377733A (en) | A kind of text based Emotion identification method, terminal device and medium | |
CN111625638B (en) | Question processing method, device, equipment and readable storage medium | |
CN114492601A (en) | Resource classification model training method and device, electronic equipment and storage medium | |
CN111199421B (en) | Social relationship-based user recommendation method and device and electronic equipment | |
US11783221B2 (en) | Data exposure for transparency in artificial intelligence | |
US20240244135A1 (en) | Systems and methods for utilizing a machine learning model to determine an intent of a voice customer in real time | |
CN111507726A (en) | Message generation method, device and equipment | |
CN114820039A (en) | Method and device for selecting commercial store site | |
WO2024159917A1 (en) | Data processing method, apparatus and device | |
CN113032676B (en) | Recommendation method and system based on micro-feedback | |
CN112598526A (en) | Asset data processing method and device | |
CN114077859A (en) | Abnormal sample detection method and device, electronic device and storage medium | |
CN116956204A (en) | Network structure determining method, data predicting method and device of multi-task model | |
CN112967044B (en) | Payment service processing method and device | |
CN115576789A (en) | Method and system for identifying lost user | |
CN116701587A (en) | Question and answer method and device based on machine learning | |
CN115168575A (en) | Subject supplement method applied to audit field and related equipment | |
CN111753548B (en) | Information acquisition method and device, computer storage medium and electronic equipment | |
CN111985945A (en) | Order determining method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |