# US 2021/0174204 A1 · System and method for natural language processing using neural network

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

- Number: US 2021/0174204 A1
- Document ID: US20210174204A1
- Status: Published application
- Kind: A1
- Application number: 17/093,478
- Filed: 2020-11-09
- Published: 2021-06-10
- Earliest claimed: 2019-12-09
- Assignees: salesforce.com, inc.
- Applicants: salesforce.com, inc.
- Inventors: Wenpeng Yin; Nazneen Rajani; Richard Socher; Caiming Xiong
- Web page: https://patentgrep.com/patent/US20210174204A1

## CPC

- G06F 40/20: Natural language analysis (semantic analysis of natural language G06F40/30)
- G06F 16/3329: Natural language query formulation
- G06F 16/3344: {using natural language analysis}
- G06F 40/279: Recognition of textual entities
- G06F 40/30: Semantic analysis
- G06N 3/0499: Feedforward networks
- G06N 3/08: Learning methods
- G06N 3/09: Supervised learning
- G06N 3/096: Transfer learning
- G06N 3/048: Activation functions
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

A method for using a neural network model for natural language processing (NLP) includes receiving training data associated with a source domain and a target domain; and generating one or more query batches. Each query batch includes one or more source tasks associated with the source domain and one or more target tasks associated with the target domain. For each query batch, class representations are generated for each class in the source domain and the target domain. A query batch loss for the query batch is generated based on the corresponding class representations. An optimization is performed on the neural network model by adjusting its network parameters based on the query batch loss. The optimized neural network model is used to perform one or more new NLP tasks.

## Claims

### Claim 1

A method for using a neural network model for natural language processing (NLP), comprising:
receiving training data associated with a source domain and a target domain;
generating one or more query batches, wherein each query batch includes one or more source tasks associated with the source domain and one or more target tasks associated with the target domain;
for each query batch, generating class representations for each class in the source domain and the target domain;
generating a query batch loss for the query batch based on the corresponding class representations, wherein the generating the query batch loss includes:
for each query in the query batch, generating a query loss based on a cross-task probability distribution of the query using the class representations; and
performing an optimization on the neural network model by adjusting its network parameters based on the query batch loss,
wherein the optimized neural network model is used to perform one or more new NLP tasks.

### Claim 2 (depends on 1)

The method of claim 1, wherein a first new NLP task is from one of the target domain and a new domain, wherein the new domain is different from the source domain and target domain.

### Claim 3 (depends on 2)

The method of claim 2, wherein a second new NLP task is from the other of the target domain and the new domain.

### Claim 4 (depends on 1)

The method of claim 1, wherein the neural network model includes a textual entailment model,
wherein the one or more source tasks and the one or more target tasks include one or more textual entailment tasks regarding a relation of a premise sentence including a premise and a hypothesis sentence including a hypothesis, where the relation indicates whether the hypothesis is true given the premise;
wherein the predictions include textual entailment predictions.

### Claim 5 (depends on 1)

The method of claim 1, wherein the generating a query batch include:
generating a source subquery batch including the one or more source tasks associated with the source domain;
generating a target subquery batch including the one or more target tasks associated with the target domain; and
generating the query batch using the source subquery batch and the target subquery batch.

### Claim 6 (depends on 5)

The method of claim 5, wherein the generating the query batch loss includes:
generating a source loss using the source subquery batch of the query batch;
generating a target loss using the target subquery batch of the query batch; and
generating the query batch loss using the source loss and target loss.

### Claim 7 (depends on 1)

The method of claim 1, wherein few-shot learning is performed to the neural network model.

### Claim 8

A non-transitory machine-readable medium comprising a plurality of machine-readable instructions which, when executed by one or more processors, are adapted to cause the one or more processors to perform a method comprising:
receiving training data associated with a source domain and a target domain;
generating one or more query batches, wherein each query batch includes one or more source tasks associated with the source domain and one or more target tasks associated with the target domain;
for each query batch, generating class representations for each class in the source domain and the target domain;
generating a query batch loss for the query batch based on the corresponding class representations, wherein the generating the query batch loss includes:
for each query in the query batch, generating a query loss based on a cross-task probability distribution of the query using the class representations; and
performing an optimization on the neural network model by adjusting its network parameters based on the query batch loss,
wherein the optimized neural network model is used to perform one or more new NLP tasks.

### Claim 9 (depends on 8)

The non-transitory machine-readable medium of claim 8, wherein a first new NLP task is from one of the target domain and a new domain different from the source domain and target domain.

### Claim 10 (depends on 9)

The non-transitory machine-readable medium of claim 9, wherein a second new NLP task is from the other of the target domain and the new domain.

### Claim 11 (depends on 8)

The non-transitory machine-readable medium of claim 8, wherein the neural network model includes a textual entailment model,
wherein the one or more source tasks and one or more target tasks include one or more textual entailment tasks regarding a relation of a premise sentence including a premise and a hypothesis sentence including a hypothesis, where the relation indicates whether the hypothesis is true given the premise; and
wherein the predictions include textual entailment predictions.

### Claim 12 (depends on 8)

The non-transitory machine-readable medium of claim 8, wherein the generating a query batch include:
generating a source subquery batch including the one or more source tasks associated with the source domain;
generating a target subquery batch including the one or more target tasks associated with the target domain; and
generating the query batch using the source subquery batch and the target subquery batch.

### Claim 13 (depends on 12)

The non-transitory machine-readable medium of claim 12, further comprising:
generating a source loss using the source subquery batch of the query batch;
generating a target loss using the target subquery batch of the query batch; and
generating the query batch loss using the source loss and the target loss.

### Claim 14 (depends on 12)

The non-transitory machine-readable medium of claim 12, wherein the generating the class representations for each query batch includes:
generating source sample sets for the classes from the source domain; and
generating the class representations based on the source sample sets and the target subquery batch.

### Claim 15

A system, comprising:
a non-transitory memory; and
one or more hardware processors coupled to the non-transitory memory and configured to read instructions from the non-transitory memory to cause the system to perform a method comprising:
receiving training data associated with a source domain and a target domain;
generating one or more query batches, wherein each query batch includes one or more source tasks associated with the source domain and one or more target tasks associated with the target domain;
for each query batch, generating class representations for each class in the source domain and the target domain;
generating a query batch loss for the query batch based on the corresponding class representations, wherein the generating the query batch loss includes:
for each query in the query batch, generating a query loss based on a cross-task probability distribution of the query using the class representations; and
performing an optimization on the neural network model by adjusting its network parameters based on the query batch loss,
wherein the optimized neural network model is used to perform one or more new NLP tasks.

### Claim 16 (depends on 15)

The system of claim 15, wherein a first new NLP task is associated with one of the target domain and a new domain, wherein the new domain is different from the source domain and target domain.

### Claim 17 (depends on 16)

The system of claim 16, wherein a second new NLP task is associated with the other of the target domain and the new domain.

### Claim 18 (depends on 15)

The system of claim 15, wherein the neural network model includes a textual entailment model,
wherein the one or more source tasks and one or more target tasks include one or more textual entailment tasks regarding a relation of a premise sentence including a premise and a hypothesis sentence including a hypothesis, where the relation indicates whether the hypothesis is true given the premise; and
wherein the predictions include textual entailment predictions.

### Claim 19 (depends on 15)

The system of claim 15, wherein the generating a query batch include:
generating a source subquery batch including the one or more source tasks associated with the source domain;
generating a target subquery batch including the one or more target tasks associated with the target domain; and
generating the query batch using the source subquery batch and the target subquery batch.

### Claim 20 (depends on 19)

The system of claim 19, wherein the generating the query batch loss includes:
generating a source loss using the source subquery batch of the query batch;
generating a target loss using the target subquery batch of the query batch; and
generating the query batch loss using the source loss and the target loss.
