IP Library Granted Patent US 11,645,316
Granted Patent B2
US 11,645,316 · App. 17/088,053 · Granted May 9, 2023

Question answering method and language model training method, apparatus, device, and storage medium

Inventors: Yingqi Qu (Beijing, CN); Jing Liu (Beijing, CN)
G06F16/3346G06F16/338G06F16/3329G06F16/3344G06F16/3347G06N3/08
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 11,645,316
App. No.
17/088,053
Granted
May 9, 2023
Kind
B2
Abstract

Provided are a question answering method and language model training method, apparatus, device, and storage media, including: acquiring at least one candidate table matching a question to be queried, each candidate table includes a candidate answer corresponding to the question; processing the at least one candidate table to obtain at least one table text, the table text includes textual content of respective fields in the candidate table; inputting the question and each table text into a preset language model respectively to obtain a degree of matching between the question and each candidate table; and outputting a reply table according to the degree of matching of each candidate table, the reply table is a candidate table out of the at least one candidate table whose degree of matching with the question is greater than a preset value or a candidate table that corresponds to a maximum degree of matching.

Claims (60)

1. A question answering method, comprising:

acquiring at least one candidate table matching a question to be queried, wherein each candidate table comprises a candidate answer corresponding to the question;

processing the at least one candidate table to obtain at least one table text, wherein the table text comprises textual content of respective fields in the candidate table, and the fields comprise a title, a header and a cell;

inputting the question and each table text into a preset language model respectively to obtain a degree of matching between the question and each candidate table; and

outputting a reply table according to the degree of matching of each candidate table, wherein the reply table is a candidate table out of the at least one candidate table whose degree of matching with the question is greater than a preset value or a candidate table whose degree of matching with the question is maximum;

wherein the acquiring the at least one candidate table matching the question to be queried comprises:

receiving the question to be queried;

determining an answer category of the question to be queried, wherein the answer category comprises a target category indicating an exact answer, a category indicating a selective answer and a category indicating an interrogative answer; and

acquiring the at least one candidate table matching the question to be queried upon determining that the answer category is the target category indicating the exact answer, wherein the target category comprises at least one of an entity or a number;

wherein the processing the at least one candidate table to obtain the at least one table text comprises:

extracting the textual content of the respective fields in the at least one candidate table respectively; and

splicing the textual content of respective fields of each candidate table together to obtain the at least one table text.

2. The method according to claim 1 , wherein each word in the table text corresponds to field information, and the field information is configured to identify a field to which the word in the table text belongs in the candidate table.

3. The method according to claim 2 , wherein the language model comprises an input layer that comprises a vector coding module, a segment coding module, and a position coding module;

the inputting the question and each table text into the preset language model respectively to obtain the degree of matching between the question and each candidate table comprises:

inputting the question and each table text into the vector coding module to obtain a text vector;

inputting the question, each table text and the field information corresponding to the table text into the segment coding module to obtain a segment vector;

inputting the question and each table text into the position coding module to obtain a position vector; and

determining the degree of matching between the question and each candidate table according to the text vector, the segment vector and the position vector.

4. The method according to claim 1 , wherein the inputting the question and each table text into the preset language model respectively to obtain the degree of matching between the question and each candidate table comprises:

acquiring a probability value outputted by the language model according to the question and each table text; and

determining the degree of matching between the question and each candidate table according to the probability value.

5. The method according to claim 1 , wherein there is one candidate table; wherein the outputting the reply table according to the degree of matching of each candidate table comprises:

determining whether the degree of matching of the candidate table is greater than or equal to a matching degree threshold; and

if the degree of matching of the candidate table is greater than or equal to the matching degree threshold, outputting the candidate table as the reply table.

6. The method according to claim 1 , wherein there is one candidate table; wherein the outputting the reply table according to the degree of matching of each candidate table comprises:

if the degree of matching of the candidate table is less than a matching degree threshold, outputting a prompt message indicating a failure to search a matched answer.

7. The method according to claim 1 , wherein there are at least two candidate tables;

wherein the outputting the reply table according to the degree of matching of each candidate table comprises:

outputting a candidate table corresponding to a highest degree of matching as the reply table.

8. A question answering apparatus, comprising:

at least one processor; and

a memory communicatively connected to the at least one processor;

wherein the memory is stored with an instruction executable by the at least one processor, and the instruction is executed by the at least one processor to enable the at least one processor to:

acquire at least one candidate table matching a question to be queried, wherein each candidate table comprises a candidate answer corresponding to the question;

process the at least one candidate table to obtain at least one table text, wherein the table text comprises textual content of respective fields in the candidate table, and the fields comprise a title, a header and a cell;

input the question and each table text into a preset language model respectively to obtain a degree of matching between the question and each candidate table; and

output a reply table according to the degree of matching of each candidate table, wherein the reply table is a candidate table out of the at least one candidate table whose degree of matching with the question is greater than a preset value or a candidate table whose degree of matching with the question is maximum;

wherein the instruction is executed by the at least one processor to enable the at least one processor to:

receive the question to be queried;

determine an answer category of the question to be queried, wherein the answer category comprises a target category indicating an exact answer, a category indicating a selective answer and a category indicating an interrogative answer; and

acquire the at least one candidate table matching the question to be queried upon determining that the answer category is the target category indicating the exact answer, wherein the target category comprises at least one of an entity or a number;

wherein the instruction is executed by the at least one processor to enable the at least one processor to:

extract the textual content of the respective field in the at least one candidate table respectively; and

splice the textual content of respective fields of each candidate table together to obtain the at least one table text.

9. The apparatus according to claim 8 , wherein each word in the table text corresponds to field information, and the field information is configured to identify a field to which the word in the table text belongs in the candidate table.

10. The apparatus according to claim 9 , wherein the language model comprises an input layer that comprises a vector coding module, a segment coding module, and a position coding module;

the instruction is executed by the at least one processor to enable the at least one processor to:

input the question and each table text into the vector coding module to obtain a text vector; input the question, each table text and the field information corresponding to the table text into the segment coding module to obtain a segment vector; and input the question and each table text into the position coding module to obtain a position vector; and

determine the degree of matching between the question and each candidate table according to the text vector, the segment vector and the position vector.

11. The apparatus according to claim 8 , wherein the instruction is executed by the at least one processor to enable the at least one processor to:

acquire a probability value outputted by the language model according to the question and each table text; and

determine the degree of matching between the question and each candidate table according to the probability value.

12. The apparatus according to claim 8 , wherein there is one candidate table; wherein the instruction is executed by the at least one processor to enable the at least one processor to:

determine whether the degree of matching of the candidate table is greater than or equal to a matching degree threshold; and if the degree of matching of the candidate table is greater than or equal to the matching degree threshold, output the candidate table as the reply table.

13. The apparatus according to claim 8 , wherein there is one candidate table; wherein the instruction is executed by the at least one processor to enable the at least one processor to:

if the degree of matching of the candidate table is less than a matching degree threshold, output a prompt message indicating a failure to search a matched answer.

14. The apparatus according to claim 8 , wherein there are at least two candidate tables;

wherein the instruction is executed by the at least one processor to enable the at least one processor to:

output a candidate table corresponding to a highest degree of matching as the reply table.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Aug 10, 2021
From: QU, YINGQI; LIU, JING
To: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
Reel/Frame 057133/0655 →
Priority Claims (1)
CN 202010460778.6 · May 27, 2020 · national
Continuity (1)
Related Publication 20210191962A1 · Jun 24, 2021