P
US11907671B2ActiveUtilityPatentIndex 56

Role labeling method, electronic device and storage medium

Assignee: BEIJING BAIDU NETCOM SCI & TECH CO LTDPriority: Oct 14, 2020Filed: Oct 12, 2021Granted: Feb 20, 2024
Est. expiryOct 14, 2040(~14.3 yrs left)· nominal 20-yr term from priority
Inventors:PAN ZHENGLINBAI JIEWANG YI
G06F 40/35G06F 16/3334G06F 16/35G06F 40/279G06F 40/205G06F 40/30G06N 20/00G06F 40/242G06F 40/295G06F 40/289
56
PatentIndex Score
0
Cited by
22
References
20
Claims

Abstract

The disclosure provides a role labeling method. The method includes: obtaining a dialogue sentence to be labeled and context information corresponding to the dialogue sentence, and splicing the context information and the dialogue sentence to obtain a spliced text; extracting location information of a role name of the dialogue sentence in the spliced text from the spliced text; determining a first candidate role name of the dialogue sentence based on the location information; determining a second candidate role name of the dialogue sentence from role names in the spliced text; and determining a target role name of the dialogue sentence based on the first candidate role name and the second candidate role name, and performing role labeling on the dialogue sentence based on the target role name.

Claims

exact text as granted — not AI-modified
What is claimed is: 
     
       1. A role labeling method, comprising:
 obtaining a dialogue sentence to be labeled and context information corresponding to the dialogue sentence, and splicing the context information and the dialogue sentence to obtain a spliced text; 
 extracting location information of a role name of the dialogue sentence in the spliced text from the spliced text; 
 determining a first candidate role name of the dialogue sentence based on the location information; 
 determining a second candidate role name of the dialogue sentence from role names in the spliced text; and 
 determining a target role name of the dialogue sentence based on the first candidate role name and the second candidate role name, and performing role labeling on the dialogue sentence based on the target role name. 
 
     
     
       2. The method according to  claim 1 , wherein determining the second candidate role name of the dialogue sentence from the role names in the spliced text comprises:
 obtaining the role names in the spliced text; 
 inputting each role name and the spliced text into a role classification model to obtain a probability corresponding to each role name; and 
 determining the second candidate role name of the dialogue sentence based on the probabilities of the role names. 
 
     
     
       3. The method according to  claim 2 , wherein obtaining the role names in the spliced text comprises:
 obtaining a document where the dialogue sentence is located; 
 obtaining a role name set corresponding to the document, wherein the role name set comprises a plurality of third candidate role names; and 
 for each third candidate role name, determining the third candidate role name as a role name in the spliced text in a case that a keyword corresponding to the third candidate role name exists in the spliced text. 
 
     
     
       4. The method according to  claim 2 , wherein the role classification model comprises an input layer, a semantic representation layer and a classification layer, the semantic representation layer comprises a pre-trained language sub-model, and the classification layer comprises a classification sub-model, and inputting each role name and the spliced text into the role classification model to obtain the probability corresponding to each role name comprises:
 splicing each role name and the spliced text through the input layer to obtain an intermediate spliced text corresponding to each role name; 
 inputting each intermediate spliced text into the pre-trained language sub-model to obtain semantic characteristic information of each intermediate spliced text; and 
 inputting the semantic characteristic information into the classification sub-model to obtain the probability corresponding to each role name. 
 
     
     
       5. The method according to  claim 1 , wherein determining the target role name of the dialogue sentence based on the first candidate role name and the second candidate role name comprises:
 obtaining a document where the dialogue sentence is located; 
 obtaining a role name set corresponding to the document; and 
 in a case of determining that both the first candidate role name and the second candidate role name exist in the role name set, selecting one of the first candidate role name and the second candidate role name randomly as the target role name of the dialogue sentence when the first candidate role name is the same as the second candidate role name. 
 
     
     
       6. The method according to  claim 5 , further comprising:
 obtaining a first ranking of the first candidate role name in a preset dictionary ranking, and obtaining a second ranking of the second candidate role name in the preset dictionary ranking when the first candidate role name is different from the second candidate role name; 
 ranking the first candidate role name and the second candidate role name based on the first ranking and the second ranking to obtain a sort result; and 
 determining the first candidate role name as the target role name in response to determining that the first candidate role name ranks before the second candidate role name based on the sort result. 
 
     
     
       7. The method according to  claim 6 , further comprising:
 determining the second candidate role name as the target role name in response to determining that the second candidate role name ranks before the first candidate role name based on the sort result. 
 
     
     
       8. The method according to  claim 1 , wherein the location information comprises a starting location and an ending location, and determining the first candidate role name of the dialogue sentence based on the location information comprises:
 extracting a target text between the starting location and the ending location from the spliced text; and 
 determining the first candidate role name of the dialogue sentence based on the target text. 
 
     
     
       9. The method according to  claim 1 , wherein extracting the location information of the role name of the dialogue sentence in the spliced text from the spliced text comprises:
 inputting the spliced text into an information extraction model to obtain the location information of the role name of the dialogue sentence in the spliced text. 
 
     
     
       10. An electronic device, comprising:
 at least one processor; and 
 a memory communicatively connected with the at least one processor; wherein, 
 the memory stores instructions executable by the at least one processor, and when the instructions are executed by the at least one processor, the at least one processor is caused to execute a role labeling method, the method comprising: 
 obtaining a dialogue sentence to be labeled and context information corresponding to the dialogue sentence, and splicing the context information and the dialogue sentence to obtain a spliced text; 
 extracting location information of a role name of the dialogue sentence in the spliced text from the spliced text; 
 determining a first candidate role name of the dialogue sentence based on the location information; 
 determining a second candidate role name of the dialogue sentence from role names in the spliced text; and 
 determining a target role name of the dialogue sentence based on the first candidate role name and the second candidate role name, and performing role labeling on the dialogue sentence based on the target role name. 
 
     
     
       11. The electronic device according to  claim 10 , wherein determining the second candidate role name of the dialogue sentence from the role names in the spliced text comprises:
 obtaining the role names in the spliced text; 
 inputting each role name and the spliced text into a role classification model to obtain a probability corresponding to each role name; and 
 determining the second candidate role name of the dialogue sentence based on the probabilities of the role names. 
 
     
     
       12. The electronic device according to  claim 11 , wherein obtaining the role names in the spliced text comprises:
 obtaining a document where the dialogue sentence is located; 
 obtaining a role name set corresponding to the document, wherein the role name set comprises a plurality of third candidate role names; and 
 for each third candidate role name, determining the third candidate role name as a role name in the spliced text in a case that a keyword corresponding to the third candidate role name exists in the spliced text. 
 
     
     
       13. The electronic device according to  claim 11 , wherein the role classification model comprises an input layer, a semantic representation layer and a classification layer, the semantic representation layer comprises a pre-trained language sub-model, and the classification layer comprises a classification sub-model, and inputting each role name and the spliced text into the role classification model to obtain the probability corresponding to each role name comprises:
 splicing each role name and the spliced text through the input layer to obtain an intermediate spliced text corresponding to each role name; 
 inputting each intermediate spliced text into the pre-trained language sub-model to obtain semantic characteristic information of each intermediate spliced text; and 
 inputting the semantic characteristic information into the classification sub-model to obtain the probability corresponding to each role name. 
 
     
     
       14. The electronic device according to  claim 10 , wherein determining the target role name of the dialogue sentence based on the first candidate role name and the second candidate role name comprises:
 obtaining a document where the dialogue sentence is located; 
 obtaining a role name set corresponding to the document; and 
 in a case of determining that both the first candidate role name and the second candidate role name exist in the role name set, selecting one of the first candidate role name and the second candidate role name randomly as the target role name of the dialogue sentence when the first candidate role name is the same as the second candidate role name. 
 
     
     
       15. The electronic device according to  claim 14 , wherein the method further comprises:
 obtaining a first ranking of the first candidate role name in a preset dictionary ranking, and obtaining a second ranking of the second candidate role name in the preset dictionary ranking when the first candidate role name is different from the second candidate role name; 
 ranking the first candidate role name and the second candidate role name based on the first ranking and the second ranking to obtain a sort result; and 
 determining the first candidate role name as the target role name in response to determining that the first candidate role name ranks before the second candidate role name based on the sort result. 
 
     
     
       16. The electronic device according to  claim 15 , wherein the method further comprises:
 determining the second candidate role name as the target role name in response to determining that the second candidate role name ranks before the first candidate role name based on the sort result. 
 
     
     
       17. The electronic device according to  claim 10 , wherein the location information comprises a starting location and an ending location, and determining the first candidate role name of the dialogue sentence based on the location information comprises:
 extracting a target text between the starting location and the ending location from the spliced text; and 
 determining the first candidate role name of the dialogue sentence based on the target text. 
 
     
     
       18. The electronic device according to  claim 10 , wherein extracting the location information of the role name of the dialogue sentence in the spliced text from the spliced text comprises:
 inputting the spliced text into an information extraction model to obtain the location information of the role name of the dialogue sentence in the spliced text. 
 
     
     
       19. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are configured to make a computer execute a role labeling method, the method comprising:
 obtaining a dialogue sentence to be labeled and context information corresponding to the dialogue sentence, and splicing the context information and the dialogue sentence to obtain a spliced text; 
 extracting location information of a role name of the dialogue sentence in the spliced text from the spliced text; 
 determining a first candidate role name of the dialogue sentence based on the location information; 
 determining a second candidate role name of the dialogue sentence from role names in the spliced text; and 
 determining a target role name of the dialogue sentence based on the first candidate role name and the second candidate role name, and performing role labeling on the dialogue sentence based on the target role name. 
 
     
     
       20. The non-transitory computer-readable storage medium according to  claim 19 , wherein determining the second candidate role name of the dialogue sentence from the role names in the spliced text comprises:
 obtaining the role names in the spliced text; 
 inputting each role name and the spliced text into a role classification model to obtain a probability corresponding to each role name; and 
 determining the second candidate role name of the dialogue sentence based on the probabilities of the role names.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.