Response sentence generation device, response conversion learning device, database generation device, response sentence generation method, and program
The response sentence generation device uses a neural network with an encoder and decoder to generate responses that accurately reflect the semantic difference between input and example sentences, enhancing dialogue system performance by leveraging a pseudo example response database for fine-tuning.
Patent Information
- Application Number
- JP2023024133
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-02-20
- Publication Date
- 2024-08-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing example-response-based dialogue systems struggle to generate response sentences that precisely capture the semantic difference between input utterances and pre-prepared example sentences, as they are trained on general-purpose language data using self-encoders.
A response sentence generation device employing a neural network with an encoder, semantic difference vector generation, and decoder to select and convert input utterances to generate response sentences that accurately reflect the semantic difference between input and example sentences, using a pseudo example response database for fine-tuning.
Enables the generation of response sentences that precisely capture the semantic difference between input and example sentences, improving the accuracy and relevance of dialogue responses.
Smart Images

Figure 2024117996000001
Abstract
Description
[Technical field]
[0001] The present disclosure relates to natural language processing and automatic response technology, and in particular to response sentence generation in an example-response-based dialogue system that conducts dialogue based on an example-response database that stores multiple pairs of expected user inputs (example sentences) and their corresponding response sentences. [Background technology]
[0002] Dialogue systems based on example-based learning are widespread because they are simple and robust. Conventional dialogue technologies based on example-based learning use a neural network encoder-decoder model to train a response converter as an autoencoder using a large-scale language corpus (general-purpose language data), which can flexibly respond to utterances that are not intended as example sentences and generate response sentences (see, for example, Non-Patent Document 1). [Prior art documents] [Non-patent literature]
[0003] [Non-Patent Document 1] Ryota Yahagi, Takashi Nose, Akinori Ito, A Study on Flexible Response Generation Methods Using Sentence Vectors for Example-Based Dialogue Systems, Proceedings of the Autumn Conference on Acoustics, pp.809-812, 2021 Summary of the Invention [Problem to be solved by the invention]
[0004] However, the technology in Non-Patent Document 1 is an autoencoder trained from general-purpose language data, and has the problem that it cannot generate a response sentence that precisely captures the semantic difference between an input utterance sentence and a prepared example sentence.
[0005] Therefore, the present disclosure has been made to solve the above-mentioned problems, and aims to provide a technology for generating a response sentence that precisely captures the semantic difference between an input utterance sentence and a prepared example sentence. [Means for solving the problem]
[0006] In order to solve the above problem, a response sentence generation device according to an aspect of the present disclosure includes a response selection unit, an encoder, a semantic difference vector generation unit, and a decoder. The response selection unit determines an example sentence that satisfies a predetermined condition based on an input utterance sentence, which is an utterance of an input user, from an example response database having a plurality of pairs, each pair being made up of an example sentence and a response sentence corresponding to the example sentence, and selects the determined example sentence and the response sentence corresponding to the example sentence. The encoder converts the input utterance sentence, the selected example sentence, and the selected response sentence into an input utterance semantic vector, an example semantic vector, and a response semantic vector, which are semantic vectors of each sentence. The semantic difference vector generation unit generates a semantic difference vector from the difference between the input utterance semantic vector and the example semantic vector. The decoder adds the semantic difference vector and the response semantic vector to convert the semantic difference vector into a response vector that reflects the difference in meaning between the input utterance sentence and the selected example sentence, and generates a converted response sentence, which is a response sentence to the input utterance sentence, from the response vector. Effect of the Invention
[0007] According to the present disclosure, the response conversion unit 20 of the response sentence generation device 1 creates a pseudo example response database by extracting pairs of utterance sentences and response sentences similar to the example response database from the training dialogue corpus, and performs learning (fine tuning) to update the parameters of the neural network using this pseudo example response database. Therefore, it is possible to generate response sentences that precisely capture the semantic differences between the input utterance sentences and the example sentences prepared in advance. [Brief description of the drawings]
[0008] [Figure 1] FIG. 1 is a diagram illustrating an example of a functional configuration of a response sentence generation device according to an embodiment of the present disclosure. [Diagram 2] FIG. 2 is a diagram illustrating an example of a process flow of a response sentence generation method according to an embodiment of the present disclosure. [Diagram 3] FIG. 3 is a diagram illustrating an example of a functional configuration of a response transformation learning device according to an embodiment of the present disclosure. [Figure 4] FIG. 4 is a diagram illustrating an example of a process flow of a response transformation learning method according to an embodiment of the present disclosure. [Diagram 5] FIG. 5 is a diagram illustrating an example of a functional configuration of a database creation device according to an embodiment of the present disclosure. [Figure 6] FIG. 6 is a diagram illustrating an example of a process flow of a database creation method according to an embodiment of the present disclosure. [Figure 7] FIG. 7 is a diagram illustrating an example of a functional configuration of an autoencoding learning device according to an embodiment of the present disclosure. [Figure 8] FIG. 8 is a diagram illustrating an example of a process flow of the auto-encoding learning method according to an embodiment of the present disclosure. [Figure 9] FIG. 9 is a diagram illustrating a case where an input utterance sentence x, which is an utterance by a user, is input in an example of a functional configuration of a response sentence generation device according to a modified example of an embodiment of the present disclosure. [Figure 10] FIG. 10 is a diagram illustrating an example of a process flow of a response sentence generation method in a response sentence generation device according to a modified example of an embodiment of the present disclosure. [Figure 11] FIG. 11 is a diagram showing an example of a functional configuration of a response sentence generation device according to a modified example of an embodiment of the present disclosure, where an utterance sentence Si e and a response sentence Si r corresponding to the utterance sentence Si e are input from the training dialogue corpus D3. [Figure 12] FIG. 12 is a diagram showing an example of a process flow of a learning method of the response transforming unit 20a according to a modified example of the embodiment of the present disclosure. [Figure 13] FIG. 13 is a diagram illustrating an example of the functional configuration of a computer. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] <Character notation> The symbol used in a sentence with a subscript "e " (superscript e), and " r " (superscript r) should be written directly above the subscript that follows it, but due to limitations in text notation, it is written directly after the subscript. In mathematical formulas, these symbols are written in their proper position, that is, directly above the subscript. For example, "S i e " is expressed in the formula as follows.
number
number
[0010] [Response generation device] As shown in FIG. 1, the response sentence generation device 1 according to the embodiment of the present disclosure has a response selection unit 10 and a response conversion unit 20. The response conversion unit 20 is a neural network and has an encoder 21, a semantic difference vector generation unit 22, and a decoder 23. The response sentence generation device 1 uses an example response database D1 and a learned parameter database P2, which may be provided in the response sentence generation device 1, or at least one of them may be provided separately from the response sentence generation device 1 as long as they can be accessed by the response sentence generation device 1. The response sentence generation device 1 is a device that generates and outputs a converted response sentence v, which is a response sentence corresponding to an input utterance sentence x, from an input input utterance sentence x. The response sentence generation device 1 performs the response sentence generation method of this embodiment by implementing the processing flow shown in FIG. 2.
[0011] The response selection unit 10 determines an example sentence x' having the highest similarity to an input utterance sentence x, which is an utterance of an input user, from an example response database D1 having a plurality of pairs, each pair being made up of an example sentence and a response sentence corresponding to the example sentence, and selects the determined example sentence x' and the corresponding response sentence y' and outputs them to the encoder 21 (step S10). The input utterance sentence x is input to the response selection unit 10 and the encoder 21. As a method for realizing this, for example, an input unit may be provided as a processing unit preceding the response selection unit 10, and the input unit may receive the input utterance sentence x and output the received input utterance sentence x to both the response selection unit 10 and the encoder 21. Alternatively, the response selection unit 10 may be configured to output the input utterance sentence x to the encoder 21 in addition to the example sentence x' and the response sentence y'. Here, "the example sentence x' with the highest similarity" means that the response sentence generation device 1 is able to generate a converted response sentence v that precisely captures the semantic difference between the input utterance sentence x and a prepared example sentence. Therefore, the example sentence may be selected as the example sentence x' if it satisfies a specified condition, such as ensuring a similarity that satisfies a specified threshold, and is not limited to the highest similarity in the strict sense.
[0012] The encoder 21 converts the input utterance sentence x, the selected example sentence x', and the selected response sentence y' into the semantic vectors of each sentence, that is, the input utterance semantic vector ^x, the example semantic vector ^x', and the response semantic vector ^y', and outputs the input utterance semantic vector ^x and the example semantic vector ^x' to the semantic difference vector generation unit 22, and outputs the response semantic vector ^y' to the decoder 23 (step S21). The semantic difference vector generating unit 22 generates a semantic difference vector ^w from the difference between the input utterance semantic vector ^x and the example semantic vector ^x', and outputs it to the decoder 23 (step S22).
[0013] The decoder 23 adds the semantic difference vector ^w and the response semantic vector ^y' to convert it into a response vector ^v that reflects the difference in meaning between the input utterance sentence x and the selected example sentence x' (step S23-1). Next, the decoder 23 generates a converted response sentence v, which is a response sentence to the input utterance sentence x, from the response vector ^v and sets it as an output of the response sentence generation device 1 (step S23-2).
[0014] By using the response sentence generation device 1 of the present disclosure, it is possible to generate a response sentence that precisely captures the semantic difference between the input utterance sentence x and the prepared example sentence x'. Note that, although a Transformer-based encoder-decoder model is given as an example of the response conversion unit 20 shown in Fig. 1, other models may be used as long as they are neural networks having an encoder that converts a sentence into a semantic vector and a decoder that generates a sentence from the semantic vector.
[0015] [Response transformation learning device] The above-mentioned process performed by the response conversion unit 20 is learned using a response conversion learning device 300. As shown in FIG. 3, the response conversion learning device 300 according to the embodiment of the present disclosure has a response conversion unit 310 and a parameter update unit 320. The response conversion unit 310 is a neural network and has an encoder 311, a semantic difference vector generation unit 312, and a decoder 313. The response conversion learning device 300 uses an example response database D1, a pseudo example response database D2, a first parameter P31, and a second parameter P'32, which may be configured to be provided within the response conversion learning device 300, or at least one of them may be provided separately from the response conversion learning device 300 as long as they can be accessed from the response conversion learning device 300. The response conversion learning device 300 converts an example sentence T input from the example response database D1 into a semantic difference vector. j e and response text T j r and a sentence S input from the pseudo-example response database D2. k e and response text S k rThe response conversion learning device 300 performs the response conversion learning method of this embodiment by implementing the process flow shown in FIG.
[0016] The response conversion learning device 300 is j e Toko's example sentence T j e Response text T corresponding to j r A database D1 of example responses having a plurality of pairs of the above, and one pair of the pairs is a spoken sentence S k e This utterance S k e Response sentence S corresponding to k r Each pair uses one of the pairs in the example-based response database D1 and the pseudo example-based response database D2 that satisfies the formulas (3) and (4) described later. The pseudo example-based response database D2 is a database created by the database creation device 400 described later.
[0017] Here, if M, N, and Q (M>N,M>Q) are natural numbers, then the above (T j e ,T j r ) indicates the jth (j=1, 2, ..., N) example sentence and response sentence in the example-response database D1. k e ,S k r ) denotes the kth (k=1,2,...Q)th utterance and response sentence pair renumbered for convenience, which satisfies the i (i=1,2,...M)th utterance and response sentence pair in the training dialogue corpus D3 described below and satisfies the formulas (3) and (4) described below.
[0018] The encoder 311 uses the first parameter P31 to generate a set of example sentences T j e and response text T jr and a spoken sentence S , which is an utterance sentence input from a pseudo example-answer database D2 in which data satisfying this set and formulas (3) and (4) described later are stored. k e and the semantic vector of each sentence, the example semantic vector ^T j e , the response semantic vector ^T j r , and the input utterance semantic vector ^S k e and convert it into the example semantic vector ^T j e and the input utterance semantic vector ^S k e and is output to the semantic difference vector generating unit 312, and the response semantic vector ^T j r to the decoder 313 (step S311). j e and a sentence S input from the pseudo-example response database D2. k e (That is, the utterance S in the training dialogue corpus D3 i e It is preferable to configure the response transformation learning device 300 so that the inputted similarity satisfies a predetermined similarity, for example, satisfies the condition of equation (3) described later.
[0019] The first parameter P31 used by the encoder 311 is, for example, learned by an autoencoding learning device 500 described later, but a previously learned parameter may also be used. k e Response sentence S corresponding to k r is output from the pseudo example response database D2 to the parameter update unit 320.
[0020] The semantic difference vector generation unit 312 generates the input utterance semantic vector ^S k e and the example semantic vector ^T j eA semantic difference vector ^w is generated from the difference between and is output to the decoder 313 (step S312).
[0021] The decoder 313 uses the second parameter P'32 to generate the semantic difference vector ^w and the response semantic vector ^T j r Adding and to the input utterance S k e The input example sentence T j e Next, the decoder 313 converts the utterance sentence S from the response vector ^v into a response vector ^v that reflects the difference in meaning between the utterance sentence S k e The decoder 313 generates a converted response sentence v corresponding to the converted response sentence v and outputs it to the parameter update unit 320 (step S313-2). The second parameter P'32 used by the decoder 313 as an initial value is, for example, learned by the autoencoding learning device 500 described later, but a learned parameter that has been learned in advance may also be used.
[0022] There are various methods for generating the response vector ^v in step S313-1. For example, as shown in the following formula (1), the semantic difference vector ^w (i.e., the input utterance semantic vector ^S k e and the example semantic vector ^T j e One method is to over-reflect semantic difference information by multiplying the weight G by the difference between
number
[0023] As another example, as shown in the following formula (2), the semantic difference vector ^w (input utterance semantic vector ^S k e and the example semantic vector ^T j e ) and the response semantic vector ^T j rOne method is to use a neural network to learn the weights W of the vectors. Here, ";" indicates that two vectors are connected.
number
[0024] The parameter update unit 320 converts the converted response sentence v and the response sentence S input from the pseudo example response database D2. k r If the error between the utterance sentence S and the second parameter P'32 does not satisfy the condition for terminating the learning, the second parameter P'32 is updated based on a predetermined rule (step S320-1), and the learning is continued by repeating the above-mentioned processes from step S311 based on the next data from the example response database D1 and the pseudo example response database D2. Here, as an example of the updating method in step S320-1, the error is defined by a cost function (error function), and the parameters are configured so as to minimize this cost function. This learning is repeated for all utterance sentences S k e , response text S k r However, a predetermined rule may be set, such as an upper limit on the number of times learning is performed.
[0025] If the above error satisfies the learning termination condition, the first parameter P31 and the second parameter (second parameter P32) used immediately before are output as learned parameters, and a learned parameter database P2 is generated (step S320-2). The response conversion unit 310, which has become a learned model through the above learning, has a function equivalent to that of the response conversion unit 20 in the response sentence generation device 1. Hereinafter, learning in this response conversion learning device 300 is also referred to as "fine tuning".
[0026] [Database creation device] The pseudo example-response database D2 described above is a database created using a database creation device 400. As shown in FIG. 5, the database creation device 400 according to the embodiment of the present disclosure has a similarity calculation unit 410 and a database generation unit 420. The database creation device 400 uses an example-response database D1 and a learning dialogue corpus D3, which may be configured to be provided within the database creation device 400, or at least one of them may be provided separately from the database creation device 400 as long as they can be accessed from the database creation device 400. The database creation device 400 generates an example sentence T input from the example-response database D1. j e and response text T j r and a sentence S input from the training dialogue corpus D3. i e and response text S i r and extracts sentence combinations that satisfy a predetermined similarity to create a pseudo example response database D2. The database creation device 400 performs the database creation method of this embodiment by implementing the process flow shown in FIG.
[0027] The training dialogue corpus D3 consists of a set of utterances S i e and utterance S i e Response sentence S corresponding to i r The training dialogue corpus D3 is a database that has a larger number of pairs than the example-response database D1. The training dialogue corpus D3 is conversation data such as tweet-reply pairs and transcriptions of natural conversations.
[0028] If M and N (M>N) are natural numbers, then (S i e ,S i r) denotes the i (i = 1, 2, ... M)th utterance and response sentence in the training dialogue corpus D3. sim(x, y) denotes the similarity between vector x and vector y. θ sim is a predetermined threshold value. The calculation of the sentence similarity may be performed by any method that expresses the similarity between texts. One example is cosine similarity. The sentence vector may be performed by any method that expresses information contained in a sentence as a vector of a predetermined dimension. One example is a conversion model such as Sentence-BERT.
[0029] The similarity calculation unit 410 calculates the similarity of the utterance S input from the training dialogue corpus D3. i e and an example sentence T input from the example response database D1. j e The first similarity sim(S i e ,T j e ) is calculated. The similarity calculation unit 410 also calculates the similarity of the response sentence S i r and a response sentence T input from the example response database D1 j r The second similarity sim(S i r ,T j r ) is calculated (step S410). In step S410, a maximum of M×N similarities are calculated, but a predetermined rule may be set, such as determining an upper limit on the number of similarities to be calculated in advance based on the amount of data in the training dialogue corpus D3. The database generation unit 420 uses the calculated first similarity and second similarity to generate a set of data (S k e ,S k r ) are extracted from the training dialogue corpus D3 to create a pseudo example response database D2 (step S420).
number
number
[0030] By creating the pseudo example-answer database D2 by the above-mentioned processing of the database creation device 400, the set of the example-answer database D1 (example sentence T j e , response text T j r By creating the pseudo example response database D2, the response conversion learning device 300 can densely collect sentence pairs that are similar to the utterance sentence S i e and Example Sentence T j e This enables training of a response converter that can precisely grasp the difference in meaning between the original and the example response database D1. In other words, it becomes possible to generate a converted response sentence v that has a meaning close to that of the original example response database D1 and that is closer to the user's intention.
[0031] In addition, when creating the pseudo example response database D2, by selecting a specific type of learning dialogue corpus D3, it becomes possible to apply it to psychological states and mental attitudes.
[0032] For example, if a pseudo example response database D2 is created using an emotional dialogue corpus such as JEmpatheticDialogues in the learning dialogue corpus D3, this pseudo example response database D2 can be used for learning in the response conversion learning device 300, making it possible to apply it to psychological states such as emotions. As an example, a vector expressing a happy emotion can be extracted from an utterance sentence expressing a happy emotion and an example sentence, and a positive converted response sentence matching the input utterance sentence can be generated.
[0033] Furthermore, if a pseudo example response database D2 is created in the learning dialogue corpus D3 using, for example, an utterance style corpus, this pseudo example response database D2 can be used for learning in the response conversion learning device 300, making it possible to apply it to mental attitudes such as familiarity. For example, if you have a close relationship with your conversation partner, you can generate a friendly converted response sentence, and so on, thereby generating a response sentence that is more appropriate for your relationship with your conversation partner.
[0034] [Self-encoding learning device] The first parameter P31 and the second parameter P'32 used by the response transformation learning device 300 described above are output as a result of learning using the autoencoding learning device 500. As shown in FIG. 7, the autoencoding learning device 500 according to the embodiment of the present disclosure has an autoencoding unit 510 and a parameter update unit 520. The autoencoding unit 510 is a neural network and has an encoder 511 and a decoder 512. The autoencoding learning device 500 uses a language database D4, a first learning parameter P'51, and a second learning parameter P'52, which may be configured to be provided within the autoencoding learning device 500, or at least one of them may be provided separately from the autoencoding learning device 500 as long as they can be accessed from the autoencoding learning device 500.
[0035] The autoencoding learning device 500 is a device that generates a first parameter P31 and a second parameter P'32, which are learned parameters in the autoencoding learning device 500, by causing the autoencoding unit 510 to learn to convert a sentence z input from a language database D4 into a restored sentence z', using the autoencoding unit 510. The autoencoding learning device 500 performs the autoencoding learning method of this embodiment by implementing the process flow shown in Fig. 8. The language database D4 used by the autoencoding learning device 500 is a relatively large-scale of language data, such as article data from Wikipedia (registered trademark).
[0036] The encoder 511 uses the first training parameter P'51 to compress (encode) the sentence z input from the language database D4 and outputs the compressed sentence to the decoder 512 (step S511).
[0037] The decoder 512 uses the second learning parameter P'52 to decompress the input compressed sentence z and generate a decompressed sentence z' (step S512).
[0038] If the error between sentence z and restored sentence z' does not satisfy the learning termination condition, the parameter update unit 520 updates the first learning parameter P'51 and the second learning parameter P'52 based on a predetermined rule. Next, the parameter update unit 520 repeats the process from step S511 onwards for the next data from the language database D4 (step S520-1). Here, as an update method for step S520-1, for example, the error is defined by a cost function (error function) and parameters are configured so as to minimize this cost function. Learning may be performed for all data held by the language database D4, or a predetermined rule may be set, such as an upper limit on the number of times learning is performed.
[0039] When the above-mentioned error satisfies the condition for terminating learning, the parameter update unit 520 outputs the first learning parameter P'51 and the second learning parameter P'52 used immediately before as the learned parameters, the first parameter P31 and the second parameter P'32 (step S520-2).
[0040] As described above, the response sentence generation device 1 of the present disclosure has the response conversion unit 20. The response conversion unit 20 has a function equivalent to the trained response conversion unit 310 that has been fine-tuned by the response conversion learning device 300. The response conversion unit 310 is fine-tuned using the pseudo example response database D2, which is a database that satisfies the predetermined similarity indicated by the above-mentioned formulas (3) and (4), based on the example response database D1. That is, the response conversion unit 20 of the response sentence generation device 1 is fine-tuned using the pseudo example response database D2. Therefore, it is possible to generate a response sentence (converted response sentence v) that precisely captures the semantic difference between the input utterance sentence (input utterance sentence x) and the previously prepared example sentence (response sentence y').
[0041] [Modification of response sentence generation device] The above-mentioned response sentence generation device 1 may be configured as a response sentence generation device 2 described below. As shown in FIG. 9, the response sentence generation device 2 according to the modified embodiment of the present disclosure has a response selection unit 10a, a response conversion unit 20a, and a learning unit 30. The response conversion unit 20a is a neural network and has an encoder 21a, a semantic difference vector generation unit 22a, and a decoder 23a. The response sentence generation device 2 uses an example response database D1, a learning dialogue corpus D3 (see FIG. 11), and a parameter database Pa2, which may be configured to be provided within the response sentence generation device 2, or at least one of them may be provided separately from the response sentence generation device 2 as long as they can be accessed from the response sentence generation device 2.
[0042] The response sentence generation device 2 has, as one of its functions, a function of outputting a converted response sentence v which is a response sentence corresponding to the input utterance sentence x from the inputted input utterance sentence x. The parameter database Pa2 has at least a first parameter P31 and a second parameter P'32, and is a database in which the second parameter P32 is stored through learning. As shown in Fig. 9, when an input utterance sentence x which is an utterance of a user is inputted, the response sentence generation device 2 outputs a converted response sentence v which is a response sentence corresponding to the input utterance sentence x by carrying out the process flow shown in Fig. 10.
[0043] The response selection unit 10a performs a process equivalent to the above-mentioned step S10 (step S10a). The encoder 21a performs a process equivalent to the above-mentioned step S21 (step S21a). The semantic difference vector generation unit 22a performs a process equivalent to the above-mentioned step S22 (step S22a). The decoder 23a performs a process equivalent to the above-mentioned steps S23-1 and S23-2 (steps S23a-1, S23a-2).
[0044] In addition to the above functions, the response sentence generation device 2 has another function of training the response conversion unit 20a and updating the parameter database Pa2. As shown in FIG. 11, the response sentence generation device 2 extracts utterance sentences S from the training dialogue corpus D3. i e and utterance S i e Response sentence S corresponding to i r When this is input, the process flow shown in FIG. 12 is executed to cause the response conversion unit 20a to learn and update the parameter database Pa2.
[0045] The similarity calculation unit 410a calculates the utterance sentence S i e and an example sentence T input from the example response database D1. j e The first similarity sim(S i e ,T je ) and the response sentence S input from the training dialogue corpus D3. i r and a response sentence T input from the example response database D1 j r The second similarity sim(S i r ,T j r ) and calculate the result of the calculation and the utterance sentence S i e and response text S i r and are output to the parameter update unit 31 (step S410a).
[0046] If the calculated first similarity and second similarity do not satisfy at least one of the conditions of the above-mentioned equation (3) and equation (4), the parameter update unit 31 ends the processing in this loop and starts the processing from step S410a described above based on the next data from the training dialogue corpus D3.
[0047] If the calculated first similarity and second similarity satisfy both the conditions of the above-mentioned formula (3) and formula (4), the parameter update unit 31 notifies the encoder 21a of the example sentence T j e and the corresponding response T j r , and utterance S k e Using the first parameter P31, we obtain the example meaning vector ^T j e , the response semantic vector ^T j r , and the input utterance semantic vector ^S k e In addition, the parameter update unit 31 converts the input utterance semantic vector ^S k e and the example semantic vector ^T j e and output to the semantic difference vector generating unit 22a, and the response semantic vector ^T j rto the decoder 23a (step S21a). k e , Response S k r is an utterance S that satisfies both the above formula (3) and formula (4). i e , Response S i r By carrying out the above process, the example sentence T j e and utterance S k e (That is, the utterance S in the training dialogue corpus D3 i e ) means that the input satisfies the condition of the above formula (3).
[0048] The parameter update unit 31 transmits to the semantic difference vector generation unit 22a the input utterance semantic vector ^S k e and the example semantic vector ^T j e A semantic difference vector ^w is generated from the difference between them and is output to the decoder 23a (step S22a).
[0049] The parameter update unit 31 uses the second parameter P'32 to update the response semantic vector ^T j r and the semantic difference vector ^w in step S22a, the utterance sentence S i e and Example Sentence T j e The response vector ^v is converted into a response vector ^v that reflects the difference in meaning between the utterance S and the k e The converted response sentence v, which is a response sentence to the request, is generated and output to the parameter update unit 31 (step S23a-2).
[0050] The parameter update unit 31 converts the converted response sentence v and the input response sentence S from the training dialogue corpus D3.i r If the error does not satisfy the specified condition for ending learning, the second parameter P'32 is updated (step S31-1), and learning is repeated by performing the processing from step S410a described above based on the data from the next training dialogue corpus D3.
[0051] If the error satisfies the condition for terminating learning, the second parameter P'32 used immediately before is output to the parameter database Pa2 as the second parameter P32, which is a learned parameter (step S31-2).
[0052] The above-mentioned response sentence generation device 2 can also precisely grasp the semantic difference between the input utterance sentence and the prepared example sentence. In addition, the response sentence generation device 2, configured as described above, also has a learning function for response conversion.
[0053] [Programs, recording media] The various processes described above can be implemented by loading a program for executing each step of the above method into the recording unit 2020 of the computer 2000 shown in FIG. 13, and operating the control unit 2010, input unit 2030, output unit 2040, display unit 2050, etc.
[0054] The program describing the processing contents can be recorded on a computer-readable recording medium, which may be, for example, a magnetic recording device, an optical disk, a magneto-optical recording medium, a semiconductor memory, or any other type of recording medium.
[0055] The program may be distributed, for example, by selling, transferring, lending, etc. portable recording media such as DVDs and CD-ROMs on which the program is recorded. Furthermore, the program may be distributed by storing the program in a storage device of a server computer and transferring the program from the server computer to other computers via a network.
[0056] A computer that executes such a program, for example, first stores the program recorded on a portable recording medium or the program transferred from a server computer in its own storage device. Then, when executing a process, the computer reads the program stored in its own recording medium and executes a process according to the read program. As another execution form of the program, the computer may directly read the program from the portable recording medium and execute a process according to the program, or may execute a process according to the received program each time a program is transferred from the server computer to the computer. The above-mentioned process may be executed by a so-called ASP (Application Service Provider) type service that realizes a processing function only by issuing an execution instruction and obtaining a result, without transferring a program from the server computer to the computer. Note that the program in this embodiment includes information used for processing by an electronic computer and equivalent to a program (data that is not a direct command to the computer but has a nature that specifies the processing of the computer, etc.).
[0057] In addition, in this embodiment, the present device is configured by executing a specific program on a computer, but at least a part of the processing contents may be realized by hardware. [Explanation of symbols]
[0058] 1. Response sentence generation device 2. Response sentence generation device 10 Response selection unit 21, 311, 511 Encoder 22 Semantic difference vector generation unit 30 Learning unit 312 Semantic difference vector generation unit 300 Response transformation learning device 20, 20a, 310 Response conversion unit 23, 23a, 313, 512 Decoder 31,320,520 Parameter Update Section 400 Database creation device 410 Similarity calculation unit 420 Database generation unit 500 Self-encoding learning device 510 Autoencoder D1 Example response database D2 Pseudo-Example Response Database D3 Training Dialogue Corpus D4 Language Database P31 First Parameter P32,P'32 Second parameter P'51 First learning parameter P'52 Second learning parameters P2 Learned parameter database Pa2 Parameter Database S i e ,S k e Speech S i r ,S k r ,T j r Response ^S k e ,^x Input utterance semantic vector T j e ,x' Example sentence ^T j e ,^x' Example Semantic Vector ^T j r ,^y' Response meaning vector v Transformed response sentence ^v response vector ^w semantic difference vector x Input utterance y' Response sentence z sentence z' restored sentence θ sim Threshold
Claims
1. a response selection unit that determines an example sentence that satisfies a predetermined condition based on an input utterance sentence that is an utterance of an input user from an example response database having a plurality of pairs, each pair being made up of an example sentence and a response sentence corresponding to the example sentence, and selects the determined example sentence and the response sentence corresponding to the example sentence; an encoder that converts the input utterance sentence, the selected example sentence, and the selected response sentence into an input utterance semantic vector, an example semantic vector, and a response semantic vector, which are semantic vectors of each sentence; a semantic difference vector generation unit that generates a semantic difference vector from a difference between the input utterance semantic vector and the example semantic vector; a decoder that adds the semantic difference vector and the response semantic vector to convert the semantic difference vector into a response vector that reflects a difference in meaning between the input utterance sentence and the selected example sentence, and generates a converted response sentence that is a response sentence to the input utterance sentence from the response vector; A response sentence generating device having the above structure.
2. A response conversion learning device using an example response database having a plurality of pairs, each pair being made up of an example sentence and a response sentence corresponding to the example sentence, and a pseudo example response database having a plurality of pairs, each pair being made up of an utterance sentence and a response sentence corresponding to the utterance sentence, each pair satisfying a predetermined similarity with any pair in the example response database, an encoder using a first parameter that converts a set of example sentences and response sentences input from the example-response database and an input utterance sentence, which is an utterance sentence that satisfies the predetermined similarity between the set and the input utterance sentence input from the pseudo example-response database, into an example semantic vector, a response semantic vector, and an input utterance semantic vector, which are semantic vectors of each sentence; a semantic difference vector generation unit that generates a semantic difference vector from a difference between the input utterance semantic vector and the example semantic vector; a learning decoder using second parameters, which adds the semantic difference vector and the response semantic vector to convert the semantic difference vector into a response vector that reflects a difference in meaning between the input utterance sentence and the input example sentence, and generates a converted response sentence that is a response sentence to the input utterance sentence from the response vector; a parameter update unit that updates the second parameter when an error between the converted response sentence and the response sentence corresponding to the input utterance sentence does not satisfy a predetermined condition, and outputs the second parameter that has been used immediately before as a learned parameter when the error satisfies the predetermined condition; A response transformation learning device having the above-mentioned configuration.
3. M and N (M>N) are natural numbers, and (S i e , S i r ) is the i (i = 1, 2, ... M)th utterance and response sentence in the training dialogue corpus, and (T j e , T j r ) is the jth (j=1, 2, . . . N) example sentence and response sentence in the example-response database, sim(x, y) is the similarity between vector x and vector y, and θ sim is a predetermined threshold, The pseudo example response database is [0070] [0080] 3. The response conversion learning device according to claim 2, wherein utterances and response sentences satisfying the conditions of both of the above expressions are extracted from said training dialogue corpus and created.
4. The present invention uses an example-and-response database having a plurality of pairs, each pair being made up of an example sentence and a response sentence corresponding to the example sentence, and a training dialogue corpus having a greater number of pairs than the example-and-response database, each pair being made up of an utterance sentence and a response sentence corresponding to the utterance sentence, M and N (M>N) are natural numbers, and (S i e , S i r ) is the i-th (i = 1, 2, ... M) utterance and response sentence in the training dialogue corpus, and (T j e , T j r ) is the jth (j=1, 2, . . . N) example sentence and response sentence in the example-response database, sim(x, y) is the similarity between vector x and vector y, and θ sim If is the threshold, A first similarity sim(S i e , T j e ), and a second similarity sim(S i r , T j r ) a similarity calculation unit; The calculated first similarity and second similarity are expressed by the following formula: [0097] [0010] a database generating unit that extracts pairs of the utterance sentences and the response sentences that satisfy the conditions of both formulas from the training dialogue corpus to generate a database; having Database creation device.
5. A response sentence generation device using an example-response database having a plurality of example-response pairs, each pair being composed of an example sentence and a response sentence corresponding to the example sentence, a response selection unit that, when an input utterance sentence that is an utterance of a user is input, selects an example-response pair that satisfies a predetermined condition from the example-response database based on the input utterance sentence; a response conversion unit that uses the input utterance sentence and the selected example-response pair to generate a converted response sentence that is a response sentence to the input utterance sentence based on predetermined parameters; a similarity calculation unit that extracts, from a training dialogue corpus having a plurality of speech-response pairs, each of which is composed of an utterance sentence and a response sentence corresponding to the utterance sentence, speech-response pairs whose similarity with the example-response pairs included in the example-response database satisfies a predetermined condition; a parameter update unit that generates a converted response sentence by the response conversion unit using an utterance sentence included in the extracted utterance-response pair as the input utterance sentence and an example-response pair in the example-response database used for extraction by the similarity calculation unit as the selected example-response pair, and updates the parameters based on an error between the converted response sentence and the response sentence corresponding to the utterance sentence; A response sentence generating device having the above structure.
6. A response sentence generation method performed by a response sentence generation device having a response selection unit, an encoder, a semantic difference vector generation unit, and a decoder, comprising: the response selection unit determines an example sentence that satisfies a predetermined condition based on an input utterance sentence that is an utterance of the input user from an example response database having a plurality of pairs, each pair being made up of an example sentence and a response sentence corresponding to the example sentence, and selects the determined example sentence and the response sentence corresponding to the example sentence; The encoder converts the input utterance sentence, the selected example sentence, and the selected response sentence into a semantic vector of each sentence, that is, an input utterance semantic vector, an example semantic vector, and a response semantic vector; the semantic difference vector generation unit generates a semantic difference vector from a difference between the input utterance semantic vector and the example semantic vector; the decoder adds the semantic difference vector and the response semantic vector to convert the semantic difference vector into a response vector that reflects a difference in meaning between the input utterance sentence and the selected example sentence, and generates a converted response sentence that is a response sentence to the input utterance from the response vector. Response generation method.
7. A program for causing a computer to function as the response sentence generation device according to claim 1 or 5.
Citation Information
Patent Citations
Inquiry responding support apparatus and inquiry responding support system
JP2018181033A
Cited By
Information stabilization module (ICF module) that performs semantic convergence through phase correction.
JP7872912B1
