US 12,332,877 B2
Method for acquiring structured question-answering model, question-answering method and corresponding apparatus
Wenbin Jiang, Beijing (CN); Yajuan Lyu, Beijing (CN); Yong Zhu, Beijing (CN); Hua Wu, Beijing (CN); and Haifeng Wang, Beijing (CN)
Assigned to BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD., Beijing (CN)
Filed by BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD., Beijing (CN)
Filed on Jul. 12, 2022, as Appl. No. 17/862,519.
Claims priority of application No. 202110814649.7 (CN), filed on Jul. 19, 2021.
Prior Publication US 2023/0018489 A1, Jan. 19, 2023
Int. Cl. G06F 16/24 (2019.01); G06F 16/21 (2019.01); G06F 16/242 (2019.01); G06F 16/245 (2019.01); G06N 5/02 (2023.01)
CPC G06F 16/243 (2019.01) [G06F 16/212 (2019.01); G06F 16/245 (2019.01); G06N 5/02 (2013.01)] 9 Claims
OG exemplary drawing
 
1. A computer-implemented method for obtaining a structured question-answering (QA) model by training of text generation model, comprising:
acquiring training samples corresponding to N different types of structured QA database, each training sample comprising a question sample, information of the type of a structured QA database and a query instruction sample used by the question sample to query the structured QA database of the type, N being an integer greater than 1, wherein the N different types of structured QA database comprise: table-based structured QA databases and knowledge-based structured QA databases, and the information of the type of the structured QA database comprises: data schema information corresponding to the type of the structured QA database and a task identifier corresponding to the type of the structured QA database, the task identifier indicating the type of structured QA databases queried by the question sample; and
training a text generation model by using the training samples corresponding to N different types of structured QA database to obtain a general structured QA model, wherein the structured QA model is configured to simultaneously use annotation data of a plurality of QA tasks to learn, and share information in the databases and the training samples during the training, and the question samples and the information of the types of structured QA database are taken as input to the text generation model, and the query instruction samples are taken as target output of the text generation model,
wherein the text generation model comprises an encoder and a decoder;
the encoder is configured to encode a sample sequence obtained by splicing the question samples, the structured QA database type information and the query instruction samples in the training samples, to obtain vector representations of Tokens in the sample sequence, wherein the encoder is implemented based on a network layer which comprises a Recurrent Neural Network (RNN) or a Transformer;
the decoder is configured to perform mapping by using the vector representations of the Tokens in the sample sequence, to obtain query instructions which are used to query corresponding structured QA databases for the question sample; and
a training objective of the text generation model is to minimize differences between the query instructions obtained by the decoder and the corresponding query instruction samples.