WO2017092380A1 - 用于人机对话的方法、神经网络系统和用户设备 - Google Patents

用于人机对话的方法、神经网络系统和用户设备 Download PDF

Info

Publication number
WO2017092380A1
WO2017092380A1 PCT/CN2016/091892 CN2016091892W WO2017092380A1 WO 2017092380 A1 WO2017092380 A1 WO 2017092380A1 CN 2016091892 W CN2016091892 W CN 2016091892W WO 2017092380 A1 WO2017092380 A1 WO 2017092380A1
Authority
WO
WIPO (PCT)
Prior art keywords
vector
neural network
natural language
answer
knowledge
Prior art date
Application number
PCT/CN2016/091892
Other languages
English (en)
French (fr)
Inventor
蒋欣
吕正东
李航
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2017092380A1 publication Critical patent/WO2017092380A1/zh
Priority to US15/993,619 priority Critical patent/US11640515B2/en

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/3331Query processing
    • G06F16/334Query execution
    • G06F16/3344Query execution using natural language analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/205Parsing
    • G06F40/216Parsing using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/042Knowledge-based neural networks; Logical representations of neural networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks

Definitions

  • Embodiments of the present invention relate to the field of computers, and, more particularly, to a method for a human-machine dialog, a neural network system, and a user equipment.
  • Human-machine dialogue involves a range of techniques, such as speech recognition, natural language understanding, natural language dialogue, automated question and answer, search, recommendation, speech synthesis, and more.
  • the automatic question and answer technology means that the automatic question answering system can directly give answers to questions raised by users in natural language.
  • the main indicator for evaluating the quality of automated questions and answers is the correctness of the answer.
  • the automated question answering system involves multiple technologies in different directions, such as natural language processing, information retrieval, and knowledge base. Depending on the type of problem, there is a class of questions and answers in our automated question answering system that answer the factoid question. Examples of automated question answering systems in the industry include IBM Watson, Google, Baidu, and Wolfram Alpha.
  • Knowledge base technology is a technology that is closely related to the automated question answering system. It involves getting structured knowledge from the data and collating and merging it, and querying and reasoning based on it.
  • the semantic parsing process is a problem that has not been completely solved.
  • the answer to the automatic question and answer usually faces the problem of natural language ambiguity and ambiguity.
  • the natural language dialogue technology refers to the semantic dialogue between the natural language dialogue system and the user.
  • the evaluation index mainly lies in the semantic relevance and language correctness (including language coherence and grammatical correctness) of the dialogue (response).
  • Examples of natural language dialogue systems include Microsoft Xiao Bing and Baidu Baidu.
  • Natural language dialogue technology is a challenging direction in the field of natural language processing. In recent years, with the development and application of deep learning technology, a natural language dialogue system based on deep neural network has been invented, and its effect has been proved to be significantly superior to traditional technology in some data.
  • the natural language dialogue system based on deep neural network can generate semantic related responses, but due to the limitations of the model itself, the correctness of the reply statement cannot be guaranteed. For example, for the question "How high is Yao Ming?", the response may be "Yao Ming is 1.7m tall.” This reply is appropriate from a linguistic point of view, but it is wrong from a knowledge point of view.
  • the invention provides a method for a human-machine dialogue, a neural network system and a user equipment, which can perform natural language interaction with a user, and make a fact-based correct natural language answer according to the knowledge base.
  • the present invention provides a method for human-machine dialogue, comprising:
  • the neural network system acquires natural language problems input by the user;
  • the neural network system converts the natural language problem into a problem vector
  • the neural network system obtains at least one knowledge answer related to the natural language problem by text retrieval from a knowledge base, and each of the knowledge answers corresponds to a knowledge answer vector;
  • the neural network system calculates an intermediate result vector based on the knowledge base based on the problem vector and the at least one knowledge answer vector, the intermediate result vector is used to indicate the question vector and each of the knowledge answers Similarity of vectors;
  • the neural network system takes the problem vector and the intermediate result vector as inputs, and generates a natural language answer to the natural language problem by calculating a probability of the output sequence.
  • the calculating, according to the problem vector and the at least one knowledge answer vector, obtaining an intermediate result vector based on the knowledge base including:
  • the above process is the use of a neural network system.
  • the knowledge answer vector can be calculated after selecting at least one knowledge answer during use.
  • the knowledge answer vector can be trained in advance in the training process of the neural network system.
  • the knowledge answer is a triple
  • the knowledge answer vector is a triplet vector
  • the triplet vector is the triplet as the The input of the fourth neural network module of the neural network system is calculated.
  • the triplet vector may be determined according to the following steps:
  • the subject, the predicate and the object of the triplet are respectively represented by a first heat vector, a second heat vector and a third heat vector;
  • the projection matrix is a parameter of the fourth neural network module
  • the parameters of the neural network system may be Obtained by maximizing the results of a likelihood function on the training data, wherein the training data includes a plurality of sets of the natural language questions and the natural language answers.
  • a random gradient descent algorithm can be used for training.
  • converting the natural language problem into a problem vector may include:
  • the low-dimensional vector sequence is operated by the recurrent neural network model or the convolutional neural network model of the first neural network module to obtain the problem vector.
  • the problem vector and the intermediate result vector are used as inputs, and the natural language answer of the natural language problem is generated by calculating a probability of the output sequence, which may include :
  • the natural vector answer is generated by the problem vector and the intermediate result vector as the joint probability of the conditional output sequence.
  • the problem vector and the intermediate result vector are used as inputs, and the natural language answer of the natural language problem is generated by calculating a probability of the output sequence, including:
  • the module's recursive neural network model based on the attention attention vector technique calculates the probability of the output sequence and generates the natural language answer.
  • a neural network system for human-machine dialogue including an acquisition module, a first neural network module, a retrieval module, a second neural network module, and a third neural network module, for performing the first aspect correspondingly The way to achieve it.
  • the obtaining module is configured to obtain a natural language problem input by the user;
  • the first neural network module is configured to convert the natural language problem acquired by the acquiring module into a problem vector;
  • the retrieval module is configured to pass the knowledge base Text retrieval, obtaining at least one knowledge answer related to the natural language problem acquired by the obtaining module, each of the knowledge answers corresponding to a knowledge answer vector;
  • a second neural network module configured to The problem vector obtained by the network module and the at least one knowledge answer vector obtained by the retrieval module are calculated to obtain an intermediate result vector based on the knowledge base, the intermediate result vector is used to indicate the problem vector and each a similarity of the knowledge answer vector;
  • a third neural network module configured to use the problem vector obtained by the first neural network module and the intermediate result vector obtained by the second neural network module as an input, A natural language answer to the natural language problem is generated by calculating the probability of the output sequence.
  • the second neural network module is specifically configured to:
  • a similarity of the question vector to each of the knowledge answer vectors is calculated by taking the question vector and at least one of the knowledge answer vectors as inputs, wherein the similarity constitutes an element of the intermediate result vector.
  • the knowledge answer is a triplet
  • the knowledge answer vector is a triplet vector
  • the neural network system further includes:
  • a fourth neural network module configured to obtain the triplet vector by using the triplet as an input.
  • the fourth neural network module is specifically configured to:
  • the subject, the predicate and the object of the triplet are respectively represented by a first heat vector, a second heat vector and a third heat vector;
  • the projection matrix is a parameter of the fourth neural network module
  • the first neural network module is specifically configured to:
  • the low-dimensional vector sequence is operated by a recurrent neural network model or a convolutional neural network model to obtain the problem vector.
  • the third neural network module is specifically configured to:
  • the third neural network module is specifically configured to:
  • the probability of the output sequence is calculated by a recurrent neural network model based on attention attention vector technique to generate the natural language answer.
  • the parameters of the first neural network module, the second neural network module, the third neural network module, and the fourth neural network module are The results of the likelihood function on the training data are obtained, wherein the training data includes a plurality of sets of the natural language questions and the natural language answers.
  • a third aspect provides a user equipment having a human-machine dialog function, including an input device, a processor, and a memory, wherein the input device is configured to acquire an input of a user, the memory is configured to store an instruction, and the processor is configured to: The instructions stored in the memory are executed for completing a corresponding implementation of the first aspect, and the devices of the user equipment of the third aspect may correspond to respective modules of the neural network system of the second aspect.
  • the user equipment of the third aspect may further comprise an output device for outputting the natural language answer generated by the neural network system.
  • the method for the human-machine dialogue, the neural network system and the user equipment provided by the embodiments of the present invention, by vectorizing the natural language problem and the knowledge base, using the vector calculation, the dialogue and the knowledge base
  • the combination of question and answer enables it to interact with the user in natural language and to make correct natural language answers based on facts based on the knowledge base.
  • Figure 1 is a schematic diagram of the architecture of a short text dialog model.
  • FIG. 2 is a schematic diagram of a training process for human-machine dialogue in accordance with an embodiment of the present invention.
  • FIG. 3 is a schematic diagram of a calculation flow of a third neural network module.
  • FIG. 4 is a schematic flow chart of a method for human-machine dialogue according to an embodiment of the present invention.
  • Figure 5 is a schematic block diagram of a neural network system for human-machine dialogue in accordance with one embodiment of the present invention.
  • FIG. 6 is a schematic block diagram of a user equipment having a human-machine dialog function according to an embodiment of the present invention.
  • the automatic question-and-answer technology based on information retrieval is usually divided into three steps: problem analysis, document retrieval and answer extraction. among them,
  • Problem Analysis The natural language processing technology is used to analyze the problems raised by users, including problem type identification, central word extraction, synonym expansion and problem retelling.
  • Document retrieval According to the output of the problem analysis step, the indexed document library is retrieved and sorted, and the relevant paragraphs are found in the relevant documents.
  • Answer extraction from the relevant paragraph returned by the document retrieval step, depending on the type of question, The answer segments of the can be extracted, scored, sorted, and finally returned to the most relevant answer.
  • the automated question-and-answer technology based on structured knowledge base first acquires or mines structured knowledge from a large amount of data (usually unstructured or semi-structured data) and builds a structured knowledge base.
  • the structure of knowledge is usually represented by triples: (subject, predicate, object).
  • the subject is usually an entity, the object may be another entity or attribute, and the predicate indicates the relationship between the two.
  • (Yao Ming, wife, Ye Li) is a triad.
  • the knowledge base consists of multiple triples, which can usually be represented by the structure of the graph (the entity is the node of the graph and the relationship is the edge). Similar concepts include the semantic web, the ontology, the linked data, and the knowledge graph. Since the knowledge base is usually obtained from multiple data sources, knowledge fusion and disambiguation are also one of the tasks of building a knowledge base.
  • the process of automating the knowledge base built above may have problems with accuracy, so if necessary, human resources will be added for calibration.
  • the knowledge base Once the knowledge base is built, it can be queried and reasoned on it. Since the knowledge base is structured data, you can use relational database or graph database storage and query statements on structured data (such as Structured Query Language (SQL) and Simple Protocol and RDF Query Language). Simple Protocol and RDF Query Language, SparQL), etc., where RDF refers to the Resource Description Framework for querying. For the natural language that the user enters, it needs to be translated into a specific query language, a process commonly referred to as semantic parsing. Semantic parsing is a very challenging problem in natural language processing.
  • SQL Structured Query Language
  • SparQL Simple Protocol and RDF Query Language
  • Semantic parsing is a very challenging problem in natural language processing.
  • the industry's automatic question answering system can adopt the prior art A hybrid technique of two techniques (based on information retrieval and knowledge base based on prior art).
  • Natural language dialogue technology based on information retrieval indexes large-scale dialogue corpus in a "original-reply" pair.
  • the original text similar to the user input is found by searching, and the corresponding reply is returned to the user.
  • the source language such as English
  • the target language such as Chinese
  • statistical machine translation methods eg, phrase-based machine translation
  • the machine translation model does not perform well on actual short text conversation data.
  • the main reason is that the data distribution in the dialogue data is different from the bilingual “parallel corpus” in machine translation. In the dialogue data, there may be many different responses to the same original text.
  • the machine translation model mainly considers the linear mapping relationship between words and words. This complex mapping relationship may be the cause of the failure of the machine translation model.
  • Natural language dialogue techniques based on deep neural networks are used to obtain natural language dialogue systems in large-scale conversational corpus training.
  • the system accepts the user's input sequence and then through a multi-layer neural network calculation, the word-by-word output is replied to the sequence.
  • Figure 1 is a schematic diagram of the architecture of a short text dialog model. Specifically, the input natural language sequence is converted into an intermediate representation vector by an encoder, and then an output sequence is sequentially generated by a decoder.
  • the decoder and the encoder are respectively implemented by a Recurrent Neural Network (RNN), and in each step of decoding, the next output is more purposefully determined by an attention vector technique.
  • RNN Recurrent Neural Network
  • the natural language dialogue system based on deep neural networks is effective in terms of retrieval and machine translation based dialogue systems. Although it is possible to generate semantically relevant responses, due to the limitations of the model itself, the correctness of the reply statement cannot be guaranteed. For example, what is the "How high is Yao Ming?" The reply may be "Yao Ming is 1.7m tall.” This reply is appropriate from a linguistic point of view, but it is wrong from a knowledge point of view. Therefore, how to return the natural language dialogue system based on deep neural network to the correct dialogue of knowledge is a practical issue and a problem of concern to the present invention.
  • the attention vector technique can align the original problem with the part of the output that has been output, thus helping the neural network system to output the next word more accurately, and its effect is verified in both machine translation and short text dialogue.
  • the existing technology or system only considers automatic question and answer, or only considers natural language dialogue, and the accuracy of replying to questions in the dialogue is low.
  • the invention is based on a natural language dialogue system based on deep neural network, and combines natural language dialogue and knowledge base-based question and answer through deep learning technology, so that the system can make the knowledge correct and natural to the user's question in the dialogue. Language response.
  • the method for human-machine dialogue is a natural language conversational question and answer method based on a neural network model
  • the neural network system for human-machine dialogue is based on a neural network.
  • the natural language dialogue question and answer system based on neural network model can be divided into two stages of training and use.
  • the training phase is based on the training data, and the parameters of each module in the neural network system are determined by maximizing the likelihood function on the training data by a back propagation algorithm or a random gradient descent algorithm.
  • the training data used may be composed of such an example: (question, answer, Matching triples).
  • the use phase is based on the already built knowledge base, taking the user's natural language problem as input, and generating the natural language answer back to the user through the calculation of each model in the neural network system.
  • the knowledge base is based on a number of "facts".
  • Structured knowledge bases include records or "tuples.”
  • a structured knowledge base can be obtained from the Internet.
  • the knowledge base may be composed of a plurality of triplets, or may be composed of a database including a plurality of structured records, which is not limited by the embodiment of the present invention.
  • multiple triples are extracted to form a structured knowledge base.
  • Training data can be obtained from the Internet, which can be natural language question and answer session data.
  • the community question and answer website such as Baidu knows, search and ask questions can be crawled, and the "question-answer” pair is parsed, and a plurality of "question-answer” pairs are extracted.
  • the above-mentioned "question-answer” pair data can be scanned one by one to check whether it matches "one or more triples in the knowledge base", wherein the definition of "match” can be: 1, three yuan The subject of the group appears in the question; 2, the object of the triplet appears in the answer; 3, the object of the triplet does not appear in the problem.
  • the size of the knowledge base and the size of the training data may be adjusted according to training needs.
  • the structured knowledge base can include 5.5M triples
  • the "question-answer” pair can include 132M, from which 696K “question-answer” pairs are selected as training data.
  • each word may correspond to a one-hot vector.
  • the so-called heat vector means that, for example, for a certain language, there are a total of A words, each word is numbered, and any word corresponds to a unique heat vector having an M dimension, wherein the number of the word The corresponding element is 1, and the remaining elements are zero.
  • the heat vector is a high dimensional vector.
  • x i is a unique heat vector.
  • FIG. 2 is a schematic diagram of a training process for human-machine dialogue in accordance with an embodiment of the present invention. As shown in Figure 2, it mainly includes the following steps:
  • the triplet of the structured knowledge base is used as the input of the fourth neural network module of the neural network system, and the triplet vector is calculated. It should be understood that the present embodiment is described by taking a triple as an example, but the knowledge base is not limited to the triplet form, and may be other structured forms.
  • the structured knowledge base is composed of N triples, each consisting of a subject, a predicate, and an object.
  • the items of different triples may be duplicated. Therefore, the knowledge base contains a limited number of items. All items (ie words) in the knowledge base are mapped to the following low-dimensional vectors by the first projection matrix W t :
  • the triplet vector can be further obtained.
  • an optional way is to average, namely:
  • the averaging is only an achievable manner, and the ternary vector is obtained according to the low-dimensional vector of the word in other manners, which is not limited by the embodiment of the present invention.
  • the triplet vector is determined according to the following steps:
  • the subject, the predicate and the object of the triplet are respectively represented by a first heat vector, a second heat vector and a third heat vector;
  • the first heat vector, the second heat vector, and the third heat vector are respectively operated with a projection matrix to obtain a first low-dimensional vector, a second low-dimensional vector, and a third low-dimensional vector, wherein the projection Moment
  • the array is a parameter of the fourth neural network module
  • the triad vector is calculated according to the first low dimensional vector, the second low dimensional vector, and the third low dimensional vector.
  • the first projection matrix W t is a parameter of the fourth neural network module, and the parameter that needs to be trained in the training process is included. It should be understood that other parameters may be included in the fourth neural network module, which is not limited by the embodiment of the present invention.
  • the natural language problem can be input by the user through a microphone or the like, or inputting characters or graphics through a keyboard, a mouse, etc., or other input forms, and the system can be converted into a sequence according to a natural language problem input by the user.
  • x (x 1 , x 2 , . . . , x T )
  • the specific input form is not limited in the embodiment of the present invention.
  • the natural language problem can be used as an input to the first neural network module of the neural network system, and the problem vector corresponding to the natural language problem can be calculated.
  • the word sequence is mapped to a low dimensional vector sequence.
  • the low-dimensional vector sequence is then passed through the first neural network module (the first neural network module can be based on a recurrent neural network model or a convolutional neural network model, etc., and the following description uses a recursive neural network model as an example) to calculate a set of lengths.
  • a vector set that is fixed that is, a long and short problem can be transformed into a fixed-length vector, such as a 1000-dimensional vector), which can be called a problem vector.
  • These problem vectors constitute the representation of natural language problems in low dimensional space.
  • the words in the natural language problem can be mapped to the high-dimensional heat vector x 1 , x 2 , . . . , x T , respectively . Then, the words are mapped to low-dimensional vectors, expressed as Where W x is the second projection matrix. After that, the input sequence can be encoded by the recurrent neural network model to obtain the problem vector.
  • Each hidden state variable of the recurrent neural network model is recursively calculated as follows: Where h 0 can be any vector, for example, can be a zero vector; f h is a multi-layer neural network function.
  • a simple implementation manner is among them, Is a sigmoid function
  • LSTM Long Short-Term Memory
  • GRU Gated Recurrent Unit
  • the second projection matrix W x is a parameter of the first neural network module, and some parameters may be included in the f h , and the parameters that need to be trained in the training process are included. It should be understood that other parameters may be included in the first neural network module, which is not limited by the embodiment of the present invention.
  • the first neural network module may convert the natural language problem into a problem vector.
  • the natural language problem is transformed into a problem vector by an encoder of the RNN (ie, based on a recurrent neural network model), or by an encoder of a Convolutional Neural Network (CNN) (ie, based on a convolutional neural network model).
  • the natural language problem is converted into a problem vector, and the like, which is not limited by the embodiment of the present invention.
  • converting the natural language problem into a problem vector can include:
  • the word sequence of the natural language problem is represented as a low dimensional vector sequence
  • the low-dimensional vector sequence is operated by the recurrent neural network model or the convolutional neural network model of the first neural network module to obtain the problem vector.
  • the neural network system calculates the problem vector according to the problem vector and the at least one knowledge answer vector.
  • An intermediate result vector based on the knowledge base is obtained, the intermediate result vector being used to indicate the similarity between the question vector and each of the knowledge answer vectors.
  • the knowledge answer vector as a triad vector as an example
  • the problem vector and at least one triplet vector can be used as the input of the second neural network module of the neural network system, and the intermediate result vector based on the structured knowledge base is obtained.
  • the function of the second neural network module is to combine and match the problem vector with the vector of the associated triplet searched from the knowledge base, and output the vector of the matching result as the intermediate result vector.
  • the similarity between the problem vector and the triplet vector representation of each triple of at least one triple is calculated, and then the intermediate result vector with the similarity as the element is output.
  • the intermediate result vector constitutes a representation of the problem and the candidate triples in the knowledge base.
  • M is a matching parameter matrix.
  • calculating an intermediate result vector based on the knowledge base may include:
  • the role of the third neural network module is to enter the intermediate result vector of the problem vector and the matching result. Line synthesis and output natural language answers. Specifically, taking a problem vector and an intermediate result vector as input, a third neural network module (eg, based on a recurrent neural network model or a convolutional neural network model, etc.) generates a set of symbol sequences of a natural language, and the symbol sequence is The natural language answer of the output.
  • a third neural network module eg, based on a recurrent neural network model or a convolutional neural network model, etc.
  • the natural language answer sequence y (y 1 , y 2 , . . . , y T' ) is generated word by word, and the calculation is based on the following formula:
  • s j is the state variable of the recurrent neural network model.
  • the resulting answer contains two types of words: the first is the auxiliary natural language, and the second is the real answer.
  • the two variables are represented by the binary variable z j (0 for the first class and 1 for the second class), then:
  • p() is a joint probability function
  • the problem vector H and the intermediate result vector r are used as conditions to calculate the probability of the output sequence.
  • s j f z (y j-1 , s j )
  • the state variable s j f s (s j-1 , y j-1 , c j ).
  • c j is the attention vector that changes dynamically with position. ⁇ j,i ⁇ a(s j-1 ,h i ). This attention vector technique can align the original question with the part of the answer that has been output, helping to output the next word more accurately.
  • FIG. 3 shows a schematic diagram of a calculation flow of a third neural network module.
  • parameters of the first neural network module, the second neural network module, the third neural network module, and the fourth neural network module may be continuously adjusted by using an optimization algorithm (eg, a random gradient descent algorithm, etc.) so that the training data is Likelihood function Maximize the results.
  • an optimization algorithm eg, a random gradient descent algorithm, etc.
  • the problem vector and the intermediate result vector are taken as inputs, and the natural language answer of the natural language problem is generated by calculating the probability of the output sequence, which may include:
  • the problem vector and the middle are calculated by the recurrent neural network model or the convolutional neural network model of the third neural network module
  • the result vector is used as the joint probability of the conditional output sequence to generate the natural language answer.
  • the problem vector and the intermediate result vector are used as inputs, and the natural language answer of the natural language problem is generated by calculating the probability of the output sequence, which may include:
  • the probability of the output sequence is calculated by the recurrent neural network model based on the attention vector technique of the third neural network module, and the natural language answer is generated.
  • the algorithm of each neural network module in the neural network system and the training phase are described in detail above.
  • the usage phase is similar to the principle of the training phase, such as the method 300 for human-machine dialogue shown in FIG. 4, which may include:
  • the neural network system acquires a natural language problem input by the user.
  • the neural network system converts the natural language problem into a problem vector.
  • the neural network system obtains at least one knowledge answer related to the natural language problem by text retrieval from the knowledge base, and each of the knowledge answers corresponds to a knowledge answer vector.
  • the neural network system calculates an intermediate result vector based on the knowledge base according to the problem vector and the at least one knowledge answer vector, where the intermediate result vector is used to indicate the similarity between the problem vector and each of the knowledge answer vectors.
  • the neural network system takes the problem vector and the intermediate result vector as inputs, and generates a natural language answer of the natural language problem by calculating a probability of the output sequence.
  • the triplet vector can be already calculated during the training phase, and it is not necessary to determine the triplet vector during the use phase.
  • Embodiments of the present invention provide a method for human-machine dialogue, which can perform natural language interaction with a user by vectorizing a natural language problem and a knowledge base, and combining a dialogue with a knowledge base-based question and answer through vector calculation. And based on the knowledge base to make the correct natural language answer based on facts.
  • 300 examples of training data are sampled, and 300 "question-answer" pairs are selected as test data in the "question-answer” pair.
  • Two systems were selected for comparison: 1) Knowledge Retrieval Based Information Retrieval Question and Answer System (currently There is technology one); 2) deep neural network based dialogue system (prior art five). The evaluation results of the question and answer accuracy rate are shown in Table 1.
  • the solution of the embodiment of the present invention is better than the two existing solutions, and the system of the embodiment of the present invention can capture the semantics of the natural language problem to a certain extent, and the knowledge in the knowledge base is semantically Match on and give the answer.
  • the solution of the embodiment of the present invention can generate an answer in a natural language, and the search-based question answering system cannot guarantee this.
  • the method for human-machine dialogue in the embodiment of the present invention is described in detail above.
  • the neural network system for human-machine dialogue in the embodiment of the present invention is described below.
  • FIG. 5 is a schematic block diagram of a neural network system 400 for human-machine dialogue in accordance with an embodiment of the present invention.
  • the neural network system 400 for human-machine dialogue includes:
  • the obtaining module 410 is configured to obtain a natural language problem input by the user;
  • a first neural network module 420 configured to convert the natural language problem acquired by the obtaining module 410 into a problem vector
  • the retrieval module 430 is configured to obtain at least one knowledge answer related to the natural language problem acquired by the obtaining module 410 by text retrieval from the knowledge base, and each of the knowledge answers corresponds to a knowledge answer vector;
  • the second neural network module 440 is configured to calculate an intermediate result vector based on the knowledge base according to the problem vector obtained by the first neural network module 420 and the at least one knowledge answer vector obtained by the retrieval module 430, and the intermediate result The vector is used to indicate the similarity between the question vector and each of the knowledge answer vectors;
  • the third neural network module 450 is configured to input the problem vector obtained by the first neural network module 420 and the intermediate result vector obtained by the second neural network module 440 as an input, and generate the natural by calculating a probability of the output sequence.
  • the natural language answer to the language problem is configured to input the problem vector obtained by the first neural network module 420 and the intermediate result vector obtained by the second neural network module 440 as an input, and generate the natural by calculating a probability of the output sequence.
  • Embodiments of the present invention provide a neural network system for human-machine dialogue, the neural network system By vectorizing the natural language problem and the knowledge base, the intermediate result vector based on the knowledge base, representing the natural language problem and the knowledge base answer similarity is obtained by vector calculation, and then the fact based correctness is calculated according to the problem vector and the intermediate result vector. Natural language answer.
  • the knowledge answer is a triplet
  • the knowledge answer vector is a triplet vector
  • the neural network system 400 may further include:
  • a fourth neural network module is configured to obtain the triplet vector by using the triplet as an input.
  • the fourth neural network module may be specifically configured to:
  • the subject, the predicate and the object of the triplet are respectively represented by a first heat vector, a second heat vector and a third heat vector;
  • the first heat vector, the second heat vector, and the third heat vector are respectively operated with a projection matrix to obtain a first low-dimensional vector, a second low-dimensional vector, and a third low-dimensional vector, wherein the projection
  • the matrix is a parameter of the fourth neural network module
  • the triad vector is calculated according to the first low dimensional vector, the second low dimensional vector, and the third low dimensional vector.
  • the parameters of the first neural network module 420, the second neural network module 440, the third neural network module 450, and the fourth neural network module may be obtained by maximizing training data.
  • the result of the likelihood function is obtained, wherein the training data includes a plurality of sets of the natural language question and the natural language answer.
  • the first neural network module 420 may be specifically configured to:
  • the word sequence of the natural language problem is represented as a low dimensional vector sequence
  • the low-dimensional vector sequence is operated by a recurrent neural network model or a convolutional neural network model to obtain the problem vector.
  • the second neural network module 440 may be specifically configured to:
  • a similarity of the question vector to each of the knowledge answer vectors is calculated by taking the question vector and at least one of the knowledge answer vectors as inputs, wherein the similarity constitutes an element of the intermediate result vector.
  • the third neural network module 450 may be specifically configured to:
  • the problem vector and the intermediate result vector are taken as inputs, and the joint probability of the output sequence with the problem vector and the intermediate result vector as conditions is calculated by a recurrent neural network model or a convolutional neural network model to generate the natural language answer.
  • the third neural network module 450 may be specifically configured to:
  • the natural language answer is generated by calculating the probability of the output sequence by a recursive neural network model based on attention attention vector technique.
  • the obtaining module 410 may be implemented by an input device, and the first neural network module 420, the retrieval module 430, the second neural network module 440, the third neural network module 450, and the fourth neural network module may be configured by Processor implementation.
  • the neural network system can be deployed in a user equipment 500 having a human-machine dialog function, which can include a processor 510, an input device 520, and a memory 530, wherein the memory 530 can be used to store the processor 510. Executed code, etc.
  • the output of the natural language answer can be implemented by output device 540.
  • the input device 520 is configured to acquire a natural language problem input by the user
  • the memory 530 is configured to store an instruction executed by the processor 510, and the instruction may include:
  • the problem vector and the intermediate result vector are taken as inputs, and the natural language answer of the natural language problem is generated by calculating the probability of the output sequence.
  • the processor 510 is configured to:
  • a similarity of the question vector to each of the knowledge answer vectors is calculated by taking the question vector and at least one of the knowledge answer vectors as inputs, wherein the similarity constitutes an element of the intermediate result vector.
  • the knowledge answer is a triple
  • the knowledge answer vector is a triplet vector
  • the processor 510 is further configured to:
  • the subject, the predicate and the object of the triplet are respectively represented by a first heat vector, a second heat vector and a third heat vector;
  • the processor 510 is configured to:
  • the low-dimensional vector sequence is operated by a recurrent neural network model or a convolutional neural network model to obtain the problem vector.
  • the processor 510 is configured to:
  • the processor 510 is configured to:
  • the probability of the output sequence is calculated by a recurrent neural network model based on attention attention vector technique to generate the natural language answer.
  • bus system 550 which in addition to the data bus includes a power bus, a control bus, and a status signal bus.
  • the neural network system 400 shown in FIG. 5 or the user equipment 500 shown in FIG. 6 can implement the various processes implemented in the foregoing embodiments of FIG. 2 to FIG. 4. To avoid repetition, details are not described herein again.
  • the processor may be an integrated circuit chip with signal processing capabilities.
  • each step of the foregoing method embodiment may be completed by an integrated logic circuit of hardware in a processor or an instruction in a form of software.
  • the processor may be a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a Field Programmable Gate Array (FPGA), or the like. Programming logic devices, discrete gates or transistor logic devices, discrete hardware components.
  • the methods, steps, and logical block diagrams disclosed in the embodiments of the present invention may be implemented or carried out.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiments of the present invention may be directly implemented by the hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps of the above method.
  • the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be a read-only memory (ROM), a programmable read only memory (PROM), an erasable programmable read only memory (Erasable PROM, EPROM), or an electric Erase programmable read only memory (EEPROM) or flash memory.
  • the volatile memory can be a Random Access Memory (RAM) that acts as an external cache.
  • RAM Random Access Memory
  • many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (Synchronous DRAM).
  • SDRAM Double Data Rate SDRAM
  • DDR SDRAM Double Data Rate SDRAM
  • ESDRAM Enhanced Synchronous Dynamic Random Access Memory
  • SLDRAM Synchronous Connection Dynamic Random Access Memory
  • DR RAM direct memory bus random access memory
  • the disclosed systems, devices, and methods may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separate.
  • the components displayed for the unit may or may not be physical units, ie may be located in one place, or may be distributed over multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions may be stored in a computer readable storage medium if implemented in the form of a software functional unit and sold or used as a standalone product.
  • the technical solution of the present invention which is essential or contributes to the prior art, or a part of the technical solution, may be embodied in the form of a software product, which is stored in a storage medium, including
  • the instructions are used to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like, which can store program codes. .

Abstract

一种用于人机对话的方法、神经网络系统和用户设备,该用于人机对话的方法通过将自然语言问题和知识库向量化,通过向量计算得到基于知识库的,表示自然语言问题和知识库答案相似度的中间结果向量,再根据问题向量和中间结果向量计算得到基于事实的正确的自然语言答案。该方法将对话和基于知识库的问答结合,能够与用户进行自然语言交互,并且依据知识库作出基于事实的正确的自然语言答案。

Description

用于人机对话的方法、神经网络系统和用户设备 技术领域
本发明实施例涉及计算机领域,并且更具体地,涉及一种用于人机对话的方法、神经网络系统和用户设备。
背景技术
随着移动互联网和智能终端的快速发展,人机对话的应用越来越广泛。各大互联网公司也推出各自的智能助手,例如Apple Siri、Google Now、微软小娜(Microsoft Cortana)、Facebook M、百度度秘和微软小冰等等。目前的智能助手能够与人进行简单的对话,并且完成一些基本的任务。智能助手的相关技术还需要不断发展和改进,朝着更加拟人化、博学化、并且能够完成更加复杂的任务的方向发展。
人机对话涉及一系列技术,例如:语音识别、自然语言理解、自然语言对话、自动问答、搜索、推荐、语音合成等技术。
其中,自动问答技术是指自动问答系统能够直接对用户用自然语言提出的问题给出答案。评价自动问答的质量的主要指标是回答的正确性。自动问答系统涉及多个方向不同的技术,例如自然语言处理、信息检索、知识库等技术。根据问题的类型,自动问答系统中有一类我们所关注的问答是回答事实型问题(factoid question)。工业界的自动问答系统的例子包括IBM Watson、Google、Baidu和Wolfram Alpha等。知识库技术是与自动问答系统有着紧密联系的技术。它涉及从数据中获取结构化的知识并对其进行整理和融合,并在其基础上进行查询和推理。
在自动问答技术中,语义解析过程是一个尚未完全解决的问题,自动问答的答案通常面临着自然语言多义性和歧义性的问题。
自然语言对话技术是指自然语言对话系统能够跟用户进行语义相关的对话,其评价指标主要在于对话(回复)的语义相关性和语言正确性(包括语言连贯和语法正确等)。自然语言对话系统的例子包括微软小冰和百度百小度等。自然语言对话技术是自然语言处理领域一个很有挑战的方向。近年来随着深度学习技术的发展和应用,发明了基于深度神经网络的自然语言对话系统,其效果在一些数据上被证明显著优于传统的技术。
基于深度神经网络的自然语言对话系统能够产生语义相关的回复,但由于模型本身的限制,无法保证回复语句的正确性。例如,对于“姚明有多高?”这一问题,其回复可能是“姚明身高1.7m。”,这个回复单从语言角度来讲是合适的,但是从知识的角度来讲是错误的。
因此,现有的技术或系统只考虑自动问答,或只考虑自然语言对话,对对话中问题的回复的准确率低。
发明内容
本发明提供一种用于人机对话的方法、神经网络系统和用户设备,可以与用户进行自然语言交互,并且依据知识库作出基于事实的正确的自然语言答案。
第一方面,本发明提供了一种用于人机对话的方法,包括:
神经网络系统获取用户输入的自然语言问题;
所述神经网络系统将所述自然语言问题转化为问题向量;
所述神经网络系统从知识库中通过文本检索,获得与所述自然语言问题相关的至少一个知识答案,每个所述知识答案与一个知识答案向量对应;
所述神经网络系统根据所述问题向量和至少一个所述知识答案向量,计算获得基于所述知识库的中间结果向量,所述中间结果向量用于指示所述问题向量和每个所述知识答案向量的相似度;
所述神经网络系统将所述问题向量和所述中间结果向量作为输入,通过计算输出序列的概率,生成所述自然语言问题的自然语言答案。
其中,所述根据所述问题向量和至少一个所述知识答案向量,计算获得基于所述知识库的中间结果向量,包括:
将所述问题向量和至少一个所述知识答案向量作为所述神经网络系统的第二神经网络模块的输入,通过所述第二神经网络模块计算所述问题向量与每个所述知识答案向量的相似度,其中,所述相似度构成所述中间结果向量的元素。
上述过程是神经网络系统的使用过程。可以在使用过程中,选择出至少一个知识答案后计算知识答案向量。此外,也可以在神经网络系统的训练过程,提前将知识答案向量训练好。在一个例子中,所述知识答案为三元组,所述知识答案向量为三元组向量,所述三元组向量是将所述三元组作为所述 神经网络系统的第四神经网络模块的输入计算获得的。
具体地,所述三元组向量可以是根据以下步骤确定的:
将所述三元组的主语、谓语和宾语分别用第一独热向量、第二独热向量和第三独热向量表示;
将所述第一独热向量、所述第二独热向量和所述第三独热向量分别与投影矩阵运算,获得第一低维向量、第二低维向量和第三低维向量,其中,所述投影矩阵为所述第四神经网络模块的参数;
根据所述第一低维向量、所述第二低维向量和所述第三低维向量,计算获得所述三元组向量。
在训练过程中,所述神经网络系统的参数,即所述第一神经网络模块、所述第二神经网络模块、所述第三神经网络模块和所述第四神经网络模块的参数,可以是通过最大化训练数据上的似然函数的结果得到的,其中,所述训练数据包括多组所述自然语言问题和所述自然语言答案。
其中,优选地,可以采用随机梯度下降算法来进行训练。
在第一方面的一种可选的实现方式中,将所述自然语言问题转化为问题向量,可以包括:
将所述自然语言问题作为所述神经网络系统的第一神经网络模块的输入,将所述自然语言问题的词序列表示为低维向量序列;
通过所述第一神经网络模块的递归神经网络模型或卷积神经网络模型,对所述低维向量序列进行运算,获得所述问题向量。
在第一方面的一种可选的实现方式中,所述将所述问题向量和所述中间结果向量作为输入,通过计算输出序列的概率,生成所述自然语言问题的自然语言答案,可以包括:
将所述问题向量和所述中间结果向量作为所述神经网络系统的第三神经网络模块的输入,通过所述第三神经网络模块的递归神经网络模型或卷积神经网络模型,计算以所述问题向量和所述中间结果向量作为条件的输出序列的联合概率,生成所述自然语言答案。
在第一方面的一种可选的实现方式中,所述将所述问题向量和所述中间结果向量作为输入,通过计算输出序列的概率,生成所述自然语言问题的自然语言答案,包括:
将所述问题向量和所述中间结果向量作为输入,通过所述第三神经网络 模块的基于注意attention向量技术的递归神经网络模型,计算输出序列的概率,生成所述自然语言答案。
第二方面,提供了一种用于人机对话的神经网络系统,包括获取模块、第一神经网络模块、检索模块、第二神经网络模块和第三神经网络模块,用于执行第一方面相应的实现方式。其中,获取模块,用于获取用户输入的自然语言问题;第一神经网络模块,用于将所述获取模块获取的所述自然语言问题转化为问题向量;检索模块,用于从知识库中通过文本检索,获得与所述获取模块获取的所述自然语言问题相关的至少一个知识答案,每个所述知识答案与一个知识答案向量对应;第二神经网络模块,用于根据所述第一神经网络模块获得的所述问题向量和所述检索模块获得的至少一个所述知识答案向量,计算获得基于所述知识库的中间结果向量,所述中间结果向量用于指示所述问题向量和每个所述知识答案向量的相似度;第三神经网络模块,用于将所述第一神经网络模块获得的所述问题向量和所述第二神经网络模块获得的所述中间结果向量作为作为输入,通过计算输出序列的概率,生成所述自然语言问题的自然语言答案。
在第二方面的一种可选的实现方式中,所述第二神经网络模块具体用于:
将所述问题向量和至少一个所述知识答案向量作为输入,计算所述问题向量与每个所述知识答案向量的相似度,其中,所述相似度构成所述中间结果向量的元素。
在第二方面的一种可选的实现方式中,所述知识答案为三元组,所述知识答案向量为三元组向量,所述神经网络系统还包括:
第四神经网络模块,用于将所述三元组作为输入,计算获得所述三元组向量。
在第二方面的一种可选的实现方式中,所述第四神经网络模块具体用于:
将所述三元组的主语、谓语和宾语分别用第一独热向量、第二独热向量和第三独热向量表示;
将所述第一独热向量、所述第二独热向量和所述第三独热向量分别与投影矩阵运算,获得第一低维向量、第二低维向量和第三低维向量,其中,所述投影矩阵为所述第四神经网络模块的参数;
根据所述第一低维向量、所述第二低维向量和所述第三低维向量,计算获得所述三元组向量。
在第二方面的一种可选的实现方式中,所述第一神经网络模块具体用于:
将所述自然语言问题作为输入,将所述自然语言问题的词序列表示为低维向量序列;
通过递归神经网络模型或卷积神经网络模型,对所述低维向量序列进行运算,获得所述问题向量。
在第二方面的一种可选的实现方式中,所述第三神经网络模块具体用于:
将所述问题向量和所述中间结果向量作为输入,通过递归神经网络模型或卷积神经网络模型,计算以所述问题向量和所述中间结果向量作为条件的输出序列的联合概率,生成所述自然语言答案。
在第二方面的一种可选的实现方式中,所述第三神经网络模块具体用于:
将所述问题向量和所述中间结果向量作为输入,通过基于注意attention向量技术的递归神经网络模型,计算输出序列的概率,生成所述自然语言答案。
在第二方面的一种可选的实现方式中,所述第一神经网络模块、所述第二神经网络模块、所述第三神经网络模块和所述第四神经网络模块的参数是通过最大化训练数据上的似然函数结果得到的,其中,所述训练数据包括多组所述自然语言问题和所述自然语言答案。
第三方面,提供了一种具有人机对话功能的用户设备,包括输入设备、处理器和存储器,所述输入设备用于获取用户的输入,所述存储器用于存储指令,所述处理器用于执行所述存储器存储的指令,以用于完成第一方面的相应的实现方式,并且第三方面的用户设备的各器件可以与第二方面的神经网络系统的相应模块对应。
优选地,第三方面的用户设备还可以包括输出设备,以用于用于输出所述神经网络系统生成的自然语言答案。
本发明实施例提供的用于人机对话的方法、神经网络系统和用户设备,通过将自然语言问题和知识库向量化,通过向量计算,将对话和基于知识库 的问答结合,使之能够与用户进行自然语言交互,并且依据知识库作出基于事实的正确的自然语言答案。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1是一种短文本对话模型的架构的示意图。
图2是本发明一个实施例的用于人机对话的训练过程的示意图。
图3是第三神经网络模块的计算流程的示意图。
图4是本发明一个实施例的用于人机对话的方法的示意性流程图。
图5是本发明一个实施例的用于人机对话的神经网络系统的示意性框图。
图6是本发明一个实施例的具有人机对话功能的用户设备的示意性框图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
下面首先简单介绍现有的几种自动问答系统和自然语言对话系统。
基于信息检索的自动问答系统:
基于信息检索的自动问答技术通常分为三个步骤:问题分析、文档检索和答案抽取。其中,
问题分析:利用自然语言处理技术对用户提出的问题进行分析,包括问题类型识别、中心词提取、同义词扩展和问题转述等。
文档检索:根据问题分析步骤的输出,对索引的文档库进行检索并排序,并从相关文档中找出与问题相关的段落。
答案抽取:从文档检索步骤返回的相关段落中,根据问题的类型,对可 能的答案片段进行抽取和打分、排序,最后返回最相关的答案。
上述三个步骤均存在一些技术挑战(例如,问题类型识别、排序、答案抽取等),可能会导致问答系统的准确率偏低。同时,传统的检索系统无法处理字面失配的问题,例如问题为“姚明的老婆是谁?”,而文档中的叙述为“姚明的太太…”,则此时由于“老婆”和“太太”的字面不匹配,可能会导致答案无法召回或错误。
基于结构化知识库的自动问答系统:
基于结构化知识库的自动问答技术首先从大量数据(通常是非结构化或半结构化的数据)中获取或挖掘结构化的知识,并构建结构化的知识库。知识的结构通常用三元组来表示:(主语(subject),谓词(predicate),宾语(object))。主语通常是一个实体,宾语可能是另一个实体或属性,谓词表明两者的关系。例如,(姚明,妻子,叶莉)就是一个三元组。知识库由多个三元组构成,通常可以用图的结构表示(实体为图的节点,关系为边)。类似的概念包括语义网(semantic web),本体库(ontology),关系数据(linked data)和知识图谱(knowledge graph)等。由于知识库通常从多个数据源获取,那么知识的融合和消歧也是构建知识库的工作之一。上述自动化构建的知识库的过程可能存在准确率的问题,因此必要的情况下,会加入人力来进行校准。
知识库构建好后,则可以在其上进行查询和推理。由于知识库是结构化数据,因此可以使用关系数据库或图数据库存储,并在其上通过结构化数据的查询语句(例如结构化查询语言(Structured Query Language,SQL)和简单协议和RDF查询语言(Simple Protocol and RDF Query Language,SparQL)等,其中,RDF是指资源描述框架(Resource Description Framework))进行查询。对于用户输入的自然语言,需要将其转化为特定的查询语言,这一过程通常称为语义解析(semantic parsing)。语义解析是自然语言处理中一个很有挑战的问题。
上述技术面临两方面的挑战:一方面,大规模知识库的建立是一个复杂的过程,目前的自然语言处理技术还不能做到完全的自动化,往往需要人工的干预来校准;另一方面,语义解析同样是一个尚未完全解决的问题,也面临着自然语言多义性和歧义性的问题。
在当前的现有技术中,工业界的自动问答系统,可以采用现有技术一和 现有技术二两种技术(基于信息检索和基于知识库)的混合技术。
基于信息检索的自然语言对话系统:
基于信息检索的自然语言对话技术将大规模的对话语料以“原文-回复”对的方式进行索引。在线对话时,通过搜索找到与用户输入相似的原文,并将其对应的回复返回给用户。
然而,当用户输入与库中语料匹配度较低时,无法保证系统返回语义相关的对话。简单来讲,该系统没有可扩展性,也无法产生语料从没有的回复。
基于机器翻译模型的自然语言对话系统:
将原文或回复类比为机器翻译中的源语言(例如英语)和目标语言(例如汉语)。然后套用统计机器翻译的方法(例如,基于短语的机器翻译)来训练。测试(即使用系统)时,以用户输入作为统计翻译模型的源语言输入,经过翻译模型,生成目标语言序列,即给用户的回复。
机器翻译模型在实际短文本对话数据上的表现并不好,其主要原因是对话数据中的数据分布不同于机器翻译中的双语“平行语料”。对话数据中,对于同一个原文,可能有很多不同的回复。机器翻译模型中主要考虑词和词之间的线性映射关系,这种复杂的映射关系可能是导致机器翻译模型失败的原因。
基于深度神经网络的自然语言对话系统:
随着深度学习的发展,学术界提出了一种基于深度神经网络架构的“序列到序列”学习(sequence-to-sequence learning)模型。基于深度神经网络的自然语言对话技术被用于在大规模的对话语料训练得到自然语言对话系统。该系统接受用户的输入序列,然后通过多层神经网络的计算,逐词的输出回复的序列。
图1是一种短文本对话模型的架构的示意图。具体地,输入的自然语言序列经过编码器(Encoder),被转化为中间表示向量,再经过解码器(Decoder)顺序生成输出序列。其中,解码器和编码器分别通过递归神经网络(Recurrent Neural Network,RNN)实现,并且在解码的每一个步骤中,都通过一种attention向量技术来更加有目的确定下一步输出。
基于深度神经网络的自然语言对话系统在效果上由于基于检索和基于机器翻译的对话系统。虽然能够产生语义相关的回复,但由于模型本身的限制,无法保证回复语句的正确性。例如对于“姚明有多高?”这一问题,其 回复可能是“姚明身高1.7m。”,这个回复单从语言角度来讲是合适的,但是从知识的角度来讲是错误的。因此如何让基于深度神经网络的自然语言对话系统返回知识正确的对话,是一个有实际意义的问题,也是本发明所关注的问题。
注意(attention)向量技术:
attention向量技术能够起到对齐原问题和已输出的答案部分,从而帮助神经网络系统更加准确的输出下一个词,其效果在机器翻译和短文本对话中都得到了验证。
attention向量通常如下计算:
Figure PCTCN2016091892-appb-000001
其中,
Figure PCTCN2016091892-appb-000002
是编码器的状态向量集合,αj,i是动态的加权系数。αj,i通常如下计算:
Figure PCTCN2016091892-appb-000003
其中,aj,i=f(sj-1,hi)。这里,sj-1表示解码器(Decoder)的第j-1个状态向量,f是一个带参数的神经网络模型。f的一种常用的形式是:
Figure PCTCN2016091892-appb-000004
其中,va,Wa,Ua为参数向量或矩阵。利用这种计算方式,每次解码器产生一个词时,都会动态的参考编码器的状态向量,而这种动态的权重是由解码器的上一个状态向量和编码器所有的状态向量的函数决定的。
综上所述,现有的技术或系统只考虑自动问答,或只考虑自然语言对话,对对话中问题的回复的准确率低。本发明以基于深度神经网络的自然语言对话系统为部分基础,通过深度学习技术,将自然语言对话和基于知识库的问答相结合,使得系统能够在对话中对用户的提问作出知识上正确的自然语言回复。
应理解,本发明实施例所提供的用于人机对话的方法是一种基于神经网络模型的自然语言对话式问答的方法,所提供的用于人机对话的神经网络系统是一种基于神经网络模型的自然语言对话式问答系统。
作为一个机器学习模型,基于神经网络模型的自然语言对话式问答系统可以分为训练和使用两个阶段。
训练阶段是根据训练数据,通过反向传播算法或者随机梯度下降算法等,最大化训练数据上的似然函数来确定神经网络系统中各模块的参数。在本发明实施例中,所使用的训练数据可以由这样的实例构成:(问题,答案, 匹配的三元组)。例如:
问题:姚明有多高?
答案:他有2.29m,非常非常高。
匹配的三元组:(姚明,身高,2.29m)
或者:
问题:红楼梦是谁写的?
答案:是清代的曹雪芹。
匹配的三元组:(红楼梦,作者,曹雪芹)
使用阶段是基于已经构建的知识库,以用户的自然语言问题为输入,通过神经网络系统中各个模型的计算,产生自然语言答案返回给用户。
为了便于理解,下面从训练阶段开始进行介绍。
首先构建结构化知识库(本文中也可以简称为知识库)和训练数据。
知识库基于一些“事实”(facts)组成。结构化的知识库中包括记录(records)或者“元组(tuple)”。具体地,可以从互联网获取结构化知识库。在本发明实施例中,知识库具体可以由多个三元组构成,也可以由包括多条结构化的记录的数据库构成,本发明实施例对此不作限定。以知识库由多个三元组构成为例,可以从百度百科、互动百科、豆瓣等百科知识网站抓取网页,并通过对网页中的表格解析得到结构化的三元组。经过进一步的处理,例如可以包括去噪、合并等处理。最终抽取得到多个三元组,构成结构化知识库。
可以从互联网获取训练数据,该训练数据可以是自然语言问答对话数据。在本发明实施例中,可以从百度知道、搜搜问问等社区问答网站抓取网页,并解析其中的“问题-答案”对,抽取出多个“问题-答案”对。
在训练过程中,可以逐一扫描上述“问题-答案”对数据,检查是否与知识库中的某个或多个三元组“匹配”,其中,“匹配”的定义可以是:1、三元组的subject出现在问题中;2、三元组的object出现在答案中;3、三元组的object不出现在问题中。
应理解,本发明实施例中,知识库的大小和训练数据的大小可以根据训练需要进行调整。在一个具体的例子中,结构化知识库中可以包括5.5M个三元组,“问题-答案”对可以包括132M个,从中选取出696K个“问题-答案”对作为训练数据。
在本发明实施例中,每个词可以对应一个独热(one-hot)向量。所谓独热向量是指,例如,对于某种语言而言,共有A个词,对每一个词进行编号,任一个词对应一个独热向量,该独热向量具有M维,其中该词的编号对应的元素为1,其余的元素为零。独热向量为高维向量。
设输入的自然语言问题为序列x=(x1,x2,...,xT),即将自然语言问题分解为T个词,分别对应x1,x2,...,xT。xi为独热向量。
设输出的自然语言答案为y=(y1,y2,...,yT′),即自然语言答案为T′个词组合而成的,T′个词分别对应y1,y2,...,yT′。yi为独热向量。
三元组为t=(ts,tp,to),ts/p/o均为独热向量,分别表示三元组中的主语、谓词和宾语。
图2是本发明一个实施例的用于人机对话的训练过程的示意图。如图2所示,其主要包括以下步骤:
S210,将结构化知识库的三元组作为神经网络系统的第四神经网络模块的输入,计算得到三元组向量。应理解,本实施例是以三元组为例进行说明的,但知识库不限于三元组形式,也可以是其它的结构化的形式。
具体地,结构化知识库由N个三元组组成,每个三元组由主语、谓词、宾语三项组成,不同三元组的项可能存在重复。因此,知识库中包含有限个项。通过第一投影矩阵Wt,将知识库中所有的项(即词)映射为下列低维向量:
Figure PCTCN2016091892-appb-000005
Figure PCTCN2016091892-appb-000006
为ts/p/o的低维向量的表示。根据词的低维向量的表示,可以进一步得到三元组向量。其中,一种可选的方式是求平均,即:
Figure PCTCN2016091892-appb-000007
应理解,求平均只是一种可实现的方式,还可以通过其它的方式根据词的低维向量得到三元组向量,本发明实施例对此不作限定。
综上,三元组向量是根据以下步骤确定的:
将该三元组的主语、谓语和宾语分别用第一独热向量、第二独热向量和第三独热向量表示;
将该第一独热向量、该第二独热向量和该第三独热向量分别与投影矩阵运算,获得第一低维向量、第二低维向量和第三低维向量,其中,该投影矩 阵为该第四神经网络模块的参数;
根据该第一低维向量、该第二低维向量和该第三低维向量,计算获得该三元组向量。
知识库中所有的三元组向量的集合
Figure PCTCN2016091892-appb-000008
可以构成知识库的低维向量的表示。
其中,第一投影矩阵Wt即为第四神经网络模块的参数,后续在训练过程中需要训练的即包括该参数。应理解,第四神经网络模块中还可以包括其它的参数,本发明实施例对此不作限定。
S220,获取用户输入的自然语言问题。这里,自然语言问题可以由用户通过麦克风等进行语音输入,也可以通过键盘、鼠标等进行文字或图形的输入,还可以是其它的一些输入形式,系统根据用户输入的自然语言问题能够转化为序列x=(x1,x2,...,xT)即可,本发明实施例对具体的输入形式不作限定。
S230,将自然语言问题转化为问题向量。可以将自然语言问题作为神经网络系统的第一神经网络模块的输入,计算获得该自然语言问题对应的问题向量。
具体地,用户输入的多个自然语言问题可以看作是多个长度变化的词序列x=(x1,x2,...,xT)(例如“姚明有多高?”是三个词,“红楼梦的作者是谁?”是五个词)。将该词序列映射为低维向量序列。再将低维向量序列通过第一神经网络模块(第一神经网络模块可以基于递归神经网络模型或卷积神经网络模型等,下面的描述以递归神经网络模型为例进行展开)计算得到一组长度固定(即不管是多长多短的问题,都可以转化为一个定长的向量,比如一个1000维的向量)的向量集合,可以称这些向量为问题向量。这些问题向量构成了自然语言问题在低维空间上的表示。
换而言之,可以将自然语言问题中的词分别映射为高维的独热向量x1,x2,...,xT。继而,将各词映射为低维向量,表示为
Figure PCTCN2016091892-appb-000009
其中,Wx为第二投影矩阵。之后,可以再通过递归神经网络模型对输入序列进行编码,获得问题向量。
递归神经网络模型的每个隐藏状态(hidden state)变量通过如下方式递归计算:
Figure PCTCN2016091892-appb-000010
其中,h0可以为任意向量,例如可以是一个零向 量;fh是多层神经网络函数。
在本发明实施例中,一种简单的实现的方式是
Figure PCTCN2016091892-appb-000011
其中,
Figure PCTCN2016091892-appb-000012
是sigmoid函数
Figure PCTCN2016091892-appb-000013
在本发明实施例中,
Figure PCTCN2016091892-appb-000014
还可以使用更复杂的长短期记忆(Long Short-Term Memory,LSTM)神经网络模型或者门控递归单元(Gated Recurrent Unit,GRU)模型来对fh进行建模。由此得到的递归神经网络模型的隐藏状态变量,隐藏状态变量和词的向量的表示共同构成了输入问题的向量表示
Figure PCTCN2016091892-appb-000015
其中,第二投影矩阵Wx为第一神经网络模块的参数,fh中还可以包括一些参数,后续在训练过程中需要训练的即包括这些参数。应理解,第一神经网络模块中还可以包括其它的参数,本发明实施例对此不作限定。
应理解,本发明实施例中,第一神经网络模块将自然语言问题转化为问题向量的方法可以有多种。例如,通过RNN的编码器(即基于递归神经网络模型)将自然语言问题转化为问题向量,或者通过卷积神经网络(Convolutional Neural Network,CNN)的编码器(即基于卷积神经网络模型)将自然语言问题转化为问题向量,等等,本发明实施例对此不作限定。
综上,将该自然语言问题转化为问题向量,可以包括:
将该自然语言问题作为该神经网络系统的第一神经网络模块的输入,将该自然语言问题的词序列表示为低维向量序列;
通过该第一神经网络模块的递归神经网络模型或卷积神经网络模型,对该低维向量序列进行运算,获得该问题向量。
S240,从知识库中通过文本检索(text retrieval),获得与该自然语言问题相关的至少一个知识答案,每个该知识答案与一个知识答案向量对应。以知识答案为三元组为例,则是获得与自然语言问题相关的至少一个三元组,其中,至少一个三元组与至少一个三元组向量对应。即,对于每个自然语言问题,可以通过文本检索的方式找到相关的候选三元组集合,进而得到候选的三元组向量集合。
S250,该神经网络系统根据该问题向量和至少一个该知识答案向量,计 算获得基于该知识库的中间结果向量,该中间结果向量用于指示该问题向量和每个该知识答案向量的相似度。仍以知识答案向量为三元组向量为例,可以将问题向量和至少一个三元组向量作为神经网络系统的第二神经网络模块的输入,计算获得基于结构化知识库的中间结果向量。
具体而言,第二神经网络模块的作用为将问题向量和从知识库中搜索出的相关的三元组的向量进行结合与匹配,输出匹配结果的向量作为中间结果向量。计算问题向量与至少一个三元组中每个三元组的三元组向量表示的相似度,然后输出以相似度作为元素的中间结果向量。该中间结果向量构成了问题与知识库中候选三元组匹配结果的表示。
更具体地,对于候选的三元组向量集合中的每个三元组向量t,其与问题向量的相似度通过如下方式计算:
S(x,t)=qTMut
其中,上式中q为问题的向量表示H的分量,即q可以从H中得到。一种可选的计算方式是
Figure PCTCN2016091892-appb-000016
另一种可选的计算方式是q=hT,当然还可以通过其它方式从H中得到q,本发明实施例对此不作限定。
上式中M为匹配参数矩阵。设有K个候选三元组向量
Figure PCTCN2016091892-appb-000017
此时令r=(r1,...,rK),其中,
Figure PCTCN2016091892-appb-000018
向量r构成了问题与知识库的匹配结果的表示,即中间结果向量。
综上,根据该问题向量和至少一个该知识答案向量,计算获得基于该知识库的中间结果向量,可以包括:
将该问题向量和至少一个该知识答案向量作为该神经网络系统的第二神经网络模块的输入,通过该第二神经网络模块计算该问题向量与每个该知识答案向量的相似度,其中,该相似度构成该中间结果向量的元素。
S260,将该问题向量和该中间结果向量作为输入,通过计算输出序列的概率,生成该自然语言问题的自然语言答案。换而言之,将问题向量和中间结果向量作为神经网络系统的第三神经网络模块的输入,计算获得自然语言问题的自然语言答案。
第三神经网络模块的作用为将问题向量与匹配结果的中间结果向量进 行综合,并输出自然语言答案。具体地,以问题向量和中间结果向量为输入,通过第三神经网络模块(如,可以基于递归神经网络模型或卷积神经网络模型等)产生一组自然语言的符号序列,此符号序列即为输出的自然语言答案。
具体而言,以H和r作为输入,逐词产生自然语言的答案序列y=(y1,y2,...,yT′),计算时依据下列公式:
p(yj|y1,...,yj-1,x,r)=p(yj|sj,H,r)
其中,sj为递归神经网络模型的状态变量。
由于产生的答案中包含两类词:第一类是辅助性的自然语言,第二类是真实的答案。用二元变量zj来表示这两种类型(为0表示第一类,为1表示第二类),则:
p(yj|yj-1,sj,H,r)=p(zj=0|yj-1,sj)p(yj|yj-1,sj,z=0)+p(zj=1|yj-1,sj)p(yj|z=1,r)
其中,p()为联合概率函数,以问题向量H和中间结果向量r作为条件,用于计算输出序列的概率。
作为一种优选地实施例,对于p(zj|yj-1,sj)=fz(yj-1,sj),其中,状态变量sj=fs(sj-1,yj-1,cj)。在本发明实施例中,可以使用LSTM神经网络模型或者GRU模型来对fz和fs进行建模。注意,其中的cj是随位置动态变化的attention向量,
Figure PCTCN2016091892-appb-000019
αj,i∝a(sj-1,hi)。这种attention向量技术能够起到对齐原问题和已输出的答案部分,从而帮助更加准确的输出下一个词。p(yj|yj-1,sj,z=0)是产生下一个自然语言词语的概率,其建模方式与zj相仿。而对于答案类型的词语,p(yj=k|z=1,r)=rk。图3示出了第三神经网络模块的计算流程的示意图。
应理解,在使用阶段,生成答案序列的下一词时,应使得联合概率结果最大。在训练阶段,可以通过使用优化算法(例如随机梯度下降算法等),不断调整第一神经网络模块、第二神经网络模块、第三神经网络模块和第四神经网络模块的参数,使得训练数据上的似然函数
Figure PCTCN2016091892-appb-000020
的结果最大化。
综上,将该问题向量和该中间结果向量作为输入,通过计算输出序列的概率,生成该自然语言问题的自然语言答案,可以包括:
将该问题向量和该中间结果向量作为该神经网络系统的第三神经网络模块的输入,通过该第三神经网络模块的递归神经网络模型或卷积神经网络模型,计算以该问题向量和该中间结果向量作为条件的输出序列的联合概率,生成该自然语言答案。
优选地,将该问题向量和该中间结果向量作为输入,通过计算输出序列的概率,生成该自然语言问题的自然语言答案,可以包括:
将该问题向量和该中间结果向量作为输入,通过该第三神经网络模块的基于注意(attention)向量技术的递归神经网络模型,计算输出序列的概率,生成该自然语言答案。
以上详细介绍了神经网络系统中各神经网络模块的算法,以及训练阶段。使用阶段与训练阶段的原理相似,如图4所示的用于人机对话的方法300,其可以包括:
S310,神经网络系统获取用户输入的自然语言问题。
S320,该神经网络系统将该自然语言问题转化为问题向量。
S330,该神经网络系统从知识库中通过文本检索,获得与该自然语言问题相关的至少一个知识答案,每个该知识答案与一个知识答案向量对应。
S340,该神经网络系统根据该问题向量和至少一个该知识答案向量,计算获得基于该知识库的中间结果向量,该中间结果向量用于指示该问题向量和每个该知识答案向量的相似度。
S350,该神经网络系统将该问题向量和该中间结果向量作为输入,通过计算输出序列的概率,生成该自然语言问题的自然语言答案。
应理解。三元组向量可以是在训练阶段是已经计算好的,在使用阶段确定三元组向量不是必需的。
本发明实施例提供了一种用于人机对话的方法,该方法通过将自然语言问题和知识库向量化,通过向量计算,将对话和基于知识库的问答结合,能够与用户进行自然语言交互,并且依据知识库作出基于事实的正确的自然语言答案。
实现本发明实施例中的模型后,在训练数据采样300个例子,以及在“问题-答案”对再选取出300个“问题-答案”对作为测试数据。人工过滤掉其中错误的例子,对模型的问答准确率(答对的问题占问题总数的比例)进行评估。选择了两种系统作为比较:1)基于知识库的信息检索问答系统(现 有技术一);2)基于深度神经网络的对话系统(现有技术五)。问答准确率的评估结果如表1.
表1
模型 训练数据 测试数据
基于知识库的信息检索问答系统 40% 36%
基于深度神经网络的对话系统 15% 19%
本发明实施例 46% 47%
从评估结果可以看出,本发明实施例的方案优于已有的两个方案,说明本发明实施例的系统能够一定程度的捕捉到自然语言问题的语义,与知识库中的知识做到语义上的匹配,并给出答案。同时,本发明实施例的方案能够产生自然语言的答案,而基于检索的问答系统无法保证做到这一点。
上面详细介绍了本发明实施例的用于人机对话的方法,下面介绍本发明实施例的用于人机对话的神经网络系统。
图5是本发明实施例的用于人机对话的神经网络系统400的示意性框图。如图5所示,用于人机对话的神经网络系统400包括:
获取模块410,用于获取用户输入的自然语言问题;
第一神经网络模块420,用于将该获取模块410获取的该自然语言问题转化为问题向量;
检索模块430,用于从知识库中通过文本检索,获得与该获取模块410获取的该自然语言问题相关的至少一个知识答案,每个该知识答案与一个知识答案向量对应;
第二神经网络模块440,用于根据该第一神经网络模块420获得的该问题向量和该检索模块430获得的至少一个该知识答案向量,计算获得基于该知识库的中间结果向量,该中间结果向量用于指示该问题向量和每个该知识答案向量的相似度;
第三神经网络模块450,用于将该第一神经网络模块420获得的该问题向量和该第二神经网络模块440获得的该中间结果向量作为作为输入,通过计算输出序列的概率,生成该自然语言问题的自然语言答案。
本发明实施例提供了一种用于人机对话的神经网络系统,该神经网络系 统通过将自然语言问题和知识库向量化,通过向量计算得到基于知识库的,表示自然语言问题和知识库答案相似度的中间结果向量,再根据问题向量和中间结果向量计算得到基于事实的正确的自然语言答案。
可选地,作为一个实施例,该知识答案为三元组,该知识答案向量为三元组向量,该神经网络系统400还可以包括:
第四神经网络模块,用于将该三元组作为输入,计算获得该三元组向量。
在本发明实施例中,可选地,该第四神经网络模块具体可以用于:
将该三元组的主语、谓语和宾语分别用第一独热向量、第二独热向量和第三独热向量表示;
将该第一独热向量、该第二独热向量和该第三独热向量分别与投影矩阵运算,获得第一低维向量、第二低维向量和第三低维向量,其中,该投影矩阵为该第四神经网络模块的参数;
根据该第一低维向量、该第二低维向量和该第三低维向量,计算获得该三元组向量。
可选地,作为一个实施例,该第一神经网络模块420、该第二神经网络模块440、该第三神经网络模块450和该第四神经网络模块的参数可以是通过最大化训练数据上的似然函数结果得到的,其中,该训练数据包括多组该自然语言问题和该自然语言答案。
在本发明实施例中,可选地,该第一神经网络模块420具体可以用于:
将该自然语言问题作为输入,将该自然语言问题的词序列表示为低维向量序列;
通过递归神经网络模型或卷积神经网络模型,对该低维向量序列进行运算,获得该问题向量。
在本发明实施例中,可选地,该第二神经网络模块440具体可以用于:
将所述问题向量和至少一个所述知识答案向量作为输入,计算所述问题向量与每个所述知识答案向量的相似度,其中,所述相似度构成所述中间结果向量的元素。
在本发明实施例中,可选地,该第三神经网络模块450具体可以用于:
将该问题向量和该中间结果向量作为输入,通过递归神经网络模型或卷积神经网络模型,计算以该问题向量和该中间结果向量作为条件的输出序列的联合概率,生成该自然语言答案。
在本发明实施例中,可选地,该第三神经网络模块450具体可以用于:
将该问题向量和该中间结果向量作为输入,通过基于注意attention向量技术的递归神经网络模型,计算输出序列的概率,生成该自然语言答案。
应注意,本发明实施例中,获取模块410可以由输入设备实现,第一神经网络模块420、检索模块430、第二神经网络模块440、第三神经网络模块450和第四神经网络模块可以由处理器实现。如图6所示,神经网络系统可以部署于具有人机对话功能的用户设备500中,该用户设备可以包括处理器510、输入设备520和存储器530,其中,存储器530可以用于存储处理器510执行的代码等。自然语言答案的输出可以通过输出设备540实现。
其中,输入设备520用于获取用户输入的自然语言问题,所述存储器530用于存储由所述处理器510执行的指令,所述指令可以包括:
将所述自然语言问题转化为问题向量;
从知识库中通过文本检索,获得与所述自然语言问题相关的至少一个知识答案,每个所述知识答案与一个知识答案向量对应;
根据所述问题向量和至少一个所述知识答案向量,计算获得基于所述知识库的中间结果向量,所述中间结果向量用于指示所述问题向量和每个所述知识答案向量的相似度;
将所述问题向量和所述中间结果向量作为输入,通过计算输出序列的概率,生成所述自然语言问题的自然语言答案。
可选地,作为一个实施例,所述处理器510用于:
将所述问题向量和至少一个所述知识答案向量作为输入,计算所述问题向量与每个所述知识答案向量的相似度,其中,所述相似度构成所述中间结果向量的元素。
可选地,作为一个实施例,所述知识答案为三元组,所述知识答案向量为三元组向量,所述处理器510还用于:
将所述三元组的主语、谓语和宾语分别用第一独热向量、第二独热向量和第三独热向量表示;
将所述第一独热向量、所述第二独热向量和所述第三独热向量分别与投影矩阵运算,获得第一低维向量、第二低维向量和第三低维向量;
根据所述第一低维向量、所述第二低维向量和所述第三低维向量,计算获得所述三元组向量。
可选地,作为一个实施例,所述处理器510用于:
将所述自然语言问题作为输入,将所述自然语言问题的词序列表示为低维向量序列;
通过递归神经网络模型或卷积神经网络模型,对所述低维向量序列进行运算,获得所述问题向量。
可选地,作为一个实施例,所述处理器510用于:
将所述问题向量和所述中间结果向量作为输入,通过递归神经网络模型或卷积神经网络模型,计算以所述问题向量和所述中间结果向量作为条件的输出序列的联合概率,生成所述自然语言答案。
可选地,作为一个实施例,所述处理器510用于:
将所述问题向量和所述中间结果向量作为输入,通过基于注意attention向量技术的递归神经网络模型,计算输出序列的概率,生成所述自然语言答案。
用户设备500中的各个组件通过总线系统550耦合在一起,其中总线系统550除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。
图5所示的神经网络系统400或图6所示的用户设备500能够实现前述图2至图4的实施例中所实现的各个过程,为避免重复,这里不再赘述。
应注意,本发明上述方法实施例可以应用于处理器中,或者由处理器实现。处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。
可以理解,本发明实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作 为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。

Claims (20)

  1. 一种用于人机对话的方法,其特征在于,包括:
    神经网络系统获取用户输入的自然语言问题;
    所述神经网络系统将所述自然语言问题转化为问题向量;
    所述神经网络系统从知识库中通过文本检索,获得与所述自然语言问题相关的至少一个知识答案,每个所述知识答案与一个知识答案向量对应;
    所述神经网络系统根据所述问题向量和至少一个所述知识答案向量,计算获得基于所述知识库的中间结果向量,所述中间结果向量用于指示所述问题向量和每个所述知识答案向量的相似度;
    所述神经网络系统将所述问题向量和所述中间结果向量作为输入,通过计算输出序列的概率,生成所述自然语言问题的自然语言答案。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述问题向量和至少一个所述知识答案向量,计算获得基于所述知识库的中间结果向量,包括:
    将所述问题向量和至少一个所述知识答案向量作为所述神经网络系统的第二神经网络模块的输入,通过所述第二神经网络模块计算所述问题向量与每个所述知识答案向量的相似度,其中,所述相似度构成所述中间结果向量的元素。
  3. 根据权利要求1或2所述的方法,其特征在于,所述知识答案为三元组,所述知识答案向量为三元组向量,所述三元组向量是将所述三元组作为所述神经网络系统的第四神经网络模块的输入计算获得的。
  4. 根据权利要求3所述的方法,其特征在于,所述三元组向量是根据以下步骤确定的:
    将所述三元组的主语、谓语和宾语分别用第一独热向量、第二独热向量和第三独热向量表示;
    将所述第一独热向量、所述第二独热向量和所述第三独热向量分别与投影矩阵运算,获得第一低维向量、第二低维向量和第三低维向量,其中,所述投影矩阵为所述第四神经网络模块的参数;
    根据所述第一低维向量、所述第二低维向量和所述第三低维向量,计算获得所述三元组向量。
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,所述将所述 自然语言问题转化为问题向量,包括:
    将所述自然语言问题作为所述神经网络系统的第一神经网络模块的输入,将所述自然语言问题的词序列表示为低维向量序列;
    通过所述第一神经网络模块的递归神经网络模型或卷积神经网络模型,对所述低维向量序列进行运算,获得所述问题向量。
  6. 根据权利要求1至5中任一项所述的方法,其特征在于,所述将所述问题向量和所述中间结果向量作为输入,通过计算输出序列的概率,生成所述自然语言问题的自然语言答案,包括:
    将所述问题向量和所述中间结果向量作为所述神经网络系统的第三神经网络模块的输入,通过所述第三神经网络模块的递归神经网络模型或卷积神经网络模型,计算以所述问题向量和所述中间结果向量作为条件的输出序列的联合概率,生成所述自然语言答案。
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述将所述问题向量和所述中间结果向量作为输入,通过计算输出序列的概率,生成所述自然语言问题的自然语言答案,包括:
    将所述问题向量和所述中间结果向量作为输入,通过所述第三神经网络模块的基于注意attention向量技术的递归神经网络模型,计算输出序列的概率,生成所述自然语言答案。
  8. 根据权利要求1至7中任一项所述的方法,其特征在于,所述神经网络系统的参数是通过最大化训练数据上的似然函数的结果得到的,其中,所述训练数据包括多组所述自然语言问题和所述自然语言答案。
  9. 一种用于人机对话的神经网络系统,其特征在于,包括:
    获取模块,用于获取用户输入的自然语言问题;
    第一神经网络模块,用于将所述获取模块获取的所述自然语言问题转化为问题向量;
    检索模块,用于从知识库中通过文本检索,获得与所述获取模块获取的所述自然语言问题相关的至少一个知识答案,每个所述知识答案与一个知识答案向量对应;
    第二神经网络模块,用于根据所述第一神经网络模块获得的所述问题向量和所述检索模块获得的至少一个所述知识答案向量,计算获得基于所述知识库的中间结果向量,所述中间结果向量用于指示所述问题向量和每个所述 知识答案向量的相似度;
    第三神经网络模块,用于将所述第一神经网络模块获得的所述问题向量和所述第二神经网络模块获得的所述中间结果向量作为作为输入,通过计算输出序列的概率,生成所述自然语言问题的自然语言答案。
  10. 根据权利要求9所述的神经网络系统,其特征在于,所述第二神经网络模块具体用于:
    将所述问题向量和至少一个所述知识答案向量作为输入,计算所述问题向量与每个所述知识答案向量的相似度,其中,所述相似度构成所述中间结果向量的元素。
  11. 根据权利要求9或10所述的神经网络系统,其特征在于,所述知识答案为三元组,所述知识答案向量为三元组向量,所述神经网络系统还包括:
    第四神经网络模块,用于将所述三元组作为输入,计算获得所述三元组向量。
  12. 根据权利要求9至11中任一项所述的神经网络系统,其特征在于,所述第三神经网络模块具体用于:
    将所述问题向量和所述中间结果向量作为输入,通过基于注意attention向量技术的递归神经网络模型,计算输出序列的概率,生成所述自然语言答案。
  13. 根据权利要求11所述的神经网络系统,其特征在于,所述第一神经网络模块、所述第二神经网络模块、所述第三神经网络模块和所述第四神经网络模块的参数是通过最大化训练数据上的似然函数结果得到的,其中,所述训练数据包括多组所述自然语言问题和所述自然语言答案。
  14. 一种具有人机对话功能的用户设备,其特征在于,包括输入设备、处理器和存储器,所述输入设备用于获取用户输入的自然语言问题,所述存储器用于存储由所述处理器执行的指令,所述指令包括:
    将所述自然语言问题转化为问题向量;
    从知识库中通过文本检索,获得与所述自然语言问题相关的至少一个知识答案,每个所述知识答案与一个知识答案向量对应;
    根据所述问题向量和至少一个所述知识答案向量,计算获得基于所述知识库的中间结果向量,所述中间结果向量用于指示所述问题向量和每个所述知识答案向量的相似度;
    将所述问题向量和所述中间结果向量作为输入,通过计算输出序列的概率,生成所述自然语言问题的自然语言答案。
  15. 根据权利要求14所述的用户设备,其特征在于,所述处理器用于:
    将所述问题向量和至少一个所述知识答案向量作为输入,计算所述问题向量与每个所述知识答案向量的相似度,其中,所述相似度构成所述中间结果向量的元素。
  16. 根据权利要求14或15所述的用户设备,其特征在于,所述知识答案为三元组,所述知识答案向量为三元组向量,所述处理器还用于:
    将所述三元组的主语、谓语和宾语分别用第一独热向量、第二独热向量和第三独热向量表示;
    将所述第一独热向量、所述第二独热向量和所述第三独热向量分别与投影矩阵运算,获得第一低维向量、第二低维向量和第三低维向量;
    根据所述第一低维向量、所述第二低维向量和所述第三低维向量,计算获得所述三元组向量。
  17. 根据权利要求14至16中任一项所述的用户设备,其特征在于,所述处理器用于:
    将所述自然语言问题作为输入,将所述自然语言问题的词序列表示为低维向量序列;
    通过递归神经网络模型或卷积神经网络模型,对所述低维向量序列进行运算,获得所述问题向量。
  18. 根据权利要求14至17中任一项所述的用户设备,其特征在于,所述处理器用于:
    将所述问题向量和所述中间结果向量作为输入,通过递归神经网络模型或卷积神经网络模型,计算以所述问题向量和所述中间结果向量作为条件的输出序列的联合概率,生成所述自然语言答案。
  19. 根据权利要求14至18中任一项所述的用户设备,其特征在于,所述处理器用于:
    将所述问题向量和所述中间结果向量作为输入,通过基于注意attention向量技术的递归神经网络模型,计算输出序列的概率,生成所述自然语言答案。
  20. 根据权利要求14至19中任一项所述的用户设备,其特征在于,所 述用户设备还包括输出设备,用于输出所述处理器生成的所述自然语言答案。
PCT/CN2016/091892 2015-12-03 2016-07-27 用于人机对话的方法、神经网络系统和用户设备 WO2017092380A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/993,619 US11640515B2 (en) 2015-12-03 2018-05-31 Method and neural network system for human-computer interaction, and user equipment

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510882135.X 2015-12-03
CN201510882135.XA CN106844368B (zh) 2015-12-03 2015-12-03 用于人机对话的方法、神经网络系统和用户设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US15/993,619 Continuation US11640515B2 (en) 2015-12-03 2018-05-31 Method and neural network system for human-computer interaction, and user equipment

Publications (1)

Publication Number Publication Date
WO2017092380A1 true WO2017092380A1 (zh) 2017-06-08

Family

ID=58796116

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/091892 WO2017092380A1 (zh) 2015-12-03 2016-07-27 用于人机对话的方法、神经网络系统和用户设备

Country Status (3)

Country Link
US (1) US11640515B2 (zh)
CN (1) CN106844368B (zh)
WO (1) WO2017092380A1 (zh)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180365231A1 (en) * 2017-06-19 2018-12-20 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for generating parallel text in same language
US20190043483A1 (en) * 2017-08-02 2019-02-07 [24]7.ai, Inc. Method and apparatus for training of conversational agents
CN109829037A (zh) * 2017-11-22 2019-05-31 上海智臻智能网络科技股份有限公司 智能自动问答的方法、系统、服务器及存储介质
CN110019838A (zh) * 2017-12-25 2019-07-16 上海智臻智能网络科技股份有限公司 智能问答系统及智能终端
CN110019730A (zh) * 2017-12-25 2019-07-16 上海智臻智能网络科技股份有限公司 自动交互系统及智能终端
CN110019723A (zh) * 2017-12-21 2019-07-16 上海智臻智能网络科技股份有限公司 基于问答系统的问答方法、终端设备及存储介质
WO2019154724A1 (en) * 2018-02-06 2019-08-15 Robert Bosch Gmbh Methods and systems for intent detection and slot filling in spoken dialogue systems
CN110807311A (zh) * 2018-07-18 2020-02-18 百度在线网络技术(北京)有限公司 用于生成信息的方法和装置
WO2020050893A1 (en) * 2018-09-06 2020-03-12 Microsoft Technology Licensing, Llc Natural language question answering
CN111274794A (zh) * 2020-01-19 2020-06-12 浙江大学 一种基于传递的同义词扩展方法
CN111414195A (zh) * 2019-02-03 2020-07-14 北京邮电大学 通用可配置、兼容多模型、领域可迁移的多轮对话系统
CN111886601A (zh) * 2019-03-01 2020-11-03 卡德乐人工智能私人有限公司 用于自适应问答的系统和方法
CN112182308A (zh) * 2020-09-29 2021-01-05 华中师范大学 基于多热编码的多特征融合深度知识追踪方法及系统
CN112199511A (zh) * 2020-09-28 2021-01-08 西南电子技术研究所(中国电子科技集团公司第十研究所) 跨语言多来源垂直领域知识图谱构建方法

Families Citing this family (78)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2995072B1 (en) * 2013-05-05 2017-03-15 Lantiq Deutschland GmbH Training optimization of multiple lines in a vectored system using a prepared-to-join group
US10706351B2 (en) * 2016-08-30 2020-07-07 American Software Safety Reliability Company Recurrent encoder and decoder
CN107885756B (zh) * 2016-09-30 2020-05-08 华为技术有限公司 基于深度学习的对话方法、装置及设备
JP7060010B2 (ja) * 2017-03-30 2022-04-26 日本電気株式会社 情報処理装置、情報処理方法及びプログラム
CN107272521B (zh) * 2017-08-05 2019-07-19 曲阜师范大学 一种知识图谱驱动的智能硬件控制方法
KR20190019748A (ko) * 2017-08-18 2019-02-27 삼성전자주식회사 자연어 생성 방법 및 장치
CN107704506B (zh) * 2017-08-30 2021-03-30 华为技术有限公司 智能应答的方法和装置
CN107832326B (zh) * 2017-09-18 2021-06-08 北京大学 一种基于深层卷积神经网络的自然语言问答方法
CN107633079B (zh) * 2017-09-25 2021-03-23 重庆邮电大学 一种基于数据库与神经网络的车机自然语言人机交互算法
CN109684354A (zh) * 2017-10-18 2019-04-26 北京国双科技有限公司 数据查询方法和装置
CN107766506A (zh) * 2017-10-20 2018-03-06 哈尔滨工业大学 一种基于层次化注意力机制的多轮对话模型构建方法
CN109522254B (zh) * 2017-10-30 2022-04-12 上海寒武纪信息科技有限公司 运算装置及方法
CN109753636A (zh) * 2017-11-01 2019-05-14 阿里巴巴集团控股有限公司 机器处理及文本纠错方法和装置、计算设备以及存储介质
CN107818164A (zh) * 2017-11-02 2018-03-20 东北师范大学 一种智能问答方法及其系统
CN107862058B (zh) * 2017-11-10 2021-10-22 北京百度网讯科技有限公司 用于生成信息的方法和装置
US11551059B1 (en) * 2017-11-15 2023-01-10 Snap Inc. Modulated image segmentation
CN107895037B (zh) * 2017-11-28 2022-05-03 北京百度网讯科技有限公司 一种问答数据处理方法、装置、设备和计算机可读介质
CN108062388B (zh) * 2017-12-15 2021-09-17 北京百度网讯科技有限公司 人机对话的回复生成方法和装置
CN110019471B (zh) * 2017-12-15 2024-03-08 微软技术许可有限责任公司 从结构化数据生成文本
CN108038209A (zh) * 2017-12-18 2018-05-15 深圳前海微众银行股份有限公司 答案选择方法、装置和计算机可读存储介质
CN110019722B (zh) * 2017-12-21 2023-11-24 株式会社理光 对话模型的回复排序方法、装置及计算机可读存储介质
US10984196B2 (en) * 2018-01-11 2021-04-20 International Business Machines Corporation Distributed system for evaluation and feedback of digital text-based content
CN108345640B (zh) * 2018-01-12 2021-10-12 上海大学 一种基于神经网络语义分析的问答语料库构建方法
CN108427707B (zh) * 2018-01-23 2021-05-04 深圳市阿西莫夫科技有限公司 人机问答方法、装置、计算机设备和存储介质
CN108363763B (zh) * 2018-02-05 2020-12-01 深圳市腾讯计算机系统有限公司 一种自动问答方法、装置和存储介质
CN108509539B (zh) * 2018-03-16 2021-08-17 联想(北京)有限公司 信息处理方法电子设备
CN108536299B (zh) * 2018-04-12 2021-04-27 广州多益网络股份有限公司 基于矩阵的人机互动结果生成方法及系统
CN108563766A (zh) * 2018-04-19 2018-09-21 天津科技大学 食品检索的方法及装置
CN108563779B (zh) * 2018-04-25 2022-03-08 北京计算机技术及应用研究所 一种基于神经网络的无模板自然语言文本答案生成方法
CN108681574B (zh) * 2018-05-07 2021-11-05 中国科学院合肥物质科学研究院 一种基于文本摘要的非事实类问答答案选择方法及系统
US10909157B2 (en) * 2018-05-22 2021-02-02 Salesforce.Com, Inc. Abstraction of text summarization
CN108763504B (zh) * 2018-05-30 2020-07-24 浙江大学 一种基于强化双通道序列学习的对话回复生成方法及系统
CN108959388B (zh) * 2018-05-31 2020-09-11 科大讯飞股份有限公司 信息生成方法及装置
US10922342B2 (en) * 2018-06-11 2021-02-16 Stratifyd, Inc. Schemaless systems and methods for automatically building and utilizing a chatbot knowledge base or the like
CN108959467B (zh) * 2018-06-20 2021-10-15 华东师范大学 一种基于强化学习的问句和答案句相关度的计算方法
CN109086303B (zh) * 2018-06-21 2021-09-28 深圳壹账通智能科技有限公司 基于机器阅读理解的智能对话方法、装置、终端
CN108984679B (zh) * 2018-06-29 2022-05-10 北京百度网讯科技有限公司 对话生成模型的训练方法和装置
CN109033229B (zh) * 2018-06-29 2021-06-11 北京百度网讯科技有限公司 问答处理方法和装置
CN109086386B (zh) * 2018-07-26 2023-04-28 腾讯科技(深圳)有限公司 数据处理方法、装置、计算机设备和存储介质
US11152013B2 (en) * 2018-08-02 2021-10-19 Arizona Board Of Regents On Behalf Of Arizona State University Systems and methods for a triplet network with attention for speaker diartzation
CN110858215B (zh) * 2018-08-23 2023-04-07 广东工业大学 一种基于深度学习的端到端目标引导型对话方法
CN109145190B (zh) * 2018-08-27 2021-07-30 安徽大学 一种基于神经机器翻译技术的局部引文推荐方法及系统
CN109271496B (zh) * 2018-08-30 2021-12-24 广东工业大学 一种基于文本、知识库及序列到序列的自然问答方法
CN110929001B (zh) * 2018-09-03 2023-09-01 蔚来(安徽)控股有限公司 语音对话系统中的匹配方法以及匹配系统
CN109657038B (zh) * 2018-10-10 2023-04-18 创新先进技术有限公司 一种问答对数据的挖掘方法、装置及电子设备
US10891951B2 (en) * 2018-10-17 2021-01-12 Ford Global Technologies, Llc Vehicle language processing
CN109327614B (zh) * 2018-10-17 2021-01-26 永德利硅橡胶科技(深圳)有限公司 全球同声传译手机及方法
CN109410974B (zh) * 2018-10-23 2021-09-28 百度在线网络技术(北京)有限公司 语音增强方法、装置、设备及存储介质
CN111309875B (zh) * 2018-12-10 2023-08-04 百度在线网络技术(北京)有限公司 问题应答的方法、装置、设备和存储介质
CN109714340A (zh) * 2018-12-28 2019-05-03 厦门服云信息科技有限公司 一种序列到序列的网络异常请求识别方法以及装置
CN109740077B (zh) * 2018-12-29 2021-02-12 北京百度网讯科技有限公司 基于语义索引的答案搜索方法、装置及其相关设备
CN109871428B (zh) 2019-01-30 2022-02-18 北京百度网讯科技有限公司 用于确定文本相关度的方法、装置、设备和介质
CN110008288B (zh) * 2019-02-19 2021-06-29 武汉烽火技术服务有限公司 用于网络故障分析的知识图谱库的构建方法及其应用
US11258730B2 (en) * 2019-03-06 2022-02-22 Go Daddy Operating Company, LLC Generating a plurality of selectable responses based on a database indexed by receiver devices storing responses to similar SMS messages
CN109933660B (zh) * 2019-03-25 2019-11-12 广东石油化工学院 面向自然语言形式基于讲义和网站的api信息检索方法
CN110196928B (zh) * 2019-05-17 2021-03-30 北京邮电大学 完全并行化具有领域扩展性的端到端多轮对话系统及方法
CN110275959B (zh) * 2019-05-22 2023-04-28 广东工业大学 一种面向大规模知识库的快速学习方法
CN110297954B (zh) * 2019-06-14 2022-08-30 北京百度网讯科技有限公司 答案校验处理方法、装置、设备和存储介质
CN110674280B (zh) * 2019-06-21 2023-12-15 北京中科微末生物科技有限公司 一种基于增强问题重要性表示的答案选择算法
CN110532360A (zh) * 2019-07-19 2019-12-03 平安科技(深圳)有限公司 医疗领域知识图谱问答处理方法、装置、设备及存储介质
CN112836023A (zh) * 2019-11-22 2021-05-25 华为技术有限公司 一种基于知识图谱的问答方法及装置
CN110895879A (zh) * 2019-11-26 2020-03-20 浙江大华技术股份有限公司 同行车的检测方法及装置、存储介质、电子装置
CN111177345B (zh) * 2019-12-19 2023-06-20 中国平安财产保险股份有限公司 基于知识图谱的智能问答方法、装置和计算机设备
CN111125335B (zh) 2019-12-27 2021-04-06 北京百度网讯科技有限公司 问答处理方法、装置、电子设备和存储介质
CN111160041B (zh) * 2019-12-30 2024-02-13 科大讯飞股份有限公司 语义理解方法、装置、电子设备和存储介质
CN111291185B (zh) * 2020-01-21 2023-09-22 京东方科技集团股份有限公司 信息抽取方法、装置、电子设备及存储介质
CN111368042A (zh) * 2020-02-13 2020-07-03 平安科技(深圳)有限公司 智能问答方法、装置、计算机设备及计算机存储介质
US11526756B1 (en) 2020-06-24 2022-12-13 Amazon Technologies, Inc. Artificial intelligence system with composite models for multiple response-string queries
CN111813909A (zh) * 2020-06-24 2020-10-23 泰康保险集团股份有限公司 一种智能问答方法和装置
CN111737438B (zh) * 2020-07-27 2020-11-27 恒生电子股份有限公司 基于文本相似度的数据处理方法、装置以及电子设备
CN112199482B (zh) * 2020-09-30 2023-07-21 平安科技(深圳)有限公司 一种对话生成方法、装置、设备及可读存储介质
CN113486160B (zh) * 2021-05-26 2023-04-11 山东大学 基于跨语言知识的对话方法及系统
CN114116994A (zh) * 2021-06-30 2022-03-01 同济人工智能研究院(苏州)有限公司 一种迎宾机器人对话方法
CN113742447B (zh) * 2021-07-19 2024-04-02 暨南大学 基于查询路径生成的知识图谱问答方法、介质和设备
CN113849613B (zh) * 2021-09-15 2023-04-18 北方工业大学 一种食品安全问答推理方法、系统及电子设备
CN114357191B (zh) * 2021-12-31 2023-05-30 科大讯飞(苏州)科技有限公司 知识抽取、问答及推荐方法和相关装置、设备、介质
CN114637765A (zh) * 2022-04-26 2022-06-17 阿里巴巴达摩院(杭州)科技有限公司 基于表格数据的人机交互方法、装置及设备
US20240004907A1 (en) * 2022-06-30 2024-01-04 International Business Machines Corporation Knowledge graph question answering with neural machine translation

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140236577A1 (en) * 2013-02-15 2014-08-21 Nec Laboratories America, Inc. Semantic Representations of Rare Words in a Neural Probabilistic Language Model
CN104915386A (zh) * 2015-05-25 2015-09-16 中国科学院自动化研究所 一种基于深度语义特征学习的短文本聚类方法
CN105068661A (zh) * 2015-09-07 2015-11-18 百度在线网络技术(北京)有限公司 基于人工智能的人机交互方法和系统
CN105095444A (zh) * 2015-07-24 2015-11-25 百度在线网络技术(北京)有限公司 信息获取方法和装置

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5519608A (en) * 1993-06-24 1996-05-21 Xerox Corporation Method for extracting from a text corpus answers to questions stated in natural language by using linguistic analysis and hypothesis generation
US7251637B1 (en) * 1993-09-20 2007-07-31 Fair Isaac Corporation Context vector generation and retrieval
US6925432B2 (en) * 2000-10-11 2005-08-02 Lucent Technologies Inc. Method and apparatus using discriminative training in natural language call routing and document retrieval
US7475015B2 (en) * 2003-09-05 2009-01-06 International Business Machines Corporation Semantic language modeling and confidence measurement
CN1952928A (zh) * 2005-10-20 2007-04-25 梁威 建立自然语言知识库及其自动问答检索的计算机系统
CN101566998B (zh) 2009-05-26 2011-12-28 华中师范大学 一种基于神经网络的中文问答系统
US11068657B2 (en) 2010-06-28 2021-07-20 Skyscanner Limited Natural language question answering system and method based on deep semantics
JP5431532B2 (ja) * 2012-06-08 2014-03-05 日本電信電話株式会社 質問応答装置、モデル学習装置、方法、及びプログラム
CN103049433B (zh) * 2012-12-11 2015-10-28 微梦创科网络科技(中国)有限公司 自动问答方法、自动问答系统及构建问答实例库的方法
US9535960B2 (en) * 2014-04-14 2017-01-03 Microsoft Corporation Context-sensitive search using a deep learning model
US10162882B2 (en) * 2014-07-14 2018-12-25 Nternational Business Machines Corporation Automatically linking text to concepts in a knowledge base
US10467268B2 (en) * 2015-06-02 2019-11-05 International Business Machines Corporation Utilizing word embeddings for term matching in question answering systems
US9798818B2 (en) * 2015-09-22 2017-10-24 International Business Machines Corporation Analyzing concepts over time
US10592519B2 (en) * 2016-03-29 2020-03-17 Microsoft Technology Licensing, Llc Computational-model operation using multiple subject representations
US10331684B2 (en) * 2016-06-03 2019-06-25 International Business Machines Corporation Generating answer variants based on tables of a corpus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140236577A1 (en) * 2013-02-15 2014-08-21 Nec Laboratories America, Inc. Semantic Representations of Rare Words in a Neural Probabilistic Language Model
CN104915386A (zh) * 2015-05-25 2015-09-16 中国科学院自动化研究所 一种基于深度语义特征学习的短文本聚类方法
CN105095444A (zh) * 2015-07-24 2015-11-25 百度在线网络技术(北京)有限公司 信息获取方法和装置
CN105068661A (zh) * 2015-09-07 2015-11-18 百度在线网络技术(北京)有限公司 基于人工智能的人机交互方法和系统

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180365231A1 (en) * 2017-06-19 2018-12-20 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for generating parallel text in same language
US10650102B2 (en) * 2017-06-19 2020-05-12 Beijing Baidu Netcom Science And Technology Co., Ltd. Method and apparatus for generating parallel text in same language
US10923109B2 (en) 2017-08-02 2021-02-16 [24]7.ai, Inc. Method and apparatus for training of conversational agents
US20190043483A1 (en) * 2017-08-02 2019-02-07 [24]7.ai, Inc. Method and apparatus for training of conversational agents
WO2019028261A1 (en) * 2017-08-02 2019-02-07 [24]7.ai, Inc. METHOD AND APPARATUS FOR LEARNING CONVERSATIONAL AGENTS
CN109829037A (zh) * 2017-11-22 2019-05-31 上海智臻智能网络科技股份有限公司 智能自动问答的方法、系统、服务器及存储介质
CN110019723A (zh) * 2017-12-21 2019-07-16 上海智臻智能网络科技股份有限公司 基于问答系统的问答方法、终端设备及存储介质
CN110019838A (zh) * 2017-12-25 2019-07-16 上海智臻智能网络科技股份有限公司 智能问答系统及智能终端
CN110019730A (zh) * 2017-12-25 2019-07-16 上海智臻智能网络科技股份有限公司 自动交互系统及智能终端
WO2019154724A1 (en) * 2018-02-06 2019-08-15 Robert Bosch Gmbh Methods and systems for intent detection and slot filling in spoken dialogue systems
US10431207B2 (en) 2018-02-06 2019-10-01 Robert Bosch Gmbh Methods and systems for intent detection and slot filling in spoken dialogue systems
CN110807311A (zh) * 2018-07-18 2020-02-18 百度在线网络技术(北京)有限公司 用于生成信息的方法和装置
WO2020050893A1 (en) * 2018-09-06 2020-03-12 Microsoft Technology Licensing, Llc Natural language question answering
CN111414195A (zh) * 2019-02-03 2020-07-14 北京邮电大学 通用可配置、兼容多模型、领域可迁移的多轮对话系统
CN111414195B (zh) * 2019-02-03 2022-03-25 北京邮电大学 通用可配置、兼容多模型、领域可迁移的多轮对话系统
CN111886601A (zh) * 2019-03-01 2020-11-03 卡德乐人工智能私人有限公司 用于自适应问答的系统和方法
CN111886601B (zh) * 2019-03-01 2024-03-01 卡德乐人工智能私人有限公司 用于自适应问答的系统和方法
CN111274794A (zh) * 2020-01-19 2020-06-12 浙江大学 一种基于传递的同义词扩展方法
CN112199511A (zh) * 2020-09-28 2021-01-08 西南电子技术研究所(中国电子科技集团公司第十研究所) 跨语言多来源垂直领域知识图谱构建方法
CN112199511B (zh) * 2020-09-28 2022-07-08 西南电子技术研究所(中国电子科技集团公司第十研究所) 跨语言多来源垂直领域知识图谱构建方法
CN112182308A (zh) * 2020-09-29 2021-01-05 华中师范大学 基于多热编码的多特征融合深度知识追踪方法及系统

Also Published As

Publication number Publication date
CN106844368B (zh) 2020-06-16
US11640515B2 (en) 2023-05-02
US20180276525A1 (en) 2018-09-27
CN106844368A (zh) 2017-06-13

Similar Documents

Publication Publication Date Title
WO2017092380A1 (zh) 用于人机对话的方法、神经网络系统和用户设备
CN109033068B (zh) 基于注意力机制的用于阅读理解的方法、装置和电子设备
Zhu et al. Knowledge-based question answering by tree-to-sequence learning
CN108427707B (zh) 人机问答方法、装置、计算机设备和存储介质
US10089580B2 (en) Generating and using a knowledge-enhanced model
CN110717034A (zh) 一种本体构建方法及装置
TW202009749A (zh) 人機對話方法、裝置、電子設備及電腦可讀媒體
CN109376222B (zh) 问答匹配度计算方法、问答自动匹配方法及装置
CN111191002A (zh) 一种基于分层嵌入的神经代码搜索方法及装置
CN112632226B (zh) 基于法律知识图谱的语义搜索方法、装置和电子设备
CN112328800A (zh) 自动生成编程规范问题答案的系统及方法
CN114647713A (zh) 基于虚拟对抗的知识图谱问答方法、设备及存储介质
CN116304748A (zh) 一种文本相似度计算方法、系统、设备及介质
CN112417155B (zh) 基于指针-生成Seq2Seq模型的庭审询问生成方法、装置、介质
US20190129948A1 (en) Generating method, generating device, and recording medium
Lyu et al. Deep learning for textual entailment recognition
CN113705207A (zh) 语法错误识别方法及装置
CN117290478A (zh) 一种知识图谱问答方法、装置、设备和存储介质
CN109977194B (zh) 基于无监督学习的文本相似度计算方法、系统、设备及介质
CN112417170A (zh) 面向不完备知识图谱的关系链接方法
CN114579605B (zh) 表格问答数据处理方法、电子设备及计算机存储介质
CN110826341A (zh) 一种基于seq2seq模型的语义相似度计算方法
Sun et al. Chinese microblog sentiment classification based on convolution neural network with content extension method
JP6261669B2 (ja) クエリ校正システムおよび方法
He et al. Distant supervised relation extraction via long short term memory networks with sentence embedding

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16869691

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16869691

Country of ref document: EP

Kind code of ref document: A1