IP Library Granted Patent US 12,131,728
Granted Patent B2
US 12,131,728 · App. 17/828,773 · Granted Oct 29, 2024

Method and apparatus of training natural language processing model, and method and apparatus of processing natural language

Inventors: Siyu Ding (Beijing, CN); Chao Pang (Beijing, CN); Shuohuan Wang (Beijing, CN); Yanbin Zhao (Beijing, CN); Junyuan Shang (Beijing, CN); Yu Sun (Beijing, CN); Shikun Feng (Beijing, CN); Hao Tian (Beijing, CN); Hua Wu (Beijing, CN); Haifeng Wang (Beijing, CN)
Assignee: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
G10L15/063G10L15/02G10L15/18
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,131,728
App. No.
17/828,773
Granted
Oct 29, 2024
Kind
B2
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 (68)

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;

adjusting a parameter of the natural language processing model according to the loss for each branch task; and

determining a second output result for each branch task based on the semantic feature, 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.

2. The method of claim 1 , wherein 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.

3. 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.

4. 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.

5. The method of claim 1 , wherein the multi-tasks further 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.

6. The method of claim 1 , 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.

7. The method of claim 1 , wherein the multi-tasks further 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 further 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.

8. 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;

adjusting a parameter of the natural language processing model according to the loss for each branch task; and

determining a second output result for each branch task based on the semantic feature, 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.

9. The method of claim 8 , wherein 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.

10. The method of claim 9 , 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.

11. The method of claim 8 , wherein the multi-tasks further 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.

12. The method of claim 8 , 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.

13. The method of claim 8 , wherein the multi-tasks further 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 further 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.

14. 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;

adjusting a parameter of the natural language processing model according to the loss for each branch task; and

determining a second output result for each branch task based on the semantic feature, 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.

15. 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 8 .

16. 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 8 .

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded May 31, 2022
From: DING, SIYU; PANG, CHAO; WANG, SHUOHUAN; ZHAO, YANBIN; SHANG, JUNYUAN; SUN, YU; FENG, SHIKUN; TIAN, HAO; WU, HUA; WANG, HAIFENG
To: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
Reel/Frame 060060/0238 →
Priority Claims (1)
CN 202110747046.X · Jun 30, 2021 · national
Continuity (1)
Related Publication 20220293092A1 · Sep 15, 2022