Conversation device and training device therefor
Patent Information
- Application Number
- JP2023523432
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2022-05-18
- Filing Date
- 2022-05-18
- Publication Date
- 2025-04-21
- Estimated Expiration
- 2042-05-18
AI Technical Summary
Conventional dialogue systems face limitations in developing topics from user input, as they either remain within database constraints, lack control over response generation, or require extensive interaction data, making it difficult to generate responses that advance conversations.
A dialogue device and training device utilizing a neural network that generates responses based on causal relationships, where the training data is created by extracting and chaining causal relationships from the internet, allowing for the development of topics and providing potential consequences to user inputs.
The system effectively generates responses that can develop conversations beyond database constraints, providing opportunities and risks, thus enhancing the dialogue's depth and usability beyond conventional systems.
Abstract
Description
Dialogue device and training device therefor
[0001] This invention relates to a dialogue device that uses a computer to dialogue with a user, a training device for the dialogue device, and a computer program, and in particular to a dialogue device that can develop a topic from user input, and a training device for training the dialogue device in this manner. This application claims priority to Japanese Application No. 2021-090300, filed on May 28, 2021, and incorporates by reference all of the contents of that Japanese application.
[0002] In recent years, interest in dialogue systems based on deep learning has grown, and research and development of various dialogue system technologies is progressing. Conventional dialogue system technologies can be broadly categorized into the following three types.
[0003] 1) Search-based approaches take user input and use the results to search for information based on the information obtained from the user input from some database, not necessarily dialogue-based, and may use deep learning techniques to select and process the search results.
[0004] 2) Automatic generation of response sentences from user input. End-to-end methods using deep learning fall into this category. Patent Document 1, listed below, employs this method. In this method, dialogue data is acquired from dialogue logs such as those of online chat services. This dialogue data is used to perform learning, primarily using deep learning technology, so that the system automatically generates responses to inputs.
[0005] 3) A scenario-based approach: Many so-called AI (Artificial Intelligence) speakers use this method.
[0006] Japanese Patent Application Laid-Open No. 2018-156272
[0007] In the first method, the information obtained as a response is limited to the scope of the database. Moreover, the relationship between the user input and the response is not clear to the user, which hinders the development of a dialogue with the user.
[0008] The second method mentioned above has the problem that it is not possible to control the generated response output. Deep learning inherently has the problem that the process of generating a response from input cannot be seen from the outside. Therefore, even if you try to control the response, it is not clear how to do so. Furthermore, this method requires the collection of a large amount of dialogue data, and the data must cover a wide range of areas. Collecting such data is generally known to be extremely difficult.
[0009] Therefore, the second method has a problem in that it is difficult to train the response device to generate responses to user inputs that will develop a conversation.
[0010] Furthermore, the third method is constrained by the fact that responses must remain within the scope of the prepared scenario, and there are inherent limitations to developing a dialogue within this constraint.
[0011] Therefore, a main object of the present invention is to provide a dialogue device capable of outputting a response that can develop a topic in response to a user's input, and a training device for training the dialogue device to do so.
[0012] A training device for a dialogue device according to a first aspect of the present invention includes: expected input storage means for storing a plurality of expected inputs, each of which is expected as an input to the dialogue device; and causal relationship storage means for storing a plurality of causal relationship expressions, each of which includes a cause expression and an effect expression; causal relationship expression extraction means for extracting, for each of the plurality of expected inputs stored in the expected input storage means, a causal relationship expression having a predetermined relationship as the expected input from the plurality of causal relationship expressions; training data creation means for inputting the expected inputs and creating training data samples in which the causal relationship expressions extracted by the causal relationship expression extraction means are used as answers, and storing the training data samples in a predetermined storage device; and training means for training a dialogue device consisting of a neural network designed to generate output sentences for input sentences in natural language, using the training data samples stored in the training data creation means.
[0013] Preferably, the causal relationship expression extraction means includes specific causal relationship expression extraction means for extracting, from the plurality of causal relationship expressions, a causal relationship having a noun phrase included in the expected input as a cause expression.
[0014] More preferably, the training device further includes a topic word model that is pre-trained to, when a word is given, output the distribution probability of surrounding words of the word for each word in a predetermined vocabulary, and a first training data sample adding means for identifying, for each causal relationship expression of the training data sample stored in the predetermined storage device, words with high distribution probabilities for words included in the causal relationship expression based on the output of the topic word model, and adding the identified words to the input of the training data sample to generate a new training data sample and adding the identified words to the predetermined storage device.
[0015] More preferably, the training device further includes a second training data sample adding means for extracting, for each causal relationship expression of the training data sample stored in the predetermined storage device, sentences having distribution probabilities of surrounding words similar to the distribution probabilities of the surrounding words of the causal relationship expression from the predetermined corpus based on the output of the topic word model, and adding the extracted sentences to the input of the training data sample to generate a new training data sample and adding the new training data sample to the predetermined storage device.
[0016] A computer program according to a second aspect of the present invention causes a computer to function as expected input storage means for storing a plurality of expected inputs, each of which is expected as an input to a dialogue device, and as causal relationship storage means for storing a plurality of causal relationship expressions, each of which includes a cause expression and an effect expression. The computer program further causes the computer to function as causal relationship expression extraction means for extracting, for each of the plurality of expected inputs stored in the expected input storage means, a causal relationship expression having a predetermined relationship with the expected input from the plurality of causal relationship expressions, and as training data creation means for inputting the expected inputs and creating training data samples in which the causal relationship expressions extracted by the causal relationship expression extraction means are used as answers, and storing the training data samples in a predetermined storage device. The computer program also causes the computer to function as training means for training a dialogue device consisting of a neural network designed to generate output sentences for input sentences in natural language, using the training data samples stored in the training data creation means.
[0017] A third aspect of the present invention provides a dialogue apparatus for natural language dialogue, including a neural network designed to generate output sentences for input sentences in natural language, the neural network being trained so that the output sentences represent potential consequences for the input sentences.
[0018] Preferably, the dialogue apparatus further includes a related expression adding means for, in response to receiving an input sentence, adding a related expression, which is an expression including a word or sentence related to a phrase in the input sentence, to the input sentence and inputting the related expression to the neural network.
[0019] A dialogue device according to a fourth aspect of the present invention includes an utterance memory unit that stores past utterances of a user, a topic model that outputs a probability distribution of occurrence of surrounding words for an input word, and a response generation unit that uses the user utterance as input, the user utterance stored in the utterance memory unit, and the topic model to generate a response to the user utterance.
[0020] A dialogue device according to a fifth aspect of the present invention includes an utterance memory unit that stores past utterances of a user, a topic model that outputs a probability distribution of occurrence of surrounding words for an input word, a response generation unit that takes the user's utterance as input and generates a response to the utterance, and a response generation adjustment unit that adjusts the generation of a response by the response generation unit based on the output of the topic model for the user's utterance.
[0021] 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.
[0022] FIG. 1 is a block diagram of a dialogue system for training a dialogue device according to a first embodiment of the present invention. FIG. 2 is a block diagram of a training data creation unit that is a part of the dialogue device shown in FIG. 1. FIG. 3 is a flowchart showing the control structure of a computer program that causes a computer to function as a training data creation device for the dialogue system shown in FIG. 1. FIG. 4 is a block diagram of a dialogue system for training a dialogue device according to a second embodiment of the present invention. FIG. 5 is a block diagram of a training data addition unit shown in FIG. 4. FIG. 6 is a block diagram of a related expression search unit shown in FIG. 4. FIG. 7 is a flowchart showing the control structure of a computer program that causes a computer to function as a training data creation device for the dialogue system according to the second embodiment. FIG. 8 is a flowchart showing the control structure of a routine that realizes the related expression addition process of FIG. 7. FIG. 9 is a block diagram of a dialogue device according to a third embodiment of the present invention and a training device that trains the dialogue device. FIG. 10 is a schematic diagram showing an example of training data prepared by the training device according to the third embodiment. FIG. 11 is a flowchart showing the control structure of a computer program that causes a computer to function as a training data creation device for the dialogue system according to the third embodiment. FIG. 12 is a flowchart showing the control structure of a computer routine that causes a computer to function to realize the related word addition process shown in FIG. 11. Fig. 13 is a block diagram of a dialogue device according to a fourth embodiment of the present invention. Fig. 14 is a block diagram of a dialogue device according to a fifth embodiment of the present invention. Fig. 15 is an external view of a computer system for realizing the above embodiments. Fig. 16 is a block diagram showing the hardware configuration of the computer system shown in Fig. 15.
[0023] 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.
[0024] 1 First Embodiment 1 Configuration (1) Dialogue System 50 Fig. 1 shows in block diagram form the configuration of a dialogue system 50 according to a first embodiment of the present invention. Referring to Fig. 1, the dialogue system 50 includes a dialogue device 52 and a training data generation device 54 connected to the Internet 60 and configured to generate training data for training the dialogue device 52 using causal relationship expressions extracted from the Internet 60. The dialogue system 50 further includes a training device 56 configured to train the dialogue device 52 using the training data generated by the training data generation device 54.
[0025] The configuration of each element of the dialogue system 50 will be described below. Note that each word constituting a natural language sentence used in the following embodiment is assumed to be converted into a word vector in advance. That is, each natural language sentence is represented as a word vector sequence consisting of word vectors.
[0026] (2) Dialogue Device 52 The dialogue device 52 includes a response generation neural network 100, which is a neural network, that receives a user input 102, such as a sentence in a natural language, and generates a response sentence. The dialogue device 52 further includes an utterance shaping unit 104 that performs shaping processing on the response sentence generated by the response generation neural network 100 so that the response sentence is in a form appropriate for the user input 102, and outputs the utterance as a response utterance 106.
[0027] The response generation neural network 100 is of a so-called end-to-end type, and is pre-trained to generate responses in natural language sentences in response to input natural language sentences. The training of the response generation neural network 100 by the training device 56 corresponds to so-called fine tuning.
[0028] The response generation neural network 100 can be a generative network consisting of a combination of a transformer-encoder and a transformer-decoder, or a UniLM network pre-trained with BERT for generative purposes. However, the response generation neural network 100 can be implemented with any generative network. Furthermore, if there is a large amount of data for generative training, it can be implemented using only standard generative training. (For details on the BERT model, see Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. BERT: Pre-training of deep bidirectional transformers for language understanding.) (3) Training Data Generation Device 54 The training data generation device 54 includes a causal relationship extraction unit 62 for extracting causal relationship expressions from the Internet 60 using a known method, and a causal relationship database (DB) 64 for storing the causal relationship expressions extracted by the causal relationship extraction unit 62. The training data generation device 54 further includes a chained causal relationship generation unit 66 that, when a consequence part of a causal relationship (first causal relationship) and a cause part of another causal relationship (second causal relationship) semantically match among the causal relationship expressions stored in the causal relationship DB 64, generates new causal relationship candidates in a chained manner by linking the cause part of the first causal relationship with the consequence part of the second causal relationship and further linking the new causal relationship generated in this way with other causal relationships, and a generated causal relationship DB 68 for storing the causal relationship candidates generated by the chained causal relationship generation unit 66. The causal relationship extraction unit 62 can extract causal relationships using, for example, the causal relationship recognition method disclosed in Japanese Patent Application Laid-Open No. 2018-60364. As a method for generating new candidate causal relationships by linking causal relationships, for example, the technology disclosed in Japanese Patent Application Laid-Open No. 2015-121897 can be used.
[0029] The training data generation device 54 further includes a chain causal relationship selection unit 70 that selects a causal relationship that represents an appropriate causal relationship from among the candidate causal relationships stored in the generated causal relationship DB 68, a chain causal relationship DB 72 for storing the causal relationships selected by the chain causal relationship selection unit 70, and an extended causal relationship DB 74 that integrates and stores the causal relationships stored in the causal relationship DB 64 and the causal relationships stored in the chain causal relationship DB 72.
[0030] The training data generation device 54 also includes an expected input extraction unit 76 that extracts from the Internet 60 expressions that are expected to become user inputs 102 to the dialogue device 52, and an expected input storage unit 78 that stores the expected inputs extracted by the expected input extraction unit 76 and expected inputs added manually from the console 80. The training data generation device 54 further includes a training data creation unit 82 that inputs any of the expected inputs stored in the expected input storage unit 78, creates training data samples that have, as correct answers, causal relationships that have consequence parts that can be answers to the expected inputs from among the causal relationships stored in the extended causal relationship DB 74, and outputs the training data samples to the training device 56.
[0031] As described below, the training data creation unit 82 creates training data samples by reading from the extended causal relationship DB 74 causal relationships that have the noun phrase contained in the expected input as the cause part for each expected input read from the expected input memory unit 78.
[0032] 2 , training data creation unit 82 includes an expected input reading unit 150 that reads out expected inputs from expected input storage unit 78 in order, and a noun phrase identification unit 152 that identifies a noun phrase included in the expected input read out by expected input reading unit 150. Training data creation unit 82 further includes a causal relationship search unit 154 that searches extended causal relationship DB 74 for and reads out all causal relationships that include a noun phrase identified by noun phrase identification unit 152 in the consequence part, and a training data sample creation unit 156 that creates training data samples that have the expected input as input and the causal relationship as output for each of the causal relationships read out by causal relationship search unit 154, and stores the training data sample in training data storage unit 84.
[0033] (4) Training Device 56 The training device 56 includes a training data storage unit 84 for storing the training data samples output by the training data creation unit 82, and a training unit 86 for training the response-generating neural network 100 using the training data samples stored in the training data storage unit 84. The processing performed by the training unit 86 on the response-generating neural network 100 is, as described above, fine-tuning of the response-generating neural network 100. Specifically, the training unit 86 provides an expected input to the response-generating neural network 100 for each training data sample, and trains the response-generating neural network 100 by backpropagation so as to generate an output that is a consequence of a causal relationship caused by the expected input.
[0034] (5) Training Data Generation Program Fig. 3 is a flowchart showing the control structure of a computer program for causing a computer to function as training data generation device 54. Referring to Fig. 3, this program includes, after starting the program, step 200 for allocating and initializing a storage area, opening relevant files, connecting to a database, etc., and step 202 for reading all expected inputs from expected input storage unit 78 shown in Fig. 1. This program further includes step 204 for executing step 206 for each expected input read in step 202, and step 208 for executing a predetermined termination process to terminate execution of the program after step 204 is completed.
[0035] Step 206 includes step 230 of identifying all noun phrases present in the expected input to be processed, and step 232 of performing step 234 for each noun phrase identified in step 230 .
[0036] Step 234 includes step 260 of reading all causal relations having the noun phrase under processing as a cause part from the extended causal relation DB 74 shown in FIG. 1, and step 262 of executing step 264 of creating training data samples consisting of combinations of each of the causal relations read in step 260 with the assumed input under processing.
[0037] Specifically, step 264 creates training data samples in which expected inputs during processing are input and causal relationships during processing are used as answers, and stores the data in the training data storage unit 84 shown in FIG.
[0038] 2. Operation The dialogue system 50 whose structure has been described above operates as follows.
[0039] (1) Creation of Training Data First, the training data generation device 54 operates as follows to create training data for the response generation neural network 100. First, the causal relationship extraction unit 62 extracts a large number of causal relationships from the Internet 60 and stores them in the causal relationship DB 64. The causal relationship DB 64 stores these causal relationships in a format that allows various searches. For example, the technology disclosed in the above-mentioned Japanese Patent Application Laid-Open No. 2018-60364 can distinguish between the cause part and the consequence part of a causal relationship. If the causal relationship DB 64 is designed to store the cause part and the consequence part of each causal relationship in separate columns, it can easily extract only causal relationships that contain, for example, a specific word in the cause part.
[0040] The chained causal relationship generation unit 66 generates all two causal relationship candidates from the causal relationships stored in the causal relationship DB 64, in which the consequence part of the first causal relationship has substantially the same meaning as the cause part of the second causal relationship. Further, by performing similar processing, new causal relationship candidates are generated by chaining multiple causal relationships. In this embodiment, a large number of causal relationship candidates are generated by chaining causal relationships up to a predetermined upper limit number of times. All of these causal relationship candidates are stored in the generated causal relationship DB 68. The generated causal relationship DB 68 stores the causal relationship candidates in the same format as the causal relationship DB 64, for example. In the case of the generated causal relationship DB 68, information identifying the causal relationship that was the basis for generating the causal relationship candidates may also be stored.
[0041] The causal relationship candidates generated by the causal relationship chain generation unit 66 are based solely on the fact that, between two consecutive causal relationships in the chain, the consequence part of one causal relationship and the cause part of the other causal relationship are semantically identical. However, as disclosed in the above-mentioned Japanese Patent Application Laid-Open No. 2015-121897, some of the causal relationship candidates obtained by such a causal relationship chain may not represent a correct causal relationship as a whole. Therefore, the causal relationship chain selection unit 70 selects those causal relationship candidates that are considered to be correct from the causal relationship candidates stored in the generated causal relationship DB 68 and stores them in the causal relationship chain DB 72. The method for selecting the causal relationship candidates here is the one disclosed in Japanese Patent Application Laid-Open No. 2015-121897. It is also possible to fine-tune a pre-trained natural language model such as BERT to select causal relationship candidates.
[0042] The extended causal relationship DB 74 stores causal relationships that are an integration of the causal relationship DB 64 and the chain causal relationship DB 72. That is, the extended causal relationship DB 74 stores the causal relationships extracted from the Internet 60 by the causal relationship extraction unit 62 and the causal relationships generated from these causal relationships by the chain causal relationship generation unit 66 and the chain causal relationship selection unit 70. The extended causal relationship DB 74 also stores the causal relationships in the same format as the causal relationship DB 64.
[0043] On the other hand, the expected input extraction unit 76, like the causal relationship extraction unit 62, extracts expressions that can be considered as inputs to the response generation neural network 100 from numerous web pages on the Internet 60 as expected inputs to the response generation neural network 100. For example, possible candidates include questions from numerous FAQ (Frequently Asked Questions) sites on the Internet 60, as well as question-type sentences posted on sites that provide various information. In addition to this, it is also possible to extract ordinary sentences and generate questions in which noun phrases therein serve as answers. The expected inputs extracted by the expected input extraction unit 76 are stored in the expected input storage unit 78.
[0044] On the other hand, the user may supplement the assumed input using the console 80, but this is not essential.
[0045] Once the causal relationships are prepared in the extended causal relationship DB 74 and the assumed inputs are prepared in the assumed input storage unit 78 as described above, the training data creation unit 82 creates training data as follows: Specifically, the computer creates training data by executing a program whose control structure is shown in FIG.
[0046] 3, when this program is started, initial processing is first performed in step 200, and all expected inputs stored in expected input storage unit 78 are read and loaded into memory in step 202. In step 204, training data is created by performing step 206, as described below, for each expected input until all expected inputs have been processed.
[0047] In step 206, first, all noun phrases in the assumed input being processed are identified (step 230), and in step 232, the process of step 234 is executed for each of these noun phrases.
[0048] In step 234, for the noun phrase being processed, all causal relations that have that noun phrase as a cause are read from the extended causal relation DB 74 (step 260). Furthermore, in step 262, for each of these causal relations, a training data sample is created using the expected input being processed as an input and the consequence of the causal relation as an answer, and the training data sample is saved in the training data storage unit 84 of Figure 1. This process is repeated until it is completed for all causal relations.
[0049] When the process of step 232 has been completed for all of the noun phrases identified in step 230, step 206 for a certain expected input is completed, and the process of step 206 is then executed again for the next expected input.
[0050] Creation of training data is completed when step 204 is completed for all assumed inputs read out in step 202. The training data is stored in the training data storage unit 84 in FIG.
[0051] (2) Training Once the training data has been prepared in the manner described above, the training section 86 of the training device 56 uses the training data prepared in the training data storage section 84 to train the response generating neural network 100 .
[0052] The training of the response generation neural network 100 itself is performed using the usual backpropagation method. That is, assumed inputs are given to the response generation neural network 100, and an output of the response generation neural network 100 is obtained. At this time, the output of the response generation neural network 100 is output sequentially in the form of word vectors. The parameters of the response generation neural network 100 are modified so that the word vector sequence formed by these word vectors becomes the (word vector sequence of) the consequence part of the causal relationship, which is the answer of the training data. Since this training is based on an existing method, the details will not be repeated here.
[0053] (3) Dialogue Processing Once training of the response generation neural network 100 is complete, the dialogue device 52 can be used. When a user provides some input in natural language, this input is converted into a word vector sequence and provided to the response generation neural network 100 as a user input 102. The response generation neural network 100 generates a response to this user input 102 and outputs it to the utterance shaping unit 104. The utterance shaping unit 104 formats the response provided by the response generation neural network 100 to be appropriate as a response to the user input 102 (for example, by adding some wording to the beginning to match the user input 102, repeating part of the user input 102, or transforming the ending of the sentence into a conversational expression), and outputs it as a response utterance 106. This shaping may be performed based on rules, or a neural network trained using sentences and modified endings as training data may be used.
[0054] The user may make an utterance by voice, and the utterance may be subjected to speech recognition and input to the response generation neural network 100 as the user input 102. In this case, the response utterance 106 may also be output as speech by speech synthesis.
[0055] 3. Effects Because the response-generating neural network 100 is trained based on causal relationships, what the response-generating neural network 100 generates in response to the user input 102 is a sentence related to some causal consequence of the user input 102. The training data also includes causal relationships generated by chaining causal relationships, and it is highly likely that the response-generating neural network 100 will output not only answers that can usually be derived immediately from the user input 102, but also sentences related to potential risks or opportunities derived from the user input 102. As a result, the dialogue is more likely to develop compared to when searching for answers within a certain framework as in conventional dialogue systems.
[0056] In this embodiment, training data is created using causal relationships. While it is difficult to obtain a large amount of general dialogue data, as is done in conventional technology, causal relationships can be obtained in large quantities from the Internet using existing techniques. This allows for a large amount of training data to be prepared, improving the accuracy of the response generation neural network 100. In other words, the response generation neural network 100 can generate answers based on causal relationships in response to user input 102 that are likely to further develop the dialogue.
[0057] In conventional dialogue systems using neural networks, the neural network itself is a black box. This poses a problem in that it is difficult to explain to the user the intention behind the responses output by the dialogue system. In contrast, a neural network trained using causal relationships, such as the response generation neural network 100 of this embodiment, can be explained as informing the user of potential opportunities and risks derived from the user's utterances. Therefore, rather than thinking of a dialogue system as a simple dialogue partner, the scope of use of the dialogue system can be expanded as a tool to develop the user's thinking or a tool to guide the user's behavior.
[0058] 2 Second Embodiment 1 Configuration (1) Dialogue System 300 Fig. 4 shows in block diagram form the configuration of a dialogue system 300 according to a second embodiment of the present invention. Referring to Fig. 4, this dialogue system 300 includes a training data generation device 54 and a training device 56, similar to those in the first embodiment. The dialogue system 300 further includes a training data extension unit 58, which is connected to the training data storage unit 84 of the training device 56 and the expected input storage unit 78 of the training data generation device 54, and which creates new training data samples by adding, to the expected input, any words or phrases related to the expected input as topics, and adds the new training data samples to the training data storage unit 84, and a dialogue device 302 that uses a response generation neural network 340 trained by the training device 56 using the extended training data.
[0059] Of these, the configurations of the training data extension unit 58 and the dialogue device 302 will be explained below in order.
[0060] (2) Training Data Expansion Unit 58 A. Configuration The training data expansion unit 58 includes a topic word model 330 prepared in advance using corpus statistics so as to, when a word is given, output a surrounding word distribution vector whose elements are the probability of each word occurring around the word. The training data expansion unit 58 further includes a related expression search unit 332 that, when a word is given, identifies words having surrounding word distribution vectors similar to the surrounding word distribution vector for the given word based on the output of the topic word model 330 and extracts expected inputs from the expected input storage unit 78 that include words having word vectors similar to the surrounding word distribution vector for the given word. The training data expansion unit 58 further includes a training data addition unit 334 that extracts words included in the consequence parts of the causal relationship expressions contained in each training data sample stored in the training data storage unit 84, provides the extracted words to the related expression search unit 332, and in response adds the combination of words and expected inputs output from the related expression search unit 332 to the expected inputs of the training data sample to develop a new training data sample and add it to the training data storage unit 84.
[0061] 5, the training data adding unit 334 has the following configuration: The training data adding unit 334 includes a training data reading unit 360 that reads out the training data samples stored in the training data storage unit 84 one by one and extracts words included in the consequence parts of the causal relationships therein, and a related expression query unit 362 that queries the related expression searching unit 332 about related expressions for each of the words extracted by the training data reading unit 360.
[0062] The training data adding unit 334 further includes a related expression adding unit 366 for receiving related expressions output by the related expression searching unit 332 in response to a query from the related expression querying unit 362, and for generating new training data samples by adding predetermined combinations of the related expressions to expected inputs in the training data samples read by the training data reading unit 360. The training data adding unit 334 further includes a training data writing unit 364 for adding and writing the new training data samples generated by the related expression adding unit 366 to the training data storage unit 84.
[0063] C. Topic Word Model 330 As described above, the topic word model 330 is obtained by performing statistical processing on a predetermined corpus in advance to output a surrounding word distribution vector, whose elements represent the probability of each word appearing around the given word (e.g., before and after the word, or within two ranges both before and after the word). The surrounding word distribution vector has elements corresponding to a certain number of words selected from the target language. From this surrounding word distribution vector, words that are likely to appear around a given word can be determined. Furthermore, the surrounding word distribution vectors of words that appear in similar situations are similar to each other. Therefore, words that appear in similar situations can also be estimated using this topic word model 330. Whether two surrounding word distribution vectors are similar can be determined by their cosine similarity.
[0064] In addition to topic word models that calculate word embeddings such as Word2Vec, it is also possible to adopt topic word models that fine-tune a pre-trained BERT model to estimate the probability distribution of words that appear in an input sentence or in sentences nearby it.
[0065] 6, the related expression search unit 332 includes a related expected input search unit 400 that, when given a word from the related expression query unit 362 shown in Fig. 5, receives a peripheral word distribution vector for the word from the topic word model 330, and further searches for expected inputs stored in the expected input storage unit 78 that include words having peripheral word distribution vectors similar to the peripheral word distribution vector, and extracts these as related expected inputs. The related expression search unit 332 further includes a related word search unit 402 that, when given a word from the related expression query unit 362, obtains the peripheral word distribution vector of the word from the topic word model 330, and selects, from the peripheral word distribution vector, words that are highly likely to be used around the input word, as related words. The related expression search unit 332 further includes a related expression expansion unit 404 for generating various combinations of the related assumed input retrieved by the related assumed input search unit 400 and the related words selected by the related word search unit 402, and a related expression output unit 406 for outputting each of the combinations generated by the related expression expansion unit 404 to the related expression addition unit 366 of Figure 5.
[0066] (3) Dialogue Device 302 A. Configuration Referring to Fig. 4, the dialogue device 302 is a response generation neural network 340 having a configuration similar to that of the response generation neural network 100 of Fig. 1, but unlike the response generation neural network 100, includes a response generation neural network 340 that has been trained using training data expanded by a training data expansion unit 58. The dialogue device 302 further includes an information addition device 338 that adds, to the user input 102 to the dialogue device 302, one or more expressions that the user has used in a dialogue in the past or words that represent the topic of the dialogue with the user, and inputs the added information to the response generation neural network 340.
[0067] The information addition device 338 includes a topic word model 344 similar to the topic word model 330 of the training data expansion unit 58, a user input storage unit 346 for storing past user utterances, and a word selection unit 348 for receiving the user input 102, extracting words included in the user input 102, and selecting several words that are highly likely to be related to the extracted words by referring to the topic word model 344. The information addition device 338 further includes an utterance selection unit 350 for selecting several utterances related to the user input 102 from the user inputs stored in the user input storage unit 346, and an information addition unit 352 for selecting any combination of the words selected by the word selection unit 348 and the user input selected by the utterance selection unit 350 (including the case where no combination is selected) for the user input 102, adding the selected combination to the user input 102, and providing the information addition unit 352 as an input to the response generation neural network 340.
[0068] B. Topic Word Model 344 The topic word model 344 is similar to the topic word model 330 in FIG.
[0069] C. Word Selection Unit 348 The word selection unit 348 extracts words included in the user input 102, and obtains a surrounding word distribution vector for each of the extracted words by referencing the topic word model 344. It then has the function of selecting words corresponding to a predetermined number of elements with the highest probability among the surrounding word distribution vectors.
[0070] D. User Input Storage Unit 346 The user input storage unit 346 stores a predetermined number of the most recent user inputs that have been input by the user in the past. The user inputs may be stored with the time of input.
[0071] E. Utterance selection unit 350 The utterance selection unit 350 has a neural network that is pre-trained to receive a word vector sequence that combines the user input 102 and past user inputs stored in the user input storage unit 346 via predetermined separation tokens, output a value indicating the degree to which the two are related, and selects several past user utterances that have the highest output value from this neural network. Note that, if the input time of the user input is stored, the selection targets may be limited to user inputs from a predetermined time before the present up to the present, or the probability that a user input will be selected may be inversely correlated with the elapsed time since the input.
[0072] F. Information Addition Unit 352 The information addition unit 352 has the function of receiving all words selected by the word selection unit 348 and all user utterances selected by the utterance selection unit 350, generating a set of all combinations of these, and randomly selecting one combination from among them to add to the user input 102. The combinations include combinations that do not include any words or past inputs. Therefore, the output of the information addition unit 352 can be in various forms, such as the user input 102 only, the user input 102 + a word, the user input 102 + a past input, the user input 102 + two words, or the user input 102 + a word + a past input.
[0073] (4) Training Data Generation Program A. Overall Configuration FIG. 7 shows the control structure of a program for causing a computer to function as the training data generation device 54, the training device 56, and the training data extension unit 58 in FIG.
[0074] Referring to FIG. 7, this program differs from that of the first embodiment shown in FIG. 3 in that it includes step 450 between step 204 and step 208, in which a process of adding a related expression to the user input 102 is performed.
[0075] b) Related Expression Addition Process FIG. 8 shows a control structure of a program routine that causes a computer to execute step 450 of FIG.
[0076] 8, this routine includes step 500, which performs predetermined initial processing when the routine starts to run, step 502, which performs processing of step 504, described below, for each training data sample until the end of the training data sample, and step 506, which performs predetermined termination processing after step 502 is completed, thereby completing the execution of this routine and returning control to the parent routine shown in FIG.
[0077] Step 504 includes step 530 of extracting words from the consequences of the causal relationships included in the training data sample to be processed, and step 532 of generating a set of candidate words to be added to the hypothesis input by performing step 534 for each word until all the words extracted in step 530 are exhausted. Step 504 further includes, after step 532 is completed, step 536 of generating all possible combinations of words included in the set of words generated in step 532, and for each combination, performing step 538 of generating a new training data sample by adding the combination to the hypothesis input included in the training data sample to be processed, and adding it to the training data.
[0078] Step 534 includes step 560 of calculating a surrounding word distribution vector for the word being processed using the topic word model 330, and step 562 of selecting a predetermined number of words with the highest probabilities calculated in step 560. Step 534 further includes step 564 of selecting, based on the surrounding word distribution vector calculated in step 560, a predetermined number of expected inputs having words with surrounding word distribution vectors similar to the surrounding word distribution vector, from expected input storage unit 78 of FIG.
[0079] In this embodiment, when selecting words in step 562, only words with a probability equal to or greater than a threshold value are selected, even if they have a high probability. Similarly, in step 564, only words with a similarity between neighboring word distribution vectors equal to or greater than a predetermined value are selected. An appropriate value for the threshold value can be determined through experiments. Such a restriction does not have to be imposed.
[0080] 2. Operation (1) Creation of Training Data A. Creation of Basic Training Data Creation of basic training data is performed from step 200 to step 204 in Fig. 7. The operation of this embodiment in this case is the same as that of the first embodiment.
[0081] B. Training Data Expansion Training data expansion is performed in step 450 of Fig. 7. Specifically, with reference to Figs. 4 and 5, the training data reading unit 360 of the training data adding unit 334 reads out training data one by one from the training data storage unit 84 (step 502 of Fig. 8), extracts words from the consequence parts of the causal relationships in the training data (step 530), and provides these to the related expression querying unit 362. The related expression querying unit 362 queries the related expression searching unit 332 for related expressions for each of the words (step 532) (step 534).
[0082] 6, when a word is provided from the related expression query unit 362, the related expected input search unit 400 of the related expression search unit 332 calculates a surrounding word distribution vector for that word from the topic word model 330 (step 560). The related word search unit 402 selects a predetermined number of words that are likely to be used around the input word from the surrounding word distribution vector as related words (step 562). The related expected input search unit 400 further searches the expected inputs stored in the expected input storage unit 78 for expected inputs that include words with surrounding word distribution vectors similar to the surrounding word distribution vector, and extracts them as related expected inputs (step 564). This process is performed for each word.
[0083] The related expression development unit 404 generates possible combinations of the related assumed inputs extracted by the related assumed input search unit 400 and the related words selected by the related word search unit 402 (step 536). The related expression output unit 406 outputs each of the combinations generated by the related expression development unit 404 as related expressions related to the causal relationship to the related expression addition unit 366 in FIG.
[0084] 5, the related expression adding unit 366 receives the related expression combinations output by the related expression searching unit 332 and adds these combinations to the expected inputs in the training data sample being processed to generate new training data samples. The training data writing unit 364 adds and writes the new training data samples thus generated by the related expression adding unit 366 to the training data storage unit 84 (step 538).
[0085] The training data is expanded through the above process.
[0086] (2) Training The training of the response generation neural network 340 performed in this second embodiment is similar to that performed on the response generation neural network 100 in the first embodiment. However, since the training data in the second embodiment is different from that in the first embodiment, the internal parameters of the response generation neural network 340 at the end of training will be significantly different from the internal parameters of the response generation neural network 100 in the first embodiment.
[0087] (3) Dialogue Processing During dialogue processing, the dialogue device 302 operates as follows: First, when a user input 102 is provided to the dialogue device 302, the word selection unit 348 extracts words included in the user input 102 and selects several words that are highly likely to be related to the extracted words by referring to the topic word model 344. The utterance selection unit 350 selects several utterances related to the user input 102 from among past user inputs stored in the user input storage unit 346. The information addition unit 352 selects one of any combinations (including no selection) of the words selected by the word selection unit 348 and the user input selected by the utterance selection unit 350 in some way, for example, randomly, and adds it to the user input 102, and provides it as input to the response generation neural network 340.
[0088] The internal operation of the response generation neural network 340 after receiving this input is the same as that of the response generation neural network 100 of the first embodiment. However, because the internal parameters of the two networks are different, even when the same user input 102 is given, the output of the response generation neural network 340 is likely to differ from the output of the response generation neural network 100. This possibility is further increased by adding a word or the like to the user input 102. In particular, in the case of the response generation neural network 340, when generating an answer, it is likely to generate a response not only by relying on the user input 102 but also based on a causal relationship in which the consequence section contains a word contained in the user input 102, or a causal relationship in which the consequence section contains an expression related to a user input prior to the user input 102. Therefore, while maintaining continuity in the dialogue with the user, topics that the user did not anticipate can be presented by reflecting potential opportunities or risks based on a chain of causal relationships.
[0089] For example, assume that the user input 102 is "Artificial intelligence has come a long way, hasn't it?". Further assume that a past user input includes "I'm worried about the elderly," and that this past user input is added to the user input 102 and provided to the response generation neural network 340 in the form of "Artificial intelligence has come a long way, hasn't it? + I'm worried about the elderly." In this case, the response generation neural network 340 may output, for example, "Let's use robots to provide nursing care services and support the elderly," thereby developing the topic from the user input 102 and advancing the dialogue in a direction that the user had not considered at the time the user input 102 was uttered.
[0090] 3. Effects As described above, this embodiment can generate responses to user inputs based on causal relationships. To generate such responses, the neural network must be trained using a large number of causal relationship expressions. However, unlike regular dialogue data, causal relationship expressions can be easily collected in large quantities from the Internet. Moreover, the amount of such data is increasing daily. Therefore, the accuracy of response generation by the neural network used in the dialogue can be easily improved. Furthermore, because responses are generated based on causal relationships, unlike conventional dialogue systems using neural networks, responses can be generated based on potential opportunities and risks that the user is not aware of, reflecting causal relationships and causal chains. As a result, dialogue with the user can be developed in a more beneficial manner than in the past.
[0091] 9 is a block diagram showing the configuration of a dialogue system 600 according to a third embodiment of the present invention. Referring to Fig. 9, the dialogue system 600 includes a training data generation device 610 for creating training data for the dialogue system, and a dialogue device 612 including a neural network. The dialogue system 600 further includes a training data extension unit 58 similar to that shown in Fig. 4 that creates and adds new training data samples to each training data sample created by the training data generation device 610 by adding, as a topic, any words or phrases related to the expected input to the expected input, and a training device 56 that trains the dialogue device 612 using the training data generated by the training data generation device 610 and extended by the training data extension unit 58.
[0092] The training data generation device 610 differs from the training data generation device 54 shown in FIG. 1 in that it includes a causal consequence chain generation unit 620, placed after the causal chain selection unit 70 in FIG. 1, for generating a character string (referred to here as a causal consequence chain) by extracting only the cause part of the first causal relation and the consequence part of the causal relation included in that causal chain from each of the causal chains selected by the causal chain selection unit 70 and concatenating them in order; it includes a causal consequence chain memory unit 622, instead of the causal chain DB 72 in FIG. 1, for storing the causal consequence chains generated by the causal consequence chain generation unit 620; and it includes a causal consequence chain DB 624, instead of the extended causal relation DB 74 shown in FIG. 1, for storing the individual causal relations stored in the causal relation DB 64 and the causal consequence chains stored in the causal consequence chain memory unit 622. A single causal relationship stored in the causal relationship DB 64 can be considered as a causal consequence chain consisting of only one causal consequence. The training data generation device 610 further differs from the training data generation device 54 shown in Fig. 1 in that it includes a training data creation unit 626, instead of the training data creation unit 82 shown in Fig. 1, that creates training data for training the dialogue device 612 using the causal consequence chain stored in the causal consequence chain DB 624 and the expected input stored in the expected input storage unit 78.
[0093] The third embodiment differs from the first and second embodiments in that the user inputs a user input 630 to the dialogue device 612 by specifying a natural number N that designates the number of sequences in the causal consequence chain.
[0094] The dialogue device 612 includes a response generation neural network 632 trained by the training device 56, and an information addition device 642 including the topic word model 344, word selection unit 348, and information addition unit 352 in the information addition device 338 shown in FIG. 4 , which receives a user input 630, extracts words representing the topic of a conversation with the user, adds any combination of these words to the user input 630, and inputs the result to the response generation neural network 632. These any combinations of added words are inserted between the user input 630 and a natural number N. That is, the input to the response generation neural network 632 is in the format of "user input 630" + "combination of words added by the information addition device 338" + "natural number N specifying the number of chains." As will be described later, when an input in the above format is given, the response generation neural network 632 is trained to output a character string consisting of N causal consequence chains, the final causal consequence chain including one of the words added by the information addition device 338.
[0095] The dialogue device 612 further includes a question generation unit 634 that generates a question sentence from the output result of the response generation neural network 632 in response to the input provided from the information addition device 338, a response acquisition unit 636 that provides the question generated by the question generation unit 634 to the external question answering system 614 to obtain a response thereto, and an utterance shaping unit 638 that formats the response obtained by the response acquisition unit 636 into a dialogue sentence and outputs it as a response utterance 640.
[0096] In this embodiment (and other embodiments as well), the question generator 634 creates questions by prefixing the causal relationship expression output by the response generation neural network 632 with an interrogative word and then somehow formatting the end of the expression into a question. These questions can be created using a separately trained neural network or a rule-based formatting means.
[0097] For example, assume that the causal relationship expression output by the response generation neural network 632 is "go to Nara" → "meet a deer." (1) By adding "how" to this obtained causal relationship expression, the question "How to go to Nara to meet a deer?" is created. (2) In addition to this result, the word "is it good?" is further added to the end to create the question "How to go to Nara to meet a deer?"
[0098] The answer acquisition unit 636 inputs one or both of these questions into the question answering system 614 and obtains an answer and the text from which the answer was extracted as output. The utterance formatting unit 638 uses the answer alone or in combination with the text from which the answer was extracted, formats the answer to be suitable for a response in a dialogue with the user, and outputs a final response utterance 640.
[0099] Here, the question-answering system 614 is assumed to be a system that performs a search process on an internal database or an external information source (e.g., documents on the Internet) based on input, extracts factual or evidence-based statements that are recognized to be related to the input question, and outputs them as a response. An example of such a question-answering system is the WISDOM X question-answering system (https: / / www.wisdom-nict.jp / ) operated by the National Institute of Information and Communications Technology. By cascading such question-answering systems 614, it is possible to use evidence-based statements and text in the response generation process, thereby providing evidence for the response utterance 640 to the user. It should be noted that the output of a regular search engine, not limited to WISDOM X, can also be used.
[0100] As described above, the input to the response generation neural network 632 is in the form of "user input 630" + "combination of utterances and words added by the information addition device 338" + "natural number N specifying the number of chains," so training data such as that shown in Figure 10 is required for the response generation neural network 632.
[0101] 10, each of the training samples constituting this training data has as input "expected input + related word(s) + natural number N" and includes as output a causal conclusion chain consisting of as many causal conclusions as specified by the natural number N. In this case, the causal conclusion at the end of the output of each training sample includes one of the words included in the related word(s).
[0102] Figure 11 is a flowchart showing the control structure of a computer program that causes a computer to function as training data creation unit 626 shown in Figure 9. Referring to Figure 11, this program is similar to that of the second embodiment shown in Figure 7. However, the program shown in Figure 11 differs from that shown in Figure 7 in that it includes step 670 instead of step 206 in Figure 7, and step 672 for adding related words to the input instead of related expressions instead of step 450 in Figure 7.
[0103] Step 670 is similar to step 206 of Figure 7. However, step 670 differs from step 234 of Figure 7 in that step 670 includes step 680 instead of step 234.
[0104] Step 680 includes step 690 of reading all causal consequence chains that have the noun phrase being processed as the cause (the head of the causal consequence chain), and step 692 of executing step 694 for each causal consequence chain read in step 690.
[0105] Step 694 is for creating and saving a training data sample for the combination of expected input and causal consequence chain being processed, with the expected input and the number of times of the causal consequence chain as input and the causal consequence chain as answer.
[0106] That is, the processing of step 680 results in a training data sample obtained by removing the "related word(s)" from the training data sample shown in Figure 10. The "related word(s)" are added in step 672.
[0107] Figure 12 shows the control structure of a program routine that implements step 672 of Figure 11. Referring to Figure 12, this program includes step 700, which performs predetermined initial processing, step 702, which performs step 704 for each training data sample, and step 706, which, after step 702 is completed, performs predetermined termination processing to terminate execution of this routine.
[0108] Step 704 includes step 710 of extracting words from the final consequences of the causal chain of the training data sample being processed, step 711 of generating all combinations of the words extracted in step 710, and step 712 of performing step 714 for each combination generated in step 711.
[0109] Step 714 includes step 720, in which the combination of words being processed is inserted between the assumed input of the training data sample being processed and the natural number N indicating the number of chains to create a new sample, and step 722, in which the new sample created in step 720 is written to the training data storage unit 84 shown in FIG. 9 and the execution of step 714 is terminated.
[0110] 2 Operation and Effects By running the program whose control structure is shown in Figures 11 and 12 on a computer, training data with the structure shown in Figure 10 can be obtained. It should be noted here that the words included in the "related word(s)" in the input section of the training data are included in the causal consequences at the end of the causal consequence chain in the output, and that the number of causal consequences in the output section is the number specified by the natural number in the input section.
[0111] This training data is used to train the response generation neural network 632 shown in Fig. 9. As a result, when an input having the configuration shown as "input" in Fig. 10 is given to the response generation neural network 632, the parameters of the response generation neural network 632 are set so that the response generation neural network 632 outputs a causal consequence chain having a cause part related to the expected input specified in the input, having as many causal consequences as specified in the input, and having the related word specified in the input or a word similar to the related word in the final causal consequence.
[0112] Therefore, when a user inputs a user input 630 and a natural number N to the dialogue device 612 during actual inference, words that indicate the topic of the dialogue for the user input 630 are selected as related words and added to the input. When this input is provided to the response generation neural network 632, the response generation neural network 632 outputs a causal consequence chain having a specified number of causal consequences, the final causal consequence of which contains the word specified as the related word or a word close to that word. The cause part is related to the input. This causal consequence chain is the "causal relationship expression" referred to in the first and second embodiments. A question generation unit 634 generates a question sentence from this causal relationship expression. A response acquisition unit 636 provides the question sentence to the question answering system 614 to obtain a response. An utterance shaping unit 638 shapes the response into a form suitable for a response to the user input 630 and outputs it as a response utterance 640.
[0113] In this embodiment, a user input, related words, and a natural number N are input to the response generation neural network 632 to obtain multiple causal consequence chains, each consisting of N causal consequences. For example, consider a case where "artificial intelligence will develop" is given as a user input and the word "elderly" is found as a related word. Assuming the values of the natural number N are 1, 2, and 3, the following output is expected to be obtained:
[0114] N=1: Support the elderly.
[0115] N=2: Utilize robots → Support the elderly.
[0116] N=3: Utilizing robots → Nursing care services can be provided → Support for the elderly.
[0117] Therefore, the value of the natural number N has the effect of revealing the relationship between the input and the final conclusion in more detail. In other words, the response utterance 640 includes the number of causal consequences between the input and the output, as specified by the user. Therefore, a consequence that the user did not expect when issuing the user input 630 can be obtained, including the process thereof. In other words, the thought process of the dialogue device 612 in the dialogue can be clarified, and this can serve as an opportunity for the dialogue to develop.
[0118] During generation, the input to the response generation neural network 632 does not necessarily include the additional words from the information addition device 642, and may be omitted.
[0119] 4 Fourth Embodiment 1 Configuration Using the response generation neural network 632 trained in the third embodiment, the following embodiment is also possible: Figure 13 shows the configuration of a dialogue device 730 according to the fourth embodiment.
[0120] 13 , this dialogue device 730 includes the response generation neural network 632 described above, and an information addition device 642 for receiving a user input 740 and outputting the user input 740 with a related word(s) indicating a topic. The dialogue device 730 further includes a chain count addition unit 742 for adding an externally provided natural number N indicating the number of chains of causal consequences described in the third embodiment to the output of the information addition device 642 and inputting the added natural number N to the response generation neural network 632. The dialogue device 730 further includes an upper limit storage unit 746 for storing an upper limit of the chain count, and a counting unit 744 for incrementing the natural number N by one from 1 to the upper limit stored in the upper limit storage unit 746 and providing it to the chain count addition unit 742, thereby sequentially outputting the output of the information addition device 642 with the natural number N added.
[0121] The dialogue device 730 further includes an output storage unit 748 for storing a series of causal consequence chains successively output from the response generation neural network 632 in response to these inputs, and a ranking unit 750 for ranking the series of causal consequence chains stored in the output storage unit 748. The dialogue device 730 further includes an utterance selection unit 752 for selecting the causal consequence chain ranked highest by the ranking unit 750 as an utterance candidate, and an utterance formatting unit 754 for formatting the causal consequence chain selected by the utterance selection unit 752 so as to be suitable as a response to the user input 740 and outputting it as a response utterance 756.
[0122] A pre-trained neural network can be used as the ranking unit 750. The neural network can be trained using manually evaluated sets of causal consequence chains for combinations of user input and related words.
[0123] 2. Effects This embodiment provides the following effects. For example, suppose the input is "artificial intelligence will develop" and the additional word "elderly" is selected. The final consequence is "supporting the elderly," but a chain of multiple causal consequences is possible. Moreover, the number of these multiple causal consequences is not known in advance. However, this embodiment generates a causal consequence chain containing the same number of causal consequences for every number within the range of input natural numbers, and outputs the highest-ranked one among them as the response utterance 756. As a result, it is possible to select a causal consequence that the user did not consider when issuing the user input 740, yet is still appropriate as a response.
[0124] It should be noted that the number of chains of causal consequences during inference does not need to be limited to the natural number N of the data during learning. For example, even if the maximum value of the natural number N of the learning data is 10, it is not necessary to limit the natural number N to 10 during inference. As long as a predetermined accuracy is obtained, it is also possible to perform inference processing by setting the natural number N to 15, for example.
[0125] Fifth Embodiment 1. Configuration In the fourth embodiment, multiple response causal consequences generated for multiple natural numbers N are evaluated ex post, and the one with the highest score is selected. However, the present invention is not limited to such an embodiment. A similar evaluation can also be performed in advance and the results can be used in a dialogue system. The fifth embodiment is such an example. Specifically, in this example, for each combination of an expected input and its associated words, multiple causal consequence chains consisting of one to N causal consequences are created in advance, either manually or using the response generation neural network 632 of the fourth embodiment. The results are then manually ranked. Then, training data is created using the combination of the expected input and its associated words as input, with the natural number N that is the highest ranked among the causal consequence chains obtained from that combination as correct answer data. This training data is used to train a neural network (N-evaluation neural network) that outputs a natural number N when a user input is provided. Then, input and related words are input to this trained N-evaluation neural network to obtain a natural number N, and "input + related words + N" is given to the response generation neural network to obtain an output.
[0126] 14 , a dialogue system 770 according to the fifth embodiment includes an information addition device 642 that adds related words to a user input 780, and a chain count estimation unit 782 that includes the above-described N-evaluation neural network and that obtains the output of the information addition device 642 and outputs the value of an optimal natural number N for the combination of the user input and the related words included in the output. The dialogue system 770 further includes a chain count addition unit 784 that adds the natural number N, which is the number of chains output by the chain count estimation unit 782, to the output of the information addition device 642.
[0127] The dialogue system 770 further includes a response generation neural network 632 that receives as input the user input, related words, and natural number N, which are the outputs of the chain count adding unit 784, and outputs a causal consequence chain including the specified N causal consequences, and an utterance shaping unit 786 that shapes the causal consequence chain output by the response generation neural network 632 so that it is suitable as a response to the user input 780, and outputs a response utterance 788.
[0128] 2. Effects According to the fifth embodiment, when the user simply inputs (utters) the user input 780, the dialogue system 770 estimates related words, and the chain count estimation unit 782 estimates the natural number N and provides it to the response generation neural network 632. Therefore, the user does not need to think of related words or specify the natural number N. In addition, an appropriate response utterance 788 is obtained from the response generation neural network 632, and the user can easily understand the thought process of the dialogue system 770 from the causal conclusion in the response utterance 788. As a result, the dialogue by the dialogue system 770 can be developed in a way that is meaningful to the user.
[0129] In the explanations of the third, fourth, and fifth embodiments so far, it is assumed that the final causal conclusion includes a word designated as a related word or a word close to that word, but this is not necessarily required, and learning may also be performed in cases where an expression representing a topic is not included in the conclusion chain.
[0130] 15 is an external view of a computer system for realizing each of the above embodiments. Fig. 16 is a hardware block diagram of the computer system shown in Fig. 15.
[0131] 15, 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.
[0132] 16 , 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. Computer 970 further includes a ROM (Read-Only Memory) 996 connected to bus 1010 and storing a boot-up program of computer 970, a RAM (Random Access Memory) 998 connected to 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 a non-volatile memory connected to bus 1010. The SSD 1000 is for storing 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 that enables communication with other terminals, and a USB (Universal Serial Bus) port 1006 to which a USB memory 984 can be attached or detached and that provides communication between the USB memory 984 and each unit within the computer 970.
[0133] The computer 970 further includes an audio I / F 1004 connected to the microphone 982, the speaker 980, and the bus 1010. The audio I / F 1004 reads 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, performs analog conversion and amplification processing, and drives the speaker 980, and digitizes analog audio signals from the microphone 982 and stores them in the RAM 998 or the SSD 1000 at any address specified by the CPU 990.
[0134] In the above embodiments, the programs for implementing the dialogue systems 50, 300, 600, and 770 or parts thereof, such as the training data generation devices 54 and 610, the training device 56, the dialogue devices 52, 302, 612, and 730, and the training data augmentation unit 58, the neural network parameters and neural network programs, as well as the training data, causal relationships, causal consequence chains, and expected inputs, are all stored, for example, in the SSD 1000, RAM 998, DVD 978, or USB memory 984 shown in FIG. 16 , or in a storage medium of an external device (not shown) connected via the network I / F 1008 and the network 986. Typically, these data and parameters are written to the SSD 1000 from an external device and loaded into the RAM 998 when the computer 970 executes the program. In some cases, part of the code executed by the program may be loaded into the RAM 998 from outside the computer 970 via the network 986 during execution.
[0135] Computer programs for operating this computer system to realize the functions of the systems and their components of the above-described embodiments are stored on a DVD 978 inserted into a DVD drive 1002 and transferred from the DVD drive 1002 to the SSD 1000. Alternatively, these programs may be stored in a USB memory 984, which may be inserted into a USB port 1006 and transferred to the SSD 1000. Alternatively, the programs may be transmitted to the computer 970 via a network 986 and stored in the SSD 1000.
[0136] The program is loaded into RAM 998 when executed. Of course, a source program may be input using the keyboard 974, monitor 972, and mouse 976, and the compiled object program may be stored in SSD 1000. In the case of a scripting language, a script input using the 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. Because training and testing of a neural network involves a large amount of calculation, it is preferable to realize each part of an embodiment of the present invention as an object program consisting of native computer code rather than a scripting language.
[0137] 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. 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 a network. 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.
[0138] The program that enables the computer 970 to realize the functions of the systems and their components according to the above-described embodiments 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 are provided by an operating system (OS) or third-party programs running on the computer 970, or by modules of various toolkits installed on the computer 970. Therefore, the program does not necessarily include all of the functions required to realize the systems and methods of the embodiments. The program may include only instructions that execute the operations of the above-described devices and their components by statically linking appropriate functions or functions of a "program library" in a controlled manner to achieve the desired results, or by dynamically calling these functions during program execution. The method for operating the computer 970 in this manner is well known, and will not be repeated here.
[0139] 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.
[0140] Seventh Modification In the above embodiment, the causal relations collected from the web are used as they are, and only appropriate extended causal relations are used. However, the present invention is not limited to such an embodiment. For example, the causal relations used for training may be filtered in some way. As an example, causal relations with a positive or negative sentiment polarity may be selected. Only causal relations whose affinity with a specific topic is determined by a topic word model may be used. In the first place, responses may be manually or automatically labeled as appropriate for the dialogue, and only those determined to be appropriate may be used.
[0141] The neural network used in the above embodiment is a pre-trained neural network (for example, the aforementioned BERT) that has been fine-tuned using training data prepared from causal relationships. However, the neural network is not limited to this type of network, and it is also possible to use a network that produces causal conclusions when given input in a special format, such as GPT-3 described in the following literature:
[0142] Reference: Tom B. Brown et al., Language Models are Few-Shot Learners, https: / / arxiv.org / pdf / 2005.14165.pdf. When generating a response, the system may, for example, repeat user input and further transform it according to deep learning neural networks or rules, such as sentence-final expressions, before returning the response. In response to the user's back-and-forth in response to the dialogue system's response, the system may trace further causal relationships and present the conclusion in the form of a response. Separate training data may be created to determine how to interpret the back-and-forth, using a neural network trained by deep learning. If the user has a negative reaction to the dialogue system's response, a "why" question may be posed, and the system may search for causal relationships with the wording used in the response as the conclusion, and present the cause. Similarly, the process by which the response was generated may be explained to the user.
[0143] Conversely, if the user responds positively to the response of the dialogue system, a causal relationship having the wording of the response in the consequence part may be searched for, and a response may be generated from the cause part.
[0144] Furthermore, in the second to fifth embodiments, a word or expected input is added to the user input 102, 630, 740, 780. However, the present invention is not limited to such an embodiment. A combination of the word and expected input to be added may be converted into a fixed-length feature vector by an encoder consisting of a neural network, and this feature vector may be added to the user input 102, 630, 740, 780 and used as the input to the response generation neural network 340, 632.
[0145] 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 scope of the claims, taking into consideration the description of the detailed description of the invention, and includes all modifications within the meaning and scope equivalent to the wording described therein.
[0146] 50, 300, 600, 770 Dialogue system 52, 302, 612, 730 Dialogue device 54, 610 Training data generation device 56 Training device 58 Training data expansion unit 60 Internet 62 Causal relationship extraction unit 64 Causal relationship DB 66 Chain causal relationship generation unit 68 Generated causal relationship DB 70 Chain causal relationship selection unit 72 Chain causal relationship DB 74 Extended causal relationship DB 76 Expected input extraction unit 78 Expected input storage unit 80 Console 82, 626 Training data creation unit 84 Training data storage unit 86 Training unit 100, 340, 632 Response generation neural network 102, 630, 740, 780 User input 104, 638, 754, 786 Speech shaping unit 106, 640, 756, 788 Response utterance 150 Expected input reading unit 152 Noun phrase identification unit 154 Causal relationship search unit 156 Training data sample creation unit 330, 344 Topic word model 332 Related expression search unit 334 Training data addition unit 338, 642 Information addition device 346 User input storage unit 348 Word selection unit 350, 752 Utterance selection unit 352 Information addition unit 360 Training data reading unit 362 Related expression query unit 364 Training data writing unit 366 Related expression addition unit 400 Related expected input search unit 402 Related word search unit 404 Related expression development unit 406 Related expression output unit 614 Question answering system 620 Causal consequence chain generation unit 622 Causal consequence chain storage unit 624 Causal consequence chain DB 634 Question generation unit 750 Ranking unit 782 Chain count estimation unit
Claims
1. A training device for a dialogue device, comprising: expected input storage means for storing a plurality of expected inputs, each of which is expected as an input to a dialogue device; causal relationship storage means for storing a plurality of causal relationship expressions, each of which includes a cause expression and an effect expression; causal relationship expression extraction means for extracting, for each of the plurality of expected inputs stored in the expected input storage means, a causal relationship expression having a predetermined relationship as the expected input from the plurality of causal relationship expressions; training data creation means for inputting the expected inputs and creating training data samples with the causal relationship expressions extracted by the causal relationship expression extraction means as answers, and storing the training data samples in a predetermined storage device; and training means for training a dialogue device consisting of a neural network designed to generate output sentences for input sentences in natural language, using the training data samples stored in the training data creation means.
2. A training device as described in claim 1, wherein the causal relationship expression extraction means includes specific causal relationship expression extraction means for extracting, from the plurality of causal relationship expressions, a causal relationship having a noun phrase contained in the expected input as a cause expression.
3. The training device according to claim 1 or claim 2, further comprising: a topic word model that is pre-trained so that, when a word is given, it outputs the distribution probability of words surrounding the word for each word in a predetermined vocabulary; and a first training data sample adding means for identifying, for each causal relationship expression of training data samples stored in the predetermined storage device, words with a high distribution probability for words included in the causal relationship expression based on the output of the topic word model, and adding the words to the input of the training data sample to generate a new training data sample and adding the new training data sample to the predetermined storage device.
4. The training device according to claim 3, further comprising a second training data sample adding means for extracting, for each causal relationship expression of the training data sample stored in the predetermined storage device, sentences having a distribution probability of surrounding words similar to the distribution probability of the surrounding words of the causal relationship expression from a predetermined corpus based on the output of the topic word model, and adding the extracted sentences to the input of the training data sample to generate a new training data sample and adding the new training data sample to the predetermined storage device.
5. A natural language dialogue device including a neural network designed to generate output sentences for natural language input sentences, the neural network being trained such that the output sentences represent potential consequences for the input sentences.
6. The dialogue device according to claim 5, further comprising a related expression adding means for, in response to an input sentence being given, adding a related expression to the input sentence, the related expression being an expression containing a word or sentence related to a phrase in the input sentence, and inputting the related expression to the neural network.
7. A dialogue device comprising: an utterance memory unit that stores a user's past utterances; a topic model that outputs a probability distribution of the occurrence of surrounding words for an input word; and a response generation unit that receives a user utterance as input and generates a response to the user utterance using the user utterance stored in the utterance memory unit and the topic model.
8. A dialogue device comprising: an utterance memory unit that stores a user's past utterances; a topic model that outputs a probability distribution of the occurrence of surrounding words for an input word; a response generation unit that takes a user's utterance as input and generates a response to the utterance; and a response generation adjustment unit that adjusts the generation of the response by the response generation unit based on the output of the topic model for the user's utterance.