# US 2022/0293094 A1 · Machine learning based models for automatic conversations in online systems

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

- Number: US 2022/0293094 A1
- Document ID: US20220293094A1
- Status: Published application
- Kind: A1
- Application number: 17/202,077
- Filed: 2021-03-15
- Published: 2022-09-15
- Earliest claimed: 2021-03-15
- Assignees: salesforce.com, inc.
- Applicants: salesforce.com, inc.
- Inventors: Yixin Mao; Zachary Alexander; Victor Winslow Yee; Joseph R. Zeimen; Na Cheng; Chien-Sheng Wu; Wenhao Liu; Caiming Xiong
- Web page: https://patentgrep.com/patent/US20220293094A1

## CPC

- G10L 15/16: using artificial neural networks
- G06F 40/35: Discourse or dialogue representation
- G10L 15/063: {Training}
- G10L 15/08: Speech classification or search
- G10L 15/22: Procedures used during a speech recognition process, e.g. man-machine dialogue
- H04L 51/02: using automatic reactions or user delegation, e.g. automatic replies or chatbot-generated messages
- G06F 16/3344: {using natural language analysis}
- G06F 40/216: using statistical methods
- G06F 40/279: Recognition of textual entities
- G06F 40/56: Natural language generation
- G10L: SPEECH ANALYSIS TECHNIQUES OR SPEECH SYNTHESIS; SPEECH RECOGNITION; SPEECH OR VOICE PROCESSING TECHNIQUES; SPEECH OR AUDIO CODING OR DECODING
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A system uses conversation engines to process natural language requests and conduct automatic conversations with users. The system generates responses to users in an online conversation. The system ranks generated user responses for the online conversation. The system generates a context vector based on a sequence of utterances of the conversation and generates response vectors for generated user responses. The system ranks the user responses based on a comparison of the context vectors and user response vectors. The system uses a machine learning based model that uses a pretrained neural network that supports multiple languages. The system determines a context of an utterance based on utterances in the conversation. The system generates responses and ranks them based on the context. The ranked responses are used to respond to the user.

## Claims

### Claim 1

A computer-implemented method to performing online conversations, comprising:
receiving a sequence of utterances representing a context in an online conversation, the sequence comprising one or more utterances;
generating a context vector by:
generating one or more utterance vectors by providing the one or more utterances to an utterance vector generator comprising a multilingual neural network and a multilayer perceptron;
generating one or more encoded utterance vectors from the one or more utterance vectors, using a transformer encoder neural network; and
aggregating the one or more encoded utterance vectors to obtain a context vector;
accessing one or more candidate responses for the online conversation;
determining distance scores for the candidate responses from the context vector, wherein a distance score for a candidate response is determined by:
generating a response vector for the candidate response using the utterance vector generator; and
combining the response vector with the context vector to obtain the distance score;
selecting a response based on the distance scores of the candidate responses; and
providing the selected response to the user via the online conversation.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein the pretrained multilingual model is trained to receive an input utterance in one of a plurality of languages and generate a vector representation of the input utterance.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein the pretrained multilingual model is based on a convolutional neural network.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, wherein the online conversation is performed by a computing system of a multi-tenant system, wherein the pretrained language model is pretrained using a training dataset independent of tenants of the multi-tenant system the method comprising:
training the models using a training dataset specific to a tenant of the multi-tenant system.

### Claim 5 (depends on 1)

The computer-implemented method of claim 1, wherein combining a response vector with the context vector to generate a score comprises determining a dot product of the response vector and the context vector.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, wherein combining a plurality of encoded utterance vectors to obtain a context vector comprises performing a mean pooling of the encoded utterance vectors.

### Claim 7 (depends on 1)

The computer-implemented method of claim 1, wherein using a transformer encoder to generate an encoded utterance vector from the utterance comprises:
adding a user embedding of the user performing the conversation to the utterance vector to generate a combined vector; and
providing the combined vector as input to the transformer encoder.

### Claim 8 (depends on 1)

The computer-implemented method of claim 1, wherein the utterance vector generator and the transformer encoder neural network are trained to:
maximize a vector product of a context vector and an actual response vector pair; and
minimize a vector product of a context vector and a random response vector pair.

### Claim 9

A non-transitory computer readable storage medium storing instructions that when executed by a computer processor, cause the computer processor to perform steps comprising:
receiving a sequence of utterances representing a context in an online conversation, the sequence comprising one or more utterances;
generating a context vector by:
generating one or more utterance vectors by providing the one or more utterances to an utterance vector generator comprising a multilingual neural network and a multilayer perceptron;
generating one or more encoded utterance vectors from the one or more utterance vectors, using a transformer encoder neural network; and
aggregating the one or more encoded utterance vectors to obtain a context vector;
accessing one or more responses for the online conversation;
determining distance scores for the candidate responses from the context vector, wherein a distance score for a candidate response is determined by:
generating a response vector for the candidate response using the utterance vector generator; and
combining the response vector with the context vector to obtain the distance score;
selecting a response based on the distance scores of the candidate responses; and
providing the selected response to the user via the online conversation.

### Claim 10 (depends on 9)

The non-transitory computer readable storage medium of claim 9, wherein the pretrained multilingual model is trained to receive an input utterance in one of a plurality of languages and generate a vector representation of the input utterance.

### Claim 11 (depends on 9)

The non-transitory computer readable storage medium of claim 9, wherein the pretrained multilingual model is based on a convolutional neural network.

### Claim 12 (depends on 9)

The non-transitory computer readable storage medium of claim 9, wherein the online conversation is performed by a computing system of a multi-tenant system, wherein the pretrained language model is pretrained using a training dataset independent of tenants of the multi-tenant system the instructions further causing the computer processor to perform steps comprising:
training the models using a training dataset specific to a tenant of the multi-tenant system.

### Claim 13 (depends on 9)

The non-transitory computer readable storage medium of claim 9, wherein combining a response vector with the context vector to generate a score comprises determining a dot product of the response vector and the context vector.

### Claim 14 (depends on 9)

The non-transitory computer readable storage medium of claim 9, wherein combining a plurality of encoded utterance vectors to obtain a context vector comprises performing a mean pooling of the encoded utterance vectors.

### Claim 15 (depends on 9)

The non-transitory computer readable storage medium of claim 9, wherein instructions for using a transformer encoder to generate an encoded utterance vector from the utterance comprise instructions that cause the computer processor to perform steps comprising:
adding a user embedding of the user performing the conversation to the utterance vector to generate a combined vector; and
providing the combined vector as input to the transformer encoder.

### Claim 16 (depends on 9)

The non-transitory computer readable storage medium of claim 9, wherein the utterance vector generator and the transformer encoder neural network are trained to:
maximize a vector product of a context vector and an actual response vector pair; and
minimize a vector product of a context vector and a random response vector pair.

### Claim 17

A computer system comprising:
a computer processor; and
a non-transitory computer readable storage medium storing instructions that when executed by the computer processor cause the computer processor to perform steps for enabling custom configuration of a tenant-specific conversation engine to process and act upon natural language requests without requiring tenant-specific training, the steps comprising:
receiving a sequence of utterances representing a context in an online conversation, the sequence comprising one or more utterances;
generating a context vector by:
generating one or more utterance vectors by providing the one or more utterances to an utterance vector generator comprising a multilingual neural network and a multilayer perceptron;
generating one or more encoded utterance vectors from the one or more utterance vectors, using a transformer encoder neural network; and
aggregating the one or more encoded utterance vectors to obtain a context vector;
accessing one or more responses for the online conversation;
determining distance scores for the candidate responses from the context vector, wherein a distance score for a candidate response is determined by:
generating a response vector for the candidate response using the utterance vector generator; and
combining the response vector with the context vector to obtain the distance score;
selecting a response based on the distance scores of the candidate responses; and
providing the selected response to the user via the online conversation.

### Claim 18 (depends on 17)

The computing system of claim 17, wherein the online conversation is performed by a computing system of a multi-tenant system, wherein the pretrained language model is pretrained using a training dataset independent of tenants of the multi-tenant system the instructions further causing the computer processor to perform steps comprising:
training the models using a training dataset specific to a tenant of the multi-tenant system.

### Claim 19 (depends on 17)

The computing system of claim 17, wherein instructions for using a transformer encoder to generate an encoded utterance vector from the utterance comprise instructions that cause the computer processor to perform steps comprising:
adding a user embedding of the user performing the conversation to the utterance vector to generate a combined vector; and
providing the combined vector as input to the transformer encoder.

### Claim 20 (depends on 17)

The computing system of claim 17, wherein the utterance vector generator and the transformer encoder neural network are trained to:
maximize a vector product of a context vector and an actual response vector pair; and
minimize a vector product of a context vector and a random response vector pair.
