CN110019732B - Intelligent question answering method and related device - Google Patents

Intelligent question answering method and related device Download PDF

Info

Publication number
CN110019732B
CN110019732B CN201711453223.3A CN201711453223A CN110019732B CN 110019732 B CN110019732 B CN 110019732B CN 201711453223 A CN201711453223 A CN 201711453223A CN 110019732 B CN110019732 B CN 110019732B
Authority
CN
China
Prior art keywords
question
target
generated
discriminator
generator
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.)
Active
Application number
CN201711453223.3A
Other languages
Chinese (zh)
Other versions
CN110019732A (en
Inventor
晏小辉
徐传飞
蒋洪睿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201711453223.3A priority Critical patent/CN110019732B/en
Publication of CN110019732A publication Critical patent/CN110019732A/en
Application granted granted Critical
Publication of CN110019732B publication Critical patent/CN110019732B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/332Query formulation
    • G06F16/3329Natural language query formulation or dialogue systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Theoretical Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application discloses an intelligent question-answering method and a related device, which are used for improving the accuracy of an intelligent question-answering system. The method in the embodiment of the application comprises the following steps: obtaining a target user question; generating a target generation problem corresponding to the target user problem according to a problem optimization model, wherein the problem optimization model is obtained based on generative confrontation network training, and comprises a generator and a discriminator; judging whether the generation quality of the target generation problem is higher than a first preset threshold value or not according to the discriminator, wherein the generation quality is used for indicating the probability that the target generation problem is a standard problem; and if so, determining a target answer according to the target generation question.

Description

Intelligent question answering method and related device
Technical Field
The present application relates to the field of information recommendation technologies, and in particular, to an intelligent question answering method and a related device.
Background
In this rapidly growing age, the more the manpower resources can be saved, the greater the liberation of productivity. In order to better meet the requirements of users and save human resources, more and more service industries arrange common questions and answers thereof proposed by users, namely arrange the common questions and the answers thereof into a standard question bank form, and establish an intelligent question-answering system based on the question bank. The intelligent question-answering system is a novel information retrieval system for processing natural language, receives questions provided by a user in a question-answering mode, accurately positions relevant knowledge in a question-answering library related to the questions, performs business migration according to a preset business processing flow in the system, realizes interaction between business guidance and the user, feeds the relevant knowledge back to the user as an answer to the questions, and completes intelligent question-answering.
In the prior art, a rule (template) -based matching method is generally adopted, and the core idea is to manually define different questions (called as templates or extended questions) for each standard question. The form of the template varies from company to company. When a user inputs a question, the steps of the template-based question-answering system include the following 4 steps: 1. analyzing the user problems; 2. retrieving candidate templates from a template library; 3. scoring the matching degree of the template; 4. if the score is larger than a certain threshold value, outputting an answer corresponding to the template; otherwise, the system is considered to be incapable of answering, and the proposal is changed to manual customer service.
However, in an actual question-answering system, the descriptions and expressions of the questions by the user are various, and the questions are not spoken and even abnormal, including word informality such as "how to input the testimony codes is not true", word order inversion such as "how to not arrive, express delivery", and the like. Therefore, the problem analysis of the existing question-answering system is difficult due to the non-standard expressions, so that the question-answering system based on matching and searching is difficult to understand the problems of the user, an accurate answer is found, and the accuracy of the question-answering system is reduced.
Disclosure of Invention
The embodiment of the application provides an intelligent question-answering method and a related device, which are used for improving the accuracy of an intelligent question-answering system.
A first aspect of an embodiment of the present application provides an intelligent question answering method, including: the method comprises the steps of obtaining a target user problem, inputting the target user problem into a problem optimization model to generate a target generation problem corresponding to the target user problem, wherein the problem optimization model is obtained based on generative confrontation network training, and the problem optimization model comprises a generator and a discriminator. And after the target generation problem is obtained, judging whether the generation quality of the target generation problem is higher than a first preset threshold value according to a discriminator in a problem optimization model, wherein the generation quality is used for indicating the probability that the target generation problem is a standard problem, and if the generation quality of the target generation problem is higher than the first preset threshold value, determining a target answer according to the target generation problem. In the embodiment of the application, the questions input by the user are optimized through the question optimization model to obtain the target generation questions expressed in the specification, the user is helped to express the user's requirements more accurately and clearly, the matching degree with the standard questions is improved, the target answers can be found more accurately, and the accuracy of the intelligent question-answering system is improved.
In a possible design, in a first implementation manner of the first aspect of the embodiment of the present application, before the obtaining the target user question, the method further includes: a training set is obtained, and the training set comprises source user problem-source specification problem pairs, which are used to represent a set of source user problems and source specification problems corresponding to the source user problems. In this implementation, one of the preparation tasks required to train the problem optimization model is described: and a training set is obtained, so that the process of the embodiment of the application is more complete.
In a possible design, in a second implementation manner of the first aspect of the embodiment of the present application, the obtaining a training set includes: and calculating similarity values of standard questions in a standard data set and source user questions in a user log, wherein the standard data set is used for storing the standard questions, and the user log comprises interaction records of the user and the question-answering system. And after the similarity value is obtained, taking the source user problem with the similarity value larger than a second preset threshold value with the standard problem as a candidate user problem to determine the problem with the semantic consistency with the standard problem in the candidate user problem so as to obtain the source user problem-source specification problem pair, wherein the standard problem is contained in the source specification problem. In the implementation mode, a specific way for obtaining the training set is explained, the training set is constructed through the standard database and the user log, the manual writing process is avoided, the construction cost of the training set is reduced, and the scale of the training set is favorably enlarged.
In a possible design, in a third implementation manner of the first aspect of the embodiment of the present application, after the obtaining the training set and before the obtaining the target user question, the method further includes: inputting the source user questions in the training set into the generator so that the generator performs model training and obtains generated questions according to the trained models; and acquiring the generated problems obtained by the generator, and storing the generated problems in a generated data set, wherein the generated data set is used for storing the generated problems. In this implementation, a specific manner of the training generator is described, so that the embodiment of the present application has higher operability.
In a possible design, in a fourth implementation manner of the first aspect of the embodiment of the present application, after the obtaining the training set and before the obtaining the target user question, the method further includes: inputting the source specification questions in the training set and the generation questions in the generation data set into the discriminator, so that the discriminator performs model training by taking the source specification questions in the training set as positive example samples and the generation questions in the generation data set as negative example samples; inputting the generated problem generated by the generator to the discriminator so that the discriminator discriminates the generated problem by attribution rate, wherein the attribution rate is used for indicating the probability that the problem belongs to the standard data set or the generated data set; obtaining a discrimination result of the discriminator on the generated problem; inputting the discrimination result into the generator, so that the generator performs model training according to the generated problem discriminated by the discriminator and the discrimination result, and generates a new generated problem according to the trained model; and acquiring a new generation question generated by the generator and saving the new generation question in the generation data set. In the implementation mode, a mode of how the arbiter and the generator in the problem optimization model perform countermeasure training is provided, so that the steps of the embodiment of the application are more complete.
In one possible design, in a fifth implementation manner of the first aspect of the embodiment of the present application, the method further includes: and when the variation of a judgment result obtained by judging the problem generated by the generator by the discriminator is smaller than a third preset threshold value, stopping inputting the problem generated by the generator into the discriminator and stopping inputting the judgment result of the discriminator into the generator so as to finish the training of the problem optimization model. In this implementation, one of the conditions that the end problem optimization model needs to satisfy is provided: the variation is converged, so that the embodiment of the application is more feasible.
In a possible design, in a sixth implementation manner of the first aspect of the embodiment of the present application, the method further includes: and when the iteration number reaches a fourth preset threshold, stopping inputting the problem generated by the generator into the discriminator and stopping inputting the discrimination result of the discriminator into the generator so as to finish the training of the problem optimization model, wherein the generator generates a problem and the discriminator judges the problem generated by the generator once to represent an iteration. In this implementation, one of the conditions that the problem-ending optimization model needs to satisfy is also provided: the iteration times meet the preset maximum iteration times, so that the embodiment of the application has feasibility.
In one possible design, in a seventh implementation manner of the first aspect of the embodiment of the present application, the determining a target answer according to the target generation question includes: matching a target standard problem in a standard data set according to the target generation problem, wherein the similarity value of the target standard problem and the target generation problem is larger than a fifth preset threshold value; and determining the answer of the target standard question in the standard data set as the target answer, wherein the standard data set is used for storing the standard question. In the implementation mode, specific operation of determining the target answer according to the target generation problem is provided, the target standard problem similar to the target generation problem is found in the standard data set, the answer corresponding to the target standard problem is used as the target answer, rewriting from the target user problem to the standard problem is realized, the labor cost is greatly reduced, and the effect of large-scale user problem optimization is improved.
In a possible design, in an eighth implementation manner of the first aspect of the embodiment of the present application, after determining, according to the discriminator, whether the reliability of the target generation problem is higher than a first preset threshold, the method further includes: and if the discriminator judges that the credibility of the target generation problem is not higher than a first preset threshold value, outputting the target user problem. In this implementation, it is also explained that when the quality of the problem generated by the trained generator is low, the problem of the user input is output, so as to avoid the unreasonable problem of the output after rewriting.
A second aspect of the embodiments of the present application provides an intelligent question answering device, including: the acquisition unit is used for acquiring a target user question; the generation unit is used for generating a target generation problem corresponding to the target user problem according to a problem optimization model, the problem optimization model is obtained based on generative confrontation network training, and the problem optimization model comprises a generator and a discriminator; the judging unit is used for judging whether the generation quality of the target generation problem is higher than a first preset threshold value or not according to the discriminator, and the generation quality is used for indicating the probability that the target generation problem is a standard problem; and the determining unit is used for determining a target answer according to the target generation question if the judging unit determines that the generation quality of the target generation question is higher than the first preset threshold. In the embodiment of the application, the questions input by the user are optimized through the question optimization model to obtain the target generation questions expressed in the specification, the user is helped to express the user's requirements more accurately and clearly, the matching degree with the standard questions is improved, the target answers can be found more accurately, and the accuracy of the intelligent question-answering system is improved.
In a possible design, in a first implementation manner of the second aspect of the embodiment of the present application, the obtaining unit is further configured to: a training set is obtained, the training set including source user problem-source specification problem pairs representing a set of source user problems and source specification problems corresponding to the source user problems. In this implementation, one of the preparation tasks required to train the problem optimization model is described: and a training set is obtained, so that the process of the embodiment of the application is more complete.
In a possible design, in a second implementation manner of the second aspect of the embodiment of the present application, the obtaining unit includes: the system comprises a calculation module, a query module and a query and answer module, wherein the calculation module is used for calculating similarity values of standard questions in a standard data set and source user questions in a user log, the standard data set is used for storing the standard questions, and the user log comprises interaction records of a user and a question and answer system; a first determining module, configured to use the source user question with the similarity value greater than a second preset threshold with the standard question as a candidate user question, so as to determine a question that is semantically consistent with the standard question in the candidate user question, and further obtain the source user question-source specification question pair, where the standard question is included in the source specification question. In the implementation mode, a specific way for obtaining the training set is explained, the training set is constructed through the standard database and the user log, the manual writing process is avoided, the construction cost of the training set is reduced, and the scale of the training set is favorably enlarged.
In a possible design, in a third implementation manner of the second aspect of the embodiment of the present application, the intelligent question-answering device further includes: the input unit is used for inputting the source user questions in the training set into the generator so as to enable the generator to carry out model training and obtain generated questions according to the trained models; and the storage unit is used for acquiring the generated questions obtained by the generator and storing the generated questions in a generated data set, and the generated data set is used for storing the generated questions. In this implementation, a specific manner of the training generator is described, so that the embodiment of the present application has higher operability.
In a possible design, in a fourth implementation manner of the second aspect of the embodiment of the present application, the intelligent question-answering device further includes: the input unit is further configured to input the source specification problem in the training set and the generation problem in the generation data set to the discriminator, so that the discriminator performs model training with the source specification problem in the training set as a positive sample and the generation problem in the generation data set as a negative sample; inputting the generated problem generated by the generator to the discriminator so that the discriminator discriminates the generated problem by attribution rate, wherein the attribution rate is used for indicating the probability that the problem belongs to the standard data set or the generated data set; the obtaining unit is further configured to obtain a result of the discrimination of the generated problem by the discriminator; the input unit is further configured to input the discrimination result to the generator, so that the generator performs model training according to the generated problem discriminated by the discriminator and the discrimination result, and generates a new generated problem according to the trained model; the obtaining unit is further configured to obtain a new generation question generated by the generator and save the new generation question in the generation dataset. In the implementation mode, a mode of how the arbiter and the generator in the problem optimization model perform countermeasure training is provided, so that the steps of the embodiment of the application are more complete.
In a possible design, in a fifth implementation manner of the second aspect of the embodiment of the present application, the intelligent question and answer apparatus further includes: and the termination unit is used for stopping inputting the problem generated by the generator into the discriminator and stopping inputting the discrimination result of the discriminator into the generator to finish the training of the problem optimization model when the variation of the discrimination result obtained by discriminating the problem generated by the generator by the discriminator is smaller than a third preset threshold. In this implementation, one of the conditions that the end problem optimization model needs to satisfy is provided: the variation is converged, so that the embodiment of the application is more feasible.
In a possible design, in a sixth implementation manner of the second aspect of the embodiment of the present application, the intelligent question and answer apparatus further includes: the termination unit is further configured to stop inputting the problem generated by the generator to the discriminator and stop inputting the discrimination result of the discriminator to the generator when the number of iterations reaches a fourth preset threshold, so as to end the training of the problem optimization model, where the generator generates a problem and the discriminator determines that the problem generated by the generator represents one iteration. In this implementation, one of the conditions that the problem-ending optimization model needs to satisfy is also provided: the iteration times meet the preset maximum iteration times, so that the embodiment of the application has feasibility.
In a possible design, in a seventh implementation manner of the second aspect of the embodiment of the present application, the determining unit includes: the matching module is used for matching a target standard problem in a standard data set according to the target generation problem, and the similarity value of the target standard problem and the target generation problem is larger than a fifth preset threshold value; and the second determining module is used for determining that the answer corresponding to the target standard question in the standard data set is the target answer, and the standard data set is used for storing the standard question. In the implementation mode, specific operation of determining the target answer according to the target generation problem is provided, the target standard problem similar to the target generation problem is found in the standard data set, the answer corresponding to the target standard problem is used as the target answer, rewriting from the target user problem to the standard problem is realized, the labor cost is greatly reduced, and the effect of large-scale user problem optimization is improved.
In a possible design, in an eighth implementation manner of the second aspect of the embodiment of the present application, the intelligent question and answer apparatus further includes: and the output unit is used for outputting the target user question if the judgment unit determines that the credibility of the target generation question is not higher than a first preset threshold. In this implementation, it is also explained that when the quality of the problem generated by the trained generator is low, the problem of the user input is output, so as to avoid the unreasonable problem of the output after rewriting.
A third aspect of the present application provides a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to perform the method of the above-described aspects.
A fourth aspect of the present application provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of the above-described aspects.
According to the technical scheme, the embodiment of the application has the following advantages: obtaining a target user question; generating a target generation problem corresponding to the target user problem according to a problem optimization model, wherein the problem optimization model is obtained based on generative confrontation network training, and comprises a generator and a discriminator; judging whether the generation quality of the target generation problem is higher than a first preset threshold value or not according to the discriminator, wherein the generation quality is used for indicating the probability that the target generation problem is a standard problem; and if so, determining a target answer according to the target generation question. In the embodiment of the application, the questions input by the user are optimized through the question optimization model to obtain the target generation questions expressed in the specification, the user is helped to express the user's requirements more accurately and clearly, the matching degree with the standard questions is improved, the target answers can be found more accurately, and the accuracy of the intelligent question-answering system is improved.
Drawings
Fig. 1A is a schematic diagram of a system architecture applied to a possible intelligent question answering method according to an embodiment of the present disclosure;
FIG. 1B is a block diagram of one possible intelligent customer service system component provided by an embodiment of the present application;
fig. 2 is a schematic flowchart of a possible intelligent question answering method according to an embodiment of the present disclosure;
FIG. 3 is a flow chart of a possible training process provided by an embodiment of the present application;
FIG. 4 is a diagram of a possible display interface provided by an embodiment of the present application;
fig. 5 is a schematic structural diagram of a possible intelligent question answering device according to an embodiment of the present application;
FIG. 6 is a schematic structural diagram of another possible intelligent question answering device according to an embodiment of the present application;
FIG. 7 is a schematic block diagram of a possible intelligent question answering device provided in an embodiment of the present application;
fig. 8 is a schematic structural diagram of another possible intelligent question answering device according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides an intelligent question-answering method and a related device, which are used for improving the accuracy of an intelligent question-answering system.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The intelligent question-answering system applies artificial intelligence technology to enable a computer to automatically answer questions of a person, and at the present stage, answers or paragraphs related to the questions of the user can be positioned by adopting a template matching-based method. In this method, a service provider needs to maintain an FAQ knowledge base, define some templates (usually based on keywords) for some common questions, and return answers corresponding to the templates when a user question matches a certain template. Generally, since the query methods of the users are various, the templates also need to be defined correspondingly, for example, the templates may include keyword templates or question templates, where the keyword templates include keywords and logical operators, and the question templates include complete questions, as shown in table 1, which are different templates that may be defined for "time for sale of mobile phone" as an example.
TABLE 1
Figure BDA0001528155990000061
In recent years, in the field of artificial intelligence, a deep learning technology has been developed dramatically, and compared with a conventional machine learning algorithm, the deep learning algorithm has two significant advantages: 1. the deep learning model can better depict deep complex structures inside the data; secondly, the deep learning algorithm applies a feature learning method in a large number, so that all used features can be automatically learned from a large number of data, and the time-consuming and labor-consuming manual feature construction process is avoided. Therefore, the application of the deep learning technology to improve the intelligent level of the intelligent question answering becomes a hotspot direction.
In the prior art, the application of a deep learning algorithm in an intelligent question-answering system mainly focuses on answer matching and generation. In general, one potential assumption of these approaches is that the user's question is format specification. However, in practical question-answering systems (especially internet-oriented users), the user's descriptions and wording of questions are various and even very irregular. It will be appreciated that although these problems occur only infrequently from a single point of view, the total amount is very high due to the long tail phenomenon. Due to the fact that training samples are not enough, the irregular questions are directly applied to matching and generating of answers, accurate effects are difficult to obtain, and the accuracy of the intelligent question-answering system and the improvement of user experience are severely limited.
Under the condition that the training samples are sufficient, the deep neural network based on the deep learning algorithm can capture various changes of the natural language, so that the problems proposed by the user can be better understood, and the accuracy of question answering is improved. In view of this, the embodiment of the present application applies the deep neural network, and provides a set of solutions for automatically rewriting the non-standard problem into the standard problem with consistent semantics for the problem of the user, so as to reduce the difficulty of analyzing the problem by the intelligent question-answering system and improve the question-answering accuracy of the intelligent question-answering system. It should be noted that the specification problem is a problem that words and expressions meet the specification, and the specified words and expressions are not shown in the present application but are represented by the standard problem in the existing standard data set, that is, it can be understood that the closer the words and expressions of a problem are to the standard problem, the more the problem is considered to be specified.
Referring to fig. 1A, a schematic diagram of a system architecture applied to an intelligent question answering method provided in the embodiment of the present application may specifically include the following modules: the system comprises a problem analysis module, a problem optimization model, a training set construction module, a question-answer matching module and a log collection and statistics module. Wherein:
a problem analysis module: and extracting key information from the questions represented by the character strings, wherein the key information comprises word segmentation, named entity identification and the like.
A problem optimization module: training a canonical problem generation model based on the generated countermeasure network, accepting user input problems and outputting corresponding normalized problems. A countermeasure network with a generator (generator) that generates some type of data from random input; there is also a discriminator (discriminator) which takes input from the producer or from a set of real data, the discriminator being able to discriminate between different inputs, i.e. whether they are from the producer or the real data. The two neural networks are alternately trained and optimized, so that the generator can generate input which is more consistent with real data distribution, and the discriminator can more accurately judge the source of the input.
A training set construction module: and (4) mining source user question-source standard question pairs from the standard question-answer library and the user logs, and providing a training set for model learning.
Question-answer matching module: the method is used for matching the generated problem generated after the source user problem passes through the problem optimization module with the standard problem in the standard data set, and firstly, in order to improve the matching efficiency, the standard data set can be indexed. And then, according to the keywords in the generated problems, candidate problems are searched from the standard data set, and the candidate problems and the generated standard problems are scored according to the similarity of the scoring function.
The log collecting and counting module comprises: the method is used for recording the interaction records of the user and the question-answering system, and the interaction records can comprise hotspot problem statistics, unsolved problem statistics and the like. In practical application, business personnel can continuously update the standard data set based on the unsolved problem records in the log.
It should be noted that the intelligent question answering method described in the present application may be implemented by a server, or may be implemented by a terminal, where the terminal may be an intelligent device such as a personal computer, a tablet computer, or a smart phone. The function of each module can be realized by the server alone, the terminal alone, or both the server and the terminal, the server realizes the function of one module, and the terminal realizes the function of the other module, which is not limited specifically. In the following, the intelligent question-answering method is described as being implemented by a server.
In addition, the intelligent question answering method provided by the application may include two parts, namely, an offline training part and an online service part, wherein the offline training part is used for training a problem optimization model according to the obtained training set, and the online service part is used for providing an online service according to the trained problem optimization model, please refer to fig. 1B, which is a possible structure diagram of an intelligent customer service system component provided by the embodiment of the application, and the trained problem optimization model is introduced into the existing intelligent customer service system, and includes a web/app front end, an application Rest service module, a problem optimization module and a problem retrieval module, and functions of the two parts are as follows:
web/app front-end: the system is responsible for inputting and displaying results of the target user questions;
applying a Rest service module: each external service module comprises a question completion module, a question recommendation module, an answer generation module and the like which are deployed on the server in a Rest mode. And after the service is started, loading the corresponding model. The web/app front end can be called by javascript, and returns the result to be formatted and displayed to the user.
A problem optimization module: a training set can be obtained according to the user log and the standard data set, and model training is performed based on the training set to obtain a problem optimization model, and the implementation steps of the problem optimization module are specifically described in steps 201 to 202 in the embodiment of the present application, and are not described herein again.
A question retrieval module: including matching calculations and full text searches. The system is responsible for executing prefix retrieval in the problem completion process; and for the complete user input problem, rewriting through the problem optimization module, performing full text search on the optimized problem, and performing matching calculation on the retrieved result according to the application requirement.
Referring to the embodiment shown in fig. 2, a schematic flow chart of a possible intelligent question answering method provided in the embodiment of the present application is provided, which exemplarily describes offline training and online service, where steps 201 to 202 are an offline training process, and steps 203 to 207 are an online service process, and specifically includes:
201. obtaining a training set;
in general, deep neural networks are used in the task of supervised learning, i.e. there is a large amount of labeled data to train the model. Therefore, before training a model for a problem optimization model, training data is acquired, and in the present application, for convenience of understanding, a training set is defined as a set of training data, including a source user problem and a source specification problem set corresponding to the source user problem. For each user problem, manually writing a standard problem corresponding to the user problem is difficult to implement, and on one hand, the cost is high; on the other hand, it is difficult to specify a standard writing method. In the application, a training set can be constructed by using the existing standard data set and the user log, wherein the standard data set comprises standard questions, and it can be understood that standard answers corresponding to the standard questions are also stored in the standard data set; the user log comprises interaction records of a user and the question-answering system, including hotspot problem statistics, unsolved problem statistics and the like, so that unsolved problems in the user log can be used as source user problems, standard problems in the standard data set are used as source specification problems, and a specific training set constructing mode comprises the following steps:
step 1, calculating similarity values of standard problems in a standard data set and source user problems in a user log;
for the calculation of the similarity value between the standard problem and the source user problem, a Vector Space Model (VSM) based TF-idf (term frequency updated document frequency) algorithm may be adopted, which is implemented as follows:
(1) counting all words w1, w2 and w3 … wn appearing in the corpus according to the word frequency;
(2) each question is represented as an n-dimensional vector: t ═<T1,T2,…,Ti,…,Tn>;
Wherein, TiN is log (M/M), i is not less than 1 and not more than n, n is the TF value which is the frequency of occurrence of the words wi in the problem, M is the number of the problems containing the words wi in the corpus, M is the total number of the problems in the corpus, and log (M/M) is the IDF value. Above TiThe comprehensive expression of (a) reflects the frequency of occurrence of a keyword and the ability of the keyword to distinguish different sentences, namely: the more times a word occurs in a sentence, the more important it is to the sentence.
(3) Let n-dimensional vectors of any two questions be T' and T ", respectively, then the similarity can be calculated as follows using the cosine angle of the two sentence vectors:
Figure BDA0001528155990000081
it can be understood that, in the present application, the corpus includes the standard problem in the standard data set and the source user problem in the user log, so the similarity value between the standard problem in the standard data set and each source user problem in the user log can be calculated through the above algorithm.
It should be noted that, in practical applications, there are various methods for calculating the similarity value between two questions, for example, a semantic dictionary method, a part-of-speech and word-sequence combination method, a dependency tree method, or an edit distance method may also be used, and the specific application is not limited thereto.
Step 2, taking the source user problem with the similarity value larger than a second preset threshold value with the standard problem as a candidate user problem;
after the similarity values between the standard questions and the source user questions are obtained through calculation, the source user questions with the similarity values larger than the second preset threshold value with the standard questions are used as candidate user questions, and it can be understood that the number of the candidate user questions can be 0, 1 or more.
It should be noted that, in practical applications, there are various ways to determine the candidate user questions, for example, the source user questions may be sorted in the order from the big to the small of the similarity value of the standard questions, and a preset number of the source user questions in the top of the sorting are selected as the candidate user questions, so the way to determine the candidate user questions is not limited in this application.
Optionally, in order to ensure semantic consistency between the candidate user question and the standard question, in practical applications, the question with inconsistent semantics in the candidate user question may be removed through manual review, for example, the standard question is "when to send an express delivery? ", the determined candidate user question includes" what is happening when express? "," send out express delivery in several hours? "and" what express delivery? "so by reviewing what express was sent the" semantic inconsistency problem "among the candidate user problems? And removing.
After determining the candidate user problem corresponding to the standard user problem, since the candidate user problem may include a plurality of problems, for example, the standard problem a, and the candidate user problem corresponding thereto includes { user problem a, user problem B, and user problem C }, the source user problem-source specification problem pair obtained includes user problem a-standard problem a, user problem B-standard problem a, and user problem C-standard problem a.
It will be appreciated that different standard user questions may correspond to the same source user question, for example, assuming "when did Mate10 sell? "and" what is the time-to-shelf of Mate 10? "are all standard questions, source user questions" when can you ask Mate 10? ", then the source user question corresponds to both standard questions.
It should be noted that, besides the above-mentioned manner of automatically constructing the training set, there are various manners of obtaining the training set in practical applications, for example, a source user question-a source specification question, etc. are manually edited, and the details are not limited herein.
202. Training a problem optimization model according to a training set;
after a training set is obtained, a problem optimization model is trained based on the training set, wherein the problem optimization model comprises a generator and a discriminator. In the application, the generator and the discriminator are alternately trained by adopting the idea of antagonism training, and the finally obtained generator is used for rewriting the user problem into the standard problem. In particular, the generator is a probabilistic generating model whose goal is to generate samples (i.e., problems in natural language) that are consistent with the distribution of training data (i.e., source specification problems in the training set). The discriminator is then a classifier whose goal is to accurately discriminate whether a sample (i.e., a natural language question) is from training data or from the generator. In this way, the generator and the arbiter form a "confrontation", the generator being continually optimised so that the arbiter cannot distinguish between the generated samples and the training data samples, and the arbiter being continually optimised so that such differences can be resolved. Alternately training the generator and the discriminator to finally reach balance: the generator can generate samples that completely fit the training data distribution (so that the arbiter cannot resolve), while the arbiter can sensitively resolve any samples that do not fit the training data distribution.
Referring to fig. 3, for a possible training process provided by the embodiment of the present application, a generator is responsible for generating a generation problem with the same vocabulary and description style as the standard problem according to the source user problem. An improved version of the Recurrent Neural Network (RNN) can be used as a generator of natural language questions, with the input being to tokenize source user questions in the training set to obtain word sequences, e.g., assuming that the source user question is "cell phone screen broken, can be guaranteed? "pronounce the question to" cell phone/screen/garrulous/,/can/warrant/how? "each word or punctuation in the question is replaced by a vector, that is, a word is mapped into a word vector by a word embedding layer embedding, wherein the word vector is a vector which is formed by mapping each word in a natural language into a fixed length, all the vectors are put together to form a word vector space, and each vector is a point in the space, and the similarity (lexical and semantic) between the words can be judged according to the distance between the words by introducing a" distance "into the space.
And then modeling the sequence dependence relationship between words by using a Bi-directional long-short term memory (Bi-LSTM). The Bi-LSTM outputs the converted word vectors as input to the one-hot entry layer. The one-hot entry layer updates the current state vector in conjunction with the historical state information each time one or more words are selected from the output of the Bi-LSTM without repetition. And finally, calculating the output words according to the current state.
The discriminator is responsible for discriminating the difference between the generated problem generated by the generator and the source specification problem, and in the application, the quality of the generated problem can be judged from the following three aspects: (1) differences between literal and source specification problems; (2) generating the difference between the problem and the source specification problem in a word vector space, and mainly measuring the difference between the problem and the source specification problem in semantics; (3) and the entity difference of the generation problem and the source specification problem ensures that the entities of the generation problem and the source specification problem are consistent as much as possible. The discriminator feeds back the discrimination result to the generator in a gradient form, so that the generator updates the network parameter value after receiving the gradient, thereby improving the quality of the next problem.
It should be noted that, in practical applications, LSTM or other networks may be used instead of the Bi-LSTM network to obtain the generator, and the application is not limited in particular. The following will be described by taking an LSRM as an example:
specifically, the recurrent neural network receives a variable-length input sequence (e.g., a natural language sentence, which can be regarded as a word sequence), and calculates each hidden state variable (hidden state) in turn: the ith state variable is calculated by the current input word and the state variable of the previous step: h isi=fh(xi,hi-1) Wherein f ishIs a multi-layer neural network. A simple way of implementation is fh(xi,hi-1)=φh(Uxi+Whi-1) Wherein phihIs a sigmoid function, for example:
Figure BDA0001528155990000101
in practice, more complex LSTM (Long Short-Term Memory) or GRU (gated Recurrent Unit) can be used to pair fhAnd modeling. Meanwhile, after each state variable is determined, the recurrent neural network can continuously generate words and finally form a sequence (i.e., a sentence in natural language). The probability of the ith word being generated is: p (y)i|y1,...,yi-1)=gh(hi,yi-1)=φg(Eyi-1+Wohi) The probability of the whole sentence is:
Figure BDA0001528155990000102
thus, when a recurrent neural network is given a random initial input vector, a sentence is generated, and the parameters therein determine the distribution of natural language that can be generated.
Optionally, the arbiter model and the generator model are set to perform antagonistic training, so as to enhance the ability of the generator to generate the interference problem and enhance the ability of the arbiter to discriminate the probability of the problem, and the training arbiter specifically may be:
inputting K source specification problems in a training set and L generation problems in a generation data set into a discriminator, so that the discriminator takes the K source specification problems in the training set as positive example samples and takes the L generation problems in the generation data set as negative example samples to carry out model training; inputting the generated problem generated by the generator to the discriminator so that the discriminator discriminates the generated problem by attribution rate, wherein the attribution rate is used for indicating the probability that the problem belongs to the standard data set or the generated data set. Wherein, K and L are positive integers which are more than or equal to 1, and the specific values of K and L can be the same or different.
In the embodiment of the present application, a Convolutional Neural Network (CNN) may be used as a discriminator of natural language problems.
Specifically, for the input sequence, a convolution (convolution) + pooling (Pooling) calculation method is adopted. One way of calculating the convolution is:
Figure BDA0001528155990000111
wherein
Figure BDA0001528155990000112
The value of the j-th feature representing the i-th position after convolution, k representing the length of the sliding window. One way of calculating pooling is to find the maximum (max-pooling):
Figure BDA0001528155990000113
this convolution and pooling may be repeated multiple times. Finally, by making z ═ z1,z2,...,zl]Taking softmax, obtaining a discriminant function: dCNN(q)=φ(Wqz+bq). Where D isCNN(q) gives the probability of whether a problem is from a standard data set (i.e., is a specification problem).
In the training process of the generator model and the discriminator model, the generator model and the discriminator model can be subjected to antagonism training, so that the capacities of the two models are increased. Therefore, the embodiment of the present application may further include the following steps:
acquiring a discrimination result of the discriminator on the generated problem, inputting the discrimination result into the generator, so that the generator performs model training according to the generated problem discriminated by the discriminator and the discrimination result, and generates a new generated problem according to the trained model; and acquiring the new generation problem generated by the generator again, and storing the new generation problem in the generation data set. Inputting K source specification problems in a training set and L random generation problems in a generation data set into a discriminator, so that the discriminator takes the K source specification problems in the training set as positive example samples and takes the L generation problems in the generation data set as negative example samples to carry out model training; wherein the L generated problem sets contain new generated problems.
And the discriminator performs model training on the generator according to the positive example sample and the negative example sample, discriminates the attribution rate of each generated problem generated by the generator through the trained discriminator model, and sends the discrimination result to the generator, so that the generator performs model training according to the new generated problem discriminated by the discriminator and the discrimination result. By performing cyclic antagonistic training, the ability of the generator to generate interference problems is improved, and the ability of the discriminator to discriminate the attribution rate of the generated problems is improved.
Referring to the above example, specifically, the training method of the discriminator is as follows:
step 1, randomly sampling m source specification problems from a training set
Figure BDA0001528155990000114
As a positive example;
step 2, the slave generator
Figure BDA0001528155990000115
Select 1 question
Figure BDA0001528155990000116
As a negative sample;
step 3, for the discriminator DCNN(q;θD),θDAre parameters in the function. Optimizing an objective function:
Figure BDA0001528155990000117
specifically, a gradient descent algorithm is adopted to solve thetaD
Figure BDA0001528155990000118
Specifically, the training method of the generator may be:
step 1, generating n random vectors
Figure BDA0001528155990000119
Wherein p (z) ═ N (0, σ)2I) Is normally distributed;
step 2, according to the generator
Figure BDA0001528155990000121
Generating n questions:
Figure BDA0001528155990000122
and 3, for the n problems, obtaining the judgment results by using a discriminator:
Figure BDA0001528155990000123
step 4, for the generator
Figure BDA0001528155990000124
Optimizing an objective function:
Figure BDA0001528155990000125
specifically, a reward function is defined:
Figure BDA0001528155990000126
the objective function is:
Figure BDA0001528155990000127
solving theta by adopting gradient descent algorithmG
Figure BDA0001528155990000128
According to the REINFORCE algorithm:
Figure BDA0001528155990000129
for a Recurrent Neural Network (RNN), one can calculate:
Figure BDA00015281559900001210
optionally, when the variable quantity of the discrimination result obtained by the discriminator discriminating the attribution rate of the problem according to all the obtained positive examples and negative examples is smaller than a third preset threshold, the input of the problem set selected from the training set and the generated data set to the discriminator is stopped, and the input of the discrimination result of the discriminator to the generator is stopped, so as to end the training of the problem optimization model.
That is, in the antagonistic training, the arbiter and the generator are alternately trained until equilibrium is reached. When the capability of the generator and the capability of the discriminator are trained to a certain degree, the attribution rate of the problems generated by the discriminator for discriminating the generator tends to be stable. For example, taking a fixed sample as an example, when the discriminator takes a fixed positive sample and a fixed negative sample as the basis for discriminating a problem, if the probability of the attribution standard data set of the generated problem generated by the generator discriminated within a preset number of times (for example, 20 times) is in a range of 0.39 to 0.41, it indicates that the discrimination capability of the discriminator tends to be stable, and at this time, the training of the models of the generator and the discriminator may be stopped.
Optionally, whether to stop training may be determined by using the number of iterations of the generator and the arbiter as a determination condition, where the generator generates a problem and determines that the problem generated by the generator represents an iteration. For example, 1000 iteration indexes are set, and the training may be stopped after the generator generates 1000 iterations, or the training may be stopped after the discriminator determines 1000 iterations.
After the training of the problem optimization model is finished, the trained problem optimization model export file is transmitted to the model server, and RESTful Web service is used for providing external service or is directly used as a local file for loading and calling an online service program.
203. Obtaining a target user problem and judging whether the target user problem is complete; if not, go to step 204; if yes, go to step 205;
and after the problem optimization model is trained, performing online service. Firstly, obtaining a target user problem, specifically comprising: in the online service process, a target user question input by a user is received through the web/app front end, and it should be noted that the question input by the user can be in a text form or a voice form. When the target user question input by the user is in a text form, receiving the target user question input by the user, and calling a question completion interface, namely when the target user question is not completely input, executing step 204; when the target user question input is complete, step 205 is performed.
When the user inputs a voice question, the voice can be recognized first to obtain corresponding text information, and the corresponding text information is displayed in the input box, and the subsequent flow is similar to the flow in which the user inputs a question in a text form, and details are not repeated here.
204. Carrying out prefix retrieval;
in the process of inputting a target user question by a user, a question completion interface is called to perform prefix retrieval to display candidate questions to help the user to input the question quickly, and as shown in fig. 4, for a possible display interface provided in the embodiment of the present application, the user inputs "express delivery" in an input box, a candidate question set "what express delivery is sent", "what express delivery is sent for asking you," and "express delivery is sent" is displayed above the input box.
It can be understood that, in practical application, this step is an optional step, that is, in the process of inputting the target user question, the prefix search is not performed to complete the question, and after the target user question is input, if the question in the standard data set is not matched, step 205 is executed.
205. Generating a target generation problem based on a problem optimization model;
after the complete target user problem is obtained, the target user problem is used as an input of a generator in the trained problem optimization model to generate a target generation problem.
206. Determining a target answer according to the target generation question;
after the generator generates the target generation problem, the discriminator may score the generation quality of the target generation problem by the scoring function, and it is understood that the higher the score of the discriminator on the problem is, the higher the generation quality of the problem is, that is, the closer the standard degree of the problem is to the standard problem. And when the mark of the discriminator on the target generation question exceeds a first preset threshold value, outputting the target generation question and determining a target answer according to the target generation question. In practical applications, there are various ways to determine the target answer, for example, 1, target generation question → target standard question → target answer: the target generated question and the standard questions in the standard data set can be matched, namely the similarity value of the target generated question and each standard question in the standard data set is calculated, the standard questions with the similarity value higher than a fifth preset threshold value with the target generated question are used as the target standard questions, it can be understood that the number of the target standard questions can be 0, 1 or more, when the number of the target standard questions is 0, the obtained target user questions can be output, and then the manual customer service can perform question answering to obtain target answers; when the number of the target standard questions is 1, determining answers corresponding to the target standard questions as target answers; when the number of the target standard questions is multiple, determining an answer corresponding to the target standard question with the highest similarity value with the target generated question as a target answer, or randomly selecting any one of the target standard questions, wherein the corresponding answer is the target answer, and the specific details are not limited herein; 2. target generated question → target answer: converting the target generation question into a query statement such as Structured Query Language (SQL), and determining the answer corresponding to the query statement in the database as the target answer, for example, the target generation question is "how much the price of MATE9 is", and the prices of various mobile phones are stored in the database, so that the target generation question is converted into the SQL statement, that is, the answer can be directly found in the database. In summary, the manner of determining the target answer according to the target generation question is not limited herein.
Optionally, when the score of the target generated question by the discriminator does not exceed the first preset threshold, in order to avoid unreasonable generated questions, the original question, that is, the obtained target user question, may still be output, and then a manual customer service may perform a question reply to obtain a target answer.
207. And returning the target answer.
And after the target answer is determined, outputting and displaying the target answer through the web/app front end.
It can be understood that when the question completion interface is called to perform prefix retrieval, after the click operation of the user on any question in the candidate question set is received, the standard answer corresponding to the clicked question in the standard data set is returned, and the standard answer is the target answer.
It should be noted that the intelligent question-answering method provided by the present application can be applied to various scenarios, such as a website after-sale customer service response service scenario, a website before-sale customer service response service scenario, a medical service response scenario, or a navigation service scenario, and the present application is not limited in particular.
In the embodiment of the application, 1, existing data in the existing standard data set is used as a standard problem set, relevant user problems are mined from a user log and used as source user problems to construct a training set, only editing is needed to check the automatically mined results, and a manual writing process is avoided, so that the construction cost of the training set is greatly reduced, and the scale of the training set is favorably enlarged; 2. the sequence generation model based on the RNN is further provided for learning the conversion rule from the original problem to the standard problem, the generated problem can be kept consistent with the semantics of the source user problem by introducing a null character string and a non-repeated attention mechanism, automatic rewriting from the original problem to the standard problem is realized, the labor cost is greatly reduced, and the efficiency of large-scale user problem optimization is improved; 3. the present application provides a two-class neural network to compute the probability that a generated problem is a canonical problem. The classifier integrates the literal feature, the word vector feature, the entity feature and the like, can effectively measure and generate a problem normative measurement mode, and is manually participated; 4. the strategy gradient is output and calculated from the discriminator by adopting a generation countermeasure training mode and applying a strategy gradient idea in reinforcement learning, so that the parameters in the generator are continuously updated, the result of the generator is continuously optimized in an iterative manner, and the effect of problem generation can be obviously improved.
The above describes the intelligent question-answering method in the embodiment of the present application, and the following describes the intelligent question-answering device in the embodiment of the present application, with reference to fig. 5, an embodiment of the intelligent question-answering device in the embodiment of the present application includes:
an obtaining unit 501, configured to obtain a target user question;
a generating unit 502, configured to generate a target generation problem corresponding to the target user problem according to a problem optimization model, where the problem optimization model is obtained based on generative confrontation network training, and the problem optimization model includes a generator and a discriminator;
a determining unit 503, configured to determine, according to the discriminator, whether a generation quality of the target generation problem is higher than a first preset threshold, where the generation quality is used to indicate a probability that the target generation problem is a normative problem;
a determining unit 504, configured to determine a target answer according to the target generation question if the determining unit determines that the generation quality of the target generation question is higher than the first preset threshold.
In the embodiment of the application, the questions input by the user are optimized through the question optimization model to obtain the target generation questions expressed in the specification, the user is helped to express the user's requirements more accurately and clearly, the matching degree with the standard questions is improved, the target answers can be found more accurately, and the accuracy of the intelligent question-answering system is improved.
For convenience of understanding, the following describes in detail an intelligent question answering device in an embodiment of the present application, and with reference to fig. 6 on the basis of the above fig. 5, fig. 6 is a schematic view of another embodiment of the intelligent question answering device in an embodiment of the present application, and the intelligent question answering device includes: an acquisition unit 601, a generation unit 602, a judgment unit 603, and a determination unit 604.
Optionally, the obtaining unit 601 may further be configured to:
a training set is obtained, the training set including source user problem-source specification problem pairs representing a set of source user problems and source specification problems corresponding to the source user problems.
Optionally, the obtaining unit 601 specifically includes:
a calculating module 6011, configured to calculate similarity values between a standard question in a standard data set and each source user question in a user log, where the standard data set is used to store the standard question, and the user log includes interaction records of a user and a question-answering system;
a first determining module 6012, configured to use the source user problem with the similarity value greater than the second preset threshold with the standard problem as a candidate user problem, so as to determine a problem, in the candidate user problem, that is semantically consistent with the standard problem, and further obtain the source user problem-source specification problem pair, where the standard problem is included in the source specification problem.
Optionally, the intelligent question answering device further includes:
an input unit 605, configured to input the source user question in the training set to the generator, so that the generator performs model training, and obtains a generated question according to a trained model;
a saving unit 606, configured to acquire the generated questions obtained by the generator, and save the generated questions in a generated data set, where the generated data set is used to store the generated questions.
Optionally, the intelligent question answering device further includes:
an input unit 605, configured to input the source specification questions in the training set and the generation questions in the generation data set to the discriminator, so that the discriminator performs model training with the source specification questions in the training set as positive example samples and the generation questions in the generation data set as negative example samples; inputting the generated problem generated by the generator to the discriminator so that the discriminator discriminates the generated problem by attribution rate, wherein the attribution rate is used for indicating the probability that the problem belongs to the standard data set or the generated data set;
the obtaining unit 601 is further configured to obtain a result of the discrimination of the generated problem by the discriminator;
an input unit 605, configured to input the determination result to the generator, so that the generator performs model training according to the generated problem determined by the determiner and the determination result, and generates a new generated problem according to the trained model;
the obtaining unit 601 is further configured to obtain a new generation question generated by the generator, and save the new generation question in the generation data set.
Optionally, the intelligent question answering device further includes:
a termination unit 607, configured to stop inputting the problem generated by the generator to the discriminator and stop inputting the discrimination result of the discriminator to the generator to end the training of the problem optimization model when a variation of a discrimination result obtained by the discriminator for discriminating the problem generated by the generator is smaller than a third preset threshold.
Optionally, the termination unit 607 is further configured to:
and when the iteration number reaches a fourth preset threshold, stopping inputting the problem generated by the generator into the discriminator and stopping inputting the discrimination result of the discriminator into the generator so as to finish the training of the problem optimization model, wherein the generator generates a problem and the discriminator judges the problem generated by the generator once to represent an iteration.
Optionally, the determining unit 604 specifically includes:
a matching module 6041, configured to match a target standard problem in a standard data set according to the target generation problem, where a similarity value between the target standard problem and the target generation problem is greater than a fifth preset threshold;
a second determining module 6042, configured to determine that an answer of the target standard question in the standard data set is the target answer, where the standard data set is used to store the standard question.
Optionally, the intelligent question answering device further includes:
an output unit 608, configured to output the target user question if the determining unit 603 determines that the reliability of the target generation question is not higher than a first preset threshold.
Fig. 5 to 6 respectively describe the intelligent question answering device in the embodiment of the present application in detail from the perspective of the modular functional entity, and the intelligent question answering device in the embodiment of the present application is described in detail from the perspective of hardware processing.
Fig. 7 is a schematic structural diagram of an intelligent question answering device according to an embodiment of the present application, and refer to fig. 7. In the case of an integrated unit, fig. 7 shows a schematic diagram of a possible structure of the intelligent question answering device according to the above-described embodiment. The intelligent question answering apparatus 700 includes: a processing unit 702 and a communication unit 703. The processing unit 702 is configured to control and manage the actions of the smart question-answering device, for example, the processing unit 702 is configured to support the smart question-answering device to perform steps 202 to 206 in fig. 2, and/or other processes for the techniques described herein. The communication unit 703 is used to support communication of the smart question answering device with other devices, such as performing steps 201 and 207 in fig. 2, and/or other processes for the techniques described herein. The intelligent question-answering device may further include a storage unit 701 for storing program codes and data of the intelligent question-answering device.
The processing unit 702 may be a processor or a controller, such as a Central Processing Unit (CPU), a general-purpose processor, a Digital Signal Processor (DSP), an application-specific integrated circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. A processor may also be a combination of computing functions, e.g., comprising one or more microprocessors, a DSP and a microprocessor, or the like. The communication unit 703 may be a communication interface, a transceiver circuit, etc., wherein the communication interface is generally referred to and may include one or more interfaces, such as a transceiver interface. The memory unit 701 may be a memory.
When the processing unit 702 is a processor, the communication unit 703 is a communication interface, and the storage unit 701 is a memory, the apparatus according to the embodiment of the present application may be the intelligent question answering device shown in fig. 8.
Referring to fig. 8, the intelligent question answering device 810 includes: processor 812, communications interface 813, memory 811. Optionally, the intelligent question answering device 810 may also include a bus 814. Wherein the communication interface 813, the processor 812 and the memory 811 may be connected to each other by a bus 814; the bus 814 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus 814 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product.
The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store or a data storage device, such as a server, a data center, etc., that is integrated with one or more available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (17)

1. An intelligent question answering method is characterized by comprising the following steps:
obtaining a training set, wherein the training set comprises source user problem-source specification problem pairs, and the source user problem-source specification problem pairs are used for representing a set of source user problems and source specification problems corresponding to the source user problems;
obtaining a target user question;
generating a target generation problem corresponding to the target user problem according to a problem optimization model, wherein the problem optimization model is obtained by training the training set based on a generative confrontation network, the problem optimization model comprises a generator and a discriminator, and the generative confrontation network is obtained by alternately confronting and training the generator and the discriminator;
judging whether the generation quality of the target generation problem is higher than a first preset threshold value or not according to the discriminator, wherein the generation quality is used for indicating the probability that the target generation problem is a standard problem;
and if so, determining a target answer according to the target generation question.
2. The method of claim 1, wherein the obtaining the training set comprises:
calculating similarity values of standard questions in a standard data set and source user questions in a user log, wherein the standard data set is used for storing the standard questions, and the user log comprises interaction records of users and a question-answering system;
and taking the source user question with the similarity value larger than a second preset threshold value with the standard question as a candidate user question to determine the question with the semantic consistent with the standard question in the candidate user question so as to obtain the source user question-source specification question pair, wherein the standard question is contained in the source specification question.
3. The method of claim 2, wherein after obtaining the training set and before obtaining the target user question, the method further comprises:
inputting the source user questions in the training set into the generator so that the generator performs model training and obtains generated questions according to the trained models;
and acquiring the generated problems obtained by the generator, and storing the generated problems in a generated data set, wherein the generated data set is used for storing the generated problems.
4. The method of claim 3, wherein after obtaining the training set and before obtaining the target user question, the method further comprises:
inputting the source specification questions in the training set and the generation questions in the generation data set into the discriminator, so that the discriminator performs model training by taking the source specification questions in the training set as positive example samples and the generation questions in the generation data set as negative example samples;
inputting the generated problem generated by the generator to the discriminator so that the discriminator discriminates the generated problem by attribution rate, wherein the attribution rate is used for indicating the probability that the problem belongs to the standard data set or the generated data set;
obtaining a discrimination result of the discriminator on the generated problem;
inputting the discrimination result into the generator, so that the generator performs model training according to the generated problem discriminated by the discriminator and the discrimination result, and generates a new generated problem according to the trained model;
and acquiring a new generation question generated by the generator and saving the new generation question in the generation data set.
5. The method of claim 4, further comprising:
and when the variation of a judgment result obtained by judging the problem generated by the generator by the discriminator is smaller than a third preset threshold value, stopping inputting the problem generated by the generator into the discriminator and stopping inputting the judgment result of the discriminator into the generator so as to finish the training of the problem optimization model.
6. The method of claim 4, further comprising:
and when the iteration number reaches a fourth preset threshold value, stopping inputting the problem generated by the generator into the discriminator and stopping inputting the discrimination result of the discriminator into the generator so as to finish the training of the problem optimization model, wherein the generator generates a problem and the discriminator judges the problem generated by the generator once to represent an iteration.
7. The method of any one of claims 1 to 6, wherein said determining a target answer from said target-generated question comprises:
matching a target standard problem in a standard data set according to the target generation problem, wherein the similarity value of the target standard problem and the target generation problem is larger than a fifth preset threshold value;
and determining the answer of the target standard question in the standard data set as the target answer, wherein the standard data set is used for storing the standard question.
8. The method of claim 1, wherein after determining whether the confidence level of the target generated question is higher than a first preset threshold according to the discriminator, the method further comprises:
and if the discriminator judges that the credibility of the target generation problem is not higher than a first preset threshold value, outputting the target user problem.
9. An intelligent question answering device, comprising:
the acquisition unit is used for acquiring a training set, wherein the training set comprises source user problem-source specification problem pairs which are used for representing a source user problem and a set of source specification problems corresponding to the source user problem;
the acquisition unit is used for acquiring a target user question;
the generation unit is used for generating a target generation problem corresponding to the target user problem according to a problem optimization model, the problem optimization model is obtained by training the training set based on a generative confrontation network, the problem optimization model comprises a generator and a discriminator, and the generative confrontation network is obtained by alternately confronting and training the generator and the discriminator;
the judging unit is used for judging whether the generation quality of the target generation problem is higher than a first preset threshold value or not according to the discriminator, and the generation quality is used for indicating the probability that the target generation problem is a standard problem;
and the determining unit is used for determining a target answer according to the target generation question if the judging unit determines that the generation quality of the target generation question is higher than the first preset threshold.
10. The intelligent question answering device according to claim 9, wherein the acquisition unit includes:
the system comprises a calculation module, a query module and a query and answer module, wherein the calculation module is used for calculating similarity values of standard questions in a standard data set and source user questions in a user log, the standard data set is used for storing the standard questions, and the user log comprises interaction records of a user and a question and answer system;
a first determining module, configured to use the source user question with the similarity value greater than a second preset threshold with the standard question as a candidate user question, so as to determine a question that is semantically consistent with the standard question in the candidate user question, and further obtain the source user question-source specification question pair, where the standard question is included in the source specification question.
11. The intelligent question-answering device according to claim 10, characterized by further comprising:
the input unit is used for inputting the source user questions in the training set into the generator so as to enable the generator to carry out model training and obtain generated questions according to the trained models;
and the storage unit is used for acquiring the generated questions obtained by the generator and storing the generated questions in a generated data set, and the generated data set is used for storing the generated questions.
12. The intelligent question-answering device according to claim 11, characterized by further comprising:
the input unit is further configured to input the source specification problem in the training set and the generation problem in the generation data set to the discriminator, so that the discriminator performs model training with the source specification problem in the training set as a positive sample and the generation problem in the generation data set as a negative sample; inputting the generated problem generated by the generator to the discriminator so that the discriminator discriminates the generated problem by attribution rate, wherein the attribution rate is used for indicating the probability that the problem belongs to the standard data set or the generated data set;
the obtaining unit is further configured to obtain a result of the discrimination of the generated problem by the discriminator;
the input unit is further configured to input the discrimination result to the generator, so that the generator performs model training according to the generated problem discriminated by the discriminator and the discrimination result, and generates a new generated problem according to the trained model;
the obtaining unit is further configured to obtain a new generation question generated by the generator and save the new generation question in the generation dataset.
13. The intelligent question-answering device according to claim 12, characterized by further comprising:
and the termination unit is used for stopping inputting the problem generated by the generator into the discriminator and stopping inputting the discrimination result of the discriminator into the generator to finish the training of the problem optimization model when the variation of the discrimination result obtained by discriminating the problem generated by the generator by the discriminator is smaller than a third preset threshold.
14. The intelligent question-answering device according to claim 12, characterized by further comprising:
and the termination unit is further configured to stop inputting the problem generated by the generator to the discriminator and stop inputting the discrimination result of the discriminator to the generator when the number of iterations reaches a fourth preset threshold, so as to finish training the problem optimization model, where the generator generates a problem and the discriminator determines that the problem generated by the generator represents one iteration.
15. The intelligent question-answering device according to any one of claims 9 to 14, characterized in that the determination unit includes:
the matching module is used for matching a target standard problem in a standard data set according to the target generation problem, and the similarity value of the target standard problem and the target generation problem is larger than a fifth preset threshold value;
and the second determining module is used for determining that the answer corresponding to the target standard question in the standard data set is the target answer, and the standard data set is used for storing the standard question.
16. The intelligent question-answering device according to claim 9, characterized by further comprising:
and the output unit is used for outputting the target user question if the judging unit determines that the credibility of the target generation question is not higher than a first preset threshold.
17. A computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform the method of any one of claims 1-8.
CN201711453223.3A 2017-12-27 2017-12-27 Intelligent question answering method and related device Active CN110019732B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711453223.3A CN110019732B (en) 2017-12-27 2017-12-27 Intelligent question answering method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711453223.3A CN110019732B (en) 2017-12-27 2017-12-27 Intelligent question answering method and related device

Publications (2)

Publication Number Publication Date
CN110019732A CN110019732A (en) 2019-07-16
CN110019732B true CN110019732B (en) 2021-10-15

Family

ID=67187049

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711453223.3A Active CN110019732B (en) 2017-12-27 2017-12-27 Intelligent question answering method and related device

Country Status (1)

Country Link
CN (1) CN110019732B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112749259B (en) * 2019-10-29 2024-01-02 阿里巴巴集团控股有限公司 Commodity question and answer generation method and device and computer storage medium
CN112837676B (en) * 2019-11-04 2023-12-01 深圳市优必选科技股份有限公司 Statement generation method, statement generation device and intelligent device
CN110929085B (en) * 2019-11-14 2023-12-19 国家电网有限公司 System and method for processing electric customer service message generation model sample based on meta-semantic decomposition
CN111177336B (en) * 2019-11-30 2023-11-10 西安华为技术有限公司 Method and device for determining response information
CN111125325B (en) * 2019-12-06 2024-01-30 山东浪潮科学研究院有限公司 FAQ generation system and method based on GAN network
CN111126075B (en) * 2019-12-24 2023-07-25 重庆兆光科技股份有限公司 Semantic understanding method, system, equipment and medium for text resistance training
CN111209382B (en) * 2020-01-03 2024-02-27 联想(北京)有限公司 Content processing method, device, electronic equipment and medium
CN111428448B (en) * 2020-03-02 2024-05-07 平安科技(深圳)有限公司 Text generation method, device, computer equipment and readable storage medium
CN111737439B (en) * 2020-07-31 2020-12-11 支付宝(杭州)信息技术有限公司 Question generation method and device
CN114429141A (en) * 2022-03-31 2022-05-03 北京中科闻歌科技股份有限公司 Answer determination method and device, computing equipment and storage medium
CN114969291B (en) * 2022-05-31 2023-08-08 湖南工商大学 Automatic question and answer method and device
CN116523031B (en) * 2023-07-05 2024-05-10 深圳须弥云图空间科技有限公司 Training method of language generation model, language generation method and electronic equipment
CN117234341B (en) * 2023-11-15 2024-03-05 中影年年(北京)科技有限公司 Virtual reality man-machine interaction method and system based on artificial intelligence

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106803092B (en) * 2015-11-26 2020-07-10 阿里巴巴集团控股有限公司 Method and device for determining standard problem data
CN105677636A (en) * 2015-12-30 2016-06-15 上海智臻智能网络科技股份有限公司 Information processing method and device for intelligent question-answering system
GB201607994D0 (en) * 2016-05-06 2016-06-22 Magic Pony Technology Ltd Encoder pre-analyser
CN107423707A (en) * 2017-07-25 2017-12-01 深圳帕罗人工智能科技有限公司 A kind of face Emotion identification method based under complex environment
CN107423437B (en) * 2017-08-04 2020-09-01 逸途(北京)科技有限公司 Question-answer model optimization method based on confrontation network reinforcement learning

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
情感倾向性分析及应用研究综述;李建华 等;《信息安全学报》;20170430;第2卷(第2期);第48-49页 *
社会化问答网站的知识传播研究;胡青;《中国优秀硕士学位论文全文数据库》;20151215(第12期);第1页 *

Also Published As

Publication number Publication date
CN110019732A (en) 2019-07-16

Similar Documents

Publication Publication Date Title
CN110019732B (en) Intelligent question answering method and related device
CN108363790B (en) Method, device, equipment and storage medium for evaluating comments
WO2020108608A1 (en) Search result processing method, device, terminal, electronic device, and storage medium
KR20200094627A (en) Method, apparatus, device and medium for determining text relevance
CN112667794A (en) Intelligent question-answer matching method and system based on twin network BERT model
CN106708929B (en) Video program searching method and device
CN110990532A (en) Method and device for processing text
CN111753167B (en) Search processing method, device, computer equipment and medium
CN111414763A (en) Semantic disambiguation method, device, equipment and storage device for sign language calculation
CN114861889B (en) Deep learning model training method, target object detection method and device
CN111563384A (en) Evaluation object identification method and device for E-commerce products and storage medium
CN112926308B (en) Method, device, equipment, storage medium and program product for matching text
CN112182145A (en) Text similarity determination method, device, equipment and storage medium
CN111090771A (en) Song searching method and device and computer storage medium
CN110727769B (en) Corpus generation method and device and man-machine interaction processing method and device
CN110874536A (en) Corpus quality evaluation model generation method and bilingual sentence pair inter-translation quality evaluation method
CN115795030A (en) Text classification method and device, computer equipment and storage medium
CN114003682A (en) Text classification method, device, equipment and storage medium
CN110795942B (en) Keyword determination method and device based on semantic recognition and storage medium
CN106570196B (en) Video program searching method and device
CN115248839A (en) Knowledge system-based long text retrieval method and device
CN116049376B (en) Method, device and system for retrieving and replying information and creating knowledge
CN117076636A (en) Information query method, system and equipment for intelligent customer service
CN111859955A (en) Public opinion data analysis model based on deep learning
CN116108181A (en) Client information processing method and device and electronic equipment

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
TA01 Transfer of patent application right

Effective date of registration: 20200420

Address after: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Applicant after: HUAWEI TECHNOLOGIES Co.,Ltd.

Address before: 301, A building, room 3, building 301, foreshore Road, No. 310052, Binjiang District, Zhejiang, Hangzhou

Applicant before: Huawei Technologies Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant