# US 2023/0267278 A1 · Context-based response generation

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0267278 A1
- Document ID: US20230267278A1
- Status: Published application
- Kind: A1
- Application number: 17/675,078
- Filed: 2022-02-18
- Published: 2023-08-24
- Earliest claimed: 2022-02-18
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Gaurav Pandey; DANISH CONTRACTOR; Nathaniel Mills; Jatin GANHOTRA; Ross Warren Judd; Sachindra Joshi; Luis A. Lastras-Montano
- Web page: https://patentgrep.com/patent/US20230267278A1

## CPC

- G06F 40/35: Discourse or dialogue representation
- G06F 40/20: Natural language analysis (semantic analysis of natural language G06F40/30)
- G06N 20/20: Ensemble learning
- G06N 20/00: Machine learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Methods, systems, and computer program products for context-based response generation are provided herein. A method includes: obtaining conversation logs comprising agent responses matched to contexts and a set of designated responses that are not matched to the contexts; replacing at least a portion of the agent responses with the designated responses to form modified conversation logs; training a first model, using the modified conversation logs, to output a designated response in the set for a given context and a second model, using the historical conversation logs, to output one of the agent responses for a given context; identifying one or more new responses based at least in part on the output of the second machine learning model for a particular one of the contexts; and retraining the first machine learning model based at least in part on the one or more new responses.

## Claims

### Claim 1

A computer-implemented method, the method comprising:
obtaining (i) one or more historical conversation logs comprising a plurality of agent responses matched to a plurality of conversation contexts and (ii) a set of designated responses that are not matched to the plurality of conversation contexts;
replacing at least a portion of the plurality of agent responses with the designated responses in the set, thereby forming one or more modified conversation logs;
training (i) a first machine learning model, using the one or more modified conversation logs, to output one of the designated responses in the set for a given one of the conversation contexts and (ii) a second machine learning model, using the one or more historical conversation logs, to output one of the agent responses for a given conversation context;
in response to determining that the trained first machine learning model does not output one of the designated responses in the set for a particular one of the plurality conversation contexts, identifying one or more new responses based at least in part on the output of the second machine learning model for the particular conversation context; and
retraining the first machine learning model based at least in part on the one or more new responses;
wherein the method is carried out by at least one computing device.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, comprising:
training a common scoring model that assigns a score to each of the outputs of the first and second machine learning models, wherein the common scoring model is trained using the historical training logs and assigns:
a high score in response to at least one of: (i) an input-output pair of the first machine learning model matching a conversation context-designated response pair from the one or more modified conversation logs, and (ii) an input-output pair of the second machine learning model matching a conversation context-agent response pair from the one or more historical conversation logs; and
a low score for all other outputs of the first and second machine learning models.

### Claim 3 (depends on 2)

The computer-implemented method of claim 2, wherein the identifying comprises:
using the common scoring model to assign scores to agent responses that are output by the second machine learning model for the particular conversation context; and
recommending at least one of the agent responses to a user based on the assigned scores, wherein the one or more new responses comprises one of the recommended agent responses validated by the user in response to the recommending.

### Claim 4 (depends on 2)

The computer-implemented method of claim 2, wherein training the common scoring model comprises:
using the common scoring model to assign scores to multiple designated responses output by the first machine learning model;
providing, based on the assigned scores, at least one of the multiple designated responses to a user; and
finetuning the common scoring model in response to the user selecting one of the provided designated responses.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, comprising:
generating response embeddings for at least a portion of the agent responses;
clustering the response embeddings into a plurality of clusters;
applying a homogeneity filtering process to each of the plurality of cluster;
generating one or more synthetic responses based at least in part on the filtered clusters; and
adding the one or more synthetic responses to the set of designated responses in response to a user validating the one or more synthetic responses.

### Claim 6 (depends on 5)

The computer-implemented method of claim 5, wherein the one or more synthetic responses are generated based on a centroid computed for at least one of the filtered clusters.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein at least one of the first machine learning model and the second machine learning model is trained using an encoder-decoder architecture.

### Claim 8 (depends on 1)

The computer-implemented method of claim 1, comprising:
deploying at least the first machine learning model in a conversation system that outputs designated responses from the set during a real-time conversation between an agent and a user.

### Claim 9 (depends on 1)

The computer-implemented method of claim 1, wherein software is provided as a service in a cloud environment.

### Claim 10

A computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a computing device to cause the computing device to:
obtain (i) one or more historical conversation logs comprising a plurality of agent responses matched to a plurality of conversation contexts and (ii) a set of designated responses that are not matched to the plurality of conversation contexts;
replace at least a portion of the plurality of agent responses with the designated responses in the set, thereby forming one or more modified conversation logs;
train (i) a first machine learning model, using the one or more modified conversation logs, to output one of the designated responses in the set for a given one of the conversation contexts and (ii) a second machine learning model, using the one or more historical conversation logs, to output one of the agent responses for a given conversation context;
in response to determining that the trained first machine learning model does not output one of the designated responses in the set for a particular one of the plurality conversation contexts, identify one or more new responses based at least in part on the output of the second machine learning model for the particular conversation context; and
retrain the first machine learning model based at least in part on the one or more new responses.

### Claim 11 (depends on 10)

The computer program product of claim 10, wherein the program instructions executable by a computing device further cause the computing device to:
train a common scoring model that assigns a score to each of the outputs of the first and second machine learning models, wherein the common scoring model is trained using the historical training logs and assigns:
a high score in response to at least one of: (i) an input-output pair of the first machine learning model matching a conversation context-designated response pair from the one or more modified conversation logs, and (ii) an input-output pair of the second machine learning model matching a conversation context-agent response pair from the one or more historical conversation logs; and
a low score for all other outputs of the first and second machine learning models.

### Claim 12 (depends on 11)

The computer program product of claim 11, wherein the identifying comprises:
using the common scoring model to assign scores to agent responses that are output by the second machine learning model for the particular conversation context; and
recommending at least one of the agent responses to a user based on the assigned scores, wherein the one or more new responses comprises one of the recommended agent responses validated by the user in response to the recommending.

### Claim 13 (depends on 12)

The computer program product of claim 12, wherein training the common scoring model comprises:
using the common scoring model to assign scores to multiple designated responses output by the first machine learning model;
providing, based on the assigned scores, at least one of the multiple designated responses to a user; and
finetuning the common scoring model in response to the user selecting one of the provided designated responses.

### Claim 14 (depends on 10)

The computer program product of claim 10, wherein the program instructions executable by a computing device further cause the computing device to:
generate response embeddings for at least a portion of the agent responses;
cluster the response embeddings into a plurality of clusters;
apply a homogeneity filtering process to each of the plurality of cluster;
generate one or more synthetic responses based at least in part on the filtered clusters; and
add the one or more synthetic responses to the set of designated responses in response to a user validating the one or more synthetic responses.

### Claim 15 (depends on 14)

The computer program product of claim 14, wherein the one or more synthetic responses are generated based on a centroid computed for at least one of the filtered clusters.

### Claim 16 (depends on 10)

The computer program product of claim 10, wherein at least one of the first machine learning model and the second machine learning model is trained using an encoder-decoder architecture.

### Claim 17 (depends on 10)

The computer program product of claim 10, wherein the program instructions executable by a computing device further cause the computing device to:
deploy at least the first machine learning model in a conversation system that outputs designated responses from the set during a real-time conversation between an agent and a user.

### Claim 18

A system comprising:
a memory configured to store program instructions;
a processor operatively coupled to the memory to execute the program instructions to:
obtain (i) one or more historical conversation logs comprising a plurality of agent responses matched to a plurality of conversation contexts and (ii) a set of designated responses that are not matched to the plurality of conversation contexts;
replace at least a portion of the plurality of agent responses with the designated responses in the set, thereby forming one or more modified conversation logs;
train (i) a first machine learning model, using the one or more modified conversation logs, to output one of the designated responses in the set for a given one of the conversation contexts and (ii) a second machine learning model, using the one or more historical conversation logs, to output one of the agent responses for a given conversation context;
in response to determining that the trained first machine learning model does not output one of the designated responses in the set for a particular one of the plurality conversation contexts, identify one or more new responses based at least in part on the output of the second machine learning model for the particular conversation context; and
retrain the first machine learning model based at least in part on the one or more new responses.

### Claim 19 (depends on 18)

The system of claim 18, wherein the processor is operatively coupled to the memory to execute the program instructions to:
train a common scoring model that assigns a score to each of the outputs of the first and second machine learning models, wherein the common scoring model is trained using the historical training logs and assigns:
a high score in response to at least one of: (i) an input-output pair of the first machine learning model matching a conversation context-designated response pair from the one or more modified conversation logs, and (ii) an input-output pair of the second machine learning model matching a conversation context-agent response pair from the one or more historical conversation logs; and
a low score for all other outputs of the first and second machine learning models.

### Claim 20 (depends on 19)

The system of claim 19, wherein the identifying comprises:
using the common scoring model to assign scores to agent responses that are output by the second machine learning model for the particular conversation context; and
recommending at least one of the agent responses to a user based on the assigned scores, wherein the one or more new responses comprises one of the recommended agent responses validated by the user in response to the recommending.
