Inference device, question answering device, dialogue device, and inference method

By training neural networks to cluster vector representations and using a pre-constructed database for efficient search, the solution addresses the computational resource challenges of conventional systems, enhancing speed and accuracy in question-answering and dialogue systems.

JP7798346B2Active Publication Date: 2026-01-14NAT INST OF INFORMATION & COMM TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
JP2022058254
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2026-01-14
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

Conventional question-answering and dialogue systems require large computational resources due to extensive data processing, including natural language processing of numerous passages, leading to inefficiencies in processing speed and accuracy.

Method used

Utilizing a first and second neural network trained on vector representations of inputs with predetermined relationships, clustering these representations, and employing a pre-constructed database for efficient search and extraction of clusters, reducing the need for extensive data processing.

Benefits of technology

The solution enables high-speed operation with sufficient accuracy using fewer computational resources by limiting data processing to clusters of relevant passages, significantly reducing storage capacity and processing time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007798346000001
    Figure 0007798346000001
  • Figure 0007798346000002
    Figure 0007798346000002
  • Figure 0007798346000003
    Figure 0007798346000003
Patent Text Reader

Abstract

To provide an inference apparatus that can operate at a high speed and with a sufficient accuracy using few computational resources.SOLUTION: An inference apparatus 50 includes a first neural net 80 that outputs a vector representation of a first input, and a second neural net that outputs a vector representation of a second input, and when there is a predetermined relation between the vector representation of the first and second inputs using learning data of the first and second inputs which has a predetermined relation, causes the first and second neural nets to be learned so as to be located close to each other in a vector space, and clusters the vector representation which is an output of the learned second neural net. The inference apparatus 50 further includes a database 84 constructed in advance so as to enable retrieval extraction of clusters on the basis of the vector representation of the first input, and infers an output on the basis of information 88 of the clusters retrieved and extracted from the database 84 on the basis of the vector representation of the input by the first neural net 80 with respect to an input 60.SELECTED DRAWING: Figure 1
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] The present invention relates to a natural language inference device, a question and answer device, a dialogue device, and an inference method. [Background technology]

[0002] One known question-answering system is WISDOM X, developed by the present applicant and available on the web. This system primarily extracts a number of content words that form a group of keywords from an input question. Based on this group of keywords, it selects several passages (groups of around seven consecutive sentences) collected from the Internet or elsewhere. The resulting group of passages, along with the question, are input into a neural network, which classifies the passages based on whether they contain an answer to the question. For passages that are determined to contain an answer, phrases and words that provide an answer to the question are extracted from them, formatted, and the answer is output. Summary of the Invention [Problem to be solved by the invention]

[0003] Due to the nature of question-answering systems, it is necessary to provide answers to questions quickly. To achieve this, the above-mentioned system crawls the web in advance and stores web data in a local storage device. The search range of the above-mentioned keyword-based search engine is the information stored in this storage device, resulting in a large number of answer candidates. Therefore, the process of determining whether each answer candidate contains the answer to the question involves processing a large amount of data. Furthermore, each passage to be processed contains a certain amount of data, and natural language processing is required, so a large-scale neural network is used for the process. As a result, the total amount of data processing that ultimately needs to be performed is extremely large. Therefore, there is a problem in that large computing resources are required to operate conventional question-answering systems.

[0004] This situation is not limited to question-answering systems. The present applicant has also developed a dialogue system that responds to general inputs, not just questions. In this dialogue system, to generate answer candidates, multiple questions are generated from the input, and the questions are input into the question-answering system to obtain multiple answers for each. A response to the input utterance is then generated from the answers, and an optimal response is selected from the multiple responses generated. The amount of data processing required for this exceeds the amount of data processing required for the question-answering system. As a result, there is a problem in that extremely large computational resources are required to operate the dialogue system.

[0005] SUMMARY OF THE INVENTION Therefore, an object of the present invention is to provide an inference device, a question and answer device, a dialogue device, and an inference method that can operate at high speed and with sufficient accuracy using fewer computational resources than conventional devices. [Means for solving the problem]

[0006] An inference device according to a first aspect of the present invention includes a first neural network that receives a first input and outputs a vector representation of the first input, and a second neural network that receives a second input and outputs a vector representation of the second input, and uses training data of at least the first and second inputs that have a predetermined relationship to train the first and second neural networks so that the vector representation of the first input and the vector representation of the second input are located close to each other in vector space when they have a predetermined relationship; the device clusters the vector representations that are the output of the trained second neural network based on their positions in the vector space; and further includes a database that is pre-constructed to enable search and extraction of clusters based on the vector representation of the first input; and infers an output that has a predetermined relationship based on information about clusters searched and extracted from the database based on the vector representation of the input by the first neural network for an input to the device.

[0007] Preferably, the database is searched using the centroids of the vector representations of the outputs contained in each cluster.

[0008] More preferably, the first neural network is additionally trained based on a vector representation associated with a cluster to which a first input and a second input that has a predetermined relationship with the first input belong.

[0009] A question and answering device according to a second aspect of the present invention includes any of the inference devices described above, and the predetermined relationship includes a question and an answer to that question.

[0010] A dialogue device according to a third aspect of the present invention includes any of the inference devices described above, and the predetermined relationship includes an utterance and a response to the utterance.

[0011] A fourth aspect of the present invention provides an inference method in which a first input is supplied, and a vector of the first input is calculated. the first and second neural networks are trained using training data of at least the first and second inputs that are in a predetermined relationship so that the vector representation of the first input and the vector representation of the second input are located close to each other in a vector space when the vector representation of the first input and the vector representation of the second input are in a predetermined relationship; the vector representations that are the outputs of the trained second neural network are clustered based on their positions in the vector space, and a database is constructed in advance to enable search and extraction of clusters based on the vector representation of the first input; and the step of inferring an output that is in a predetermined relationship based on information about the clusters searched and extracted from the database based on the vector representation of the input by the first neural network.

[0012] A question answering device according to a fifth aspect of the present invention includes a database containing a plurality of records, each of which includes a link destination of an answer candidate for a question and an identifier of a cluster to which a vector representation of the answer candidate belongs; a neural network for converting the question sentence into a question vector which is a vector representation of the question sentence in response to input of the question sentence; cluster selection means for selecting a predetermined number of clusters from among the clusters of semantic representation vectors of the answer candidates, the representative vectors of which are closest to the question vector; answer candidate collection means for collecting answer candidates from each of the link destinations included in records in the database which have the identifier of any of the predetermined number of clusters selected by the cluster selection means; and answer selection means for selecting an answer to the question sentence from the answer candidates collected by the answer candidate collection means in a predetermined procedure.

[0013] Preferably, the question answering device further includes a speech history storage means for storing the speech history of the questioner who posed the question; the speech history storage means; a topic identification means for, in response to input of a question, identifying one or more topic candidates from the past speech history of the questioner who posed the question based on the speech history stored in the speech history storage means; and a topic addition means for adding information representing the one or more topics identified by the topic identification means to the question before the question is input to the neural network.

[0014] More preferably, each of the answer candidates includes multiple consecutive sentences.

[0015] A dialogue device according to a sixth aspect of the present invention includes the above-described question and answering device, topic estimation means for estimating a topic of an input utterance, topic addition means for adding information indicating the topic estimated by the topic estimation means to the input utterance and inputting the added information as a question to the question and answering device, and response generation means for generating a response to the input utterance by shaping an output of the question and answering device in response to the utterance so as to be suitable for a dialogue.

[0016] A seventh aspect of the present invention provides a method for training a question and answer model, comprising the steps of: preparing learning data by generating, from a plurality of question sentences and a group of answer candidates for each of the plurality of question sentences, positive examples each consisting of a combination of a question sentence and an answer candidate corresponding to the question sentence, and negative examples each consisting of a combination of a question sentence and an answer candidate not corresponding to the question sentence; training, using a Siamese network, a question conversion neural network for converting a question sentence into a question vector that is a vector representation of the question sentence, and an answer conversion neural network for converting an answer candidate into an answer candidate vector that is a vector representation of the answer candidate; and The method includes the steps of: using a neural network to convert answer candidates included in a group of answer candidates into answer candidate vectors that are vector representations of the answer candidates; clustering the answer candidate vectors generated by the converting step into a predetermined number of clusters and assigning to each of the answer candidates an identifier of the cluster to which the answer candidate belongs; associating, for each of a plurality of question statements, an identifier of a cluster that includes the answer candidate corresponding to the question; and performing additional training on the neural network for question conversion so that, for each of a plurality of question statements, a predetermined index that indicates the distance between the question vector output by the neural network for question conversion and the cluster to which the answer candidate corresponding to the question statement belongs becomes smaller.

[0017] Preferably, the method for training a question-answering model further includes a step of collecting a plurality of question sentences from the Internet prior to the step of preparing the learning data.

[0018] More preferably, the collecting step includes, prior to the learning data preparing step, a step of collecting a plurality of question sentences together with their preceding or succeeding sentences from the Internet, and a step of estimating, for each of the plurality of question sentences, a topic related to the question sentence based on the preceding or succeeding sentences collected for the question sentence, and the learning data preparing step includes a step of assigning a topic related to the question sentence to each of the plurality of question sentences, and a step of preparing the learning data by generating, from the plurality of question sentences assigned with topics and a group of answer candidates, positive examples each consisting of a combination of a question sentence and an answer candidate corresponding to the question sentence, and negative examples each consisting of a combination of a question sentence and an answer candidate not corresponding to the question sentence.

[0019] More preferably, the method for training a question-answering model further includes, prior to the step of preparing learning data, the steps of collecting a set of answer candidates from the Internet for each of a plurality of question sentences, and storing an Internet URL of each answer candidate included in the collected set of answer candidates in association with the answer candidate, and the method further includes the step of adding to the database, for each answer candidate, a new record including an identifier of a cluster to which the answer candidate belongs and the Internet URL of the answer candidate.

[0020] The above and other objects, features, aspects and advantages of the present invention will become apparent from the following detailed description of the invention taken in conjunction with the accompanying drawings. [Brief explanation of the drawings]

[0021] [Figure 1] FIG. 1 is a functional block diagram of a question and answering device according to a first embodiment of the present invention. [Figure 2] FIG. 2 is a functional block diagram of a learning device that performs learning of question BERT in the question and answering device according to the first embodiment. [Figure 3] FIG. 3 is a functional block diagram of the BERT learning unit shown in FIG. [Figure 4]FIG. 4 is a schematic diagram showing problems that may arise with BERT queries before additional training. [Figure 5] Figure 5 is a schematic diagram showing how the problem is solved by query BERT after additional learning. [Figure 6] FIG. 6 is a functional block diagram of the additional learning unit shown in FIG. [Figure 7] FIG. 7 is a functional block diagram of a dialogue device according to the second embodiment of the present invention. [Figure 8] FIG. 8 is a functional block diagram of a learning device that performs learning of the dialogue history management unit in the dialogue device according to the embodiment of FIG. [Figure 9] FIG. 9 is a functional block diagram of the additional learning unit shown in FIG. [Figure 10] FIG. 10 is a diagram showing the appearance of a computer system that realizes the question and answering device 50 according to the first embodiment of the present invention, the dialogue device 350 according to the second embodiment, and a learning device that trains the neural network used in them. [Figure 11] FIG. 11 is a block diagram showing the hardware configuration of the computer system shown in FIG. DETAILED DESCRIPTION OF THE INVENTION

[0022] In the following description and drawings, the same parts are designated by the same reference numerals, and therefore detailed description thereof will not be repeated.

[0023] 1. First embodiment 1. Configuration A. Question answering device FIG. 1 shows a functional block diagram of a question answering apparatus 50 according to a first embodiment of the present invention. Referring to FIG. 1, the question answering apparatus 50 includes an answer candidate search unit 64 for receiving a question 60 and searching the Internet 62 for answer candidate passages, and a passage database (DB) 66 for storing the passages searched by the answer candidate search unit 64. The number of passages stored in the passage DB 66 is limited compared to conventional methods. The question answering apparatus 50 further includes an answer generation unit 68 for generating and outputting an answer 70 to the question 60 based on the passages stored in the passage DB 66 using a method similar to the conventional method. The method by which the answer generation unit 68 generates the answer 70 in this embodiment is exactly the same as that of the conventional technique. However, the number of passages processed by the answer generation unit 68 is much smaller than that of the conventional technique.

[0024] A feature of this embodiment is that the number of passages retrieved from the Internet 62 at the time of receiving a question 60 is limited. Therefore, the number of passages stored in the passage DB 66 is small, and the computational resources required by the answer generator 68 are much smaller than in the past.

[0025] The answer candidate search unit 64 includes a question BERT 80 for converting the question 60 and outputting a question vector 82, which is a vector representing the question 60. The question BERT 80 has been trained in advance, and the training will be described later with reference to FIG. 2 and subsequent figures. Here, the question BERT or the like includes a Bidirectional Encoder Representation from Transformers neural network, and is a neural network including a Transformer Encoder, such as BERT or RoBERTa, and is generally used after undergoing pre-training using language resources and fine-tuning according to the task. Fine-tuning and the like in this embodiment will be described later.

[0026] The answer candidate search unit 64 further includes a centroid DB 84. The centroid DB 84 is generated simultaneously during the training process of the question BERT 80, etc. The method for generating the centroid DB 84 will be described later in conjunction with the explanation of learning. Simply put, the centroid DB 84 is a database of centroids created by vectorizing and clustering many passages containing answers to various questions. Each record in the centroid DB 84 includes a cluster identifier for the cluster represented by the centroid and a vector representing the position of the centroid in vector space. A vectorized passage is called a passage vector. A passage vector and a question vector 82 are vectors with the same number of dimensions.

[0027] The answer candidate search unit 64 further includes an answer candidate cluster identification unit 86 that receives the question vector 82, searches the centroid DB 84 for records of a predetermined number of centroids that are closest to the question vector 82 in the vector space, and outputs cluster identifiers 88 for each of the searched predetermined number of centroids. Each cluster represented by these cluster identifiers 88 is expected to contain passage vectors corresponding to passages that are likely to contain an answer to the question 60. The reason for this will be made clear in the explanation of training the Question BERT 80.

[0028] The answer candidate search unit 64 further includes an answer candidate DB 90 for storing a large number of passage records representing passages that are answer candidates for various questions. Each record in the answer candidate DB 90 is created from information downloaded from the web about passages that are thought to contain answers to questions that have been created in advance. More specifically, each record includes a URL indicating the location where the passage was located and a cluster identifier for the cluster to which the passage vector belongs.

[0029] The answer candidate search unit 64 further includes an answer candidate search unit 92 that receives the cluster identifier 88 output by the answer candidate cluster identification unit 86, searches the answer candidate DB 90 for records having a cluster identifier that matches the cluster identifier 88, and outputs the URLs of the searched records as an answer candidate URL group 94, and a passage search unit 96 that accesses each of the URLs included in the answer candidate URL group 94, downloads text including passages that are thought to contain answer candidates, extracts the passages, and stores them in the passage DB 66.

[0030] As mentioned above, the passage search unit 96 accesses only URLs that belong to the cluster corresponding to the centroid identified by the answer candidate cluster identification unit 86. Therefore, there is no need to access a large amount of data downloaded from the entire web as in the prior art. Only data downloaded from URLs belonging to a selected number of clusters is accessed. Therefore, even if the same answer generation unit 68 as in the prior art is adopted, the required storage capacity and computing resources can be significantly reduced.

[0031] B. Learning Device 2 shows the functional configuration of a learning device 150 for training the question BERT 80 shown in FIG. 1 and simultaneously generating the centroid DB 84 and the answer candidate DB 90. Referring to FIG. 2, the learning device 150 includes a question / passage collection unit 160 for collecting a large number of questions and a large number of passages containing answer candidates for each question from the Internet 62, a question DB 162 for storing the questions collected by the question / passage collection unit 160, and a passage DB 164 for storing the passages collected by the question / passage collection unit 160. While FIG. 2 shows that BERT training and passage clustering are performed using passages stored in the passage DB 164, a different DB, for example, a DB consisting of some of the passages stored in the passage DB 164, can also be used.

[0032] Each record in the question DB 162 corresponds to a question, and includes, for example, a question identifier, a cluster identifier of a cluster to which the passage corresponding to the question primarily belongs, the question text, and the URL on the Internet where the question is located.

[0033] Each record in the question and passage collection unit 160 corresponds to a passage, and includes the passage ID, the corresponding question ID, and the URL on the Internet where the passage is located.

[0034] The learning device 150 further includes a training target question BERT 168 having the same configuration as the question BERT 80 shown in FIG. 1 , an answer candidate BERT 170 having the same configuration as the question BERT 168, and a BERT learning unit 166 for simultaneously learning the question BERT 168 and the answer candidate BERT 170 using Siamese BERT networks using data stored in the question DB 162 and the question / passage collection unit 160. The Siamese BERT network is described in the following references. An overview of the Siamese BERT network in this embodiment will be described later with reference to FIG. 3. Note that the present invention is not limited to a configuration using a Siamese BERT network, and there is no problem as long as the proximity and distance of the vector representations output by the question BERT 80 and the answer candidate BERT 170 are consistent with the learning data.

[0035] [References] Nils Reimers and Iryna Gurevych,”Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks,”[online],August 27, 2019,Arxiv.org,[Retrieved March 10, 2020],Internet,<https: / / arxiv.org / pdf / 1908.10084> The learning device 150 further includes a passage clustering unit 172 that converts each passage included in the question / passage collection unit 160 into a passage vector using the answer candidate BERT 170 trained by the BERT training unit 166, and further clusters the passages to generate an answer candidate DB 90 and a centroid DB 84. The passage clustering unit 172 generates the answer candidate DB 90 according to the following procedure. First, each passage included in the question / passage collection unit 160 is input to the answer candidate BERT 170, and converted into a vector obtained as the output of the answer candidate BERT 170. These vectors are passage vectors representing each passage. The passage clustering unit 172 further clusters these passage vectors into a predetermined number of clusters. The number of clusters may be determined in advance, or may be determined within a certain range based on a predetermined criterion, such as minimizing the total variance of vectors within a cluster, so as not to cause any problems.

[0036] After clustering the passage vectors in this way, the passage clustering unit 172 determines the centroid of each cluster. Furthermore, it assigns to each centroid the identifier of the cluster that the centroid represents. The passage clustering unit 172 records information about each centroid thus obtained to generate the centroid DB 84. Specifically, each record in the centroid DB 84 includes a cluster identifier and the centroid vector. Naturally, the centroid vector has the same dimensions as the passage vectors and question vectors.

[0037] The passage clustering unit 172 generates each record in the answer candidate DB 90 as follows: For each record in the question and passage collection unit 160, the passage clustering unit 172 registers a record in the answer candidate DB 90 by pairing the cluster identifier of the cluster to which the passage vector obtained from the passage of that record belongs and the URL of that record. The passage clustering unit 172 also performs processing to assign, for each record in the question DB 162, the centroid ID of the cluster to which the passage obtained for that question DB 162 mainly belongs.

[0038] The training device 150 further includes an additional training unit 174 for additionally training the query BERT 168 using the centroid DB 84 and the question DB 162. After training by the BERT training unit 166, the query BERT 168 is additionally trained by the additional training unit 174 to become the query BERT 80 shown in Fig. 1. The meaning of this additional training will be described later with reference to Figs. 4 and 5.

[0039] Figure 3 shows in block diagram form the configuration of the BERT training unit 166 shown in Figure 2. The training data in this training consists of a set of a question, a passage, and a label indicating whether the passage contains the answer to the question. For example, the label is 1 if the passage contains the answer to the question, and 0 otherwise.

[0040] 3, the BERT training unit 166 inputs a question and an answer candidate passage of the training data to the question BERT 168 and the answer candidate BERT 170, respectively, converts them into a vector 200 (U) representing the question and a vector 202 (V) representing the answer candidate passage, and then includes a cosine similarity calculation unit 204 for calculating the cosine similarity between the vectors U and V, a normalization processing unit 206 for normalizing the output of the cosine similarity calculation unit 204 (in the range of [-1, 1]) to the range of [0, 1], and a parameter update unit 208 for updating the parameters of the question BERT 168 and the answer candidate BERT 170 by backpropagation based on the output of the normalization processing unit 206 and the label 210 (0 or 1) of the training data so that both of them match. The normalization by the normalization processing unit 206 can be performed by, for example, {cos(U, V) + 1} / 2. In this embodiment, the mean square error is used as the loss function for updating in the parameter update unit 208.

[0041] The query BERT 168 includes a BERT 220 and a Pooling layer 222 for outputting a vector 200 by performing average pooling on each element of the final layer of the BERT 220.

[0042] The answer candidate BERT170 has exactly the same configuration as the question BERT168. That is, the answer candidate BERT170 includes a BERT230 having the same configuration as the BERT220, and a Pooling layer 232 for outputting a vector 202 by performing average pooling on each element of the final layer of the BERT230. At this stage, the parameter configurations of the BERT220 and the BERT230 are all common, and updates to their values ​​are also reflected in each other.

[0043] As described above, the question BERT 168 and the answer candidate BERT 170 have the same configuration, and the parameter values ​​are updated by the parameter update unit 208 so that they are common. The BERT training unit 166 repeats this training for all training data until a predetermined termination condition is met. As a result, if the answer candidate passage given to the answer candidate BERT 170 includes an answer to the question given to the question BERT 168, the vectors 200 and 202 become similar vectors, and if not, they become different vectors.

[0044] However, when the above-described learning is performed, the following problem may occur. For example, with reference to FIG. 4, suppose that vector 254 is obtained as a result of transformation 256 by question BERT 168 for a certain question. Meanwhile, suppose that vector 260 is obtained as a result of transformation of a passage containing the correct answer to this question by answer candidate BERT 170. Furthermore, suppose that vector 260 belongs to cluster 250, and its centroid is vector 270.

[0045] On the other hand, suppose there is a cluster 252 different from cluster 250, and its centroid is vector 272. Note that while Figure 4 considers vectors to be two-dimensional, in reality the number of dimensions is much higher.

[0046] In this situation, the cosine similarity between vector 254 and vector 260 is greater than the cosine similarity between vector 254 and any vector included in cluster 252. However, considering the cosine similarities between vector 254 and the vectors 270 and 272 of each centroid, a relationship of cos1 < cos2 will hold between the cosine similarity 264 (cos1) between vector 254 and vector 270 and the cosine similarity 262 (cos2) between vector 254 and vector 272. In such a situation, when the answer candidate search unit 92 shown in FIG. 1 selects a cluster based on the cosine similarity between the query vector 82 and the centroid of each cluster, there is a possibility that correct processing cannot be performed. Therefore, the additional learning unit 174 shown in FIG. 2 performs the following additional learning.

[0047] Referring to FIG. 5, in the additional learning, for example, the cosine similarity between the vector generated by the conversion by the query BERT 168 and vector 270 may be made greater than the cosine similarity with vector 272. Therefore, by additional learning of the query BERT 168, the parameters of the query BERT 168 are updated so that instead of the conversion 256 of the query BERT 168, a conversion 258 is realized in which the obtained vector 280 approaches vector 270 more. That is, it is only necessary to move vector 254 by the amount corresponding to vector 282 to the position of vector 280. If the cosine similarity 286 between vector 280 and vector 270 is represented by cos′1 and the cosine similarity 284 between vector 280 and vector 272 is represented by cos′2, it should be made such that cos′1 > cos′2.

[0048] Therefore, in this embodiment, the additional training unit 174 has the following configuration. Referring to FIG. 6 , the additional training unit 174 inputs a question 60 to the question BERT 168 to output a vector 310. Meanwhile, assuming that the vector of the centroid of the cluster to which the passage corresponding to the question 60 mainly belongs is vector W, the additional training unit 174 includes: a cosine similarity calculation unit 314 for calculating the cosine similarity between vector 310 and vector W; a normalization processing unit 316 for normalizing the output of the cosine similarity calculation unit 314 (in the range of [−1, 1]) to the range of [0, 1]; and a parameter update unit 318 for updating the parameters of the BERT 220 by backpropagation so that the output of the normalization processing unit 316 approaches the label "1." The cosine similarity calculation unit 314 is the same as the cosine similarity calculation unit 204 shown in FIG. 3 . The normalization processing unit 316 is the same as the normalization processing unit 206 shown in FIG. 3 . 3, but differs from the parameter update unit 208 in that it updates the parameters of only the BERT 220 of the query BERT 168. The additional learning unit 174 repeatedly performs this update until a predetermined termination condition is met.

[0049] The label "1" indicates the correct answer. By performing such updates, the BERT220 parameters can be updated so that the cosine similarity between each question vector and the vector of the passage containing the correct answer increases. Note that in this additional training, it is sufficient to position the question vector close to the centroid of the cluster to which the vector of the correct passage belongs (so that the cosine similarity increases). Therefore, it is sufficient to perform training using only the training data related to the correct passage, without using the incorrect passage.

[0050] 2.Operation The question and answering device 50 and learning device 150 configured as described above operate as follows. First, the learning device 150 during learning of the question BERT80 will be described, and then the operation of the question and answering device 50 using the question BERT80 will be described.

[0051] 2-1. Question BERT80 training Referring to FIG. 2, when training the question BERT 80, the training device 150 operates as follows. First, the question / passage collection unit 160 crawls the Internet 62, collects questions, and stores them in a question DB 162. The question / passage collection unit 160 further collects passages from the Internet 62 that are thought to contain answers to each question stored in the question DB 162. The question / passage collection unit 160 associates the collected passages with the corresponding questions and stores them in a passage DB 164. These processes by the question / passage collection unit 160 can be realized using conventional technology.

[0052] Next, the BERT training unit 166 generates training data consisting of positive examples and negative examples from each of the questions stored in the question DB 162 and the passages corresponding to these questions stored in the passage DB 164. Using this training data, the BERT training unit 166 simultaneously trains a question BERT 168 and an answer candidate BERT 170 using a Siamese BERT network.

[0053] More specifically, referring to Figure 3, the training data in this learning consists of a set of a question, a passage, and a label indicating whether the passage contains the answer to the question. The label is, for example, 1 if the passage contains the answer to the question, and 0 otherwise.

[0054] The BERT training unit 166 inputs the question and answer candidate passage of the training data to the question BERT 168 and the answer candidate BERT 170, respectively. The BERT 220 and Pooling layer 222 of the question BERT 168 convert the question into a vector 200(U). The BERT 230 and Pooling layer 232 of the answer candidate BERT 170 convert the answer candidate passage into a vector 202(V). The cosine similarity calculation unit 204 calculates the cosine similarity between the vectors U and V and inputs it to the normalization processing unit 206. This value is in the range of [-1, 1]. The normalization processing unit 206 normalizes the value of the cosine similarity calculation unit 204 to the range of [0, 1] and inputs it to the parameter update unit 208. Based on the output of normalization processing unit 206 and label 210 (0 or 1) of the training data, parameter update unit 208 updates the parameters of question BERT 168 and answer candidate BERT 170 by backpropagation so that the two match. Question BERT 168 and answer candidate BERT 170 have the same configuration, and parameter update unit 208 performs updating so that the parameter values ​​are also common.

[0055] The BERT training unit 166 repeats this training for all training data until a predetermined termination condition is met. As a result, if the answer candidate passage given to the answer candidate BERT 170 contains the answer to the question given to the question BERT 168, the vectors 200 and 202 become similar vectors, and if not, they become different vectors.

[0056] The passage clustering unit 172 uses the answer candidate BERT 170 that has completed this training to convert all passages stored in the passage DB 164 into passage vectors. The passage clustering unit 172 then classifies these passage vectors into a predetermined number of clusters using the k-means algorithm. Each of these clusters is assigned an identifier. The passage clustering unit 172 then calculates the centroid vector for each cluster and assigns the cluster identifier to the centroid identifier. For each centroid thus obtained, the passage clustering unit 172 pairs the cluster identifier and the centroid vector and registers them in the centroid DB 84.

[0057] Meanwhile, the passage clustering unit 172 registers records in the answer candidate DB 90, pairing the URL of a passage corresponding to a passage vector belonging to each cluster with the identifier of the cluster to which the passage belongs. The passage clustering unit 172 also adds, to the record of each question stored in the question DB 162, the cluster identifier of the cluster that contains the most answers to that question.

[0058] Once the centroids have been registered in the centroid DB 84, the additional training unit 174 reads out, for each question stored in the question DB 162, the centroid vector corresponding to that question from the centroid DB 84. The additional training unit 174 performs additional training on the question BERT 80 for each question using the centroid vector read out from the centroid DB 84 as correct answer data. The training of the question BERT 80 ends when a predetermined termination condition is met.

[0059] More specifically, referring to Figure 6, the training data includes a question, a vector W of the centroid of the cluster to which the passage vector of the passage containing the correct answer to the question belongs, and a label. In this case, the value of the label is always "1".

[0060] A query is provided to the query BERT 168. The BERT 220 and Pooling layer 222 of the query BERT 168 process the query and output a vector 310. The vector 310 is provided to a first input of a cosine similarity calculation unit 314. Meanwhile, a vector W is provided to a second input of the cosine similarity calculation unit 314. The cosine similarity calculation unit 314 calculates the similarity between the first input vector and the second input vector and provides the result to a normalization processing unit 316. The normalization processing unit 316 normalizes the output of the cosine similarity calculation unit 314 to the range [0, 1] and provides the result to a parameter update unit 318. The parameter update unit 318 updates the parameters of the BERT 220 by backpropagation so that this value approaches the label (1).

[0061] The additional learning unit 174 repeatedly executes this additional learning until a predetermined end condition is met.

[0062] This additional learning reduces the likelihood of a situation like that shown in Figure 4 occurring, and increases the likelihood that the centroid with the greatest cosine similarity to the question vector obtained by vectorizing the question using Question BERT80, as shown in Figure 5, will be the centroid vector 270 of the correct cluster 250.

[0063] 2-2. Answer Generation 1, answer candidate search unit 64 having question BERT 80 after additional training and question answering device 50 including answer candidate search unit 64 operate as follows: Note that answer candidate DB 90 and centroid DB 84 have already been obtained through training.

[0064] It is assumed that a question 60 is input from a conversation partner. The question 60 is provided to a question BERT 80. The question 60 is also provided to an answer generation unit 68 at the same time.

[0065] In response to input of a question 60, the question BERT 80 outputs a question vector 82 representing the question 60. The answer candidate cluster identification unit 86 searches the centroid DB 84 for the vector of the centroid closest to the question vector 82 and outputs its cluster identifier 88.

[0066] The answer candidate search unit 92 searches the answer candidate DB 90, extracts all passages (answer candidates) that have this cluster identifier 88, and outputs a set of answer candidate URLs 94. The passage search unit 96 receives this set of answer candidate URLs 94, downloads passages from each URL on the Internet 62, and stores them in the passage DB 66.

[0067] The answer generator 68 selects the most appropriate answer to the question 60 from the group of passages stored in the passage DB 66, and outputs it as an answer 70. The selection of an answer by the answer generator 68 is exactly the same as in the conventional method.

[0068] 3.Effects According to the first embodiment, answer candidates for a question 60 are collected in the passage DB 66 using an answer candidate DB 90 and a centroid DB 84 created in advance offline, and a question BERT 80 similarly trained in advance offline. The number of answer candidates is limited to answer candidates belonging to a cluster selected by the answer candidate cluster identification unit 86 shown in FIG. 1 . When answering a question, it is not necessary to apply a neural network to a large number of answer candidates to select an answer. This has the advantage of significantly reducing the required storage capacity and computational resources. In particular, as shown in the example of FIG. 1 , the answer candidate DB 90 stores the URLs where the passages are located, rather than the passages themselves. This has the advantage of further reducing the storage capacity and easing processing compared to storing the passages themselves. Furthermore, the passage search unit 96 can download each passage from the Internet in parallel, which has the advantage of shortening the time required to generate an answer 70 for a question 60.

[0069] In addition to the above configuration, it is also possible to configure the system so that the question history (multiple past questions) of the entity asking question 60 is used as reference information to control the answering behavior (for example, changing the level of the answer, such as an answer for beginners or an answer for experts).

[0070] Second Embodiment 1. Configuration The first embodiment relates to a question answering device that provides answers to questions. However, the present invention is not limited to such embodiments and can also be applied to so-called dialogue devices. In dialogue devices, the input received by the system is not limited to questions. However, the same techniques as those used for question answering can be used to search for responses to inputs.

[0071] A dialogue device differs from a question and answer device in that when generating a response to an utterance from the other party, it is desirable to generate a response that is related to the history of the dialogue up to that point. This second embodiment relates to such a dialogue system.

[0072] A. Interactive Device 7 shows the configuration of a dialogue device 350 according to the second embodiment of the present invention. This dialogue device 350 also uses a query BERT 380 having a configuration similar to that of the query BERT 80 of the first embodiment. The training of the query BERT 380 will be described later with reference to FIG. 8 and subsequent figures.

[0073] Referring to FIG. 7 , the dialogue device 350 includes a reply candidate search device 360 ​​that searches the Internet 62 for appropriate reply candidates in response to an utterance 362 from the other party; a passage DB 363 for storing the reply candidates searched by the reply candidate search device 360; a response generation unit 364 that selects an appropriate reply to the utterance 362 from the reply candidates stored in the passage DB 363 and generates and outputs a response 366; and a response shaping unit 368 that formats the output of the response generation unit 364 into a form appropriate for the dialogue and outputs the formatted output. The passage DB 363 has the same configuration as that used in the first embodiment. However, because the passages selected by the reply candidate search device 360 ​​differ from those in the first embodiment, the contents stored in the passage DB 363 also differ from those in the first embodiment. Different dialogues have speaking styles appropriate for the dialogue. Therefore, in this embodiment, the response shaping unit 368 shapes the output of the response generation unit 364 and outputs it.

[0074] The response candidate search device 360 ​​includes a dialogue history management unit 370 for managing the history of dialogue between the dialogue device 350 and the other party, a dialogue history DB 372 for storing the dialogue history managed by the dialogue history management unit 370, and a topic model 374 for outputting information indicating the topic of the dialogue including the content words in response to input of multiple content words. The topic model 374 is, for example, a statistical model that has been trained in advance. For example, the method described in Japanese Patent Application Laid-Open No. 2015-045915 can be used to train the topic model. Alternatively, a topic model can be constructed using a neural network. The output of the topic model 374 is, for example, one or more words representing the topic.

[0075] The reply candidate search device 360 ​​further includes a topic assignment unit 376 that responds to the utterance 362 and assigns information indicating the topic of the dialogue with the other party to the utterance 362 using information stored in the dialogue history DB 372 and a topic model 374. Specifically, the topic assignment unit 376 reads the history of the dialogue with the other party from the dialogue history DB 372 and extracts content words. The topic assignment unit 376 provides these content words to the topic model 374 and receives one or more words representing the topic output by the topic model 374. The topic assignment unit 376 further appends the one or more words received from the topic assignment unit 376 to the end of the utterance 362 and outputs the utterance 362.

[0076] The answer candidate search device 360 ​​further includes a question BERT 380 having a configuration similar to the question BERT 80 in the first embodiment, for receiving the output of the topic assigner 376 and outputting a question vector 382 similar to the question vector in the first embodiment; The second embodiment includes a centroid DB 378 obtained in the same manner as the centroid DB 84 in the first embodiment, and a response candidate cluster identification unit 386 for searching the centroid DB 378 for a predetermined number of centroid vectors having the greatest cosine similarity with the query vector 382 in response to the query vector 382 and outputting their cluster identifiers 388. The configuration of the centroid DB 378 itself is the same as that of the centroid DB 84 in the first embodiment. However, in this second embodiment, the centroid DB 378 is trained using a method slightly different from that in the first embodiment. For this reason, the centroid DB 378 is described herein as being separate from the centroid DB 84.

[0077] The answer candidate search device 360 ​​further includes an answer candidate DB 390 having a configuration similar to that of the answer candidate DB 90 in the first embodiment, and an answer candidate search unit 392 having the same configuration as that of the first embodiment for searching the answer candidate DB 390 in response to a cluster identifier 388 from the answer candidate cluster identification unit 386, reading all answer candidate records having cluster identifiers matching the cluster identifier 388, and outputting the read records as an answer candidate URL set 394.

[0078] The answer candidate retrieval device 360 ​​further includes a passage retrieval unit 396, also similar to the passage retrieval unit 96 of the first embodiment, for receiving the answer candidate URLs 394, searching the Internet 62, downloading answer candidate passages from the URLs stored in each answer candidate record, and storing them in the passage DB 363.

[0079] B. Learning Device Referring to Figure 8, a learning device 400 for training the question BERT 380 of the answer candidate search device 360 ​​includes a question / passage collection unit 410 that crawls the Internet 62, downloads questions together with several sentences before and after them (hereinafter, a collection of a question and its surrounding sentences will be referred to as a question passage), and further downloads appropriate passages as answers to each question, a question passage DB 412 that stores the question passages downloaded by the question / passage collection unit 410, and a passage DB 164 having a configuration similar to that shown in Figure 2 that stores the passages downloaded by the question / passage collection unit 410 in association with questions.

[0080] The training device 400 further includes a BERT training unit 414 for training the question BERT 380 and the answer candidate BERT 418 using a Siamese BERT network, using training data created using the topic model 374, each question passage stored in the question passage DB 412, the passages stored in the passage DB 164, and topic-related words obtained from the topic model 374. Like the question BERT 168 and the answer candidate BERT 170 in the first embodiment, the question BERT 380 and the answer candidate BERT 418 have the same configuration, and updates to the parameters of one during training are reflected in updates to the parameters of the other. In reality, the configurations of the question BERT 380 and the answer candidate BERT 418 are the same as those of the question BERT 168 and the answer candidate BERT 170 in the first embodiment, but their internal parameters differ as a result of training.

[0081] The learning device 400 further includes a passage clustering unit 172 that uses an answer candidate BERT 418 that has been trained by a BERT learning unit 414 to cluster the passages stored in the passage DB 164 into a predetermined number of clusters and assign a cluster identifier to each cluster, an answer candidate DB 390 that stores each answer candidate clustered by the passage clustering unit 172, with the cluster identifier of the cluster to which it belongs, and a centroid DB 378 that stores, for each cluster, a record including the centroid vector of each cluster obtained as a result of the clustering by the passage clustering unit 172 and the cluster identifier of the cluster that represents the cluster. For each question stored in the question passage DB 412, the passage clustering unit 172 assigns the cluster identifier of the cluster to which the most passages related to the question belong to the record of each question in the question passage DB 412.

[0082] The training device 400 further includes an additional training unit 422 for additionally training the question BERT 380 using the questions stored in the question passage DB 412 and information on the centroid of each cluster stored in the centroid DB 378. By performing additional training on the question BERT 380 by the additional training unit 422, the question BERT 380 shown in FIG.

[0083] 9 shows a functional configuration of the BERT training unit 414 in block diagram form. Referring to FIG. 9, the BERT training unit 414 includes a topic assignment unit 450 that receives each question stored in the question passage DB 412 shown in FIG. 8 and a question passage containing the question, and assigns one or more words indicating a topic of a context containing the question to the question using the topic model 374, and a topic assignment unit 452 that assigns one or more words indicating a topic of the answer candidate passage to each answer candidate passage stored in the passage DB 164 using the topic model 374. Training data for the question BERT 380 is generated from the output of the topic assignment unit 450, the output of the topic assignment unit 452, and a label that is 1 if the answer candidate passage is a passage that provides an answer to the question and 0 otherwise.

[0084] The query BERT 416 includes a BERT 480 and a Pooling layer 482 for performing average pooling on each element of the final layer of the BERT 480 to output a vector 454(U). Similarly, the answer candidate BERT 418 includes a BERT 490 and a Pooling layer 492 for performing average pooling on each element of the final layer of the BERT 484 to output a vector 456(V).

[0085] The BERT training unit 414 further includes a cosine similarity calculation unit 204 for providing the output of the topic assignment unit 450 to the question BERT 416 and the output of the topic assignment unit 452 to the answer candidate BERT 418, and for calculating the cosine similarity between the vector 454 output by the question BERT 416 and the vector 456 output by the answer candidate BERT 418, a normalization processing unit 206 for normalizing the value output by the cosine similarity calculation unit 204 (in the range of [-1, 1]) to the range of [0, 1], and a parameter update unit 208 for updating each parameter of the BERTs 480 and 490 in the direction in which the normalized cosine similarity obtained by the normalization processing unit 206 becomes equal to the label 210.

[0086] The BERT learning unit 414 has a function of repeatedly executing such update processing using the above-mentioned learning data until a predetermined termination condition is met.

[0087] The configuration of the additional learning unit 422 is substantially the same as that of the additional learning unit 174 in the first embodiment shown in Fig. 6. However, in this example, the additional learning unit 422 differs from the additional learning unit 174 in that the topic of the question passage is assigned to the question.

[0088] 2.Operation In this second embodiment, too, first, a question BERT 416 is trained by the training device 400 shown in Fig. 8, and a centroid DB 378 and an answer candidate DB 390 are generated. Then, additional training is performed on the question BERT 416 by the additional training unit 422. As a result, a question BERT 380 is obtained, enabling processing by the dialogue device 350 shown in Fig. 7.

[0089] 2-1. Question BERT380 training The learning flow of the query BERT 380 is roughly the same as the learning flow of the query BERT 80 in the first embodiment.

[0090] 8, when training the question BERT 380, the training device 150 operates as follows. First, the question / passage collection unit 410 crawls the Internet 62, collects question passages including question sentences and sentences before and after the question sentences, and stores them in the question passage DB 412. The question / passage collection unit 410 further collects from the Internet 62 a plurality of passages that are thought to include answers to the questions for each question sentence stored in the question passage DB 412. The question / passage collection unit 410 associates the collected passages with the questions stored in the question passage DB 412 and stores them in the passage DB 164. These processes by the question / passage collection unit 410 can be realized by conventional technology.

[0091] Next, the BERT training unit 414 generates training data consisting of positive examples and negative examples from each of the questions and question passages stored in the question passage DB 412, and the passages that are answer candidates for these questions stored in the passage DB 164, using the topic model 374. The BERT training unit 414 uses this training data to simultaneously train a question BERT 416 and an answer candidate BERT 418 using a Siamese BERT network.

[0092] The passage clustering unit 172 uses the candidate response BERT 418 that has completed this training to convert all passages stored in the passage DB 164 into passage vectors. The passage clustering unit 172 then classifies these passage vectors into a predetermined number of clusters using the k-means algorithm. Each cluster is assigned an identifier. The passage clustering unit 172 then calculates the centroid vector for each cluster and assigns the cluster identifier to the centroid identifier. For each centroid thus obtained, the passage clustering unit 172 pairs the cluster identifier and the centroid vector and registers them in the centroid DB 378.

[0093] Meanwhile, the passage clustering unit 172 registers records, each pair consisting of a URL of a passage corresponding to a passage vector belonging to each cluster and an identifier of the cluster to which the passage vector belongs, in the answer candidate DB 390. The passage clustering unit 172 also adds, to the record of each question stored in the question passage DB 412, the cluster identifier of the cluster that contains the most answers to that question.

[0094] Once the centroids have been registered in the centroid DB 378, the additional training unit 422 reads out the centroid vector corresponding to each question stored in the question passage DB 412 from the centroid DB 378. The additional training unit 422 performs additional training on the question BERT 380 for each question using the centroid vector read out from the centroid DB 378 as correct answer data. The training of the question BERT 380 ends when a predetermined termination condition is met.

[0095] 2-2. Response Generation 7, the answer candidate search device 360 ​​having the question BERT 380 after additional training and the dialogue device 350 including the answer candidate search device 360 ​​operate as follows. Note that the answer candidate DB 390 and centroid DB 378 have already been obtained through the training described above. The topic model 374 used is the same as that used for training.

[0096] Assume that an utterance 362 is input from a dialogue partner. The utterance 362 is provided to the topic assigner 376, the dialogue history manager 370, and the response generator 364. The dialogue history manager 370 stores the history of dialogues received over a certain period of time in a dialogue history DB 372 for each dialogue partner. Meanwhile, the topic assigner 376 searches the dialogue history DB 372 for the dialogue partner's past utterance history and extracts content words from those utterances. The topic assigner 376 further inputs these content words to a topic model 374 and receives one or more words representing each topic as an output of the topic model 374. The topic assigner 376 appends these one or more words to the utterance 362 and inputs the result to a query BERT 380.

[0097] The question BERT 380 outputs a question vector in response to the topic-annotated utterance 362. This question vector is provided to the answer candidate cluster identification unit 386.

[0098] In response to the question vector 382, ​​the answer candidate cluster identification unit 386 selects a predetermined number of centroids stored in the centroid DB 378 that have the largest cosine similarity between the vector and the question vector 382, ​​and provides their cluster identifiers to the answer candidate search unit 392 as cluster identifiers 88.

[0099] The answer candidate search unit 392 searches the answer candidate DB 390, extracts all records of passages (answer candidates) having cluster identifiers equal to any of the cluster identifiers 388, and outputs the URLs together as an answer candidate URL set 394. The passage search unit 396 receives the answer candidate URL set 394, accesses the Internet 62 using each URL included in the answer candidate URL set 394, and downloads the answer candidate passages to store in the passage DB 363.

[0100] The response generation unit 364 selects the most appropriate response to the utterance 362 from the group of passages stored in the passage D3B66, and provides it to the response shaping unit 368. The response shaping unit 368 shapes the input into a format suitable for the dialogue and outputs it as a response 366. The response selection and generation method by the response generation unit 364 can use conventional methods as they are.

[0101] 3.Effects According to the second embodiment, the passages processed to generate a response to an input utterance are limited to those corresponding to vectors belonging to clusters corresponding to one or more trackloids selected by the answer candidate cluster identification unit 386 shown in FIG. 7 . Therefore, the optimal response does not need to be selected from multiple answer candidates generated based on multiple answers obtained from a question-and-answer system, as in the conventional system. This significantly reduces the amount of processing performed by the answer generation unit 364 when generating a response. Furthermore, the computational resources required for processing are also significantly reduced. Furthermore, unlike the first embodiment, the topic of the utterance is used as information when searching for answer candidate passages. Therefore, the resulting response is appropriate for the topic of the dialogue. As a result, a dialogue device can be provided that operates quickly and with sufficient accuracy using fewer resources than conventional systems.

[0102] 3. Computer implementation Figure 10 is an external view of a computer system that operates as, for example, question and answering device 50 shown in Figure 1. Figure 11 is a hardware block diagram of the computer system shown in Figure 10. Learning device 150 shown in Figure 2, dialogue device 350 shown in Figure 7, and learning device 400 shown in Figure 8 can each be realized by a computer system with approximately the same configuration as question and answering device 50. Here, we will only describe the configuration of a computer system that operates as question and answering device 50, and will not describe in detail the configurations of computer systems that realize other devices.

[0103] 10, this computer system 950 includes a computer 970 having a DVD (Digital Versatile Disc) drive 1002, and a keyboard 974, a mouse 976, and a monitor 972 for interacting with a user, all of which are connected to the computer 970. Of course, these are just one example of a configuration for when user interaction is required, and any general hardware and software that can be used for user interaction (e.g., a touch panel, voice input, or a general pointing device) can be used.

[0104] 11 , the computer 970 includes, in addition to a DVD drive 1002, a CPU (Central Processing Unit) 990, a GPU (Graphics Processing Unit) 992, and a bus 1010 connected to the CPU 990, the GPU 992, and the DVD drive 1002. The computer 970 further includes a ROM (Read-Only Memory) 996 connected to the bus 1010 and storing a boot-up program of the computer 970, a RAM (Random Access Memory) 998 connected to the bus 1010 and storing instructions constituting a program, a system program, working data, and the like, and an SSD (Solid State Drive) 1000, which is non-volatile memory connected to the bus 1010. The SSD 1000 is used to store programs executed by the CPU 990 and the GPU 992, as well as data used by the programs executed by the CPU 990 and the GPU 992. The computer 970 further includes a network I / F (Interface) 1008 that provides connection to a network 986 (response generation unit 364 shown in FIG. 7) that enables communication with other terminals, and a USB port 1006 to which a USB (Universal Serial Bus) memory 984 can be attached or detached and that provides communication between the USB memory 984 and each unit within the computer 970.

[0105] The computer 970 further includes an audio I / F 1004 that is connected to the microphone 982, the speaker 980, and the bus 1010, and has the function of reading out audio signals, video signals, and text data generated by the CPU 990 and stored in the RAM 998 or the SSD 1000 in accordance with instructions from the CPU 990, converting them to analog, amplifying them, and driving the speaker 980, and digitizing the analog audio signal from the microphone 982 and storing it at any address in the RAM 998 or the SSD 1000 specified by the CPU 990.

[0106] In the above embodiment, programs and the like that realize the functions of question and answer device 50 shown in Fig. 1, learning device 150 shown in Fig. 2, dialogue device 350 shown in Fig. 7, and learning device 400 shown in Fig. 8 are all stored, for example, in SSD 1000, RAM 998, DVD 978, or USB memory 984 shown in Fig. 11, or in a storage medium of an external device (not shown) connected via network I / F 1008 and network 986. Typically, these data and parameters are written to SSD 1000 from the outside, for example, and loaded into RAM 998 when computer 970 is executed.

[0107] The computer programs for operating this computer system to realize the functions of question and answering device 50 shown in Figure 1, learning device 150 shown in Figure 2, dialogue device 350 shown in Figure 7, and learning device 400 shown in Figure 8, as well as each of their components, are stored on a DVD 978 inserted into DVD drive 1002 and transferred from DVD drive 1002 to SSD 1000. Alternatively, these programs may be stored on a USB memory 984, which is inserted into USB port 1006 and the programs transferred to SSD 1000. Alternatively, the programs may be transmitted to computer 970 via network 986 and stored in SSD 1000.

[0108] The program is loaded into RAM 998 when executed. Of course, a source program may be entered using keyboard 974, monitor 972, and mouse 976, and the compiled object program may be stored in SSD 1000. If the program is written in a scripting language, a script entered using keyboard 974 or the like may be stored in SSD 1000. In the case of a program that runs on a virtual machine, a program that functions as a virtual machine must be installed in computer 970 in advance. Neural networks are used for speech recognition, speech synthesis, and the like. A trained neural network may be used in question answering device 50 and dialogue device 350, or the question answering device 50 and dialogue device 350 may be used as learning devices 150 and 400, respectively, to train the neural network.

[0109] The CPU 990 reads a program from the RAM 998 according to an address indicated by an internal register called a program counter (not shown), interprets the instructions, reads data required to execute the instructions from the RAM 998, the SSD 1000, or another device according to the address specified by the instruction, and executes the processing specified by the instruction. The CPU 990 stores the execution result data at an address specified by the program, such as in the RAM 998, the SSD 1000, or a register within the CPU 990. Depending on the address, the data may be output from the computer to an external device. At this time, the program counter value is also updated by the program. The computer program may be loaded directly into the RAM 998 from the DVD 978, the USB memory 984, or via the network 986. Note that some tasks (mainly numerical calculations) of the program executed by the CPU 990 are dispatched to the GPU 992 according to instructions included in the program or according to the analysis results obtained when the CPU 990 executes the instructions.

[0110] The program that causes the computer 970 to realize the functions of each unit according to the above-described embodiment includes a plurality of instructions written and arranged to cause the computer 970 to operate to realize those functions. Some of the basic functions required to execute these instructions may be provided by an operating system (OS) or third-party program running on the computer 970, various toolkit modules installed on the computer 970, or the program's execution environment. Therefore, the program does not necessarily include all of the functions required to realize the system and method according to this embodiment. The program may include only instructions that execute the operations of the above-described devices and their components by statically linking appropriate functions or modules at compile time or by dynamically calling them at runtime in a controlled manner to achieve the desired results. The method for operating the computer 970 to achieve this is well known. Therefore, a description of the method for operating the computer 970 will not be repeated here.

[0111] The GPU 992 is capable of parallel processing, and can execute a large amount of calculations involved in machine learning simultaneously in parallel or in a pipelined manner. For example, parallel calculation elements discovered in a program when the program is compiled or when the program is executed are dispatched from the CPU 990 to the GPU 992 as needed, and executed. The results are returned to the CPU 990 directly or via a predetermined address in the RAM 998, and assigned to a predetermined variable in the program.

[0112] Fourth Variation In the above embodiment, the termination condition for the BERT update is only a predetermined termination condition. In this case, the termination condition is, for example, a condition in which all training data has been used a predetermined number of times and the BERT parameter update has been completed. Another condition may be, for example, when the gradient of each parameter becomes approximately zero during parameter update. Various other termination conditions are also possible.

[0113] In the above embodiment, it is assumed that BERT Large is used as BERT. However, this invention is not limited to BERT Large. BERT-based models may also be used. Furthermore, similar to BERT, a model that can perform sentence-based transformation by arranging a transformer encoder or similar elements may also be used.

[0114] Furthermore, in the above embodiment, average pooling is performed to vectorize the output of the BERT, such as in the query BERT 80 shown in Figure 1. However, the present invention is not limited to such an embodiment. Maximum pooling may be used instead of average pooling.

[0115] In the above embodiment, mean squared error is used as the loss function for training BERT. However, the present invention is not limited to such an embodiment. Softmax may be used as the measure instead of cosine similarity, and cross-entropy error may be used as the loss function.

[0116] In the above embodiment, the k-means method is used to cluster passage vectors during learning. However, the present invention is not limited to such an embodiment. Clustering based on the Related Minimum Variance criterion, clustering based on a scatter plot criterion, etc. may also be used.

[0117] Furthermore, in the above embodiment, the question vector of the utterance to which a topic has been added is provided to the answer candidate cluster identifying unit 386, and the cluster identifier of an appropriate centroid is obtained from the centroids in the centroid DB 378. However, without being limited to this, the answer candidate cluster identifying unit 386 may be provided with a question vector based on the utterance and a dialogue history expressed as a vector, and the centroid may be determined from the similarity (or distance) to obtain its cluster identifier.

[0118] Furthermore, in the above embodiment, the answer candidate DB 90 shown in FIG. 1 and the answer candidate DB 390 shown in FIG. 7 store URLs of answer candidates. However, the present invention is not limited to such an embodiment. The answer candidate DB 90 and the answer candidate DB 390 may store passages themselves, rather than URLs of answer candidates. In that case, the answer candidate search unit 92 and the answer candidate search unit 392 output the answer candidate passages themselves, rather than URLs of answer candidates. Therefore, the passage search unit 96 shown in FIG. 1 and the passage search unit 396 shown in FIG. 7 are not necessary. Since there is no need to download passages from the Internet 62 when answering a question or providing a response, the processing volume is reduced, and responses are likely to be faster than in the first and second embodiments.

[0119] Furthermore, in the above embodiment, the passage DB 164 shown in FIGS. 2 and 8 is unnecessary and can be discarded once BERT training is complete. However, if the passage DB 164 has sufficient storage capacity to store a large number of passages, the passage DB 164 may be retained. In this case, the answer candidate DB 90 and the response candidate DB 390 may store information necessary to search for the relevant passage from the passage DB 164, rather than the answer candidate passage itself. The information necessary for the search may be, for example, an identifier of the record containing the passage, or a URL where the passage existed. In particular, if a URL is stored, the passage can be retrieved from the passage DB 164 if it exists there. If the passage is not found in the passage DB 164, the URL can be accessed and the passage can be downloaded. In this case, the answer candidate search unit 92 and the response candidate search unit 392 output a group of URLs for the response candidates, but the passages can usually be read from the locally stored passage DB 164 without accessing the Internet. Therefore, the response is likely to be faster than in the first and second embodiments. Furthermore, even if some passages are deleted from the passage DB 164, the passages can be downloaded from the Internet because the URLs are known.

[0120] In the second embodiment described above, passages likely to contain candidate responses to an input to the dialogue device 350 are searched from the Internet 62, and responses are generated in the response generator 364 using those passages. However, the present invention is not limited to such an embodiment. For example, if appropriate candidate responses to the utterance 362 can be prepared in advance, such candidate responses can be stored in the response candidate DB 390 instead of the passages. Various utterances 362 are prepared, and appropriate candidate responses are determined for them, and then stored in the response candidate DB 390. Once a large number of candidate responses are obtained, the dialogue device 350 can be constructed using those candidate responses using the method described in the second embodiment. In this case, rather than generating responses from passages likely to contain candidate responses, appropriate responses to the utterances are collected in advance, and responses are generated from those responses. Therefore, the responses are more appropriate than those described in the second embodiment.

[0121] The following method can be considered for pre-accumulating appropriate responses to an utterance: First, a large number of nouns (e.g., one million words) that may constitute an utterance are selected. From each of these nouns, multiple questions are generated using an existing method. These questions are input to the question answering device 50 of the first embodiment. Based on the answers from the question answering device 50, appropriate responses to the questions containing the original nouns are created, and the questions and responses are stored in the question passage DB 412 and passage DB 164 shown in FIG. 8 . After that, the question BERT 380 shown in FIGS. 7 and 8 can be trained using a method similar to that of the second embodiment. The dialogue device 350 can be constructed using appropriate response candidates for the utterance, rather than passages that are considered to contain response candidates for the utterance. In this modified example, response candidates considered to be most appropriate for the utterance are generated and selected in advance, thereby completing heavy computational processing tasks in the dialogue device in advance. This results in faster inference processing and reduced computational resources.

[0122] In the second embodiment shown in FIG. 7 and subsequent figures, the topic model 374 is used in both training and inference. However, it is not essential to use the topic model 374 when assigning topics in a dialogue. For example, words that satisfy certain conditions may be extracted from the dialogue history, or the dialogue history itself, and assigned to the utterance 362 by the topic assignment unit 376. Instead of identifying a topic using the dialogue history, the topic may be determined by a setting made in advance. For example, the speaker may explicitly specify a topic. Furthermore, the topic assignment unit 376 itself may be omitted.

[0123] The embodiments disclosed herein are merely examples, and the present invention is not limited to the above-described embodiments. The scope of the present invention is defined by the claims in the appended claims, taking into consideration the detailed description of the invention, and includes all modifications within the meaning and scope equivalent to the wordings described therein. [Explanation of symbols]

[0124] 50 Question answering device 64, 92 Answer candidate search section 66, 164, 363 Passage DB 68 Answer generation part 80, 168, 380, 416 Questions BERT 82,382 Question Vector 84, 378 Centroid DB 86 Answer candidate cluster identification part 88,388 cluster identifier 90 Answer candidate DB 94 Answer candidate URL group 96, 396 Passage Search Section 150, 400 learning device 160, 410 Question and Passage Collection Section 162 Questions DB 166, 414 BERT Learning Part 170 possible answers BERT 172 Passage Clustering Section 174, 422 Additional Learning Section 204, 314 Cosine similarity calculation unit 206, 316 Normalization processing unit 208, 318 Parameter update section 210 Label 220, 230, 480, 484, 490 BERT 222, 232, 482, 492 Pooling layer 250, 252 clusters 350 Interactive Device 360 Response candidate search device 362 utterances 364 Response Generation Unit 368 Response Formatting Department 370 Dialogue History Management Unit 372 Dialogue History DB 374 Topic Model 376, 450, 452 Topic assignment section 386 Response candidate cluster identification part 390 Response Candidate DB 392 Response candidate search unit 394 Response candidate URLs 412 Question Passage DB 418 Response Candidate BERT

Claims

1. a first neural network that is supplied with a first input and outputs a vector representation of the first input; a second neural network to which a second input is supplied and which outputs a vector representation of the second input; during training, using training data of the first and second inputs that are in a predetermined relationship, the first and second neural networks are trained so that, when the vector representation of the first input and the vector representation of the second input are in the predetermined relationship, they are positioned close to each other in a vector space; an inference device further including a database constructed in advance to cluster vector representations obtained by inputting a plurality of passages that are answer candidates for inference into the trained second neural network based on their positions in the vector space, and to enable search and extraction of the clusters based on the vector representations of the first input, An inference device that, during inference, uses only the first neural network of the first neural network and the second neural network to infer an output that has the predetermined relationship based on information about the cluster searched and extracted from the database based on a vector representation of the input by the first neural network in response to an input to the inference device.

2. 2. The inference device according to claim 1, wherein the database is searched and extracted using centroids of vector representations of outputs contained in each cluster.

3. 3. An inference device according to claim 1, wherein the first neural network has undergone additional learning based on a vector representation associated with the first input and a cluster to which the second input, which has the predetermined relationship with the first input, belongs.

4. 4. A question and answering apparatus including the inference device according to claim 1, wherein the predetermined relationship includes a question and an answer to the question.

5. 4. A dialogue apparatus including an inference device according to claim 1, wherein the predetermined relationship includes an utterance and a response to the utterance.

6. An inference device comprising: a step of preparing a first neural network to which a first input is supplied and which outputs a vector representation of the first input; and a second neural network to which a second input is supplied and which outputs a vector representation of the second input; a step in which an inference device uses training data of at least the first and second inputs that are in a predetermined relationship to train the first and second neural networks so that, when the vector representation of the first input and the vector representation of the second input are in the predetermined relationship, they are located close to each other in a vector space; an inference device inputting a plurality of passages that are answer candidates for inference into the trained second neural network, clustering the vector representations obtained based on their positions in the vector space, and constructing a database in advance so that the clusters can be searched and extracted based on the vector representations of the first input; and a step in which the inference device infers an output having the predetermined relationship based on information of the cluster retrieved from the database based on a vector representation of the input by the first neural network.

Citation Information

Patent Citations

  • Method and system for automated intent mining, classification and disposition

    JP2019169148A

  • Answer selection using a compare-aggregate model with language model and condensed similarity information from latent clustering

    US20200372025A1