IP Library Granted Patent US 12,106,052
Granted Patent B2
US 12,106,052 · App. 17/205,894 · Granted Oct 1, 2024

Method and apparatus for generating semantic representation model, and storage medium

Inventors: Shuohuan Wang (Beijing, CN); Siyu Ding (Beijing, CN); Yu Sun (Beijing, CN)
Assignee: BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY CO., LTD.
G06F40/30G06F18/2163G06F40/279G06N5/02
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,106,052
App. No.
17/205,894
Granted
Oct 1, 2024
Kind
B2
Abstract

The disclosure discloses a method and an apparatus for generating a semantic representation model, and a storage medium. The detailed implementation includes: performing recognition and segmentation on the original text included in an original text set to obtain knowledge units and non-knowledge units in the original text; performing knowledge unit-level disorder processing on the knowledge units and the non-knowledge units in the original text to obtain a disorder text; generating a training text set based on the character attribute of each character in the disorder text; and training an initial semantic representation model by employing the training text set to generate the semantic representation model.

Claims (59)

1. A method for generating a semantic representation model, comprising:

obtaining an original text set comprising original texts;

performing recognition and segmentation on the original text to obtain knowledge units and non-knowledge units in the original text;

performing knowledge unit-level disorder processing on the knowledge units and the non-knowledge units in the original text to obtain a disorder text;

generating a character attribute of each character in the disorder text, the character attribute comprising an original position of the character in the original text and a current position of the character;

generating a training text set based on the character attribute of each character in the disorder text; and

training an initial semantic representation model by employing the training text set to generate the semantic representation model;

wherein training the initial semantic representation model by employing the training text set comprises:

obtaining a present character of the disorder text in the training text set;

determining a first character based on the character attribute of each character in the disorder text, the first character being a character at each position in front of the present position of the present character in the disorder text;

inputting the first character, a character attribute of the first character and the character attribute of the present character into the semantic representation model to obtain a character prediction result of the semantic representation model for the current position of the present character; and

calculating a loss function value and adjusting a coefficient of the semantic representation model based on the current character and the character prediction result, to generate the semantic representation model.

2. The method of claim 1 , wherein performing the recognition and segmentation on the original text comprises:

performing first-level recognition and segmentation on the original text to obtain first-level knowledge units and first-level non-knowledge units; and

performing second-level recognition and segmentation on the first-level knowledge units to obtain second-level knowledge units and second-level non-knowledge units.

3. The method of claim 2 , wherein the first level is a sentence level, and the second level is a word level.

4. The method of claim 1 , after performing the knowledge unit-level disorder processing on the knowledge units and the non-knowledge units in the original text to obtain the disorder text, further comprising:

performing character-level disorder processing on a plurality of characters comprised in the knowledge units.

5. The method of claim 1 , after training the initial semantic representation model by employing the training text set to generate the semantic representation model, further comprising:

determining a task scene of the semantic representation model;

obtaining training data in the task scene, the training data comprising a training text and a task target; and

training the semantic representation model by employing the training text and the task target to generate the semantic representation model in the task scene.

6. An apparatus for generating a semantic representation model, comprising:

one or more processors;

a memory storing instructions executable by the one or more processors;

wherein the one or more processors are configured to:

obtain an original text set comprising original texts;

perform recognition and segmentation on the original text to obtain knowledge units and non-knowledge units in the original text;

perform knowledge unit-level disorder processing on the knowledge units and the non-knowledge units in the original text to obtain a disorder text;

generate a character attribute of each character in the disorder text, the character attribute comprising an original position of the character in the original text and a current position of the character;

generate a training text set based on the character attribute of each character in the disorder text; and

train an initial semantic representation model by employing the training text set to generate the semantic representation model;

wherein the one or more processors are configured to:

obtain a present character of the disorder text in the training text set;

determine a first character based on the character attribute of each character in the disorder text, the first character being a character at each position in front of the current present of the present character in the disorder text;

input the first character, a character attribute of the first character and the character attribute of the present character into the semantic representation model to obtain a character prediction result of the semantic representation model for the present position of the current character; and

calculate a loss function value and adjusting a coefficient of the semantic representation model based on the current character and the character prediction result, to generate the semantic representation model.

7. The apparatus of claim 6 , wherein the one or more processors are configured to:

perform first-level recognition and segmentation on the original text to obtain first-level knowledge units and first-level non-knowledge units; and

perform second-level recognition and segmentation on the first-level knowledge units to obtain second-level knowledge units and second-level non-knowledge units.

8. The apparatus of claim 7 , wherein the first level is a sentence level, and the second level is a word level.

9. The apparatus of claim 6 , wherein the one or more processors are configured to:

perform character-level disorder processing on a plurality of characters comprised in the knowledge units.

10. The apparatus of claim 6 , wherein the one or more processors are configured to:

determine a task scene of the semantic representation model;

obtain training data in the task scene, the training data comprising a training text and a task target; and

train the semantic representation model by employing the training text and the task target to generate the semantic representation model in the task scene.

11. A non-transitory computer readable storage medium having computer instructions stored thereon, wherein the computer instructions are configured to cause a computer to execute a method for generating a semantic representation model, and the method comprises:

obtaining an original text set comprising original texts;

performing recognition and segmentation on the original text to obtain knowledge units and non-knowledge units in the original text;

performing knowledge unit-level disorder processing on the knowledge units and the non-knowledge units in the original text to obtain a disorder text;

generating a character attribute of each character in the disorder text, the character attribute comprising an original position of the character in the original text and a current position of the character;

generating a training text set based on the character attribute of each character in the disorder text; and

training an initial semantic representation model by employing the training text set to generate the semantic representation model;

wherein training the initial semantic representation model by employing the training text set comprises:

obtaining a present character of the disorder text in the training text set;

determining a first character based on the character attribute of each character in the disorder text, the first character being a character at each position in front of the present position of the present character in the disorder text;

inputting the first character, a character attribute of the first character and the character attribute of the present character into the semantic representation model to obtain a character prediction result of the semantic representation model for the current position of the present character; and

calculating a loss function value and adjusting a coefficient of the semantic representation model based on the current character and the character prediction result, to generate the semantic representation model.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 18, 2021
From: WANG, SHUOHUAN; DING, SIYU; SUN, YU
To: BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY CO., LTD.
Reel/Frame 055642/0738 →
Priority Claims (1)
CN 202010574268.1 · Jun 22, 2020 · national
Continuity (1)
Related Publication 20210248484A1 · Aug 12, 2021