# US 2022/0293092 A1 · Method and apparatus of training natural language processing model, and method and apparatus of processing natural language

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

- Number: US 2022/0293092 A1
- Document ID: US20220293092A1
- Status: Published application
- Kind: A1
- Application number: 17/828,773
- Filed: 2022-05-31
- Published: 2022-09-15
- Earliest claimed: 2021-06-30
- Assignees: Beijing Baidu Netcom Science Technology Co., Ltd.
- Applicants: Beijing Baidu Netcom Science Technology Co., Ltd.
- Inventors: Siyu DING; Chao PANG; Shuohuan WANG; Yanbin ZHAO; Junyuan SHANG; Yu SUN; Shikun FENG; Hao TIAN; Hua WU; Haifeng WANG
- Web page: https://patentgrep.com/patent/US20220293092A1

## CPC

- G10L 15/063: {Training}
- G06F 40/30: Semantic analysis
- G10L 15/02: Feature extraction for speech recognition; Selection of recognition unit
- G10L 15/16: using artificial neural networks
- G10L 15/18: using natural language modelling
- 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)

## Abstract

The present application provides a method of training a natural language processing model, which relates to a field of artificial intelligence, and in particular to a field of natural language processing. A specific implementation scheme includes: performing a semantic learning for multi-tasks on an input text, so as to obtain a semantic feature for the multi-tasks, wherein the multi-tasks include a plurality of branch tasks; performing a feature learning for each branch task based on the semantic feature, so as to obtain a first output result for each branch task; calculating a loss for each branch task according to the first output result for the branch task; and adjusting a parameter of the natural language processing model according to the loss for each branch task. The present application further provides a method of processing a natural language, an electronic device, and a storage medium.

## Claims

### Claim 1

A method of training a natural language processing model, comprising:
performing a semantic learning for multi-tasks on an input text, so as to obtain a semantic feature for the multi-tasks, wherein the multi-tasks comprise a plurality of branch tasks;
performing a feature learning for each branch task based on the semantic feature, so as to obtain a first output result for each branch task;
calculating a loss for each branch task according to the first output result for the branch task; and
adjusting a parameter of the natural language processing model according to the loss for each branch task.

### Claim 2 (depends on 1)

The method of claim 1, wherein the multi-tasks comprise a first branch task for a semantic understanding; and the performing a feature learning for each branch task based on the semantic feature, so as to obtain a first output result for each branch task comprises:
determining, for each word in the input text, a preceding-text information prior to the word and a following-text information subsequent to the word based on the semantic feature; and
determining a semantic understanding information for the input text as a first output result for the first branch task according to the preceding-text information and the following-text information.

### Claim 3 (depends on 2)

The method of claim 2, further comprising:
calculating a logical distance between a plurality of statements in the input text as the first output result for the first branch task according to the preceding-text information and the following-text information.

### Claim 4 (depends on 2)

The method of claim 2, further comprising:
determining a logical order of a plurality of statements in the input text as the first output result for the first branch task according to the preceding-text information and the following-text information.

### Claim 5 (depends on 1)

The method of claim 1, wherein the multi-tasks comprise a second branch task for a language generation; and the performing a feature learning for each branch task based on the semantic feature, so as to obtain a first output result for each branch task comprises: for each word in the input text,
determining a preceding-text information prior to the word based on the semantic feature; and
predicting a following-text information subsequent to the word as a first output result for the second branch task based on the preceding-text information.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
determining a second output result for each branch task based on the semantic feature.

### Claim 7 (depends on 6)

The method of claim 6, wherein the calculating a loss for each branch task according to the first output result for the branch task comprises:
calculating the loss for the branch task according to the first output result for the branch task and the second output result for the branch task.

### Claim 8 (depends on 6)

The method of claim 6, wherein the multi-tasks comprise a first branch task for a semantic understanding; and the determining a second output result for each branch task based on the semantic feature comprises one of:
determining a semantic understanding information for the input text as the second output result for the first branch task based on the semantic feature;
calculating a logical distance between a plurality of statements in the input text as the second output result for the first branch task based on the semantic feature; and
determining a logical order of a plurality of statements in the input text as the second output result for the first branch task based on the semantic feature.

### Claim 9 (depends on 6)

The method of claim 6, wherein the multi-tasks comprise a second branch task for a language generation; and the determining a second output result for each branch task based on the semantic feature comprises:
predicting, for each word in the input text, a following-text information subsequent to the word as the second output result for the second branch task based on the semantic feature.

### Claim 10

A method of processing a natural language, comprising:
acquiring a to-be-processed text for a preset branch task; and
performing a semantic learning for multi-tasks on the to-be-processed text by using a natural language processing model, so as to obtain a semantic feature for the multi-tasks, and performing a feature learning for the preset branch task according to the semantic feature, so as to obtain a processing result for the preset branch task,
wherein the multi-tasks comprise the preset branch task, and the natural language processing model is trained using operations of training a natural language processing model, comprising:
performing a semantic learning for multi-tasks on an input text, so as to obtain a semantic feature for the multi-tasks, wherein the multi-tasks comprise a plurality of branch tasks;
performing a feature learning for each branch task based on the semantic feature, so as to obtain a first output result for each branch task;
calculating a loss for each branch task according to the first output result for the branch task; and
adjusting a parameter of the natural language processing model according to the loss for each branch task.

### Claim 11 (depends on 10)

The method of claim 10, wherein the multi-tasks comprise a first branch task for a semantic understanding; and the performing a feature learning for each branch task based on the semantic feature, so as to obtain a first output result for each branch task comprises:
determining, for each word in the input text, a preceding-text information prior to the word and a following-text information subsequent to the word based on the semantic feature; and
determining a semantic understanding information for the input text as a first output result for the first branch task according to the preceding-text information and the following-text information.

### Claim 12 (depends on 11)

The method of claim 11, further comprising:
calculating a logical distance between a plurality of statements in the input text as the first output result for the first branch task according to the preceding-text information and the following-text information.

### Claim 13 (depends on 10)

The method of claim 10, wherein the multi-tasks comprise a second branch task for a language generation; and the performing a feature learning for each branch task based on the semantic feature, so as to obtain a first output result for each branch task comprises: for each word in the input text,
determining a preceding-text information prior to the word based on the semantic feature; and
predicting a following-text information subsequent to the word as a first output result for the second branch task based on the preceding-text information.

### Claim 14 (depends on 10)

The method of claim 10, further comprising:
determining a second output result for each branch task based on the semantic feature.

### Claim 15 (depends on 14)

The method of claim 14, wherein the calculating a loss for each branch task according to the first output result for the branch task comprises:
calculating the loss for the branch task according to the first output result for the branch task and the second output result for the branch task.

### Claim 16 (depends on 14)

The method of claim 14, wherein the multi-tasks comprise a first branch task for a semantic understanding; and the determining a second output result for each branch task based on the semantic feature comprises one of:
determining a semantic understanding information for the input text as the second output result for the first branch task based on the semantic feature;
calculating a logical distance between a plurality of statements in the input text as the second output result for the first branch task based on the semantic feature; and
determining a logical order of a plurality of statements in the input text as the second output result for the first branch task based on the semantic feature.

### Claim 17 (depends on 14)

The method of claim 14, wherein the multi-tasks comprise a second branch task for a language generation; and the determining a second output result for each branch task based on the semantic feature comprises:
predicting, for each word in the input text, a following-text information subsequent to the word as the second output result for the second branch task based on the semantic feature.

### Claim 18

An electronic device, comprising:
at least one processor; and
a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions, when executed by the at least one processor, cause the at least one processor to implement operations of training a natural language processing model, comprising:
performing a semantic learning for multi-tasks on an input text, so as to obtain a semantic feature for the multi-tasks, wherein the multi-tasks comprise a plurality of branch tasks;
performing a feature learning for each branch task based on the semantic feature, so as to obtain a first output result for each branch task;
calculating a loss for each branch task according to the first output result for the branch task; and
adjusting a parameter of the natural language processing model according to the loss for each branch task.

### Claim 19 (depends on 10)

An electronic device, comprising:
at least one processor; and
a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions, when executed by the at least one processor, cause the at least one processor to implement the method of claim 10.

### Claim 20 (depends on 10)

A non-transitory computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions allow a computer to implement the method of claim 10.
