[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN112685543B - A method and device for answering questions based on text - Google Patents

A method and device for answering questions based on text Download PDF

Info

Publication number
CN112685543B
CN112685543B CN201910995402.2A CN201910995402A CN112685543B CN 112685543 B CN112685543 B CN 112685543B CN 201910995402 A CN201910995402 A CN 201910995402A CN 112685543 B CN112685543 B CN 112685543B
Authority
CN
China
Prior art keywords
semantic information
question
text
parameter
text semantic
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910995402.2A
Other languages
Chinese (zh)
Other versions
CN112685543A (en
Inventor
曹秀亭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Potevio Information Technology Co Ltd
Original Assignee
Potevio Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Potevio Information Technology Co Ltd filed Critical Potevio Information Technology Co Ltd
Priority to CN201910995402.2A priority Critical patent/CN112685543B/en
Publication of CN112685543A publication Critical patent/CN112685543A/en
Application granted granted Critical
Publication of CN112685543B publication Critical patent/CN112685543B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the invention provides a method and a device for answering questions based on texts, wherein the method comprises the following steps: inputting the question semantic information and the text semantic information into a preset question answer model, and determining a first parameter corresponding to each word in the text semantic information and a second parameter corresponding to each word in the question semantic information according to the question semantic information, the text semantic information and a classifier in the preset question answer model; determining context characterization parameters of the perceivable problem according to the first parameter, the second parameter, the text semantic information and the fully connected network in the preset problem answer model; and outputting a start index and a stop index of the answer questions in the text semantic information according to the question semantic information and the context characterization parameters. The apparatus performs the above method. The method and the device provided by the embodiment of the invention can accurately output the starting index and the ending index of the answer questions in the text semantic information.

Description

一种基于文本回答问题的方法及装置A method and device for answering questions based on text

技术领域Technical field

本发明涉及人工智能技术领域,尤其涉及一种基于文本回答问题的方法及装置。The present invention relates to the field of artificial intelligence technology, and in particular, to a method and device for answering questions based on text.

背景技术Background technique

随着人工智能技术的发展,人们需要让计算机替代人们进行一部分活动,例如,让计算机像人类一样阅读文本,进而根据对该文本的理解来回答问题。这种阅读理解就像是让计算机来做类似高考英语的阅读理解题。目前,基于神经网络的方法成为主流趋势,因为它们可以抓住问题和文本之间的语义和语法关系。With the development of artificial intelligence technology, people need to let computers replace people in part of their activities. For example, let computers read text like humans and answer questions based on their understanding of the text. This kind of reading comprehension is like asking a computer to do reading comprehension questions similar to college entrance examination English. Currently, neural network-based methods have become a mainstream trend because they can capture the semantic and grammatical relationships between questions and texts.

现有技术利用LSTM实现基于文本回答问题,具体可以包括:采用Seq2Seq的模型方案,利用LSTM进行编码器-解码器进行学习序列到序列模型的阅读理解,包括两个LSTM:即一个编码器和一个解码器。编码器将序列作为输入,并在每个时间点处理一个符号,其目的就是将符号序列转换为固定大小的特征向量,该特征向量仅对序列中的重要信息进行编码,同时丢失不必要的信息。通过Seq2Seq的模型方案可以实现阅读理解,输入是question(问题语义信息)和documents(文本语义信息),通过模型在documents扫描输出起始index和终止index,但是,上述方法并不能很好的解决这个问题,回答问题的准确率很低。The existing technology uses LSTM to answer questions based on text. Specifically, it can include: using the Seq2Seq model solution, using the LSTM encoder-decoder to learn sequence-to-sequence model reading comprehension, including two LSTMs: one encoder and one decoder. The encoder takes a sequence as input and processes one symbol at each time point. Its purpose is to convert the symbol sequence into a fixed-size feature vector that only encodes important information in the sequence while losing unnecessary information. . Reading comprehension can be achieved through the Seq2Seq model solution. The input is question (question semantic information) and documents (text semantic information). The model scans and outputs the starting index and ending index in the documents. However, the above method cannot solve this problem well. question, the accuracy of answering the question is very low.

发明内容Contents of the invention

针对现有技术存在的问题,本发明实施例提供一种基于文本回答问题的方法及装置。In order to solve the problems existing in the existing technology, embodiments of the present invention provide a method and device for answering questions based on text.

本发明实施例提供一种基于文本回答问题的方法,包括:Embodiments of the present invention provide a method for answering questions based on text, including:

输入问题语义信息和文本语义信息至预设问题回答模型,并根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数;其中,所述第一参数包含问题语义信息中的、与文本语义信息中的各词分别相关的语义信息、所述第二参数包含文本语义信息中的、与问题语义信息中的各词分别相关的语义信息;Input the question semantic information and the text semantic information into the preset question answering model, and determine the first words corresponding to each word in the text semantic information based on the question semantic information, the text semantic information and the classifier in the preset question answering model. A parameter, and a second parameter respectively corresponding to each word in the question semantic information; wherein the first parameter includes semantic information in the question semantic information, respectively related to each word in the text semantic information, the said third parameter The second parameter contains the semantic information in the text semantic information and related to each word in the question semantic information;

根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数;Determine the context representation parameters of the perceptible question according to the first parameter, the second parameter, the text semantic information and the fully connected network in the preset question answering model;

根据所述问题语义信息和所述上下文表征参数,在所述文本语义信息中输出回答问题的起始索引和终止索引。According to the question semantic information and the context characterization parameter, a start index and an end index of answering the question are output in the text semantic information.

其中,所述根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数,包括:Wherein, based on the question semantic information, the text semantic information and the classifier in the preset question answering model, the first parameters respectively corresponding to each word in the text semantic information and the first parameters corresponding to each word in the question semantic information are determined. The corresponding second parameters include:

根据问题语义信息和文本语义信息,确定相似度矩阵;所述相似度矩阵的行是与文本语义信息中的各词分别对应的问题语义信息中的全部词之间的相似度,所述相似度矩阵的列是与问题语义信息中的各词分别对应的文本语义信息中的全部词之间的相似度;According to the question semantic information and the text semantic information, a similarity matrix is determined; the rows of the similarity matrix are the similarities between all words in the question semantic information corresponding to each word in the text semantic information, and the similarity is The columns of the matrix are the similarities between all words in the text semantic information corresponding to each word in the question semantic information;

根据所述相似度矩阵、所述问题语义信息和所述分类器,确定所述第一参数,并根据所述相似度矩阵、所述文本语义信息和所述分类器,确定所述第二参数。The first parameter is determined based on the similarity matrix, the question semantic information and the classifier, and the second parameter is determined based on the similarity matrix, the text semantic information and the classifier .

其中,所述根据所述相似度矩阵、所述问题语义信息和所述分类器,确定所述第一参数,包括:根据如下公式确定所述第一参数:Wherein, determining the first parameter according to the similarity matrix, the question semantic information and the classifier includes: determining the first parameter according to the following formula:

U'=Σj(softmax(St:)*U:j)U'=Σ j (softmax(S t: )*U :j )

其中,U'为所述第一参数、softmax为所述分类器、St:为所述相似度矩阵中第t行的所有数据、U:j为问题语义信息中第j列的所有数据。Wherein, U' is the first parameter, softmax is the classifier, S t: is all the data in the t-th row in the similarity matrix, and U :j is all the data in the j-th column in the question semantic information.

其中,所述根据所述相似度矩阵、所述文本语义信息和所述分类器,确定所述第二参数,包括:根据如下公式计算所述第二参数:Wherein, determining the second parameter based on the similarity matrix, the text semantic information and the classifier includes: calculating the second parameter according to the following formula:

H'=Σt(softmax(max(S:j))*Ht:)H'=Σ t (softmax(max(S :j ))*H t: )

其中,H'为所述第二参数、softmax为所述分类器、max为求最大值函数、S:j为所述相似度矩阵中第j列的所有数据、Ht:为文本语义信息中第t行的所有数据。Wherein, H' is the second parameter, softmax is the classifier, max is the maximum function, S :j is all the data in the jth column in the similarity matrix, Ht : is the text semantic information. All data in row t.

其中,所述根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数,包括,根据如下拼接方式确定所述上下文表征参数:Wherein, determining the context representation parameters of perceptible questions according to the first parameter, the second parameter, the text semantic information and the fully connected network in the preset question answering model includes, based on the following splicing The context characterization parameters are determined by:

G=β(H;U';H*U';H*H')G=β(H;U';H*U';H*H')

其中,G为所述上下文表征参数、β为所述全连接网络、H为所述文本语义信息、U'为所述第一参数、所述H'为所述第二参数。Wherein, G is the context representation parameter, β is the fully connected network, H is the text semantic information, U' is the first parameter, and H' is the second parameter.

其中,所述输入问题语义信息和文本语义信息至预设问题回答模型的步骤之后,所述基于文本回答问题的方法还包括:Wherein, after the step of inputting question semantic information and text semantic information into the preset question answering model, the method of answering questions based on text also includes:

对所述文本语义信息和所述问题语义信息分别进行编码处理;Encoding the text semantic information and the question semantic information respectively;

用编码处理后的文本语义信息和编码处理后的问题语义信息替换所述根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数步骤中的问题语义信息和文本语义信息,并执行后续步骤。Use the encoded text semantic information and the encoded question semantic information to replace the classifier in the question semantic information, the text semantic information and the preset question answering model, and determine the difference between each word in the text semantic information. The corresponding first parameter, the question semantic information and the text semantic information in the second parameter step respectively corresponding to each word in the question semantic information, and perform subsequent steps.

其中,所述对所述文本语义信息和所述问题语义信息分别进行编码处理,包括:Wherein, encoding the text semantic information and the question semantic information separately includes:

对于所述文本语义信息进行如下处理:The text semantic information is processed as follows:

对所述文本语义信息进行向量化处理,以获取文本语义向量;Perform vectorization processing on the text semantic information to obtain text semantic vectors;

输入所述文本语义向量至所述预设问题回答模型中的self-attention层、并采用L2norm对self-attention层的输出结果和所述文本语义向量进行处理,以获取第一处理结果;Input the text semantic vector to the self-attention layer in the preset question answering model, and use L2norm to process the output result of the self-attention layer and the text semantic vector to obtain the first processing result;

输入所述第一处理结果至所述预设问题回答模型中的前馈神经网络、并采用L2norm对前馈神经网络的输出结果和所述第一处理结果进行处理,以获取第二处理结果;Input the first processing result to the feedforward neural network in the preset question answering model, and use L2norm to process the output result of the feedforward neural network and the first processing result to obtain the second processing result;

对于所述问题语义信息进行如下处理:The semantic information of the problem is processed as follows:

对所述问题语义信息进行向量化处理,以获取问题语义向量;Vectorize the question semantic information to obtain a question semantic vector;

输入所述问题语义向量至所述预设问题回答模型中的self-attention层、并采用L2norm对self-attention层的输出结果和所述问题语义向量进行处理,以获取第一处理结果;Input the question semantic vector to the self-attention layer in the preset question answering model, and use L2norm to process the output result of the self-attention layer and the question semantic vector to obtain the first processing result;

输入所述第一处理结果至所述预设问题回答模型中的前馈神经网络、并采用L2norm对前馈神经网络的输出结果和所述第一处理结果进行处理,以获取第二处理结果。The first processing result is input to the feedforward neural network in the preset question answering model, and L2norm is used to process the output result of the feedforward neural network and the first processing result to obtain the second processing result.

本发明实施例提供一种基于文本回答问题的装置,包括:An embodiment of the present invention provides a device for answering questions based on text, including:

第一确定单元,用于输入问题语义信息和文本语义信息至预设问题回答模型,并根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数;其中,所述第一参数包含问题语义信息中的、与文本语义信息中的各词分别相关的语义信息、所述第二参数包含文本语义信息中的、与问题语义信息中的各词分别相关的语义信息;The first determination unit is used to input question semantic information and text semantic information into the preset question answering model, and determine the text semantic information based on the question semantic information, text semantic information and the classifier in the preset question answering model. The first parameter corresponding to each word in the question semantic information, and the second parameter corresponding to each word in the question semantic information; wherein, the first parameter includes the question semantic information, respectively related to each word in the text semantic information. The semantic information, the second parameter includes semantic information in the text semantic information that is respectively related to each word in the question semantic information;

第二确定单元,用于根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数;A second determination unit configured to determine context representation parameters of perceptible questions based on the first parameter, the second parameter, the text semantic information and the fully connected network in the preset question answering model;

回答单元,用于根据所述问题语义信息和所述上下文表征参数,在所述文本语义信息中输出回答问题的起始索引和终止索引。An answering unit, configured to output a start index and an end index of answering the question in the text semantic information according to the question semantic information and the context characterization parameter.

本发明实施例提供一种电子设备,包括:存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,An embodiment of the present invention provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein,

所述处理器执行所述计算机程序时实现如下方法步骤:When the processor executes the computer program, the following method steps are implemented:

输入问题语义信息和文本语义信息至预设问题回答模型,并根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数;其中,所述第一参数包含问题语义信息中的、与文本语义信息中的各词分别相关的语义信息、所述第二参数包含文本语义信息中的、与问题语义信息中的各词分别相关的语义信息;Input the question semantic information and the text semantic information into the preset question answering model, and determine the first words corresponding to each word in the text semantic information based on the question semantic information, the text semantic information and the classifier in the preset question answering model. A parameter, and a second parameter respectively corresponding to each word in the question semantic information; wherein the first parameter includes semantic information in the question semantic information, respectively related to each word in the text semantic information, the said third parameter The second parameter contains the semantic information in the text semantic information and related to each word in the question semantic information;

根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数;Determine the context representation parameters of the perceptible question according to the first parameter, the second parameter, the text semantic information and the fully connected network in the preset question answering model;

根据所述问题语义信息和所述上下文表征参数,在所述文本语义信息中输出回答问题的起始索引和终止索引。According to the question semantic information and the context characterization parameter, a start index and an end index of answering the question are output in the text semantic information.

本发明实施例提供一种非暂态计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如下方法步骤:Embodiments of the present invention provide a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the following method steps are implemented:

输入问题语义信息和文本语义信息至预设问题回答模型,并根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数;其中,所述第一参数包含问题语义信息中的、与文本语义信息中的各词分别相关的语义信息、所述第二参数包含文本语义信息中的、与问题语义信息中的各词分别相关的语义信息;Input the question semantic information and the text semantic information into the preset question answering model, and determine the first words corresponding to each word in the text semantic information based on the question semantic information, the text semantic information and the classifier in the preset question answering model. A parameter, and a second parameter respectively corresponding to each word in the question semantic information; wherein the first parameter includes semantic information in the question semantic information, respectively related to each word in the text semantic information, the said third parameter The second parameter contains the semantic information in the text semantic information and related to each word in the question semantic information;

根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数;Determine the context representation parameters of the perceptible question according to the first parameter, the second parameter, the text semantic information and the fully connected network in the preset question answering model;

根据所述问题语义信息和所述上下文表征参数,在所述文本语义信息中输出回答问题的起始索引和终止索引。According to the question semantic information and the context characterization parameter, a start index and an end index of answering the question are output in the text semantic information.

本发明实施例提供的基于文本回答问题的方法及装置,通过可反映问题语义信息和文本语义信息之间的双向语义关系的第一参数和第二参数,确定可感知问题的上下文表征参数,进而能够在文本语义信息中准确输出回答问题的起始索引和终止索引。The method and device for answering questions based on text provided by the embodiments of the present invention determine the contextual representation parameters of the perceptible question through the first parameter and the second parameter that can reflect the bidirectional semantic relationship between the question semantic information and the text semantic information, and then It can accurately output the starting index and ending index of answering the question in the text semantic information.

附图说明Description of the drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without exerting creative efforts.

图1为本发明基于文本回答问题的方法实施例流程图;Figure 1 is a flow chart of an embodiment of a method for answering questions based on text according to the present invention;

图2为本发明基于文本回答问题的方法另一实施例流程图;Figure 2 is a flow chart of another embodiment of the method for answering questions based on text according to the present invention;

图3为本发明基于文本回答问题的装置实施例结构示意图;Figure 3 is a schematic structural diagram of an embodiment of a device for answering questions based on text according to the present invention;

图4为本发明实施例提供的电子设备实体结构示意图。FIG. 4 is a schematic diagram of the physical structure of an electronic device according to an embodiment of the present invention.

具体实施方式Detailed ways

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments These are some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts fall within the scope of protection of the present invention.

图1为本发明基于文本回答问题的方法实施例流程图,如图1所示,本发明实施例提供的一种基于文本回答问题的方法,包括以下步骤:Figure 1 is a flow chart of a method for answering questions based on text according to the present invention. As shown in Figure 1, a method for answering questions based on text provided by an embodiment of the present invention includes the following steps:

S101:输入问题语义信息和文本语义信息至预设问题回答模型,并根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数;其中,所述第一参数包含问题语义信息中的、与文本语义信息中的各词分别相关的语义信息、所述第二参数包含文本语义信息中的、与问题语义信息中的各词分别相关的语义信息。S101: Input question semantic information and text semantic information into the preset question answering model, and determine the corresponding words in the text semantic information based on the question semantic information, text semantic information and the classifier in the preset question answering model. The first parameter, and the second parameter respectively corresponding to each word in the question semantic information; wherein, the first parameter includes the semantic information in the question semantic information, respectively related to each word in the text semantic information, the The second parameter includes semantic information in the text semantic information that is respectively related to each word in the question semantic information.

具体的,输入问题语义信息和文本语义信息至预设问题回答模型,并根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数;其中,所述第一参数包含问题语义信息中的、与文本语义信息中的各词分别相关的语义信息、所述第二参数包含文本语义信息中的、与问题语义信息中的各词分别相关的语义信息。执行该方法步骤的可以是计算机设备。预设问题回答模型可以为神经网络,不作具体限定。问题语义信息和文本语义信息的数据主要来源可以来自于百度知道数据,由于,百度知道上有大量的话题发布,以及话题下许多人对其进行的延伸意义解读、反讽等等信息是真实的人与人交流的数据信息。百度知道上的问题就是模型中的query,而对应问题下的好几个回答就是documents。Specifically, the question semantic information and the text semantic information are input to the preset question answering model, and based on the question semantic information, the text semantic information and the classifier in the preset question answering model, the respective words in the text semantic information are determined. The corresponding first parameter, and the second parameter respectively corresponding to each word in the question semantic information; wherein, the first parameter includes the semantic information in the question semantic information, respectively related to each word in the text semantic information, The second parameter includes semantic information in the text semantic information that is respectively related to each word in the question semantic information. The method steps may be performed by a computer device. The preset question answering model can be a neural network and is not specifically limited. The main source of data for question semantic information and text semantic information can come from Baidu Zhidao data, because there are a large number of topic posts on Baidu Zhidao, and many people's extended meaning interpretation, irony and other information under the topic are real people. Data information communicated with people. The question on Baidu Knows is the query in the model, and several answers to the corresponding question are documents.

可以采用模块化设计实现本发明实施例,图2为本发明基于文本回答问题的方法另一实施例流程图,如图2所示,主要包括三个模块:(1)编码模块(对应Query Encoder和Documents Encoder):query和documents在Embedding(向量化)后输入到编码模块,其中,编码模块可以采用3个transformer(对应u1~u3或h1~h3)的编码器,使用self-attention的机制能够在训练上加快速度,并且可以让模型记住长距离的语义信息;(2)双向注意机制模块(对应Attention Flow Match Layer):从编码模块能得到query语义信息和documents语义信息,通过相似度矩阵计算词和词之间的关系,设计双向的注意力机制,输入到前馈神经网络得到它们的语义关系向量;(3)解码模块:借助于现有的注意力机制公式,采用Pointer Networks获得documents的起始索引和终止索引。Modular design can be used to implement the embodiments of the present invention. Figure 2 is a flow chart of another embodiment of the method for answering questions based on text of the present invention. As shown in Figure 2, it mainly includes three modules: (1) Encoding module (corresponding to Query Encoder and Documents Encoder): query and documents are input to the encoding module after Embedding (vectorization). Among them, the encoding module can use three transformer (corresponding to u1 ~ u3 or h1 ~ h3) encoders, using the self-attention mechanism. It speeds up training and allows the model to remember long-distance semantic information; (2) Bidirectional attention mechanism module (corresponding to Attention Flow Match Layer): query semantic information and documents semantic information can be obtained from the encoding module, through the similarity matrix Calculate the relationship between words, design a two-way attention mechanism, and input it into the feedforward neural network to obtain their semantic relationship vectors; (3) Decoding module: With the help of the existing attention mechanism formula, Pointer Networks is used to obtain documents the starting index and ending index.

对上述三个模块具体说明如下:The detailed description of the above three modules is as follows:

对于(1)编码模块:For (1) encoding module:

首先,编码模块的输入是Embedding的query和documents,可以利用腾讯的词向量文件进行查表,映射每个词为200维的向量。First, the input of the encoding module is Embedding's query and documents. You can use Tencent's word vector file to look up the table and map each word into a 200-dimensional vector.

编码模块主要由三个transformer组成,每一个transformer的每个位置的词向量都会通过一个self-attention层,然后将通过之前的词向量和输出加在一起,并采用L2norm进行处理,这样可以避免发生梯度弥散。最终的输出再通过前馈神经网络,然后,将通过之前的输出与其加在一起,并采用L2norm进行处理。即对所述文本语义信息和所述问题语义信息分别进行编码处理,参照图2,可以用编码处理后的文本语义信息和编码处理后的问题语义信息替换上述根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数步骤中的问题语义信息和文本语义信息,并执行后续步骤,例如后续步骤S102和S103。进一步地,以文本语义信息为例,进行如下处理:The encoding module is mainly composed of three transformers. The word vector at each position of each transformer will pass through a self-attention layer, and then the previous word vectors and outputs will be added together and processed using L2norm, so as to avoid Gradient dispersion. The final output is then passed through the feedforward neural network, and then the previous outputs are added together and processed using L2norm. That is, the text semantic information and the question semantic information are encoded separately. Referring to Figure 2, the encoded text semantic information and the encoded question semantic information can be used to replace the above-mentioned problem semantic information, text semantic information and The classifier in the preset question answering model determines the first parameter corresponding to each word in the text semantic information and the second parameter corresponding to each word in the question semantic information. The question semantic information and Text semantic information, and perform subsequent steps, such as subsequent steps S102 and S103. Further, taking text semantic information as an example, the following processing is performed:

对所述文本语义信息进行向量化处理,以获取文本语义向量(对应图2中words);输入所述文本语义向量至所述预设问题回答模型中的self-attention层、并采用L2norm(就是欧几里德距离)对self-attention层的输出结果和所述文本语义向量进行处理,以获取第一处理结果;输入所述第一处理结果至所述预设问题回答模型中的前馈神经网络、并采用L2norm对前馈神经网络的输出结果和所述第一处理结果进行处理,以获取第二处理结果。对于问题语义信息,可参照文本语义信息的说明,不再赘述。Perform vectorization processing on the text semantic information to obtain text semantic vectors (corresponding to words in Figure 2); input the text semantic vector to the self-attention layer in the preset question answering model, and use L2norm (that is, Euclidean distance) processes the output result of the self-attention layer and the text semantic vector to obtain the first processing result; input the first processing result to the feedforward neural in the preset question answering model network, and use L2norm to process the output result of the feedforward neural network and the first processing result to obtain the second processing result. For question semantic information, please refer to the description of text semantic information and will not go into details.

这里没有采用LSTM去获得句子的语义信息的原因是,documents中平均的词个数是300多,所以对于LSTM是很难训练的,很容易发生梯度弥散,而采用三层transformer能够有效的避免这个问题,并且也能加快训练。The reason why LSTM is not used to obtain the semantic information of sentences is that the average number of words in documents is more than 300, so it is difficult to train LSTM and gradient dispersion is easy to occur. The use of three-layer transformer can effectively avoid this problem, and can also speed up training.

对于(2)双向注意机制模块:For (2) bidirectional attention mechanism module:

该模块的输入是通过编码模块得到的query语义信息U和documents语义信息H。输出是具有问题感知的上下文表征参数G。The input of this module is the query semantic information U and documents semantic information H obtained through the encoding module. The output is a problem-aware context representation parameter G.

首先,可以计算H和U的相似度矩阵(对应根据问题语义信息和文本语义信息,确定相似度矩阵):First, the similarity matrix of H and U can be calculated (corresponding to determining the similarity matrix based on the question semantic information and text semantic information):

Stj=α(Ht,Uj)S tj =α(H t ,U j )

Stj表示的是H中第t列向量h和U中第j列向量u的相似度矩阵。α表示可以训练的映射函数,其中,α=W[h;u;h*u],W表示权值矩阵,如图2所示,相似度矩阵用于共享矩阵documents-to-query以及query-to-documents两个方向的attention,其中,第t行表示的是:文本中第t个词与问题中每一个词之间的相似度,第j列表示的是:问题中第j个词与文本中每一个词的相似度。S tj represents the similarity matrix between the t-th column vector h in H and the j-th column vector u in U. α represents the mapping function that can be trained, where α = W [h; u; h*u], W represents the weight matrix, as shown in Figure 2, the similarity matrix is used to share the matrix documents-to-query and query- to-documents attention in two directions, where the t-th row represents: the similarity between the t-th word in the text and each word in the question, and the j-th column represents: the j-th word in the question and The similarity of each word in the text.

(1).documents-to-query Attention计算的是:对每个documents word而言哪些query words和它最相关。计算公式如下(对应根据所述相似度矩阵、所述问题语义信息和所述分类器,确定所述第一参数):(1).Documents-to-query Attention calculates: for each document word, which query words are most relevant to it. The calculation formula is as follows (corresponding to determining the first parameter based on the similarity matrix, the question semantic information and the classifier):

U'=Σj(softmax(St:)*U:j)U'=Σ j (softmax(S t: )*U :j )

其中,U'为所述第一参数、softmax为所述分类器、St:为所述相似度矩阵中第t行的所有数据、U:j为问题语义信息中第j列的所有数据。Wherein, U' is the first parameter, softmax is the classifier, S t: is all the data in the t-th row in the similarity matrix, and U :j is all the data in the j-th column in the question semantic information.

将相似度矩阵Stj的每一行经过softmax层直接作为注意力值,因为,Stj中每一行表示的是文本中第t个词与问题中每个词之间的相似度,documents-to-query表示的就是documents对query的影响,再与U的每一列加权求和得到U'。Each row of the similarity matrix S tj is directly used as an attention value through the softmax layer, because each row in S tj represents the similarity between the t-th word in the text and each word in the question, documents-to- Query represents the impact of documents on query, and then weighted and summed with each column of U to obtain U'.

(2).query-to-documents Attention计算的是:对每个query words而言哪些documents word和它最相关。计算公式如下(对应根据所述相似度矩阵、所述文本语义信息和所述分类器,确定所述第二参数):(2).query-to-documents Attention calculates: for each query words, which documents words are most relevant to it. The calculation formula is as follows (corresponding to determining the second parameter based on the similarity matrix, the text semantic information and the classifier):

H'=Σt(softmax(max(S:j))*Ht:)H'=Σ t (softmax(max(S :j ))*H t: )

其中,H'为所述第二参数、softmax为所述分类器、max为求最大值函数、S:j为所述相似度矩阵中第j列的所有数据、Ht:为文本语义信息中第t行的所有数据。Wherein, H' is the second parameter, softmax is the classifier, max is the maximum function, S :j is all the data in the jth column in the similarity matrix, Ht : is the text semantic information. All data in row t.

由于,这些文本对回答问题很重要,所以直接取相似度矩阵中最大的那一列,对其进行softmax归一化计算documents向量加权求和,得到H'。Since these texts are very important to answer the question, we directly take the largest column in the similarity matrix, perform softmax normalization on it, calculate the weighted sum of the documents vectors, and obtain H'.

(3).将前两步得到的U'和H'经过拼接输入到全连接网络得到具有问题感知的上下文表征G,拼接方式可以是G=β(H;U';H*U';H*H'),其中,β就是全连接网络。(3). The U' and H' obtained in the first two steps are spliced and input into the fully connected network to obtain the problem-aware context representation G. The splicing method can be G=β(H; U'; H*U'; H *H'), where β is a fully connected network.

对于(3)解码模块:For (3) decoding module:

该模块的输入是通过编码模块得到的query语义信息U和双向注意机制模块得到的具有问题感知的上下文表征G,输出是在documents上起始索引和终止的索引。The input of this module is the query semantic information U obtained through the encoding module and the problem-aware context representation G obtained through the bidirectional attention mechanism module. The output is the starting index and ending index on the documents.

基于机器阅读理解的特点,通过一种类似指针的方式解决问题,每个指针对应输入序列的一个元素,从而可以直接操作输入序列而不需要特意设定输出词汇表。Based on the characteristics of machine reading comprehension, the problem is solved in a pointer-like manner. Each pointer corresponds to an element of the input sequence, so that the input sequence can be directly manipulated without the need to specifically set the output vocabulary.

通过tanh激活函数结合query语义信息U和上下文表征G,最终通过softmax输出documents的最大起始和终止索引点。The query semantic information U and the context representation G are combined through the tanh activation function, and finally the maximum starting and ending index points of the documents are output through softmax.

通过基于transformer网络结构进行机器阅读理解,克服了之前使用循环神经网络的训练时间慢、更新时间长的缺点。该机器阅读理解还结合了问题和文档间的信息,提高输出准确率。Through machine reading and understanding based on the transformer network structure, the shortcomings of slow training time and long update time of the previous use of recurrent neural networks are overcome. This machine reading comprehension also combines information between questions and documents to improve output accuracy.

S102:根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数。S102: Determine the context representation parameters of the perceptible question according to the first parameter, the second parameter, the text semantic information and the fully connected network in the preset question answering model.

具体的,根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数。进一步地,可以根据如下拼接方式确定所述上下文表征参数:Specifically, the context representation parameters of the perceptible question are determined according to the first parameter, the second parameter, the text semantic information and the fully connected network in the preset question answering model. Further, the context characterization parameters can be determined according to the following splicing method:

G=β(H;U';H*U';H*H')G=β(H;U';H*U';H*H')

其中,G为所述上下文表征参数、β为所述全连接网络、H为所述文本语义信息、U'为所述第一参数、所述H'为所述第二参数。可参照上述说明,不再赘述。Wherein, G is the context representation parameter, β is the fully connected network, H is the text semantic information, U' is the first parameter, and H' is the second parameter. Please refer to the above description and will not repeat them again.

S103:根据所述问题语义信息和所述上下文表征参数,在所述文本语义信息中输出回答问题的起始索引和终止索引。S103: According to the question semantic information and the context representation parameter, output the start index and the end index of answering the question in the text semantic information.

具体的,根据所述问题语义信息和所述上下文表征参数,在所述文本语义信息中输出回答问题的起始索引和终止索引。可参照上述说明,不再赘述。Specifically, according to the question semantic information and the context representation parameter, the starting index and the ending index of answering the question are output in the text semantic information. Please refer to the above description and will not repeat them again.

本发明实施例提供的基于文本回答问题的方法,通过可反映问题语义信息和文本语义信息之间的双向语义关系的第一参数和第二参数,确定可感知问题的上下文表征参数,进而能够在文本语义信息中准确输出回答问题的起始索引和终止索引。The text-based question answering method provided by the embodiment of the present invention determines the context representation parameters of the perceptible question through the first parameter and the second parameter that can reflect the bidirectional semantic relationship between the question semantic information and the text semantic information, and thereby can Accurately output the starting index and ending index of answering the question in the text semantic information.

在上述实施例的基础上,所述根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数,包括:On the basis of the above embodiments, based on the question semantic information, the text semantic information and the classifier in the preset question answering model, the first parameters respectively corresponding to each word in the text semantic information and the question are determined. The second parameters corresponding to each word in the semantic information include:

具体的,根据问题语义信息和文本语义信息,确定相似度矩阵;所述相似度矩阵的行是与文本语义信息中的各词分别对应的问题语义信息中的全部词之间的相似度,所述相似度矩阵的列是与问题语义信息中的各词分别对应的文本语义信息中的全部词之间的相似度;可参照上述说明,不再赘述。Specifically, a similarity matrix is determined based on the question semantic information and the text semantic information; the rows of the similarity matrix are the similarities between all words in the question semantic information corresponding to each word in the text semantic information, so The columns of the similarity matrix are the similarities between all words in the text semantic information corresponding to each word in the question semantic information; please refer to the above description and will not be described again.

具体的,根据所述相似度矩阵、所述问题语义信息和所述分类器,确定所述第一参数,并根据所述相似度矩阵、所述文本语义信息和所述分类器,确定所述第二参数。可参照上述说明,不再赘述。Specifically, the first parameter is determined based on the similarity matrix, the question semantic information and the classifier, and the first parameter is determined based on the similarity matrix, the text semantic information and the classifier. The second parameter. Please refer to the above description and will not repeat them again.

本发明实施例提供的基于文本回答问题的方法,通过引入相似度矩阵确定第一参数和第二参数,保证第一参数和第二参数确定的合理性,进一步能够在文本语义信息中准确输出回答问题的起始索引和终止索引。The method for answering questions based on text provided by the embodiment of the present invention determines the first parameter and the second parameter by introducing a similarity matrix, ensuring the rationality of the determination of the first parameter and the second parameter, and further being able to accurately output answers in the text semantic information. The starting index and ending index of the question.

在上述实施例的基础上,所述根据所述相似度矩阵、所述问题语义信息和所述分类器,确定所述第一参数,包括:具体的,根据如下公式确定所述第一参数:On the basis of the above embodiment, determining the first parameter based on the similarity matrix, the question semantic information and the classifier includes: specifically, determining the first parameter according to the following formula:

U'=Σj(softmax(St:)*U:j)U'=Σ j (softmax(S t: )*U :j )

其中,U'为所述第一参数、softmax为所述分类器、St:为所述相似度矩阵中第t行的所有数据、U:j为问题语义信息中第j列的所有数据。可参照上述说明,不再赘述。Wherein, U' is the first parameter, softmax is the classifier, S t: is all the data in the t-th row in the similarity matrix, and U :j is all the data in the j-th column in the question semantic information. Please refer to the above description and will not repeat them again.

本发明实施例提供的基于文本回答问题的方法,通过具体公式确定第一参数,进一步保证第一参数确定的合理性,有助于在文本语义信息中准确输出回答问题的起始索引和终止索引。The method for answering questions based on text provided by the embodiment of the present invention determines the first parameter through a specific formula, further ensuring the rationality of the determination of the first parameter, and helping to accurately output the starting index and ending index of answering the question in the text semantic information. .

在上述实施例的基础上,所述根据所述相似度矩阵、所述文本语义信息和所述分类器,确定所述第二参数,包括:具体的,根据如下公式计算所述第二参数:Based on the above embodiment, determining the second parameter based on the similarity matrix, the text semantic information and the classifier includes: specifically, calculating the second parameter according to the following formula:

H'=Σt(softmax(max(S:j))*Ht:)H'=Σ t (softmax(max(S :j ))*H t: )

其中,H'为所述第二参数、softmax为所述分类器、max为求最大值函数、S:j为所述相似度矩阵中第j列的所有数据、Ht:为文本语义信息中第t行的所有数据。可参照上述说明,不再赘述。Wherein, H' is the second parameter, softmax is the classifier, max is the maximum function, S :j is all the data in the jth column in the similarity matrix, Ht : is the text semantic information. All data in row t. Please refer to the above description and will not repeat them again.

本发明实施例提供的基于文本回答问题的方法,通过具体公式确定第二参数,进一步保证第二参数确定的合理性,有助于在文本语义信息中准确输出回答问题的起始索引和终止索引。The method for answering questions based on text provided by the embodiment of the present invention determines the second parameter through a specific formula, further ensuring the rationality of the determination of the second parameter, and helping to accurately output the starting index and ending index of answering the question in the text semantic information. .

在上述实施例的基础上,所述根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数,包括,具体的,根据如下拼接方式确定所述上下文表征参数:On the basis of the above embodiments, the context representation parameters of perceptible questions are determined based on the first parameter, the second parameter, the text semantic information and the fully connected network in the preset question answering model. , including, specifically, determining the context characterization parameters according to the following splicing method:

G=β(H;U';H*U';H*H')G=β(H;U';H*U';H*H')

其中,G为所述上下文表征参数、β为所述全连接网络、H为所述文本语义信息、U'为所述第一参数、所述H'为所述第二参数。可参照上述说明,不再赘述。可参照上述说明,不再赘述。Wherein, G is the context representation parameter, β is the fully connected network, H is the text semantic information, U' is the first parameter, and H' is the second parameter. Please refer to the above description and will not repeat them again. Please refer to the above description and will not repeat them again.

本发明实施例提供的基于文本回答问题的方法,通过具体拼接方式确定上下文表征参数,进一步能够在文本语义信息中准确输出回答问题的起始索引和终止索引。The method for answering questions based on text provided by embodiments of the present invention determines context representation parameters through specific splicing methods, and can further accurately output the starting index and ending index of answering questions in the text semantic information.

在上述实施例的基础上,所述输入问题语义信息和文本语义信息至预设问题回答模型的步骤之后,所述基于文本回答问题的方法还包括:Based on the above embodiments, after the step of inputting question semantic information and text semantic information into the preset question answering model, the method for answering questions based on text also includes:

具体的,对所述文本语义信息和所述问题语义信息分别进行编码处理;可参照上述说明,不再赘述。Specifically, the text semantic information and the question semantic information are encoded separately; reference can be made to the above description, which will not be described again.

具体的,用编码处理后的文本语义信息和编码处理后的问题语义信息替换所述根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数步骤中的问题语义信息和文本语义信息,并执行后续步骤。可参照上述说明,不再赘述。Specifically, the coded text semantic information and the coded question semantic information are used to replace the classifier in the question semantic information, the text semantic information and the preset question answering model, and the classifier in the text semantic information is determined. The first parameter corresponding to each word, and the question semantic information and text semantic information in the second parameter step corresponding to each word in the question semantic information, and subsequent steps are performed. Please refer to the above description and will not repeat them again.

本发明实施例提供的基于文本回答问题的方法,能够避免发生梯度弥散,进而改善该模型的鲁棒性。The text-based question answering method provided by the embodiment of the present invention can avoid gradient dispersion, thereby improving the robustness of the model.

在上述实施例的基础上,所述对所述文本语义信息和所述问题语义信息分别进行编码处理,包括:On the basis of the above embodiments, encoding the text semantic information and the question semantic information respectively includes:

对于所述文本语义信息进行如下处理:The text semantic information is processed as follows:

具体的,对所述文本语义信息进行向量化处理,以获取文本语义向量;可参照上述说明,不再赘述。Specifically, the text semantic information is vectorized to obtain the text semantic vector; reference can be made to the above description, which will not be described again.

具体的,输入所述文本语义向量至所述预设问题回答模型中的self-attention层、并采用L2norm对self-attention层的输出结果和所述文本语义向量进行处理,以获取第一处理结果;可参照上述说明,不再赘述。Specifically, the text semantic vector is input to the self-attention layer in the preset question answering model, and L2norm is used to process the output result of the self-attention layer and the text semantic vector to obtain the first processing result. ; Please refer to the above description and will not go into details.

具体的,输入所述第一处理结果至所述预设问题回答模型中的前馈神经网络、并采用L2norm对前馈神经网络的输出结果和所述第一处理结果进行处理,以获取第二处理结果;可参照上述说明,不再赘述。Specifically, the first processing result is input to the feedforward neural network in the preset question answering model, and L2norm is used to process the output result of the feedforward neural network and the first processing result to obtain the second Processing results; please refer to the above description and will not be repeated.

对于所述问题语义信息进行如下处理:The semantic information of the problem is processed as follows:

具体的,对所述问题语义信息进行向量化处理,以获取问题语义向量;可参照上述说明,不再赘述。Specifically, the question semantic information is vectorized to obtain the question semantic vector; reference can be made to the above description, which will not be described again.

具体的,输入所述问题语义向量至所述预设问题回答模型中的self-attention层、并采用L2norm对self-attention层的输出结果和所述问题语义向量进行处理,以获取第一处理结果;可参照上述说明,不再赘述。Specifically, the question semantic vector is input to the self-attention layer in the preset question answering model, and L2norm is used to process the output result of the self-attention layer and the question semantic vector to obtain the first processing result. ; Please refer to the above description and will not go into details.

具体的,输入所述第一处理结果至所述预设问题回答模型中的前馈神经网络、并采用L2norm对前馈神经网络的输出结果和所述第一处理结果进行处理,以获取第二处理结果。可参照上述说明,不再赘述。Specifically, the first processing result is input to the feedforward neural network in the preset question answering model, and L2norm is used to process the output result of the feedforward neural network and the first processing result to obtain the second process result. Please refer to the above description and will not repeat them again.

本发明实施例提供的基于文本回答问题的方法,进一步能够避免发生梯度弥散,更好地改善该模型的鲁棒性。The text-based question answering method provided by the embodiment of the present invention can further avoid gradient dispersion and better improve the robustness of the model.

图3为本发明基于文本回答问题的装置实施例结构示意图,如图3所示,本发明实施例提供了一种基于文本回答问题的装置,包括第一确定单元301、第二确定单元302和回答单元303,其中:Figure 3 is a schematic structural diagram of an embodiment of a device for answering questions based on text of the present invention. As shown in Figure 3, an embodiment of the present invention provides a device for answering questions based on text, including a first determination unit 301, a second determination unit 302 and Answer unit 303, where:

第一确定单元301用于输入问题语义信息和文本语义信息至预设问题回答模型,并根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数;其中,所述第一参数包含问题语义信息中的、与文本语义信息中的各词分别相关的语义信息、所述第二参数包含文本语义信息中的、与问题语义信息中的各词分别相关的语义信息;第二确定单元302用于根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数;回答单元303用于根据所述问题语义信息和所述上下文表征参数,在所述文本语义信息中输出回答问题的起始索引和终止索引。The first determining unit 301 is used to input question semantic information and text semantic information into the preset question answering model, and determine the text semantic information based on the question semantic information, text semantic information and the classifier in the preset question answering model. The first parameter corresponding to each word in the question semantic information, and the second parameter corresponding to each word in the question semantic information; wherein, the first parameter includes the question semantic information, respectively related to each word in the text semantic information. The semantic information and the second parameter include semantic information in the text semantic information that is respectively related to each word in the question semantic information; the second determination unit 302 is used to determine according to the first parameter, the second parameter, The text semantic information and the fully connected network in the preset question answering model determine the contextual representation parameters of the perceptible question; the answering unit 303 is configured to determine the contextual representation parameters in the text according to the question semantic information and the contextual representation parameters. The starting index and ending index of the answer to the question are output in the semantic information.

具体的,第一确定单元301用于输入问题语义信息和文本语义信息至预设问题回答模型,并根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数;其中,所述第一参数包含问题语义信息中的、与文本语义信息中的各词分别相关的语义信息、所述第二参数包含文本语义信息中的、与问题语义信息中的各词分别相关的语义信息;第二确定单元302用于根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数;回答单元303用于根据所述问题语义信息和所述上下文表征参数,在所述文本语义信息中输出回答问题的起始索引和终止索引。Specifically, the first determination unit 301 is used to input question semantic information and text semantic information into the preset question answering model, and determine the text according to the question semantic information, text semantic information and the classifier in the preset question answering model. A first parameter corresponding to each word in the semantic information, and a second parameter corresponding to each word in the question semantic information; wherein, the first parameter includes each parameter in the question semantic information and in the text semantic information. The second parameter includes semantic information related to each word in the text semantic information and semantic information related to each word in the question semantic information; the second determination unit 302 is configured to determine according to the first parameter, the second parameter and the semantic information related to each word in the question semantic information. The fully connected network in the two parameters, the text semantic information and the preset question answering model, determines the contextual representation parameters of the perceptible question; the answering unit 303 is used to determine the context representation parameters of the perceptible question according to the question semantic information and the context representation parameters. The starting index and ending index of answering the question are output in the text semantic information.

本发明实施例提供的基于文本回答问题的装置,通过可反映问题语义信息和文本语义信息之间的双向语义关系的第一参数和第二参数,确定可感知问题的上下文表征参数,进而能够在文本语义信息中准确输出回答问题的起始索引和终止索引。The device for answering questions based on text provided in the embodiment of the present invention determines the context representation parameters of the perceptible question through the first parameter and the second parameter that can reflect the bidirectional semantic relationship between the question semantic information and the text semantic information, and thereby can Accurately output the starting index and ending index of answering the question in the text semantic information.

本发明实施例提供的基于文本回答问题的装置具体可以用于执行上述各方法实施例的处理流程,其功能在此不再赘述,可以参照上述方法实施例的详细描述。The device for answering questions based on text provided by the embodiment of the present invention can be specifically used to execute the processing procedures of each of the above method embodiments. Its functions will not be described in detail here, and reference can be made to the detailed description of the above method embodiments.

图4为本发明实施例提供的电子设备实体结构示意图,如图4所示,所述电子设备包括:处理器(processor)401、存储器(memory)402和总线403;Figure 4 is a schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. As shown in Figure 4, the electronic device includes: a processor (processor) 401, a memory (memory) 402 and a bus 403;

其中,所述处理器401、存储器402通过总线403完成相互间的通信;Among them, the processor 401 and the memory 402 complete communication with each other through the bus 403;

所述处理器401用于调用所述存储器402中的程序指令,以执行上述各方法实施例所提供的方法,例如包括:输入问题语义信息和文本语义信息至预设问题回答模型,并根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数;其中,所述第一参数包含问题语义信息中的、与文本语义信息中的各词分别相关的语义信息、所述第二参数包含文本语义信息中的、与问题语义信息中的各词分别相关的语义信息;根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数;根据所述问题语义信息和所述上下文表征参数,在所述文本语义信息中输出回答问题的起始索引和终止索引。The processor 401 is used to call program instructions in the memory 402 to execute the methods provided by the above method embodiments, for example, including: inputting question semantic information and text semantic information into a preset question answering model, and answering the question according to the question. The classifier in the semantic information, the text semantic information and the preset question answering model determines the first parameters corresponding to each word in the text semantic information and the second parameters respectively corresponding to each word in the question semantic information. ; Wherein, the first parameter includes semantic information in the question semantic information that is respectively related to each word in the text semantic information, and the second parameter includes each word in the text semantic information and is respectively related to the question semantic information. Relevant semantic information; determine the context representation parameters of the perceptible question according to the first parameter, the second parameter, the text semantic information and the fully connected network in the preset question answering model; according to the question Semantic information and the context representation parameters, the starting index and the ending index of answering the question are output in the text semantic information.

本实施例公开一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各方法实施例所提供的方法,例如包括:输入问题语义信息和文本语义信息至预设问题回答模型,并根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数;其中,所述第一参数包含问题语义信息中的、与文本语义信息中的各词分别相关的语义信息、所述第二参数包含文本语义信息中的、与问题语义信息中的各词分别相关的语义信息;根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数;根据所述问题语义信息和所述上下文表征参数,在所述文本语义信息中输出回答问题的起始索引和终止索引。This embodiment discloses a computer program product. The computer program product includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer The methods provided by the above method embodiments can be executed, for example, including: inputting question semantic information and text semantic information into a preset question answering model, and classifying them according to the question semantic information, text semantic information and the preset question answering model. The device determines the first parameters corresponding to each word in the text semantic information and the second parameters corresponding to each word in the question semantic information; wherein the first parameter includes the question semantic information and the text. The semantic information and the second parameter respectively related to each word in the semantic information include the semantic information respectively related to each word in the question semantic information in the text semantic information; according to the first parameter and the second parameter , the text semantic information and the fully connected network in the preset question answering model determine the context representation parameters of the perceptible question; according to the question semantic information and the context representation parameters, output in the text semantic information Answer the question's starting index and ending index.

本实施例提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使所述计算机执行上述各方法实施例所提供的方法,例如包括:输入问题语义信息和文本语义信息至预设问题回答模型,并根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数;其中,所述第一参数包含问题语义信息中的、与文本语义信息中的各词分别相关的语义信息、所述第二参数包含文本语义信息中的、与问题语义信息中的各词分别相关的语义信息;根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数;根据所述问题语义信息和所述上下文表征参数,在所述文本语义信息中输出回答问题的起始索引和终止索引。This embodiment provides a non-transitory computer-readable storage medium. The non-transitory computer-readable storage medium stores computer instructions. The computer instructions cause the computer to execute the methods provided by the above method embodiments, for example, including : Input the question semantic information and the text semantic information into the preset question answering model, and determine the corresponding words respectively corresponding to each word in the text semantic information based on the question semantic information, the text semantic information and the classifier in the preset question answering model. The first parameter, and the second parameter respectively corresponding to each word in the question semantic information; wherein, the first parameter includes the semantic information in the question semantic information, respectively related to each word in the text semantic information, the said The second parameter includes semantic information in the text semantic information that is respectively related to each word in the question semantic information; according to the first parameter, the second parameter, the text semantic information and the preset question answering model The fully connected network in the system determines the context representation parameters of the perceptible question; according to the question semantic information and the context representation parameters, the starting index and the ending index of answering the question are output in the text semantic information.

本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps to implement the above method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, It includes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.

以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are only illustrative. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they may be located in One location, or it can be distributed across multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Persons of ordinary skill in the art can understand and implement the method without any creative effort.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the part of the above technical solution that essentially contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., including a number of instructions to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or certain parts of the embodiments.

最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be used Modifications are made to the technical solutions described in the foregoing embodiments, or equivalent substitutions are made to some of the technical features; however, these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1.一种基于文本回答问题的方法,其特征在于,包括:1. A method of answering questions based on text, which is characterized by including: 输入问题语义信息和文本语义信息至预设问题回答模型,并根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数;其中,所述第一参数包含问题语义信息中的、与文本语义信息中的各词分别相关的语义信息、所述第二参数包含文本语义信息中的、与问题语义信息中的各词分别相关的语义信息;Input the question semantic information and the text semantic information into the preset question answering model, and determine the first words corresponding to each word in the text semantic information based on the question semantic information, the text semantic information and the classifier in the preset question answering model. A parameter, and a second parameter respectively corresponding to each word in the question semantic information; wherein the first parameter includes semantic information in the question semantic information, respectively related to each word in the text semantic information, the said third parameter The second parameter contains the semantic information in the text semantic information and related to each word in the question semantic information; 根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数;Determine the context representation parameters of the perceptible question according to the first parameter, the second parameter, the text semantic information and the fully connected network in the preset question answering model; 根据所述问题语义信息和所述上下文表征参数,在所述文本语义信息中输出回答问题的起始索引和终止索引;According to the question semantic information and the context representation parameters, output the starting index and the ending index of answering the question in the text semantic information; 所述输入问题语义信息和文本语义信息至预设问题回答模型的步骤之后,所述基于文本回答问题的方法还包括:After the step of inputting question semantic information and text semantic information into the preset question answering model, the method for answering questions based on text also includes: 对所述文本语义信息和所述问题语义信息分别进行编码处理;Encoding the text semantic information and the question semantic information respectively; 用编码处理后的文本语义信息和编码处理后的问题语义信息替换所述根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数步骤中的问题语义信息和文本语义信息,并执行后续步骤;Use the encoded text semantic information and the encoded question semantic information to replace the classifier in the question semantic information, the text semantic information and the preset question answering model, and determine the difference between each word in the text semantic information. The corresponding first parameter, and the question semantic information and text semantic information in the second parameter step corresponding to each word in the question semantic information, and perform subsequent steps; 所述对所述文本语义信息和所述问题语义信息分别进行编码处理,包括:The encoding of the text semantic information and the question semantic information respectively includes: 对于所述文本语义信息进行如下处理:The text semantic information is processed as follows: 对所述文本语义信息进行向量化处理,以获取文本语义向量;Perform vectorization processing on the text semantic information to obtain text semantic vectors; 输入所述文本语义向量至所述预设问题回答模型中的self-attention层、并采用L2norm对self-attention层的输出结果和所述文本语义向量进行处理,以获取第一处理结果;Input the text semantic vector to the self-attention layer in the preset question answering model, and use L2norm to process the output result of the self-attention layer and the text semantic vector to obtain the first processing result; 输入所述第一处理结果至所述预设问题回答模型中的前馈神经网络、并采用L2 norm对前馈神经网络的输出结果和所述第一处理结果进行处理,以获取第二处理结果;Input the first processing result to the feedforward neural network in the preset question answering model, and use L2 norm to process the output result of the feedforward neural network and the first processing result to obtain the second processing result ; 对于所述问题语义信息进行如下处理:The semantic information of the problem is processed as follows: 对所述问题语义信息进行向量化处理,以获取问题语义向量;Vectorize the question semantic information to obtain a question semantic vector; 输入所述问题语义向量至所述预设问题回答模型中的self-attention层、并采用L2norm对self-attention层的输出结果和所述问题语义向量进行处理,以获取第一处理结果;Input the question semantic vector to the self-attention layer in the preset question answering model, and use L2norm to process the output result of the self-attention layer and the question semantic vector to obtain the first processing result; 输入所述第一处理结果至所述预设问题回答模型中的前馈神经网络、并采用L2 norm对前馈神经网络的输出结果和所述第一处理结果进行处理,以获取第二处理结果。Input the first processing result to the feedforward neural network in the preset question answering model, and use L2 norm to process the output result of the feedforward neural network and the first processing result to obtain the second processing result . 2.根据权利要求1所述的基于文本回答问题的方法,其特征在于,所述根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数,包括:2. The method for answering questions based on text according to claim 1, characterized in that the classifier in the question semantic information, text semantic information and the preset question answering model is determined to be consistent with the text semantic information. The first parameter corresponding to each word, and the second parameter corresponding to each word in the question semantic information, include: 根据问题语义信息和文本语义信息,确定相似度矩阵;所述相似度矩阵的行是与文本语义信息中的各词分别对应的问题语义信息中的全部词之间的相似度,所述相似度矩阵的列是与问题语义信息中的各词分别对应的文本语义信息中的全部词之间的相似度;According to the question semantic information and the text semantic information, a similarity matrix is determined; the rows of the similarity matrix are the similarities between all words in the question semantic information corresponding to each word in the text semantic information, and the similarity is The columns of the matrix are the similarities between all words in the text semantic information corresponding to each word in the question semantic information; 根据所述相似度矩阵、所述问题语义信息和所述分类器,确定所述第一参数,并根据所述相似度矩阵、所述文本语义信息和所述分类器,确定所述第二参数。The first parameter is determined based on the similarity matrix, the question semantic information and the classifier, and the second parameter is determined based on the similarity matrix, the text semantic information and the classifier . 3.根据权利要求2所述的基于文本回答问题的方法,其特征在于,所述根据所述相似度矩阵、所述问题语义信息和所述分类器,确定所述第一参数,包括:根据如下公式确定所述第一参数:3. The method for answering questions based on text according to claim 2, wherein determining the first parameter according to the similarity matrix, the question semantic information and the classifier includes: The following formula determines the first parameter: U'=Σj(softmax(St:)*U:j)U'=Σ j (softmax(S t: )*U :j ) 其中,U'为所述第一参数、softmax为所述分类器、St:为所述相似度矩阵中第t行的所有数据、U:j为问题语义信息中第j列的所有数据。Wherein, U' is the first parameter, softmax is the classifier, S t: is all the data in the t-th row in the similarity matrix, and U :j is all the data in the j-th column in the question semantic information. 4.根据权利要求2所述的基于文本回答问题的方法,其特征在于,所述根据所述相似度矩阵、所述文本语义信息和所述分类器,确定所述第二参数,包括:根据如下公式计算所述第二参数:4. The method for answering questions based on text according to claim 2, wherein determining the second parameter according to the similarity matrix, the text semantic information and the classifier includes: The second parameter is calculated using the following formula: H'=Σt(softmax(max(S:j))*Ht:)H'=Σ t (softmax(max(S :j ))*H t: ) 其中,H'为所述第二参数、softmax为所述分类器、max为求最大值函数、S:j为所述相似度矩阵中第j列的所有数据、Ht:为文本语义信息中第t行的所有数据。Wherein, H' is the second parameter, softmax is the classifier, max is the maximum function, S :j is all the data in the jth column in the similarity matrix, Ht : is the text semantic information. All data in row t. 5.根据权利要求1所述的基于文本回答问题的方法,其特征在于,所述根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数,包括,根据如下拼接方式确定所述上下文表征参数:5. The method for answering questions based on text according to claim 1, characterized in that the method according to the first parameter, the second parameter, the text semantic information and the preset question answering model. The fully connected network determines the context representation parameters of the perceptible problem, including determining the context representation parameters according to the following splicing method: G=β(H;U';H*U';H*H')G=β(H;U';H*U';H*H') 其中,G为所述上下文表征参数、β为所述全连接网络、H为所述文本语义信息、U'为所述第一参数、所述H'为所述第二参数。Wherein, G is the context representation parameter, β is the fully connected network, H is the text semantic information, U' is the first parameter, and H' is the second parameter. 6.一种基于文本回答问题的装置,其特征在于,包括:6. A device for answering questions based on text, characterized by including: 第一确定单元,用于输入问题语义信息和文本语义信息至预设问题回答模型,并根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数;其中,所述第一参数包含问题语义信息中的、与文本语义信息中的各词分别相关的语义信息、所述第二参数包含文本语义信息中的、与问题语义信息中的各词分别相关的语义信息;The first determination unit is used to input question semantic information and text semantic information into the preset question answering model, and determine the text semantic information based on the question semantic information, text semantic information and the classifier in the preset question answering model. The first parameter corresponding to each word in the question semantic information, and the second parameter corresponding to each word in the question semantic information; wherein, the first parameter includes the question semantic information, respectively related to each word in the text semantic information. The semantic information, the second parameter includes semantic information in the text semantic information that is respectively related to each word in the question semantic information; 第二确定单元,用于根据所述第一参数、所述第二参数、所述文本语义信息和所述预设问题回答模型中的全连接网络,确定可感知问题的上下文表征参数;A second determination unit configured to determine context representation parameters of perceptible questions based on the first parameter, the second parameter, the text semantic information and the fully connected network in the preset question answering model; 回答单元,用于根据所述问题语义信息和所述上下文表征参数,在所述文本语义信息中输出回答问题的起始索引和终止索引;An answering unit, configured to output the starting index and ending index of answering the question in the text semantic information according to the question semantic information and the context characterization parameter; 所述基于文本回答问题的装置还包括编码模块,用于:The device for answering questions based on text also includes a coding module for: 对所述文本语义信息和所述问题语义信息分别进行编码处理;Encoding the text semantic information and the question semantic information respectively; 用编码处理后的文本语义信息和编码处理后的问题语义信息替换所述根据问题语义信息、文本语义信息和所述预设问题回答模型中的分类器,确定与文本语义信息中的各词分别对应的第一参数、及与问题语义信息中的各词分别对应的第二参数步骤中的问题语义信息和文本语义信息,并执行后续步骤;Use the encoded text semantic information and the encoded question semantic information to replace the classifier in the question semantic information, the text semantic information and the preset question answering model, and determine the difference between each word in the text semantic information. The corresponding first parameter, and the question semantic information and text semantic information in the second parameter step corresponding to each word in the question semantic information, and perform subsequent steps; 所述对所述文本语义信息和所述问题语义信息分别进行编码处理,包括:The encoding of the text semantic information and the question semantic information respectively includes: 对于所述文本语义信息进行如下处理:The text semantic information is processed as follows: 对所述文本语义信息进行向量化处理,以获取文本语义向量;Perform vectorization processing on the text semantic information to obtain text semantic vectors; 输入所述文本语义向量至所述预设问题回答模型中的self-attention层、并采用L2norm对self-attention层的输出结果和所述文本语义向量进行处理,以获取第一处理结果;Input the text semantic vector to the self-attention layer in the preset question answering model, and use L2norm to process the output result of the self-attention layer and the text semantic vector to obtain the first processing result; 输入所述第一处理结果至所述预设问题回答模型中的前馈神经网络、并采用L2 norm对前馈神经网络的输出结果和所述第一处理结果进行处理,以获取第二处理结果;Input the first processing result to the feedforward neural network in the preset question answering model, and use L2 norm to process the output result of the feedforward neural network and the first processing result to obtain the second processing result ; 对于所述问题语义信息进行如下处理:The semantic information of the problem is processed as follows: 对所述问题语义信息进行向量化处理,以获取问题语义向量;Vectorize the question semantic information to obtain a question semantic vector; 输入所述问题语义向量至所述预设问题回答模型中的self-attention层、并采用L2norm对self-attention层的输出结果和所述问题语义向量进行处理,以获取第一处理结果;Input the question semantic vector to the self-attention layer in the preset question answering model, and use L2norm to process the output result of the self-attention layer and the question semantic vector to obtain the first processing result; 输入所述第一处理结果至所述预设问题回答模型中的前馈神经网络、并采用L2 norm对前馈神经网络的输出结果和所述第一处理结果进行处理,以获取第二处理结果。Input the first processing result to the feedforward neural network in the preset question answering model, and use L2 norm to process the output result of the feedforward neural network and the first processing result to obtain the second processing result . 7.一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至5任一项所述方法的步骤。7. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the computer program, any one of claims 1 to 5 is implemented. One step of the method. 8.一种非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至5任一项所述方法的步骤。8. A non-transitory computer-readable storage medium on which a computer program is stored, characterized in that when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
CN201910995402.2A 2019-10-18 2019-10-18 A method and device for answering questions based on text Active CN112685543B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910995402.2A CN112685543B (en) 2019-10-18 2019-10-18 A method and device for answering questions based on text

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910995402.2A CN112685543B (en) 2019-10-18 2019-10-18 A method and device for answering questions based on text

Publications (2)

Publication Number Publication Date
CN112685543A CN112685543A (en) 2021-04-20
CN112685543B true CN112685543B (en) 2024-01-26

Family

ID=75445003

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910995402.2A Active CN112685543B (en) 2019-10-18 2019-10-18 A method and device for answering questions based on text

Country Status (1)

Country Link
CN (1) CN112685543B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118013981B (en) * 2024-04-07 2024-07-26 浙江口碑网络技术有限公司 Method, server and system for answering questions based on text

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108763535A (en) * 2018-05-31 2018-11-06 科大讯飞股份有限公司 Information acquisition method and device
CN108959246A (en) * 2018-06-12 2018-12-07 北京慧闻科技发展有限公司 Answer selection method, device and electronic equipment based on improved attention mechanism
CN109033068A (en) * 2018-06-14 2018-12-18 北京慧闻科技发展有限公司 It is used to read the method, apparatus understood and electronic equipment based on attention mechanism
WO2019012908A1 (en) * 2017-07-13 2019-01-17 国立研究開発法人情報通信研究機構 Non-factoid question answering device
WO2019084558A1 (en) * 2017-10-27 2019-05-02 Google Llc Selecting answer spans from electronic documents using machine learning
CN110083682A (en) * 2019-04-19 2019-08-02 西安交通大学 It is a kind of to understand answer acquisition methods based on the machine readings for taking turns attention mechanism more
CN110222144A (en) * 2019-04-17 2019-09-10 深圳壹账通智能科技有限公司 Method for extracting content of text, device, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2019012908A1 (en) * 2017-07-13 2019-01-17 国立研究開発法人情報通信研究機構 Non-factoid question answering device
WO2019084558A1 (en) * 2017-10-27 2019-05-02 Google Llc Selecting answer spans from electronic documents using machine learning
CN108763535A (en) * 2018-05-31 2018-11-06 科大讯飞股份有限公司 Information acquisition method and device
CN108959246A (en) * 2018-06-12 2018-12-07 北京慧闻科技发展有限公司 Answer selection method, device and electronic equipment based on improved attention mechanism
CN109033068A (en) * 2018-06-14 2018-12-18 北京慧闻科技发展有限公司 It is used to read the method, apparatus understood and electronic equipment based on attention mechanism
CN110222144A (en) * 2019-04-17 2019-09-10 深圳壹账通智能科技有限公司 Method for extracting content of text, device, electronic equipment and storage medium
CN110083682A (en) * 2019-04-19 2019-08-02 西安交通大学 It is a kind of to understand answer acquisition methods based on the machine readings for taking turns attention mechanism more

Also Published As

Publication number Publication date
CN112685543A (en) 2021-04-20

Similar Documents

Publication Publication Date Title
CN111931517B (en) Text translation method, device, electronic equipment and storage medium
CN110134771A (en) An Implementation Method of Fusion Network Question Answering System Based on Multi-Attention Mechanism
CN111626062B (en) Text semantic coding method and system
CN112765345A (en) Text abstract automatic generation method and system fusing pre-training model
CN109522403A (en) A kind of summary texts generation method based on fusion coding
US11615247B1 (en) Labeling method and apparatus for named entity recognition of legal instrument
CN113536797B (en) Method and system for extracting key information sheet model of slice document
CN114492661B (en) Text data classification method and device, computer equipment and storage medium
CN114297399B (en) Knowledge graph generation method, system, storage medium and electronic device
CN111966811A (en) Intention recognition and slot filling method and device, readable storage medium and terminal equipment
CN113743101A (en) Text error correction method and device, electronic equipment and computer storage medium
CN114360502A (en) Speech recognition model processing method, speech recognition method and device
Mathur et al. A scaled‐down neural conversational model for chatbots
CN118227769A (en) Knowledge graph enhancement-based large language model question-answer generation method
CN115329766A (en) A Named Entity Recognition Method Based on Dynamic Word Information Fusion
CN117932066A (en) Pre-training-based 'extraction-generation' answer generation model and method
CN118014077A (en) Multi-mode thinking chain reasoning method and device based on knowledge distillation
CN119416035B (en) Conversation emotion recognition method and equipment based on multi-mode large model
CN113657092B (en) Method, device, equipment and medium for identifying tag
CN118095261B (en) Text data processing method, device, equipment and readable storage medium
Desai et al. Lightweight convolutional representations for on-device natural language processing
CN112685543B (en) A method and device for answering questions based on text
WO2025055581A1 (en) Speech encoder training method and apparatus, and device, medium and program product
CN113010662A (en) Hierarchical conversational machine reading understanding system and method
CN112765330A (en) Text data processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant