System and method for interactive dialogue
A method includes receiving natural-language input from a user. The method also includes receiving, from an information source, one or more candidate recommendations as potential responses to the natural-language input. The method further includes determining, based on a similarity between the natural-language input and a selected candidate recommendation among the one or more candidate recommendations, whether to respond to the natural-language input with natural-language output that includes (i) the selected candidate recommendation or (ii) a query for additional user input. In addition, the method includes providing, based on the determination, the natural-language output to the user.
1 . A method comprising:
receiving a natural-language input from a user, wherein the natural-language input from the user is associated with a first preference context;
receiving, from an information source, one or more first candidate recommendations as potential responses to the natural-language input, wherein the one or more first candidate recommendations are determined based on the first preference context;
determining, based on a similarity between the natural-language input and a first selected candidate recommendation among the one or more first candidate recommendations, whether to respond to the natural-language input with a first natural-language output comprising (i) the first selected candidate recommendation or (ii) a pre-recommendation query for an additional user input, the pre-recommendation query for the additional user input comprising a follow-up question requesting additional information related to the natural-language input, wherein the pre-recommendation query occurs prior to outputting the first selected candidate recommendation, and wherein determining whether to respond to the natural-language input with the first natural-language output comprising the pre-recommendation query comprises determining whether a size of a pool of candidate recommendations is greater than a threshold pool size;
responsive to determining to respond to the natural-language input with the first natural-language output comprising the pre-recommendation query for the additional user input, receiving a response to the pre-recommendation query for the additional user input, wherein the response to the pre-recommendation query for the additional user input is associated with a second preference context, wherein the second preference context differs from the first preference context;
receiving, from the information source or another information source, one or more second candidate recommendations, wherein the one or more second candidate recommendations are determined based on the first and second preference contexts;
identifying a second selected candidate recommendation among the one or more second candidate recommendations; and
providing the second selected candidate recommendation as a second natural-language output to the user.
2 . The method of claim 1 , wherein determining whether to respond to the natural-language input with the first natural-language output comprising (i) the first selected candidate recommendation or (ii) the pre-recommendation query for the additional user input comprises:
encoding the natural-language input as an input feature vector representing the natural-language input;
encoding at least one candidate suggestion as a recommendation feature vector;
creating, by a neural network, a similarity vector based on a similarity between the input feature vector and the recommendation feature vector;
comparing values of the similarity vector to a threshold value; and
one of:
responsive to at least one of the values of the similarity vector exceeding the threshold value, selecting the first natural-language output to comprise the first selected candidate recommendation; and
responsive to no values of the similarity vector exceeding the threshold value, selecting the first natural-language output to comprise the pre-recommendation query for the additional user input.
3 . The method of claim 2 , wherein the recommendation feature vector and the similarity vector each have multiple dimensions, each of the multiple dimensions corresponding to a category of information about the first selected candidate recommendation.
4 . The method of claim 2 , wherein:
the input feature vector represents the natural-language input over multiple rounds of a same dialogue; and
the natural-language input from one or more recent rounds of the multiple rounds is given a greater weight in determining the similarity between the input feature vector and the recommendation feature vector.
5 . The method of claim 1 , further comprising:
after providing the first natural-language output comprising the first selected candidate recommendation to the user, generating a reasoning summary comprising a natural-language description identifying one or more user preferences and including one or more reasons explaining why the first selected candidate recommendation was provided to the user; and
providing the reasoning summary to the user.
6 . The method of claim 5 , wherein:
a first reward model is used to determine whether to respond to the natural-language input with the first natural-language output comprising the first selected candidate recommendation or with the first natural-language output comprising the pre-recommendation query for the additional user input; and
a second reward model is used to generate the reasoning summary.
7 . The method of claim 6 , wherein:
the first reward model comprises a discriminatory reward model; and
the second reward model comprises an adversarial reward model.
8 . An electronic device comprising:
at least one memory configured to store instructions; and
at least one processing device configured when executing the instructions to:
receive a natural-language input from a user, wherein the natural-language input from the user is associated with a first preference context;
receive, from an information source, one or more first candidate recommendations as potential responses to the natural-language input, wherein the one or more first candidate recommendations are based on the first preference context;
determine, based on a similarity between the natural-language input and a first selected candidate recommendation among the one or more first candidate recommendations, whether to respond to the natural-language input with a first natural-language output comprising (i) the first selected candidate recommendation or (ii) a pre-recommendation query for an additional user input, the pre-recommendation query for the additional user input comprising a follow-up question requesting additional information related to the natural-language input, wherein the pre-recommendation query occurs prior to outputting the first selected candidate recommendation, and wherein, to determine whether to respond to the natural-language input with the first natural-language output comprising the pre-recommendation query, the at least one processing device is configured to determine whether a size of a pool of candidate recommendations is greater than a threshold pool size;
responsive to determining to respond to the natural-language input with the first natural-language output comprising the pre-recommendation query for the additional user input, receive a response to the pre-recommendation query for the additional user input, wherein the response to the pre-recommendation query for the additional user input is associated with a second preference context, wherein the second preference context differs from the first preference context;
receive, from the information source or another information source, one or more second candidate recommendations, wherein the one or more second candidate recommendations are based on the first and second preference contexts;
identify a second selected candidate recommendation among the one or more second candidate recommendations; and
provide the second selected candidate recommendation as a second natural-language output to the user.
9 . The electronic device of claim 8 , wherein, to determine whether to respond to the natural-language input with the first natural-language output comprising (i) the first selected candidate recommendation or (ii) the pre-recommendation query for the additional user input, the at least one processing device is configured to:
encode the natural-language input as an input feature vector representing the natural-language input;
encode at least one candidate suggestion as a recommendation feature vector;
create, using a neural network, a similarity vector based on a similarity between the input feature vector and the recommendation feature vector;
compare values of the similarity vector to a threshold value; and
one of:
responsive to at least one of the values of the similarity vector exceeding the threshold value, select the first natural-language output to comprise the first selected candidate recommendation; and
responsive to no values of the similarity vector exceeding the threshold value, select the first natural-language output to comprise the pre-recommendation query for the additional user input.
10 . The electronic device of claim 9 , wherein the recommendation feature vector and the similarity vector each have multiple dimensions, each of the multiple dimensions corresponding to a category of information about the first selected candidate recommendation.
11 . The electronic device of claim 9 , wherein:
the input feature vector represents the natural-language input over multiple rounds of a same dialogue; and
the at least one processing device is configured to give a greater weight to the natural-language input from one or more recent rounds of the multiple rounds when determining the similarity between the input feature vector and the recommendation feature vector.
12 . The electronic device of claim 8 , wherein the at least one processing device is further configured to:
after providing the first natural-language output comprising the first selected candidate recommendation to the user, generate a reasoning summary comprising a natural-language description identifying one or more user preferences and including one or more reasons explaining why the first selected candidate recommendation was provided to the user; and
provide the reasoning summary to the user.
13 . The electronic device of claim 12 , wherein the at least one processing device is further configured to:
use a first reward model to determine whether to respond to the natural-language input with the first natural-language output comprising the first selected candidate recommendation or with the first natural-language output comprising the pre-recommendation query for the additional user input; and
use a second reward model to generate the reasoning summary.
14 . The electronic device of claim 13 , wherein:
the first reward model comprises a discriminatory reward model; and
the second reward model comprises an adversarial reward model.
15 . A non-transitory machine-readable medium containing instructions that when executed cause at least one processor of an electronic device to:
receive a natural-language input from a user, wherein the natural-language input from the user is associated with a first preference context;
receive, from an information source, one or more first candidate recommendations as potential responses to the natural-language input, wherein the one or more first candidate recommendations are based on the first preference context;
determine, based on a similarity between the natural-language input and a first selected candidate recommendation among the one or more first candidate recommendations, whether to respond to the natural-language input with a first natural-language output comprising (i) the first selected candidate recommendation or (ii) a pre-recommendation query for an additional user input, the pre-recommendation query for the additional user input comprising a follow-up question requesting additional information related to the natural-language input, wherein the pre-recommendation query occurs prior to outputting the first selected candidate recommendation, and wherein the instructions that when executed cause the at least one processor to determine whether to respond to the natural-language input with the first natural-language output comprising the pre-recommendation query include instructions that when executed cause the at least one processor to determine whether a size of a pool of candidate recommendations is greater than a threshold pool size;
responsive to determining to respond to the natural-language input with the first natural-language output comprising the pre-recommendation query for the additional user input, receive a response to the pre-recommendation query for the additional user input, wherein the response to the pre-recommendation query for the additional user input is associated with a second preference context, wherein the second preference context differs from the first preference context;
receive, from the information source or another information source, one or more second candidate recommendations, wherein the one or more second candidate recommendations are based on the first and second preference contexts;
identify a second selected candidate recommendation among the one or more second candidate recommendations; and
provide the second selected candidate recommendation as a second natural-language output to the user.
16 . The non-transitory machine-readable medium of claim 15 , wherein the instructions that when executed cause the at least one processor to determine whether to respond to the natural-language input with the first natural-language output comprising (i) the first selected candidate recommendation or (ii) the pre-recommendation query for the additional user input comprise instructions that when executed cause the at least one processor to:
encode the natural-language input as an input feature vector representing the natural-language input;
encode at least one candidate suggestion as a recommendation feature vector;
create, using a neural network, a similarity vector based on a similarity between the input feature vector and the recommendation feature vector;
compare values of the similarity vector to a threshold value; and
one of:
responsive to at least one of the values of the similarity vector exceeding the threshold value, select the first natural-language output to comprise the first selected candidate recommendation; and
responsive to no values of the similarity vector exceeding the threshold value, select the first natural-language output to comprise the pre-recommendation query for the additional user input.
17 . The non-transitory machine-readable medium of claim 16 , wherein the recommendation feature vector and the similarity vector each have multiple dimensions, each of the multiple dimensions corresponding to a category of information about the first selected candidate recommendation.
18 . The non-transitory machine-readable medium of claim 16 , wherein:
the input feature vector represents the natural-language input over multiple rounds of a same dialogue; and
the instructions when executed cause the at least one processor to give a greater weight to the natural-language input from one or more recent rounds of the multiple rounds when determining the similarity between the input feature vector and the recommendation feature vector.
19 . The non-transitory machine-readable medium of claim 15 , further containing instructions that when executed cause the at least one processor to:
after providing the first natural-language output comprising the first selected candidate recommendation to the user, generate a reasoning summary comprising a natural-language description identifying one or more user preferences and including one or more reasons explaining why the first selected candidate recommendation was provided to the user; and
provide the reasoning summary to the user.
20 . The non-transitory machine-readable medium of claim 19 , further containing instructions that when executed cause the at least one processor to:
use a first reward model to determine whether to respond to the natural-language input with the first natural-language output comprising the first selected candidate recommendation or with the first natural-language output comprising the pre-recommendation query for the additional user input; and
use a second reward model to generate the reasoning summary.
21 . The method of claim 1 , further comprising:
in response to determining that the size of the pool of candidate recommendations is greater than the threshold pool size, generating the pre-recommendation query;
wherein the pre-recommendation query comprises a follow-up question to reduce the size of the pool of candidate recommendations.