技术领域technical field
本申请涉及自然语言处理技术领域,尤其涉及一种问答匹配处理、模型训练方法、装置、计算机设备及存储介质。The present application relates to the technical field of natural language processing, and in particular to a question-answer matching process, a model training method, a device, a computer device, and a storage medium.
背景技术Background technique
在一些应用场景中,需要对问题和回答之间的匹配程度进行度量;例如,智能面试等场景中,需要对面试者对于某面试问题的回答进行评价。现有的问答匹配方法一般通过关键词匹配等方式对回答进行判分,容易被堆砌专业名词、短语而不理解背后逻辑的回答所误导而给出匹配度较高的结果;而且现有的问答匹配方法一般是对不同的预设问题执行不同的度量策略,通用性较差,对于一个应用所需的处理模型规模较大,限制了应用范围。In some application scenarios, it is necessary to measure the matching degree between questions and answers; for example, in scenarios such as intelligent interviews, it is necessary to evaluate the interviewer's answer to an interview question. Existing question-and-answer matching methods generally score answers by means of keyword matching, etc., and are easily misled by answers that pile up professional terms and phrases without understanding the logic behind them and give results with a high degree of matching; and existing question-and-answer The matching method generally implements different measurement strategies for different preset problems, which has poor versatility, and requires a large processing model for an application, which limits the scope of application.
发明内容Contents of the invention
本申请实施例提供一种问答匹配处理、模型训练方法、装置、计算机设备及存储介质,能够较佳地实现基于特征提取子模型和匹配子模型对多种问题和回答之间的匹配程度进行度量。The embodiment of the present application provides a question-and-answer matching process, model training method, device, computer equipment, and storage medium, which can preferably measure the matching degree between various questions and answers based on the feature extraction sub-model and matching sub-model .
第一方面,本申请提供了一种问答匹配处理方法,所述方法包括:In a first aspect, the present application provides a question-answer matching processing method, the method comprising:
获取问题文本和回答文本;Get question text and answer text;
对所述问题文本和回答文本进行分词处理,得到语料分词数据;Carry out word segmentation processing to described question text and answer text, obtain corpus word segmentation data;
对所述语料分词数据进行嵌入处理,得到嵌入表示数据;Embedding the corpus word segmentation data to obtain embedded representation data;
基于特征提取子模型,对所述嵌入表示数据进行特征提取得到自注意力特征向量,所述特征提取子模型为基于自注意力机制的模型;Based on the feature extraction sub-model, performing feature extraction on the embedded representation data to obtain a self-attention feature vector, the feature extraction sub-model is a model based on a self-attention mechanism;
基于匹配子模型,根据所述自注意力特征向量生成问答匹配数据,输出所述问答匹配数据。Based on the matching sub-model, generate question-answer matching data according to the self-attention feature vector, and output the question-answer matching data.
第二方面,本申请提供了一种问答匹配处理装置,所述装置包括:In a second aspect, the present application provides a question-answer matching processing device, the device comprising:
文本获取模块,用于获取问题文本和回答文本;Text acquisition module, used to acquire question text and answer text;
分词处理模块,用于对所述问题文本和回答文本进行分词处理,得到语料分词数据;The word segmentation processing module is used to carry out word segmentation processing to described question text and answer text, obtains corpus word segmentation data;
嵌入处理模块,用于对所述语料分词数据进行嵌入处理,得到嵌入表示数据;An embedding processing module, configured to perform embedding processing on the corpus word segmentation data to obtain embedding representation data;
特征提取模块,用于基于特征提取子模型,对所述嵌入表示数据进行特征提取得到自注意力特征向量,所述特征提取子模型为基于自注意力机制的模型;The feature extraction module is used to perform feature extraction on the embedded representation data based on a feature extraction sub-model to obtain a self-attention feature vector, and the feature extraction sub-model is a model based on a self-attention mechanism;
匹配计算模块,用于基于匹配子模型,根据所述自注意力特征向量生成问答匹配数据,输出所述问答匹配数据。The matching calculation module is configured to generate question-answer matching data according to the self-attention feature vector based on the matching sub-model, and output the question-answer matching data.
第三方面,本申请提供了一种计算机设备,所述计算机设备包括存储器和处理器;所述存储器用于存储计算机程序;所述处理器,用于执行所述计算机程序并在执行所述计算机程序时实现上述的问答匹配处理方法;或者In a third aspect, the present application provides a computer device, the computer device includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and execute the computer The above-mentioned question-answer matching processing method is implemented during the program; or
实现上述的问答匹配模型训练方法。Implement the above question-answer matching model training method.
第四方面,本申请提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,若所述计算机程序被处理器执行,实现上述的问答匹配处理方法;或者In a fourth aspect, the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and if the computer program is executed by a processor, the above-mentioned question-answer matching processing method is realized; or
实现上述的问答匹配模型训练方法。Implement the above question-answer matching model training method.
本申请公开了一种问答匹配处理、模型训练方法、装置、计算机设备及存储介质,通过对获取的问题文本和回答文本进行分词、嵌入处理,得到文本的嵌入表示,然后通过基于自注意力机制的模型提取问题文本和回答文本之间的自注意力特征,以根据自注意力特征生成问答匹配数据;无需预设不同面试问题对应的不同关键词库,方法可以基于模型学习到的大量问答匹配信息,根据不同问题和对应的文本得到匹配数据,通用性较好,准确度较高。This application discloses a question-answer matching process, model training method, device, computer equipment, and storage medium. By performing word segmentation and embedding processing on the acquired question text and answer text, the embedded representation of the text is obtained, and then through the self-attention mechanism The model extracts the self-attention features between the question text and the answer text to generate question-answer matching data based on the self-attention features; there is no need to preset different keyword libraries corresponding to different interview questions, and the method can be based on a large number of question-answer matches learned by the model Information, matching data is obtained according to different questions and corresponding texts, which has good versatility and high accuracy.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present application. Those of ordinary skill in the art can also obtain other drawings based on these drawings without any creative effort.
图1为本申请一实施例的问答匹配处理方法的流程示意图;FIG. 1 is a schematic flow diagram of a question-answer matching processing method according to an embodiment of the present application;
图2为图1中获取问题文本和回答文本的一实施方式的子流程示意图;Fig. 2 is a schematic subflow diagram of an embodiment of obtaining question text and answer text in Fig. 1;
图3为图1中获取问题文本和回答文本的另一实施方式的场景示意图;Fig. 3 is a schematic diagram of the scene of another embodiment of obtaining question text and answer text in Fig. 1;
图4为图1中获取问题文本和回答文本的另一实施方式的子流程示意图;FIG. 4 is a schematic subflow diagram of another embodiment for obtaining question text and answer text in FIG. 1;
图5为图1中分词处理一实施方式的子流程示意图;Fig. 5 is a schematic subflow diagram of an embodiment of word segmentation processing in Fig. 1;
图6为图1中分词处理另一实施方式的子流程示意图;Fig. 6 is a schematic subflow diagram of another embodiment of word segmentation processing in Fig. 1;
图7为图1中嵌入处理的子流程示意图;Fig. 7 is a schematic diagram of a sub-flow of embedding processing in Fig. 1;
图8为嵌入处理的示例示意图;Fig. 8 is a schematic diagram of an example of embedding processing;
图9为图1中生成问答匹配数据的子流程示意图;FIG. 9 is a schematic diagram of a sub-flow for generating question-and-answer matching data in FIG. 1;
图10为本申请一实施例的问答匹配模型训练方法的流程示意图;FIG. 10 is a schematic flowchart of a question-answer matching model training method according to an embodiment of the present application;
图11为图10中分词处理的子流程示意图;Fig. 11 is a schematic diagram of a sub-flow process of word segmentation processing in Fig. 10;
图12为图10中嵌入处理的子流程示意图;Fig. 12 is a schematic diagram of a sub-flow of embedding processing in Fig. 10;
图13为本申请实施例提供的一种问答匹配处理装置的结构示意图;FIG. 13 is a schematic structural diagram of a question-answer matching processing device provided in an embodiment of the present application;
图14为本申请实施例提供的另一种问答匹配处理装置的结构示意图;FIG. 14 is a schematic structural diagram of another question-answer matching processing device provided in the embodiment of the present application;
图15为本申请实施例提供的一种问答匹配模型训练装置的结构示意图;FIG. 15 is a schematic structural diagram of a question-answer matching model training device provided in an embodiment of the present application;
图16为本申请实施例提供的另一种问答匹配模型训练装置的结构示意图;FIG. 16 is a schematic structural diagram of another question-and-answer matching model training device provided in the embodiment of the present application;
图17为本申请一实施例提供的一种计算机设备的结构示意图。FIG. 17 is a schematic structural diagram of a computer device provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。另外,虽然在装置示意图中进行了功能模块的划分,但是在某些情况下,可以以不同于装置示意图中的模块划分。The flow charts shown in the drawings are just illustrations, and do not necessarily include all contents and operations/steps, nor must they be performed in the order described. For example, some operations/steps can be decomposed, combined or partly combined, so the actual order of execution may be changed according to the actual situation. In addition, although the functional modules are divided in the schematic diagram of the device, in some cases, they may be divided into modules different from those in the schematic diagram of the device.
本申请的实施例提供了一种问答匹配处理方法、装置、计算机设备及存储介质。其中,该问答匹配处理方法可以应用于终端或服务器中,以实现基于特征提取子模型和匹配子模型对多种问题和回答之间的匹配程度进行度量。Embodiments of the present application provide a question-answer matching processing method, device, computer equipment, and storage medium. Wherein, the question-answer matching processing method can be applied to a terminal or a server, so as to measure the matching degree between various questions and answers based on the feature extraction sub-model and the matching sub-model.
例如,问答匹配处理方法用于服务器,当然可以用于终端。其中,终端可以是手机、平板电脑、笔记本电脑、台式电脑、个人数字助理和穿戴式设备等电子设备;服务器可以为独立的服务器,也可以为服务器集群。但为了便于理解,以下实施例将以应用于服务器的问答匹配处理方法进行详细介绍。For example, the question-and-answer matching processing method is used for the server, and of course it can be used for the terminal. Wherein, the terminal may be electronic devices such as mobile phones, tablet computers, notebook computers, desktop computers, personal digital assistants, and wearable devices; the server may be an independent server or a server cluster. However, for ease of understanding, the following embodiments will introduce in detail the question-answer matching processing method applied to the server.
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。Some implementations of the present application will be described in detail below in conjunction with the accompanying drawings. In the case of no conflict, the following embodiments and features in the embodiments can be combined with each other.
请参阅图1,图1是本申请的实施例提供的一种问答匹配处理方法的流程示意图。Please refer to FIG. 1 . FIG. 1 is a schematic flowchart of a question-answer matching processing method provided by an embodiment of the present application.
如图1所示,问答匹配处理方法包括以下步骤S110-步骤S150。As shown in FIG. 1 , the question-answer matching processing method includes the following steps S110-Step S150.
步骤S110、获取问题文本和回答文本。Step S110, obtaining question text and answer text.
在一些实施方式中,服务器预先存储了多个问题的文本,即问题文本,并且各问题对应于不同的标识,如问题ID。服务器按照预设规则抽取问题,将抽取的问题发送给终端;终端将从服务器接收到的问题对回答对象,如面试的候选人提问,并获取该对象对所述问题的回答文本,并发送给服务器;然后服务器将终端返回的回答文本与该问题的标识相关联。In some embodiments, the server pre-stores texts of multiple questions, that is, question texts, and each question corresponds to a different identifier, such as a question ID. The server extracts questions according to preset rules, and sends the extracted questions to the terminal; the terminal asks questions received from the server to the answer object, such as an interview candidate, and obtains the object’s answer text to the question, and sends it to server; the server then associates the answer text returned by the terminal with the identity of the question.
在另一些实施方式中,如图2所示,步骤S110获取问题文本和回答文本,包括步骤S101-步骤S102。In some other implementation manners, as shown in FIG. 2, step S110 acquires question text and answer text, including step S101-step S102.
步骤S101、获取面试官的问题文本,匹配与所述问题文本相似的面试问题,并获取所述面试问题的标识。Step S101. Obtain the interviewer's question text, match the interview question similar to the question text, and obtain the identifier of the interview question.
示例性的,面试官通过口头的方式提问候选人,服务器获取面试官的语音信号并将语音信号转换为问题文本;然后服务器在预先存储的多个面试问题中匹配出与该问题文本最相近的面试问题,同时也可查询出该面试问题对应的标识ID。Exemplarily, the interviewer asks the candidate orally, and the server obtains the interviewer's voice signal and converts the voice signal into question text; then the server matches the most similar question text among the multiple pre-stored interview questions. Interview questions, and at the same time, you can also query the identification ID corresponding to the interview questions.
具体的,可通过计算语音信号转换为的问题文本与预先存储的多个面试问题之间的文本相似度匹配出与该问题文本最相近的面试问题。首先对问题文本和要比较的面试问题进行词嵌入操作(Word Embedding),将自然语言表示的文本转换为计算机能够理解的向量或矩阵形式,然后计算两者的余弦相似度(cosine similarity);若余弦相似度小于预设的值或者为最小,则这个面试问题为匹配出的与所述问题文本相似的面试问题。Specifically, the interview question closest to the question text can be matched by calculating the text similarity between the question text converted from the voice signal and multiple pre-stored interview questions. First, the word embedding operation (Word Embedding) is performed on the question text and the interview question to be compared, and the text expressed in natural language is converted into a vector or matrix form that the computer can understand, and then the cosine similarity between the two is calculated (cosine similarity); if If the cosine similarity is less than a preset value or is the minimum, then the interview question is a matched interview question similar to the question text.
步骤S102、获取候选人对所述面试问题的非文本格式的回答,将所述非文本格式的回答处理为回答文本。Step S102, obtaining the candidate's non-text answer to the interview question, and processing the non-text answer into an answer text.
在一些场景下,候选人通过输入文本回答面试问题,服务器可以直接获取候选人通过输入装置输入的文本作为回答文本。在另一些场景下,候选人的回答为语音、书写文本、选择结果这些服务器无法直接存储的非文本格式的回答。则先将候选人的语义回答转为回答文本、将候选人书写的内容通过文字识别等技术转为回答文本或者将候选人在做选择题时选中的选项转为与相应面试问题的标识相关联的回答文本。In some scenarios, candidates answer interview questions by inputting text, and the server can directly obtain the text input by the candidate through the input device as the answer text. In other scenarios, the candidate's answers are in non-text formats that cannot be directly stored by the server, such as speech, written text, and selection results. Firstly, the candidate's semantic answer is converted into an answer text, and the content written by the candidate is converted into an answer text through text recognition and other technologies, or the option selected by the candidate when doing multiple-choice questions is converted into an associated with the logo of the corresponding interview question The text of the answer.
在其他一些实施方式中,如图3和图4所示,步骤S110获取问题文本和回答文本,包括步骤S111-步骤S114。In some other implementation manners, as shown in FIG. 3 and FIG. 4 , step S110 acquires question text and answer text, including step S111 - step S114.
步骤S111、从终端获取所述终端加密后的问题语音和所述终端加密后的回答语音,以及所述终端提取加密秘钥的语音片段。Step S111, acquiring the terminal's encrypted question voice and the terminal's encrypted answer voice from the terminal, and the terminal extracting the voice segment of the encryption key.
示例性的,终端获取面试官的问题语音和候选人的回答语音,在问题语音和/或回答语音种按照预设规则提取一段语音作为语音片段;例如提取问题语音结尾部分的语音和回答语音开头部分的语音作为语音片段。Exemplarily, the terminal obtains the interviewer's question voice and the candidate's answer voice, and extracts a piece of voice from the question voice and/or answer voice according to preset rules as a voice segment; for example, extracting the voice at the end of the question voice and the beginning of the answer voice Part of the speech as a speech fragment.
终端根据语音片段可以生成加密秘钥,例如识别出语音片段中的字符得到字符秘钥,或者计算语音片段的哈希值等得到加密秘钥。The terminal can generate an encryption key according to the voice segment, for example, recognize the characters in the voice segment to obtain the character key, or calculate the hash value of the voice segment to obtain the encryption key.
示例性的,终端通过语音识别从语音片段中识别出一个或多个字符,然后将识别出的一个或多个字符通过例如补零等方式处理为预设长度的加密秘钥。Exemplarily, the terminal recognizes one or more characters from the speech segment through speech recognition, and then processes the recognized one or more characters into an encryption key of a preset length by, for example, filling zeros.
终端可以根据加密秘钥对所述问题语音、回答语音进行加密,例如通过AES128或者AES256加密算法根据所述字符秘钥对所述问题语音、回答语音进行加密;然后将加密后的问题语音和所述终端加密后的回答语音,以及所述语音片段发送给服务器。The terminal can encrypt the question voice and answer voice according to the encryption key, for example, encrypt the question voice and answer voice according to the character key through the AES128 or AES256 encryption algorithm; then encrypt the encrypted question voice and the The encrypted reply voice of the terminal, and the voice segment is sent to the server.
示例性的,服务器从终端获取加密后的问题语音和加密后的回答语音,以及语音片段的数据格式如表1所示:Exemplarily, the server obtains the encrypted question voice and the encrypted answer voice from the terminal, and the data format of the voice segment is shown in Table 1:
表1从终端获取数据的数据格式Table 1 Data format of data obtained from the terminal
步骤S112、识别所述语音片段中的字符,得到解密秘钥。Step S112, identifying characters in the speech segment to obtain a decryption key.
服务器从终端接收到语音片段后,根据语音片段可以生成解密秘钥,例如识别出语音片段中的字符得到字符秘钥,或者计算语音片段的哈希值等得到解密秘钥。After the server receives the voice clip from the terminal, it can generate a decryption key according to the voice clip, for example, recognize the characters in the voice clip to obtain the character key, or calculate the hash value of the voice clip to obtain the decryption key.
示例性的,服务器通过语音识别从语音片段中识别出一个或多个字符,然后将识别出的一个或多个字符通过例如补零等方式处理为预设长度的解密秘钥。服务器将识别出的一个或多个字符处理为预设长度的解密秘钥的方式与终端将识别出的一个或多个字符处理为预设长度的加密秘钥的方式相同。Exemplarily, the server recognizes one or more characters from the speech segment through speech recognition, and then processes the recognized one or more characters into a decryption key of a preset length by, for example, padding with zeros. The manner in which the server processes the recognized one or more characters into a decryption key of a preset length is the same as the way in which the terminal processes the recognized one or more characters into an encryption key of a preset length.
步骤S113、根据所述解密秘钥对所述加密后的问题语音和所述加密后的回答语音进行解密,得到问题语音和回答语音。Step S113: Decrypt the encrypted question voice and the encrypted answer voice according to the decryption key to obtain the question voice and answer voice.
示例性的,服务器基于AES128解密算法或者AES256解密算法,根据所述解密秘钥对从终端获取的加密后的问题语音和加密后的回答语音进行解密,以得到解密后的问题语音和回答语音。Exemplarily, the server decrypts the encrypted question voice and the encrypted answer voice obtained from the terminal according to the decryption key based on the AES128 decryption algorithm or the AES256 decryption algorithm, so as to obtain the decrypted question voice and answer voice.
步骤S114、对所述问题语音进行语音识别得到问题文本,对所述回答语音进行语音识别得到回答文本。Step S114 , performing speech recognition on the question speech to obtain a question text, and performing speech recognition on the answer speech to obtain an answer text.
示例性的,服务器基于内建的或者外部调用的语音识别引擎,对解密得到的问题语音进行语音识别以得到问题文本,对解密得到的回答文本进行语音识别以得到回答文本。Exemplarily, based on a built-in or externally invoked speech recognition engine, the server performs speech recognition on the decrypted question speech to obtain the question text, and performs speech recognition on the decrypted answer text to obtain the answer text.
通过对问题语音,以及回答语音的加密、解密处理,实现了问答内容的保密,提升了信息的安全性。By encrypting and decrypting the voice of the question and the voice of the answer, the confidentiality of the content of the question and answer is realized, and the security of the information is improved.
示例性的,问题文本包括:Do you have a pet;回答文本包括:my dog is cute,he likes playing。Exemplarily, the question text includes: Do you have a pet; the answer text includes: my dog is cute, he likes playing.
步骤S120、对所述问题文本和回答文本进行分词处理,得到语料分词数据。Step S120, performing word segmentation processing on the question text and answer text to obtain corpus word segmentation data.
对于英文等语种的问题文本和回答文本,有自然的词的界限;而对于中文等语种的文本,在进行中文自然语言处理时,通常需要先进行分词。For question texts and answer texts in languages such as English, there are natural word boundaries; for texts in languages such as Chinese, word segmentation is usually required first when performing Chinese natural language processing.
示例性的,根据基于词典分词算法或者根据基于统计的机器学习算法对所述问题文本和回答文本进行分词处理。Exemplarily, word segmentation processing is performed on the question text and answer text according to a word segmentation algorithm based on a dictionary or a machine learning algorithm based on statistics.
在一些实施方式中,如图5所示,步骤S120对所述问题文本和回答文本进行分词处理,得到语料分词数据,包括步骤S121和步骤S122。In some implementations, as shown in FIG. 5 , step S120 performs word segmentation processing on the question text and answer text to obtain corpus word segmentation data, including steps S121 and S122.
步骤S121、根据预设的词典,对所述问题文本进行分词处理,得到问题分词数据。Step S121 , perform word segmentation processing on the question text according to a preset dictionary, and obtain question word segmentation data.
词典是一个常用词的候选集合,如我、爱、小狗、贝贝这些词,然后从文本头到尾遍历,如果文本中有词在词典中出现过则切分该词,从而可以将我爱小狗贝贝分词处理为我爱小狗贝贝。The dictionary is a candidate set of commonly used words, such as me, love, puppy, and beibei, and then traverses from the beginning to the end of the text. If there is a word in the text that appears in the dictionary, it will be segmented, so that we can The participle of love puppy Beibei is processed as I love puppy Beibei.
步骤S122、根据预设的词典,对所述回答文本进行分词处理,得到回答分词数据。Step S122: Perform word segmentation processing on the answer text according to a preset dictionary to obtain answer word segmentation data.
参照步骤S121,对回答文本进行分词处理后得到该回答文本对应的回答分词数据。Referring to step S121, word segmentation processing is performed on the answer text to obtain answer word segmentation data corresponding to the answer text.
在另一些实施方式中,如图6所示,步骤S120对所述问题文本和回答文本进行分词处理,得到语料分词数据,包括步骤S123和步骤S124。In other embodiments, as shown in FIG. 6 , step S120 performs word segmentation processing on the question text and answer text to obtain corpus word segmentation data, including steps S123 and S124.
步骤S123、根据预设的词库,对所述问题文本进行one-hot编码,得到问题分词数据。Step S123: Perform one-hot encoding on the question text according to the preset thesaurus to obtain question word segmentation data.
one-hot编码,即独热码、一位有效编码;独热码是这样一种码制:对于某一属性的词,有多少个状态就有多少比特,而且只有一个比特为1,其他全为0。One-hot encoding, that is, one-hot encoding, one-bit effective encoding; one-hot encoding is such a code system: for a word of a certain attribute, there are as many bits as there are states, and only one bit is 1, and the other bits are all is 0.
示例性的,预设的词典中包括性别这一属性对应的词,分别为男性、女性和其他。该属性共有3个不同的分类值,此时需要3个比特位表示该属性是什么值。例如,男性的独热码为{100},女性的独热码为{010},其他性别的独热码为{001}。Exemplarily, the preset dictionary includes words corresponding to the attribute of gender, namely male, female and others. There are 3 different classification values for this attribute. At this time, 3 bits are required to indicate what value the attribute is. For example, the one-hot code for males is {100}, the one-hot code for females is {010}, and the one-hot code for other genders is {001}.
示例性的,预设的词典中还可以包括人称、水果、季节、运动方式等属性,即各属性对应的词和独热码。Exemplarily, the preset dictionary may also include attributes such as person, fruit, season, and sport, that is, words and one-hot codes corresponding to each attribute.
假如某文本中有多个词语,需要独热码编码时,依次将每个词的独热码拼接起来:例如男性的独热码为{100},四年级的独热码为{0001},那么两者连接起来得到最后的独热码{1000001}。If there are multiple words in a text, when one-hot code encoding is required, the one-hot codes of each word are spliced together in turn: for example, the one-hot code for male is {100}, the one-hot code for fourth grade is {0001}, Then the two are connected to get the final one-hot code {1000001}.
使用one-hot编码对文本处理可以使得数据变稀疏,且one-hot编码得到的数据包含了文本中词语属性的信息。Using one-hot encoding to process text can make the data sparse, and the data obtained by one-hot encoding contains information about the attributes of words in the text.
对问题文本进行分词处理后得到该问题文本对应的问题分词数据。After word segmentation processing is performed on the question text, the question word segmentation data corresponding to the question text is obtained.
示例性的,某问题文本对应的问题分词数据为:000000000001 000000000010100000000000 010000000000 001000000000。Exemplarily, the question word segmentation data corresponding to a question text is: 000000000001 000000000010100000000000 010000000000 001000000000.
步骤S124、根据预设的词库,对所述回答文本进行one-hot编码,得到回答分词数据。Step S124: Perform one-hot encoding on the answer text according to the preset thesaurus to obtain answer word segmentation data.
具体的,参照步骤S123,对回答文本进行分词处理后得到该回答文本对应的回答分词数据。Specifically, referring to step S123, word segmentation processing is performed on the answer text to obtain answer word segmentation data corresponding to the answer text.
示例性的,某回答文本对应的回答分词数据为:000000000100 000000001000000100000000 000000010000 000010000000 000000100000 000001000000。Exemplarily, the word segmentation data corresponding to a certain answer text is: 000000000100 000000001000000100000000 000000010000 000010000000 000000100000 000001000000.
步骤S130、对所述语料分词数据进行嵌入处理,得到嵌入表示数据。Step S130, performing embedding processing on the word segmentation data of the corpus to obtain embedded representation data.
在一些实施方式中,对所述问题文本和回答文本进行分词处理,得到语料分词数据之后,在分词得到的问题分词数据和回答分词数据中对应于各句文本的开头位置添加起始符[CLS],句子间添位置加分隔符[SEP],在句子结尾处添加分隔符[SEP]。In some embodiments, the question text and the answer text are subjected to word segmentation processing, and after obtaining the word segmentation data of the corpus, an initial character [CLS ], add a separator [SEP] between sentences, and add a separator [SEP] at the end of a sentence.
示例性的,某次问题分词数据可以处理为:[CLS]您在公司待了多久[SEP]最喜欢公司什么地方[SEP]。Exemplarily, word segmentation data for a certain question can be processed as: [CLS] How long have you been in the company [SEP] Where is your favorite place in the company [SEP].
示例性的,在分词得到的问题分词数据和回答分词数据中添加起始符、分隔符、分隔符之后得到:[CLS]000000000001 000000000010 100000000000 010000000000001000000000[SEP]000000000100 000000001000 000100000000 000000010000[SEP]000010000000 000000100000 000001000000[SEP]。示例性的,在分词得到的问题分词数据和回答分词数据中添加起始符、分隔符、分隔符之后得到:[CLS]000000000001 000000000010 100000000000 010000000000001000000000[SEP]000000000100 000000001000 000100000000 000000010000[SEP]000010000000 000000100000 000001000000[ SEP].
在一些实施方式中,如图7所示,步骤S130对所述语料分词数据进行嵌入处理,得到嵌入表示数据,包括步骤S131、步骤S132。In some implementations, as shown in FIG. 7 , step S130 performs embedding processing on the corpus word segmentation data to obtain embedded representation data, including steps S131 and S132.
步骤S131、对所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息进行嵌入处理。Step S131 , embedding the word segmentation information, paragraph information, and position information of the question word segmentation data and the answer word segmentation data.
具体的,所述问题分词数据的段落信息与所述回答分词数据的段落信息不同。Specifically, the paragraph information of the question word segmentation data is different from the paragraph information of the answer word segmentation data.
示例性的,如图8所示为对所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息进行嵌入处理的示意图。Exemplarily, FIG. 8 is a schematic diagram of embedding word segmentation information, paragraph information, and position information of the question word segmentation data and the answer word segmentation data.
其中,对所述问题分词数据和所述回答分词数据的分词信息进行嵌入处理,得到的嵌入结果Token Embeddings是词向量,第一个单词是起始符[CLS],可以用于之后的预测任务。Wherein, the word segmentation information of the question word segmentation data and the answer word segmentation data is embedded, and the obtained embedding result Token Embeddings is a word vector, and the first word is a start character [CLS], which can be used for subsequent prediction tasks .
在本实施方式中,将问题文本和回答文本进行分词处理得到的语料中的每一个分词(token)送入token embedding层,对分词信息进行嵌入处理,将每一个词转换成向量形式。In this embodiment, each token in the corpus obtained by performing word segmentation processing on the question text and answer text is sent to the token embedding layer, and the token information is embedded, and each word is converted into a vector form.
示例性的,token embedding层将各个词转换成固定维度的向量,例如,将各个词转换成768维的向量表示。Exemplarily, the token embedding layer converts each word into a fixed-dimensional vector, for example, converts each word into a 768-dimensional vector representation.
所述问题分词数据的段落信息与所述回答分词数据的段落信息不同,将段落信息进行嵌入处理,得到的嵌入结果Segment Embeddings用来区别问题分词数据和所述回答分词数据。The paragraph information of the question segmentation data is different from the paragraph information of the answer segmentation data, the paragraph information is embedded, and the obtained embedding result Segment Embeddings is used to distinguish the question segmentation data and the answer segmentation data.
示例性的,如图8所示,问题分词数据的段落信息为EA,回答分词数据的段落信息为EB,所示问题分词数据的段落信息与所述回答分词数据的段落信息不同。Exemplarily, as shown in FIG. 8 , the paragraph information of the question word segmentation data is EA, the paragraph information of the answer word segmentation data is EB, and the paragraph information of the question word segmentation data is different from the paragraph information of the answer word segmentation data.
位置信息的嵌入结果Position Embeddings是学习得到的。例如,BERT模型能够处理最长512个词(token)的输入序列。通过让BERT模型在各个位置上学习一个向量表示来将序列顺序的信息编码进来。这意味着Position Embeddings层实际上就是一个大小为(512,768)的查询(lookup)表,表的第一行是代表第一个序列的第一个位置,第二行代表序列的第二个位置,以此类推。The embedding result of position information Position Embeddings is learned. For example, the BERT model can handle input sequences of up to 512 words (tokens). The sequence order information is encoded by letting the BERT model learn a vector representation at each position. This means that the Position Embeddings layer is actually a lookup table with a size of (512, 768). The first row of the table represents the first position of the first sequence, and the second row represents the second of the sequence. location, and so on.
具体的,每个分词处理后的回答文本的第一个词(token)始终是特殊分类嵌入,即起始符[CLS]。对应于该起始符的最终隐藏状态,即Transformer的输出被用作分类任务的聚合序列表示。Specifically, the first word (token) of each word-segmented answer text is always a special classification embedding, that is, the start symbol [CLS]. The final hidden state corresponding to this initiator, i.e. the output of the Transformer, is used as the aggregated sequence representation for the classification task.
步骤S132、将所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息的嵌入结果相加,得到嵌入表示数据。Step S132. Add the word segmentation data of the question and the embedding results of the word segmentation information, paragraph information, and position information of the answer word segmentation data to obtain embedded representation data.
示例性的,分词信息的嵌入结果Token Embeddings是词的向量表示,段落信息的嵌入结果Segment Embeddings可以辅助BERT模型区分问题分词数据和回答分词数据的向量表示,位置信息的嵌入结果Position Embeddings可以使BERT模型学习到输入的顺序属性。Exemplarily, the Token Embeddings of the word segmentation information embedding result is the vector representation of the word, the Segment Embeddings of the paragraph information embedding result can assist the BERT model to distinguish the vector representation of the question word segmentation data and the answer word segmentation data, and the position information embedding result Position Embeddings can make BERT The model learns the sequential properties of the input.
示例性的,分词信息、段落信息、位置信息的嵌入结果均为(1,n,768)的向量,这些嵌入结果按元素相加,得到一个大小为(1,n,768)的合成表示,可以作为面试内容数据,这一合成表示可以作为特征提取子模型,如BERT模型编码层的输入(inputrepresentation)。Exemplarily, the embedding results of word segmentation information, paragraph information, and position information are all vectors of (1, n, 768), and these embedding results are added element by element to obtain a composite representation with a size of (1, n, 768), Can be used as interview content data, and this synthetic representation can be used as a feature extraction sub-model, such as the input (inputrepresentation) of the encoding layer of the BERT model.
步骤S140、基于特征提取子模型,对所述嵌入表示数据进行特征提取得到自注意力特征向量,所述特征提取子模型为基于自注意力机制的模型。Step S140 , based on a feature extraction sub-model, perform feature extraction on the embedded representation data to obtain a self-attention feature vector, and the feature extraction sub-model is a model based on a self-attention mechanism.
在本实施方式中,通过问答匹配模型计算问答匹配数据;问答匹配模型包括特征提取子模型和匹配子模型,其中特征提取子模型包括基于自注意力机制的模型,如BERT模型。In this embodiment, the question-answer matching data is calculated through the question-answer matching model; the question-answer matching model includes a feature extraction sub-model and a matching sub-model, wherein the feature extraction sub-model includes a model based on a self-attention mechanism, such as a BERT model.
BERT(Bidirectional Encoder Representations from Transformers)模型,即双向转换(Transformer)的编码器(Encoder)旨在通过联合调节所有层中的上下文来预先训练深度双向表示;Transformer是一种完全依赖于自注意力以计算输入与输出表征的方法。The BERT (Bidirectional Encoder Representations from Transformers) model, that is, the Encoder of the two-way conversion (Transformer), aims to pre-train deep bidirectional representations by jointly adjusting the context in all layers; Methods for computing input and output representations.
BERT模型的主要创新点在预训练(pre-train)方法上,即用了遮蔽语言模型(masked language model,MLM)和下一句预测(Next Sentence Prediction)两种方法分别捕捉词语和句子级别的表示(representation)。The main innovation of the BERT model is in the pre-train method, that is, the masked language model (masked language model, MLM) and the next sentence prediction (Next Sentence Prediction) are used to capture the representation of words and sentences respectively. (representation).
遮蔽语言模型随机遮蔽模型输入中的一些单词,目标在于仅基于遮蔽词的语境来预测其原始词汇id。与从左到右的语言模型预训练不同,遮蔽语言模型的训练目标允许表征融合左右两侧的语境,从而预训练一个深度双向Transformer。Masked language models randomly mask some of the words in the model input, with the goal of predicting their original lexical id based only on the context of the masked word. Unlike the left-to-right language model pre-training, the masked language model training objective allows the representation to fuse the context of the left and right sides, thus pre-training a deep bidirectional Transformer.
随机选择语料中15%的单词,去除该15%的单词,例如用[Mask]掩码代替原始单词,然后以模型正确预测被代替的单词为目标。Randomly select 15% of the words in the corpus, remove the 15% of the words, for example, replace the original words with a [Mask] mask, and then use the model to correctly predict the replaced words as the target.
具体的15%的被选中要执行[mask]替身这项任务的单词中,只有80%真正被替换成[mask]标记,10%被随机替换成另外一个单词,10%情况这个单词不做改动。这就是Masked双向语音模型的具体做法。Of the specific 15% of the words selected to perform the task of [mask], only 80% are actually replaced with the [mask] mark, 10% are randomly replaced with another word, and in 10% of the cases, the word is not changed. . This is the specific approach of the Masked two-way speech model.
下一句预测,即Next Sentence Prediction指的是做语言模型预训练的时候,分两种情况选择两个句子,一种是选择语料中真正顺序相连的两个句子;另外一种是第二个句子从语料库中抛色子,随机选择一个拼到第一个句子后面。模型除了做上述的Masked语言模型任务外,附带再做个句子关系预测,判断第二个句子是不是真的是第一个句子的后续句子。增加这个任务有助于下游句子关系判断任务。The next sentence prediction, that is, Next Sentence Prediction, refers to the selection of two sentences in two situations when doing language model pre-training, one is to select two sentences that are actually sequentially connected in the corpus; the other is the second sentence Throw dice from the corpus, and randomly select one to spell after the first sentence. In addition to the above-mentioned Masked language model tasks, the model also makes a sentence relationship prediction to judge whether the second sentence is really a follow-up sentence of the first sentence. Adding this task helps downstream sentence relation judgment tasks.
BERT模型的预训练是个多任务过程,预训练本质上是通过设计好一个网络结构模型来做语言模型任务,然后把大量甚至是无穷尽的无标注的自然语言文本利用起来,预训练任务把大量语言学知识抽取出来编码到网络结构中。The pre-training of the BERT model is a multi-task process. The pre-training is essentially to design a network structure model to do the language model task, and then use a large number of even endless unlabeled natural language texts. The pre-training task uses a large number of Linguistic knowledge is extracted and encoded into the network structure.
谷歌开放了预训练的BERT-Base和BERT-Large模型,可以通过调用预训练的BERT模型实现根据文本抽取相应的特征向量,即可表示语义特征的向量。Google has opened up the pre-trained BERT-Base and BERT-Large models. By calling the pre-trained BERT model, the corresponding feature vector can be extracted according to the text, which can represent the vector of semantic features.
在本实施方式中,基于训练好的特征提取子模型,如BERT模型,根据嵌入表示数据提取用于描述问题分词数据、回答分词数据以及问题分词数据和回答分词数据之间的自注意力特征的自注意力特征向量。In this embodiment, based on the trained feature extraction sub-model, such as the BERT model, the embedded representation data is used to extract the self-attention features used to describe the question segmentation data, answer segmentation data, and question segmentation data and answer segmentation data. Self-attention feature vector.
BERT模型的架构基于多层的双向Transformer,基于自注意力机制从输入的(E1E2……En)提取可以体现双向的,上下文语言特征的特征向量(C T1 T2……Tn……)。其中,Token表示不同的词、E表示输入的嵌入向量、T_i表示第i个词在经过BERT处理后输出的上下文向量。The architecture of the BERT model is based on a multi-layer bidirectional Transformer, and the feature vector (C T1 T2...Tn...) that can reflect bidirectional and contextual language features is extracted from the input (E1E2...En) based on the self-attention mechanism. Among them, Token represents different words, E represents the input embedding vector, and T_i represents the context vector output by the i-th word after BERT processing.
示例性的,特征提取子模型为基于BERT的特征提取模型,在获取预训练的BERT模型后使用微调(Fine-Tuning)模式针对问答匹配度度量这一具体任务实现参数的微调。BERT模型可以为问答匹配度度量任务提供高效的信息抽取功能。Exemplarily, the feature extraction sub-model is a BERT-based feature extraction model. After obtaining the pre-trained BERT model, fine-tuning (Fine-Tuning) mode is used to implement parameter fine-tuning for the specific task of measuring the matching degree of questions and answers. The BERT model can provide an efficient information extraction function for the question-answer matching degree measurement task.
问答匹配度度量任务,如回答文本评分任务是一种句子关系类任务。输入BERT模型的嵌入表示数据包括两项数据,一项是嵌入表示数据中与问题文本对应的部分,另一项是嵌入表示数据中与回答文本对应的部分。将嵌入表示数据中对应于问题分词数据的数据作为第一输入数据,将嵌入表示数据中对应于回答分词数据的数据作为第二输入数据输入至BERT模型,第一输入数据和第二输入数据之间包括分隔符[SEP]。Question-answer matching degree measurement task, such as answer text scoring task is a sentence relation task. The embedded representation data input into the BERT model includes two items of data, one is the part corresponding to the question text in the embedded representation data, and the other is the part corresponding to the answer text in the embedded representation data. The data corresponding to the question word segmentation data in the embedded representation data is used as the first input data, and the data corresponding to the answer word segmentation data in the embedded representation data is input to the BERT model as the second input data, between the first input data and the second input data include the separator [SEP].
基于BERT模型的双输入形式,构建输入一为与问题文本对应的数据,构建输入二为与回答文本对应的数据,BERT模型的输出则为回答文本和问题文本之间的注意力特征向量。具体的,将BERT模型的与所述起始符[CLS]对应的隐层之后输出的,对应于起始符[CLS]的C向量final hidden state作为提取得到的自注意力特征向量。Based on the double-input form of the BERT model, the first input is the data corresponding to the question text, the second input is the data corresponding to the answer text, and the output of the BERT model is the attention feature vector between the answer text and the question text. Specifically, the C vector final hidden state corresponding to the start symbol [CLS] output after the hidden layer corresponding to the start symbol [CLS] of the BERT model is used as the extracted self-attention feature vector.
基于自注意力机制的特征提取子模型,如BERT模型,通过预训练将语言学知识隐含地引入问答匹配模型;且BERT模型通过采用遮蔽(Masked)语言模型,抗干扰能力强,从而问答匹配处理方法可以在一定程度上解决语音识别错误带来干扰信息的问题;该特征提取子模型还可以捕捉问题文本和回答文本中句子间的关系,从而可以在句子尺度上对问答匹配度进行度量。The feature extraction sub-model based on the self-attention mechanism, such as the BERT model, implicitly introduces linguistic knowledge into the question-answer matching model through pre-training; and the BERT model adopts a masked language model, which has strong anti-interference ability, so that question-answer matching The processing method can solve the problem of interference information caused by speech recognition errors to a certain extent; the feature extraction sub-model can also capture the relationship between sentences in the question text and answer text, so that the matching degree of question and answer can be measured on the sentence scale.
步骤S150、基于匹配子模型,根据所述自注意力特征向量生成问答匹配数据,输出所述问答匹配数据。Step S150, based on the matching sub-model, generate question-answer matching data according to the self-attention feature vector, and output the question-answer matching data.
自注意力特征向量包括问题和回答之间的注意力特征,根据匹配子模型对该自注意力特征向量的处理,可以得到用于度量所述问题文本和回答文本之间的匹配度。The self-attention feature vector includes the attention feature between the question and the answer. According to the processing of the self-attention feature vector by the matching sub-model, it can be used to measure the matching degree between the question text and the answer text.
在一些实施方式中,如图9所示,步骤S150基于匹配子模型,根据所述自注意力特征向量生成问答匹配数据,输出所述问答匹配数据,包括步骤S151、步骤S152。In some implementations, as shown in FIG. 9 , step S150 generates question-answer matching data according to the self-attention feature vector based on the matching sub-model, and outputs the question-answer matching data, including steps S151 and S152.
步骤S151、基于训练好的匹配子模型,对所述自注意力特征向量进行降维处理,得到对应于匹配和不匹配两个类别的二维向量。Step S151 , based on the trained matching sub-model, perform dimensionality reduction processing on the self-attention feature vector to obtain two-dimensional vectors corresponding to two categories of matching and non-matching.
示例性的,匹配子模型包括线性层,该线性层连接在BERT模型与所述起始符[CLS]对应的隐层之后,将该隐层输出的隐特征向量,即自注意力特征向量作为输入。Exemplary, the matching sub-model includes a linear layer, the linear layer is connected after the hidden layer corresponding to the BERT model and the start symbol [CLS], and the hidden feature vector output by the hidden layer, that is, the self-attention feature vector is used as enter.
示例性的,线性层是一个序列级分类器(sequence-level classifier)。Exemplarily, the linear layer is a sequence-level classifier.
示例性的,基于训练好的匹配子模型中的线性层,将自注意力特征向量降维处理为二维向量(y0,y1);其中,y0、y1表示的是回答文本和问题文本之间“匹配”、“不匹配”两个类别的数值。Exemplarily, based on the linear layer in the trained matching sub-model, the dimensionality reduction of the self-attention feature vector is processed into a two-dimensional vector (y0, y1); wherein, y0, y1 represent the distance between the answer text and the question text Values for the two categories of "match" and "mismatch".
步骤S152、基于所述匹配子模型,对所述二维向量进行归一化处理,根据处理后的二维向量得到问答匹配数据,输出所述问答匹配数据。Step S152 , based on the matching sub-model, perform normalization processing on the two-dimensional vector, obtain question-answer matching data according to the processed two-dimensional vector, and output the question-answer matching data.
示例性的,匹配子模型包括线性层之后连接的分类器,如softmax分类器,用于对二维向量(y0,y1)进行归一化处理。Exemplarily, the matching sub-model includes a classifier connected after the linear layer, such as a softmax classifier, for normalizing the two-dimensional vector (y0, y1).
示例性的,分类器将二维向量(y0,y1)做Softmax归一化,将y0、y1压缩到0-1的数值区间,可以表示为回答文本和问题文本之间“匹配”、“不匹配”两个类别的分类概率p0、p1。Exemplarily, the classifier performs Softmax normalization on the two-dimensional vector (y0, y1), and compresses y0, y1 to a value range of 0-1, which can be expressed as "matching" and "not matching" between the answer text and the question text. match" the classification probabilities p0, p1 of the two categories.
具体的,p0、p1之和为1;可以将回答文本和问题文本之间“匹配”的分类概率p0作为问答匹配数据,也可以将分类概率p0转化为十分制或百分制后作为问答匹配数据,用于度量问题文本和回答文本之间的匹配度;例如还可以作为所述回答文本相对于所述问题文本的评分值。Specifically, the sum of p0 and p1 is 1; the classification probability p0 of "matching" between the answer text and the question text can be used as the question-and-answer matching data, or the classification probability p0 can be converted into a ten-point system or a hundred-point system as the question-and-answer matching data. It is used to measure the matching degree between the question text and the answer text; for example, it can also be used as a score value of the answer text relative to the question text.
本申请各实施例提供的问答匹配处理方法,通过对获取的问题文本和回答文本进行分词、嵌入处理,得到文本的嵌入表示,然后通过基于自注意力机制的模型提取问题文本和回答文本之间的自注意力特征,以根据自注意力特征生成问答匹配数据;无需预设不同面试问题对应的不同关键词库,方法可以基于模型学习到的大量问答匹配信息,根据不同问题和对应的文本得到匹配数据,通用性较好,准确度较高。The question-answer matching processing method provided by each embodiment of the present application obtains the embedded representation of the text by performing word segmentation and embedding processing on the acquired question text and answer text, and then extracts the difference between the question text and the answer text through a model based on the self-attention mechanism. self-attention features to generate question-and-answer matching data based on self-attention features; there is no need to preset different keyword libraries corresponding to different interview questions, the method can be based on a large amount of question-answer matching information learned by the model, and can be obtained according to different questions and corresponding texts Matching data has better versatility and higher accuracy.
本申请的另一实施例提供了一种问答匹配模型训练方法,装置、计算机设备及存储介质。其中,该问答匹配模型训练方法可以应用于终端或服务器中,以实现对问答匹配模型进行训练,得到的问答匹配模型可以基于特征提取子模型和匹配子模型对多种问题和回答之间的匹配程度进行度量。Another embodiment of the present application provides a question-answer matching model training method, device, computer equipment and storage medium. Wherein, the question-answer matching model training method can be applied to a terminal or a server to realize the training of the question-answer matching model, and the obtained question-answer matching model can match various questions and answers based on the feature extraction sub-model and the matching sub-model measure the extent.
例如,问答匹配模型训练方法用于服务器,当然可以用于终端。For example, the question-answer matching model training method is used for the server, and of course it can be used for the terminal.
请参阅图10,图10是本申请的实施例提供的一种问答匹配模型训练方法的流程示意图。Please refer to FIG. 10 . FIG. 10 is a schematic flowchart of a method for training a question-answer matching model provided by an embodiment of the present application.
如图10所示,所述问答匹配模型训练方法,具体包括步骤S210至步骤S270。As shown in FIG. 10 , the question-answer matching model training method specifically includes steps S210 to S270.
步骤S210、获取问答匹配模型,所述问答匹配模型包括预训练的BERT模型和连接于所述BERT模型的匹配子模型。Step S210, obtaining a question-answer matching model, which includes a pre-trained BERT model and a matching sub-model connected to the BERT model.
预训练的BERT模型作为特征提取子模型,将语言学知识隐含地引入问答匹配模型;且BERT模型通过采用遮蔽(Masked)语言模型,抗干扰能力强,从而问答匹配模型可以在一定程度上解决语音识别错误带来干扰信息的问题;该特征提取子模型还可以捕捉问题文本和回答文本中句子间的关系,从而可以在句子尺度上对问答匹配度进行度量。As a feature extraction sub-model, the pre-trained BERT model implicitly introduces linguistic knowledge into the question-answer matching model; and the BERT model adopts a masked language model, which has strong anti-interference ability, so that the question-answer matching model can solve the problem to a certain extent. Speech recognition errors bring noise information; the feature extraction sub-model can also capture the relationship between sentences in the question text and answer text, so that the matching degree of question and answer can be measured on the sentence scale.
示例性的,匹配子模型包括线性层,该线性层连接在BERT模型与所述起始符[CLS]对应的隐层之后,将该隐层输出的隐特征向量作为输入。Exemplarily, the matching sub-model includes a linear layer, the linear layer is connected after the hidden layer of the BERT model corresponding to the start symbol [CLS], and the hidden feature vector output by the hidden layer is used as input.
示例性的,匹配子模型包括线性层之后连接的分类器,如softmax分类器,用于对二维向量(y0,y1)进行归一化处理。Exemplarily, the matching sub-model includes a classifier connected after the linear layer, such as a softmax classifier, for normalizing the two-dimensional vector (y0, y1).
示例性的,分类器将线性层输出的向量做Softmax归一化,将向量中的元素压缩到0-1的数值区间,例如可以表示为回答文本和问题文本之间“匹配”、“不匹配”两个类别的分类概率p0、p1。Exemplarily, the classifier performs Softmax normalization on the vector output by the linear layer, and compresses the elements in the vector to a value range of 0-1, for example, it can be expressed as "match" or "mismatch" between the answer text and the question text "Classification probabilities p0, p1 for two classes.
步骤S220、获取训练数据,所述训练数据包括问题文本样本、与所述问题文本样本对应的回答文本样本,以及所述回答文本样本对应的匹配度数据。Step S220, acquiring training data, the training data including question text samples, answer text samples corresponding to the question text samples, and matching degree data corresponding to the answer text samples.
具体的,训练数据包括标注了匹配度数据的问题文本和回答文本,标注可以由人工根据经验实现。Specifically, the training data includes question texts and answer texts labeled with matching data, and the labeling can be done manually based on experience.
示例性的,某训练数据包括问题文本样本:Do you have a pet;还包括与该问题文本样本对应的回答文本样本:my dog is cute,he likes playing;以及包括该回答文本样本对应的额匹配度数据如,匹配分数80。Exemplarily, a certain training data includes a question text sample: Do you have a pet; also includes an answer text sample corresponding to the question text sample: my dog is cute, he likes playing; and includes a matching amount corresponding to the answer text sample Degree data such as a match score of 80.
步骤S230、对所述训练数据中的问题文本样本、回答文本样本进行分词处理,得到样本分词数据。Step S230, performing word segmentation processing on the question text samples and answer text samples in the training data to obtain sample word segmentation data.
对于英文等语种的问题文本和回答文本,有自然的词的界限;而对于中文等语种的文本,在进行中文自然语言处理时,通常需要先进行分词。For question texts and answer texts in languages such as English, there are natural word boundaries; for texts in languages such as Chinese, word segmentation is usually required first when performing Chinese natural language processing.
示例性的,根据基于词典分词算法或者根据基于统计的机器学习算法对所述问题文本样本、回答文本样本进行分词处理。Exemplarily, word segmentation processing is performed on the question text samples and answer text samples according to a dictionary-based word segmentation algorithm or a statistical-based machine learning algorithm.
在一些实施方式中,如图11所示,步骤S230对所述训练数据中的问题文本样本、回答文本样本进行分词处理,得到样本分词数据,包括步骤S231、步骤S232。In some embodiments, as shown in FIG. 11 , step S230 performs word segmentation processing on the question text samples and answer text samples in the training data to obtain sample word segmentation data, including steps S231 and S232.
步骤S231、根据预设的词典,对所述问题文本样本进行分词处理,得到问题分词数据。Step S231 , perform word segmentation processing on the question text sample according to a preset dictionary, and obtain question word segmentation data.
词典是一个常用词的候选集合,如我、爱、小狗、贝贝这些词,然后从文本头到尾遍历,如果文本中有词在词典中出现过则切分该词,从而可以将我爱小狗贝贝分词处理为我爱小狗贝贝。The dictionary is a candidate set of commonly used words, such as me, love, puppy, and beibei, and then traverses from the beginning to the end of the text. If there is a word in the text that appears in the dictionary, it will be segmented, so that we can The participle of love puppy Beibei is processed as I love puppy Beibei.
步骤S232、根据预设的词典,对所述回答文本样本进行分词处理,得到回答分词数据。Step S232: Perform word segmentation processing on the answer text sample according to the preset dictionary to obtain answer word segmentation data.
参照步骤S231,对回答文本样本进行分词处理后得到该回答文本样本对应的回答分词数据。Referring to step S231, word segmentation processing is performed on the answer text sample to obtain answer word segmentation data corresponding to the answer text sample.
步骤S240、对所述样本分词数据进行嵌入处理,得到样本表示数据。Step S240, performing embedding processing on the sample word segmentation data to obtain sample representation data.
在一些实施方式中,对所述问题文本样本、回答文本样本进行分词处理,得到样本分词数据之后,在分词得到的问题分词数据和回答分词数据中对应于各句文本的开头位置添加起始符[CLS],句子间添位置加分隔符[SEP],在句子结尾处添加分隔符[SEP]。In some embodiments, word segmentation is performed on the question text samples and answer text samples, and after the sample word segmentation data is obtained, an initial character is added corresponding to the beginning position of each sentence text in the question word segmentation data and answer word segmentation data obtained by word segmentation [CLS], add a separator [SEP] between sentences, and add a separator [SEP] at the end of a sentence.
在一些实施方式中,如图12所示,步骤S240对所述样本分词数据进行嵌入处理,得到样本表示数据,包括步骤S241、步骤S242。In some implementations, as shown in FIG. 12 , step S240 performs embedding processing on the sample word segmentation data to obtain sample representation data, including steps S241 and S242.
步骤S241、对所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息进行嵌入处理。Step S241 , embedding the word segmentation information, paragraph information, and position information of the question word segmentation data and the answer word segmentation data.
具体的,所述问题分词数据的段落信息与所述回答分词数据的段落信息不同。Specifically, the paragraph information of the question word segmentation data is different from the paragraph information of the answer word segmentation data.
示例性的,如图8所示为对所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息进行嵌入处理的示意图。Exemplarily, FIG. 8 is a schematic diagram of embedding word segmentation information, paragraph information, and position information of the question word segmentation data and the answer word segmentation data.
步骤S242、将所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息的嵌入结果相加,得到样本表示数据。Step S242, adding the word segmentation data of the question and the embedding results of the word segmentation information, paragraph information, and position information of the answer word segmentation data to obtain sample representation data.
示例性的,分词信息、段落信息、位置信息的嵌入结果均为(1,n,768)的向量,这些嵌入结果按元素相加,得到一个大小为(1,n,768)的合成表示,可以作为样本表示数据,这一合成表示可以作为特征提取子模型,如BERT模型编码层的输入(inputrepresentation)。Exemplarily, the embedding results of word segmentation information, paragraph information, and position information are all vectors of (1, n, 768), and these embedding results are added element by element to obtain a composite representation with a size of (1, n, 768), The data can be represented as a sample, and this synthetic representation can be used as a feature extraction sub-model, such as the input (input presentation) of the encoding layer of the BERT model.
步骤S250、所述BERT模型对所述样本表示数据进行特征提取,得到自注意力特征向量。Step S250, the BERT model performs feature extraction on the sample representation data to obtain a self-attention feature vector.
在本实施方式中,基于特征提取子模型,如BERT模型,根据样本表示数据提取用于描述问题分词数据、回答分词数据以及问题分词数据和回答分词数据之间的自注意力特征的自注意力特征向量。In this embodiment, based on the feature extraction sub-model, such as the BERT model, the self-attention used to describe the self-attention features between the question word segmentation data, the answer word segmentation data, and the question word segmentation data and answer word segmentation data is extracted according to the sample representation data Feature vector.
问答匹配度度量任务,如回答文本评分任务是一种句子关系类任务。输入BERT模型的嵌入表示数据包括两项数据,一项是嵌入表示数据中与问题文本对应的部分,另一项是嵌入表示数据中与回答文本对应的部分。将嵌入表示数据中对应于问题分词数据的数据作为第一输入数据,将嵌入表示数据中对应于回答分词数据的数据作为第二输入数据输入至BERT模型,第一输入数据和第二输入数据之间包括分隔符[SEP]。The task of measuring the matching degree of question and answer, such as the task of scoring the answer text is a sentence relation task. The embedded representation data input into the BERT model includes two items of data, one is the part corresponding to the question text in the embedded representation data, and the other is the part corresponding to the answer text in the embedded representation data. The data corresponding to the question word segmentation data in the embedded representation data is used as the first input data, and the data corresponding to the answer word segmentation data in the embedded representation data is input to the BERT model as the second input data, between the first input data and the second input data include the separator [SEP].
具体的,将BERT模型的与所述起始符[CLS]对应的隐层之后输出的,对应于起始符[CLS]的C向量final hidden state作为提取得到的自注意力特征向量。Specifically, the C vector final hidden state corresponding to the start symbol [CLS] output after the hidden layer corresponding to the start symbol [CLS] of the BERT model is used as the extracted self-attention feature vector.
步骤S260、所述匹配子模型根据所述自注意力特征向量生成问答匹配数据。Step S260, the matching sub-model generates question-answer matching data according to the self-attention feature vector.
自注意力特征向量包括问题和回答之间的注意力特征,根据匹配子模型对该自注意力特征向量的处理,可以得到用于度量所述问题文本样本和回答文本样本之间的匹配度。The self-attention feature vector includes the attention feature between the question and the answer. According to the processing of the self-attention feature vector by the matching sub-model, it can be used to measure the matching degree between the question text sample and the answer text sample.
示例性的,基于匹配子模型,对所述自注意力特征向量进行降维处理,得到对应于匹配和不匹配两个类别的二维向量。然后基于所述匹配子模型,对所述二维向量进行归一化处理,根据处理后的二维向量得到问答匹配数据,输出所述问答匹配数据。Exemplarily, based on the matching sub-model, the self-attention feature vector is subjected to dimensionality reduction processing to obtain two-dimensional vectors corresponding to two categories of matching and non-matching. Then, based on the matching sub-model, normalize the two-dimensional vector, obtain question-answer matching data according to the processed two-dimensional vector, and output the question-answer matching data.
示例性的,可以将回答文本样本和问题文本样本之间“匹配”的分类概率作为问答匹配数据,也可以将该分类概率转化为十分制或百分制后作为问答匹配数据,用于度量问题文本样本和回答文本样本之间的匹配度;例如还可以作为所述回答文本样本相对于所述问题文本样本的评分值。Exemplarily, the classification probability of "matching" between the answer text sample and the question text sample can be used as the question-and-answer matching data, or the classification probability can be converted into tens or percentiles and used as the question-and-answer matching data for measuring the question text sample The matching degree between the answer text sample and the answer text sample; for example, it can also be used as the score value of the answer text sample relative to the question text sample.
步骤S270、基于预设的损失函数,根据所述问答匹配数据和所述匹配度数据计算损失值,根据所述损失值调整所述问答匹配模型中的参数。Step S270, based on a preset loss function, calculate a loss value according to the question-answer matching data and the matching degree data, and adjust parameters in the question-answer matching model according to the loss value.
示例性的,根据预测得到的问答匹配数据和实际标注的问答匹配数据计算两者的差值,根据该差值计算损失值,然后反向传播,根据该损失值调整所述问答匹配模型中的参数,如调整匹配子模型中的参数和/或BERT模型中的参数。Exemplarily, the difference between the predicted question-answer matching data and the actual marked question-answer matching data is calculated, the loss value is calculated according to the difference, and then backpropagation is performed to adjust the question-answer matching model according to the loss value. Parameters, such as tuning parameters in the matching submodel and/or parameters in the BERT model.
之后根据步骤S220获取新的训练数据,并依次执行步骤S230-步骤S270;直至某次执行步骤S270时损失值小于预设的阈值或者损失值的波动足够小时停止对问答匹配模型的训练,得到训练好的对问答匹配模型。Then obtain new training data according to step S220, and execute step S230-step S270 in sequence; until the loss value is less than the preset threshold or the fluctuation of the loss value is small enough to stop the training of the question-answer matching model when step S270 is executed, and the training is obtained. Good question-answer matching model.
本申请各实施例提供的问答匹配模型训练方法,通过对训练数据中的问题文本和回答文本进行分词、嵌入处理,得到文本的嵌入表示,然后通过基于自注意力机制的模型提取问题文本和回答文本之间的自注意力特征,以根据自注意力特征生成问答匹配数据;之后基于标注的匹配度数据和预测得到的问答匹配数据计算损失值,以根据损失值调整问答匹配模型中的参数;问答匹配模型可以学习大量问答之间的注意力信息。因而基于训练好的问答匹配模型实现问答匹配处理方法时,无需预设不同面试问题对应的不同关键词库,可以基于模型学习到的大量问答匹配信息,根据不同问题和对应的文本得到匹配数据,通用性较好,准确度较高。The question-answer matching model training method provided by each embodiment of the present application obtains the embedded representation of the text by performing word segmentation and embedding processing on the question text and answer text in the training data, and then extracts the question text and answer through a model based on the self-attention mechanism Self-attention features between texts to generate question-answer matching data based on self-attention features; then calculate the loss value based on the labeled matching data and the predicted question-answer matching data to adjust the parameters in the question-answer matching model according to the loss value; Question-answer matching models can learn a large amount of attention information between questions and answers. Therefore, when implementing the question-answer matching processing method based on the trained question-answer matching model, there is no need to preset different keyword libraries corresponding to different interview questions. Based on a large amount of question-answer matching information learned by the model, matching data can be obtained according to different questions and corresponding texts. Good versatility and high accuracy.
请参阅图13,图13是本申请一实施例提供的一种问答匹配处理装置的结构示意图,该问答匹配处理装置可以配置于服务器或终端中,用于执行前述的问答匹配处理方法。Please refer to FIG. 13 . FIG. 13 is a schematic structural diagram of a question-answer matching processing device provided by an embodiment of the present application. The question-answer matching processing device may be configured in a server or a terminal to execute the aforementioned question-answer matching processing method.
如图13所示,该问答匹配处理装置,包括:文本获取模块110、分词处理模块120、嵌入处理模块130、特征提取模块140、匹配计算模块150。As shown in FIG. 13 , the question-answer matching processing device includes: a text acquisition module 110 , a word segmentation processing module 120 , an embedding processing module 130 , a feature extraction module 140 , and a matching calculation module 150 .
文本获取模块110,用于获取问题文本和回答文本。A text acquisition module 110, configured to acquire question text and answer text.
示例性的,如图14所示,文本获取模块110包括:Exemplarily, as shown in Figure 14, the text acquisition module 110 includes:
语音获取子模块111,用于从终端获取所述终端加密后的问题语音和所述终端加密后的回答语音,以及所述终端提取加密秘钥的语音片段;The voice acquisition sub-module 111 is used to acquire the encrypted question voice of the terminal and the encrypted answer voice of the terminal from the terminal, and extract the voice segment of the encryption key by the terminal;
字符识别子模块112,用于识别所述语音片段中的字符,得到解密秘钥;The character identification submodule 112 is used to identify the characters in the speech segment to obtain the decryption key;
语音解密子模块113,用于根据所述解密秘钥对所述加密后的问题语音和所述加密后的回答语音进行解密,得到问题语音和回答语音;The voice decryption submodule 113 is used to decrypt the encrypted question voice and the encrypted answer voice according to the decryption key to obtain the question voice and the answer voice;
语音识别子模块114,用于对所述问题语音进行语音识别得到问题文本,对所述回答语音进行语音识别得到回答文本。The speech recognition sub-module 114 is configured to perform speech recognition on the question speech to obtain a question text, and perform speech recognition on the answer speech to obtain an answer text.
分词处理模块120,用于对所述问题文本和回答文本进行分词处理,得到语料分词数据。The word segmentation processing module 120 is configured to perform word segmentation processing on the question text and answer text to obtain corpus word segmentation data.
示例性的,如图14所示,分词处理模块120包括:Exemplary, as shown in Figure 14, word segmentation processing module 120 includes:
问题分词子模块121,用于根据预设的词典,对所述问题文本进行分词处理,得到问题分词数据;The question word segmentation sub-module 121 is used to perform word segmentation processing on the question text according to a preset dictionary to obtain question word segmentation data;
回答分词子模块122,用于根据预设的词典,对所述回答文本进行分词处理,得到回答分词数据。The answer word segmentation sub-module 122 is configured to perform word segmentation processing on the answer text according to a preset dictionary to obtain answer word segmentation data.
嵌入处理模块130,用于对所述语料分词数据进行嵌入处理,得到嵌入表示数据。The embedding processing module 130 is configured to perform embedding processing on the corpus word segmentation data to obtain embedded representation data.
示例性的,如图14所示,嵌入处理模块130包括:Exemplarily, as shown in Figure 14, the embedding processing module 130 includes:
嵌入处理子模块131,用于对所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息进行嵌入处理,所述问题分词数据的段落信息与所述回答分词数据的段落信息不同;The embedded processing sub-module 131 is used to embed the word segmentation information, paragraph information, and position information of the question word segmentation data and the answer word segmentation data, and the paragraph information of the question word segmentation data and the paragraph information of the answer word segmentation data different;
嵌入加法子模块132,用于将所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息的嵌入结果相加,得到嵌入表示数据。The embedding and addition sub-module 132 is used to add the word segmentation data of the question and the word segmentation information, paragraph information, and embedding results of the position information of the answer word segmentation data to obtain embedded representation data.
特征提取模块140,用于基于特征提取子模型,对所述嵌入表示数据进行特征提取得到自注意力特征向量,所述特征提取子模型为基于自注意力机制的模型。The feature extraction module 140 is configured to perform feature extraction on the embedded representation data based on a feature extraction sub-model to obtain a self-attention feature vector, and the feature extraction sub-model is a model based on a self-attention mechanism.
匹配计算模块150,用于基于匹配子模型,根据所述自注意力特征向量生成问答匹配数据,输出所述问答匹配数据。The matching calculation module 150 is configured to generate question-answer matching data according to the self-attention feature vector based on the matching sub-model, and output the question-answer matching data.
示例性的,如图14所示,匹配计算模块150包括:Exemplarily, as shown in Figure 14, the matching calculation module 150 includes:
向量降维子模块151,用于基于训练好的匹配子模型,对所述自注意力特征向量进行降维处理,得到对应于匹配和不匹配两个类别的二维向量;The vector dimensionality reduction sub-module 151 is configured to perform dimensionality reduction processing on the self-attention feature vector based on the trained matching sub-model to obtain two-dimensional vectors corresponding to two categories of matching and mismatching;
归一化子模块152,用于基于所述匹配子模型,对所述二维向量进行归一化处理,根据处理后的二维向量得到问答匹配数据,输出所述问答匹配数据。The normalization sub-module 152 is configured to perform normalization processing on the two-dimensional vector based on the matching sub-model, obtain question-answer matching data according to the processed two-dimensional vector, and output the question-answer matching data.
请参阅图15,图15是本申请一实施例提供的一种问答匹配模型训练装置的结构示意图,该问答匹配模型训练装置可以配置于服务器或终端中,用于执行前述的问答匹配模型训练方法。Please refer to FIG. 15. FIG. 15 is a schematic structural diagram of a question-answer matching model training device provided by an embodiment of the present application. The question-answer matching model training device can be configured in a server or a terminal to execute the aforementioned question-answer matching model training method. .
如图15所示,该问答匹配模型训练装置,包括:As shown in Figure 15, the question-answer matching model training device includes:
模型获取模块210,用于获取问答匹配模型,所述问答匹配模型包括预训练的BERT模型和连接于所述BERT模型的匹配子模型;A model acquisition module 210, configured to acquire a question-answer matching model, the question-answer matching model comprising a pre-trained BERT model and a matching sub-model connected to the BERT model;
数据获取模块220,用于获取训练数据,所述训练数据包括问题文本样本、与所述问题文本样本对应的回答文本样本,以及所述回答文本样本对应的匹配度数据;A data acquisition module 220, configured to acquire training data, the training data including question text samples, answer text samples corresponding to the question text samples, and matching degree data corresponding to the answer text samples;
样本分词模块230,用于对所述训练数据中的问题文本样本、回答文本样本进行分词处理,得到样本分词数据;The sample word segmentation module 230 is used to perform word segmentation processing on the question text samples and answer text samples in the training data to obtain sample word segmentation data;
样本嵌入模块240,用于对所述样本分词数据进行嵌入处理,得到样本表示数据;A sample embedding module 240, configured to embed the sample word segmentation data to obtain sample representation data;
特征向量提取模块250,用于所述BERT模型对所述样本表示数据进行特征提取,得到自注意力特征向量;The feature vector extraction module 250 is used for the BERT model to perform feature extraction on the sample representation data to obtain a self-attention feature vector;
匹配获取模块260,用于所述匹配子模型根据所述自注意力特征向量生成问答匹配数据;The matching acquisition module 260 is used for the matching sub-model to generate question-and-answer matching data according to the self-attention feature vector;
参数调整模块270,用于基于预设的损失函数,根据所述问答匹配数据和所述匹配度数据计算损失值,根据所述损失值调整所述问答匹配模型中的参数。The parameter adjustment module 270 is configured to calculate a loss value according to the question-answer matching data and the matching degree data based on a preset loss function, and adjust parameters in the question-answer matching model according to the loss value.
示例性的,如图16所示,样本分词模块230包括:Exemplarily, as shown in Figure 16, the sample word segmentation module 230 includes:
问题分词子模块231,根据预设的词典,对所述问题文本样本进行分词处理,得到问题分词数据;The question word segmentation sub-module 231 performs word segmentation processing on the question text sample according to a preset dictionary to obtain question word segmentation data;
回答分词子模块232,根据预设的词典,对所述回答文本样本进行分词处理,得到回答分词数据。The answer word segmentation sub-module 232 performs word segmentation processing on the answer text sample according to a preset dictionary to obtain answer word segmentation data.
示例性的,如图16所示,样本嵌入模块240包括:Exemplary, as shown in Figure 16, the sample embedding module 240 includes:
嵌入处理子模块241,用于对所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息进行嵌入处理,所述问题分词数据的段落信息与所述回答分词数据的段落信息不同;The embedded processing sub-module 241 is used to embed the word segmentation information, paragraph information, and position information of the question word segmentation data and the answer word segmentation data, and the paragraph information of the question word segmentation data and the paragraph information of the answer word segmentation data different;
嵌入加法子模块242,用于将所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息的嵌入结果相加,得到样本表示数据。The embedding and adding sub-module 242 is used to add the word segmentation data of the question and the embedding results of the word segmentation information, paragraph information, and position information of the answer word segmentation data to obtain sample representation data.
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和各模块、单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。It should be noted that those skilled in the art can clearly understand that for the convenience and brevity of the description, the specific working process of the above-described devices, modules, and units can refer to the corresponding processes in the foregoing method embodiments. No longer.
本申请的方法、装置可用于众多通用或专用的计算系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、机顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。The methods and devices of the present application can be used in many general-purpose or special-purpose computing system environments or configurations. Examples: personal computers, server computers, handheld or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, including the above A distributed computing environment for any system or device, and more.
示例性的,上述的方法、装置可以实现为一种计算机程序的形式,该计算机程序可以在如图17所示的计算机设备上运行。Exemplarily, the above method and apparatus can be implemented in the form of a computer program, and the computer program can be run on the computer device as shown in FIG. 17 .
请参阅图17,图17是本申请实施例提供的一种计算机设备的结构示意图。该计算机设备可以是服务器或终端。Please refer to FIG. 17 . FIG. 17 is a schematic structural diagram of a computer device provided by an embodiment of the present application. The computer device can be a server or a terminal.
参阅图17,该计算机设备包括通过系统总线连接的处理器、存储器和网络接口,其中,存储器可以包括非易失性存储介质和内存储器。Referring to FIG. 17 , the computer device includes a processor, a memory, and a network interface connected through a system bus, where the memory may include a non-volatile storage medium and an internal memory.
非易失性存储介质可存储操作系统和计算机程序。该计算机程序包括程序指令,该程序指令被执行时,可使得处理器执行任意一种问答匹配处理方法。Non-volatile storage media can store operating systems and computer programs. The computer program includes program instructions. When the program instructions are executed, the processor can be executed to execute any question-answer matching processing method.
处理器用于提供计算和控制能力,支撑整个计算机设备的运行。The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
内存储器为非易失性存储介质中的计算机程序的运行提供环境,该计算机程序被处理器执行时,可使得处理器执行任意一种问答匹配处理方法。The internal memory provides an environment for running the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any question-answer matching processing method.
该网络接口用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,该计算机设备的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。This network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art can understand that the structure of the computer equipment is only a block diagram of the partial structure related to the solution of the present application, and does not constitute a limitation to the computer equipment on which the solution of the application is applied. The specific computer equipment may include More or fewer components are shown in the figures, or certain components are combined, or have different component arrangements.
应当理解的是,处理器可以是中央处理单元(Central Processing Unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that the processor may be a central processing unit (Central Processing Unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Wherein, the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
其中,在一个实施例中,所述处理器用于运行存储在存储器中的计算机程序,以实现如下步骤:获取问题文本和回答文本;对所述问题文本和回答文本进行分词处理,得到语料分词数据;对所述语料分词数据进行嵌入处理,得到嵌入表示数据;基于特征提取子模型,对所述嵌入表示数据进行特征提取得到自注意力特征向量,所述特征提取子模型为基于自注意力机制的模型;基于匹配子模型,根据所述自注意力特征向量生成问答匹配数据,输出所述问答匹配数据。Wherein, in one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps: obtain question text and answer text; perform word segmentation processing on the question text and answer text to obtain corpus word segmentation data Carry out embedding process to described corpus word segmentation data, obtain embedding representation data; Based on feature extraction sub-model, carry out feature extraction to described embedding representation data and obtain self-attention feature vector, described feature extraction sub-model is based on self-attention mechanism model; based on the matching sub-model, generate question-answer matching data according to the self-attention feature vector, and output the question-answer matching data.
具体的,处理器用于实现所述获取问题文本和回答文本时,实现:从终端获取所述终端加密后的问题语音和所述终端加密后的回答语音,以及所述终端提取加密秘钥的语音片段;识别所述语音片段中的字符,得到解密秘钥;根据所述解密秘钥对所述加密后的问题语音和所述加密后的回答语音进行解密,得到问题语音和回答语音;对所述问题语音进行语音识别得到问题文本,对所述回答语音进行语音识别得到回答文本。Specifically, when the processor is used to realize the acquisition of the question text and the answer text, it can realize: acquiring the encrypted question voice of the terminal and the encrypted answer voice of the terminal from the terminal, and extracting the voice of the encryption key by the terminal segment; identify the characters in the speech segment to obtain a decryption key; decrypt the encrypted question voice and the encrypted answer voice according to the decrypted key to obtain a question voice and an answer voice; performing speech recognition on the question speech to obtain a question text, and performing speech recognition to the answer speech to obtain an answer text.
具体的,处理器用于实现所述对所述问题文本和回答文本进行分词处理,得到语料分词数据时,实现:根据预设的词典,对所述问题文本进行分词处理,得到问题分词数据;根据预设的词典,对所述回答文本进行分词处理,得到回答分词数据。Specifically, the processor is used to realize the word segmentation processing of the question text and the answer text, and when obtaining the word segmentation data of the corpus, realize: according to a preset dictionary, perform word segmentation processing on the question text to obtain the question word segmentation data; The preset dictionary performs word segmentation processing on the answer text to obtain answer word segmentation data.
具体的,处理器用于实现所述对所述语料分词数据进行嵌入处理,得到嵌入表示数据时,实现:对所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息进行嵌入处理,所述问题分词数据的段落信息与所述回答分词数据的段落信息不同;将所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息的嵌入结果相加,得到嵌入表示数据。Specifically, the processor is used to implement the embedding process on the word segmentation data of the corpus, and when the embedded representation data is obtained, realize: embedding the word segmentation information, paragraph information, and position information of the question word segmentation data and the answer word segmentation data Processing, the paragraph information of the question word segmentation data is different from the paragraph information of the answer word segmentation data; the word segmentation data of the question and the answer word segmentation data, the paragraph information, the embedding results of the position information are added to obtain the embedding Represents data.
具体的,处理器用于实现所述基于匹配子模型,根据所述自注意力特征向量生成问答匹配数据,输出所述问答匹配数据时,实现:基于训练好的匹配子模型,对所述自注意力特征向量进行降维处理,得到对应于匹配和不匹配两个类别的二维向量;基于所述匹配子模型,对所述二维向量进行归一化处理,根据处理后的二维向量得到问答匹配数据,输出所述问答匹配数据。Specifically, the processor is configured to implement the matching sub-model based, generate question-answer matching data according to the self-attention feature vector, and when outputting the question-answer matching data, realize: based on the trained matching sub-model, the self-attention Perform dimensionality reduction processing on the force feature vector to obtain two-dimensional vectors corresponding to two categories of matching and mismatching; based on the matching sub-model, perform normalization processing on the two-dimensional vector, and obtain according to the processed two-dimensional vector Question-answer matching data, outputting the question-answer matching data.
在另一个实施例中,所述处理器用于运行存储在存储器中的计算机程序,以实现如下步骤:获取问答匹配模型,所述问答匹配模型包括预训练的BERT模型和连接于所述BERT模型的匹配子模型;获取训练数据,所述训练数据包括问题文本样本、与所述问题文本样本对应的回答文本样本,以及所述回答文本样本对应的匹配度数据;对所述训练数据中的问题文本样本、回答文本样本进行分词处理,得到样本分词数据;对所述样本分词数据进行嵌入处理,得到样本表示数据;所述BERT模型对所述样本表示数据进行特征提取,得到自注意力特征向量;所述匹配子模型根据所述自注意力特征向量生成问答匹配数据;基于预设的损失函数,根据所述问答匹配数据和所述匹配度数据计算损失值,根据所述损失值调整所述问答匹配模型中的参数。In another embodiment, the processor is configured to run a computer program stored in a memory to implement the following steps: obtaining a question-answer matching model, the question-answer matching model comprising a pre-trained BERT model and a BERT model connected to the BERT model Matching sub-models; obtaining training data, the training data including question text samples, answer text samples corresponding to the question text samples, and matching degree data corresponding to the answer text samples; for the question text in the training data The sample and the answer text sample are subjected to word segmentation processing to obtain sample word segmentation data; the sample word segmentation data is embedded to obtain sample representation data; the BERT model performs feature extraction on the sample representation data to obtain a self-attention feature vector; The matching sub-model generates question and answer matching data according to the self-attention feature vector; based on a preset loss function, calculates a loss value according to the question and answer matching data and the matching degree data, and adjusts the question and answer according to the loss value Match the parameters in the model.
具体的,处理器用于实现所述对所述训练数据中的问题文本样本、回答文本样本进行分词处理,得到样本分词数据时,实现:根据预设的词典,对所述问题文本样本进行分词处理,得到问题分词数据;根据预设的词典,对所述回答文本样本进行分词处理,得到回答分词数据。Specifically, the processor is configured to perform word segmentation processing on the question text samples and answer text samples in the training data, and when the sample word segmentation data is obtained, implement: perform word segmentation processing on the question text samples according to a preset dictionary , to obtain question word segmentation data; according to a preset dictionary, perform word segmentation processing on the answer text sample to obtain answer word segmentation data.
具体的,处理器用于实现所述对所述样本分词数据进行嵌入处理,得到样本表示数据时,实现:对所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息进行嵌入处理,所述问题分词数据的段落信息与所述回答分词数据的段落信息不同;将所述问题分词数据和所述回答分词数据的分词信息、段落信息、位置信息的嵌入结果相加,得到样本表示数据。Specifically, the processor is used to implement the embedding process on the sample word segmentation data, and when the sample representation data is obtained, realize: embedding the word segmentation information, paragraph information, and position information of the question word segmentation data and the answer word segmentation data Processing, the paragraph information of the question word segmentation data is different from the paragraph information of the answer word segmentation data; add the embedding results of the word segmentation information, paragraph information, and position information of the question word segmentation data and the answer word segmentation data to obtain a sample Represents data.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例或者实施例的某些部分所述的方法,如:It can be known from the above description of the implementation manners that those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general-purpose hardware platform. Based on this understanding, the essence of the technical solution of this application or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in storage media, such as ROM/RAM, disk , optical disc, etc., including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in various embodiments or some parts of the embodiments of the present application, such as:
一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序中包括程序指令,所述处理器执行所述程序指令,实现本申请实施例提供的任一项问答匹配处理方法;或者A computer-readable storage medium, the computer-readable storage medium stores a computer program, the computer program includes program instructions, and the processor executes the program instructions to implement any of the questions and answers provided in the embodiments of the present application match processing method; or
实现上述任一项的问答匹配模型训练方法。A method for training a question-answer matching model that implements any of the above items.
其中,所述计算机可读存储介质可以是前述实施例所述的计算机设备的内部存储单元,例如所述计算机设备的硬盘或内存。所述计算机可读存储介质也可以是所述计算机设备的外部存储设备,例如所述计算机设备上配备的插接式硬盘,智能存储卡(SmartMedia Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。Wherein, the computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as a hard disk or a memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, flash memory card (Flash Card), etc.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the application, but the scope of protection of the application is not limited thereto. Any person familiar with the technical field can easily think of various equivalents within the scope of the technology disclosed in the application. Modifications or replacements, these modifications or replacements shall be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910569979.7ACN110442675A (en) | 2019-06-27 | 2019-06-27 | Question and answer matching treatment, model training method, device, equipment and storage medium |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910569979.7ACN110442675A (en) | 2019-06-27 | 2019-06-27 | Question and answer matching treatment, model training method, device, equipment and storage medium |
| Publication Number | Publication Date |
|---|---|
| CN110442675Atrue CN110442675A (en) | 2019-11-12 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910569979.7APendingCN110442675A (en) | 2019-06-27 | 2019-06-27 | Question and answer matching treatment, model training method, device, equipment and storage medium |
| Country | Link |
|---|---|
| CN (1) | CN110442675A (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110909144A (en)* | 2019-11-28 | 2020-03-24 | 中信银行股份有限公司 | Question-answer dialogue method and device, electronic equipment and computer readable storage medium |
| CN111046158A (en)* | 2019-12-13 | 2020-04-21 | 腾讯科技(深圳)有限公司 | Question-answer matching method, model training method, device, equipment and storage medium |
| CN111159340A (en)* | 2019-12-24 | 2020-05-15 | 重庆兆光科技股份有限公司 | Answer matching method and system for machine reading understanding based on random optimization prediction |
| CN111159367A (en)* | 2019-12-11 | 2020-05-15 | 中国平安财产保险股份有限公司 | Information processing method and related equipment |
| CN111368042A (en)* | 2020-02-13 | 2020-07-03 | 平安科技(深圳)有限公司 | Intelligent question answering method, device, computer equipment and computer storage medium |
| CN111401076A (en)* | 2020-04-09 | 2020-07-10 | 支付宝(杭州)信息技术有限公司 | Text similarity determination method and device and electronic equipment |
| CN111639163A (en)* | 2020-04-29 | 2020-09-08 | 深圳壹账通智能科技有限公司 | Problem generation model training method, problem generation method and related equipment |
| CN111709244A (en)* | 2019-11-20 | 2020-09-25 | 中共南通市委政法委员会 | Deep learning method for identifying causal relationship of contradictory dispute events |
| CN111708861A (en)* | 2020-04-29 | 2020-09-25 | 平安科技(深圳)有限公司 | Matching set obtaining method and device based on double matching and computer equipment |
| CN111897829A (en)* | 2020-05-26 | 2020-11-06 | 华瑞新智科技(北京)有限公司 | A natural language query method and device for medical software |
| CN112000805A (en)* | 2020-08-24 | 2020-11-27 | 平安国际智慧城市科技股份有限公司 | Text matching method, device, terminal and storage medium based on pre-training model |
| CN112328767A (en)* | 2020-11-11 | 2021-02-05 | 重庆邮电大学 | Question-answer matching method based on BERT model and comparative aggregation framework |
| CN112364634A (en)* | 2020-11-02 | 2021-02-12 | 成都不问科技有限公司 | Synonym matching method based on question sentence |
| CN112489740A (en)* | 2020-12-17 | 2021-03-12 | 北京惠及智医科技有限公司 | Medical record detection method, training method of related model, related equipment and device |
| CN112507096A (en)* | 2020-12-16 | 2021-03-16 | 平安银行股份有限公司 | Document question-answer pair splitting method and device, electronic equipment and storage medium |
| CN112632216A (en)* | 2020-12-10 | 2021-04-09 | 深圳得理科技有限公司 | Deep learning-based long text retrieval system and method |
| CN112667797A (en)* | 2021-01-06 | 2021-04-16 | 华南师范大学 | Question-answer matching method, system and storage medium for adaptive transfer learning |
| CN112732879A (en)* | 2020-12-23 | 2021-04-30 | 重庆理工大学 | Downstream task processing method and model of question-answering task |
| CN113591475A (en)* | 2021-08-03 | 2021-11-02 | 美的集团(上海)有限公司 | Unsupervised interpretable word segmentation method and device and electronic equipment |
| CN114330556A (en)* | 2021-12-29 | 2022-04-12 | 绍兴兰红智能科技有限公司 | BERT model scoring method based on attention and validity degree |
| CN114360537A (en)* | 2021-12-27 | 2022-04-15 | 科大讯飞股份有限公司 | Scoring method, training method, computer equipment and storage medium for oral question answering |
| CN114579714A (en)* | 2020-12-01 | 2022-06-03 | 广州视源电子科技股份有限公司 | Machine reading understanding method, device, equipment and storage medium |
| CN114741494A (en)* | 2022-05-25 | 2022-07-12 | 北京明略昭辉科技有限公司 | Question answering method, device, equipment and medium |
| CN114996415A (en)* | 2021-03-02 | 2022-09-02 | 北大方正集团有限公司 | Question answering method, device, electronic equipment, storage medium and program product |
| CN116166775A (en)* | 2023-01-09 | 2023-05-26 | 上海工程技术大学 | Document recommendation method and system based on Google Bert |
| CN116863935A (en)* | 2023-09-04 | 2023-10-10 | 深圳有咖互动科技有限公司 | Speech recognition method, device, electronic equipment and computer readable medium |
| JP2023547802A (en)* | 2020-11-05 | 2023-11-14 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Answer span correction |
| CN117112743A (en)* | 2023-07-25 | 2023-11-24 | 西安交通大学 | Answerability assessment method, system and storage medium for automatically generated text questions |
| US12216996B2 (en) | 2021-11-02 | 2025-02-04 | International Business Machines Corporation | Reasonable language model learning for text generation from a knowledge graph |
| US12333554B2 (en) | 2022-09-02 | 2025-06-17 | Verint Americas Inc. | System and method for suggesting and generating a customer service template |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006308635A (en)* | 2005-04-26 | 2006-11-09 | Kenwood Corp | Device and method for producing speech database, speech database, device and method for restoring speech segment, speech database, and program |
| CN104361886A (en)* | 2014-10-29 | 2015-02-18 | 北京百度网讯科技有限公司 | Voice encryption method and device and voice decryption method and device |
| CN104967992A (en)* | 2015-05-11 | 2015-10-07 | 广东美晨通讯有限公司 | Encrypting and decrypting method and device |
| CN108519890A (en)* | 2018-04-08 | 2018-09-11 | 武汉大学 | A Robust Code Summarization Method Based on Self-Attention Mechanism |
| CN108845990A (en)* | 2018-06-12 | 2018-11-20 | 北京慧闻科技发展有限公司 | Answer selection method, device and electronic equipment based on two-way attention mechanism |
| CN108959421A (en)* | 2018-06-08 | 2018-12-07 | 三角兽(北京)科技有限公司 | Candidate replys evaluating apparatus and inquiry reverting equipment and its method, storage medium |
| CN109376222A (en)* | 2018-09-27 | 2019-02-22 | 国信优易数据有限公司 | Question and answer matching degree calculation method, question and answer automatic matching method and device |
| CN109766424A (en)* | 2018-12-29 | 2019-05-17 | 安徽省泰岳祥升软件有限公司 | Filtering method and device for reading understanding model training data |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2006308635A (en)* | 2005-04-26 | 2006-11-09 | Kenwood Corp | Device and method for producing speech database, speech database, device and method for restoring speech segment, speech database, and program |
| CN104361886A (en)* | 2014-10-29 | 2015-02-18 | 北京百度网讯科技有限公司 | Voice encryption method and device and voice decryption method and device |
| CN104967992A (en)* | 2015-05-11 | 2015-10-07 | 广东美晨通讯有限公司 | Encrypting and decrypting method and device |
| CN108519890A (en)* | 2018-04-08 | 2018-09-11 | 武汉大学 | A Robust Code Summarization Method Based on Self-Attention Mechanism |
| CN108959421A (en)* | 2018-06-08 | 2018-12-07 | 三角兽(北京)科技有限公司 | Candidate replys evaluating apparatus and inquiry reverting equipment and its method, storage medium |
| CN108845990A (en)* | 2018-06-12 | 2018-11-20 | 北京慧闻科技发展有限公司 | Answer selection method, device and electronic equipment based on two-way attention mechanism |
| CN109376222A (en)* | 2018-09-27 | 2019-02-22 | 国信优易数据有限公司 | Question and answer matching degree calculation method, question and answer automatic matching method and device |
| CN109766424A (en)* | 2018-12-29 | 2019-05-17 | 安徽省泰岳祥升软件有限公司 | Filtering method and device for reading understanding model training data |
| Title |
|---|
| JACOB DEVLIN: "BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding", 《ARXIV:1810.04805V2 [CS.CL]》, pages 1 - 16* |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111709244A (en)* | 2019-11-20 | 2020-09-25 | 中共南通市委政法委员会 | Deep learning method for identifying causal relationship of contradictory dispute events |
| CN111709244B (en)* | 2019-11-20 | 2023-09-26 | 中共南通市委政法委员会 | Deep learning method for identifying cause and effect relationship of contradictory dispute |
| CN110909144A (en)* | 2019-11-28 | 2020-03-24 | 中信银行股份有限公司 | Question-answer dialogue method and device, electronic equipment and computer readable storage medium |
| CN111159367A (en)* | 2019-12-11 | 2020-05-15 | 中国平安财产保险股份有限公司 | Information processing method and related equipment |
| CN111159367B (en)* | 2019-12-11 | 2023-09-05 | 中国平安财产保险股份有限公司 | Information processing method and related equipment |
| CN111046158A (en)* | 2019-12-13 | 2020-04-21 | 腾讯科技(深圳)有限公司 | Question-answer matching method, model training method, device, equipment and storage medium |
| CN111046158B (en)* | 2019-12-13 | 2020-12-15 | 腾讯科技(深圳)有限公司 | Question-answer matching method, model training method, device, equipment and storage medium |
| CN111159340B (en)* | 2019-12-24 | 2023-11-03 | 重庆兆光科技股份有限公司 | Machine reading understanding answer matching method and system based on random optimization prediction |
| CN111159340A (en)* | 2019-12-24 | 2020-05-15 | 重庆兆光科技股份有限公司 | Answer matching method and system for machine reading understanding based on random optimization prediction |
| CN111368042A (en)* | 2020-02-13 | 2020-07-03 | 平安科技(深圳)有限公司 | Intelligent question answering method, device, computer equipment and computer storage medium |
| CN111401076A (en)* | 2020-04-09 | 2020-07-10 | 支付宝(杭州)信息技术有限公司 | Text similarity determination method and device and electronic equipment |
| CN111401076B (en)* | 2020-04-09 | 2023-04-25 | 支付宝(杭州)信息技术有限公司 | Text similarity determination method and device and electronic equipment |
| CN111708861A (en)* | 2020-04-29 | 2020-09-25 | 平安科技(深圳)有限公司 | Matching set obtaining method and device based on double matching and computer equipment |
| CN111708861B (en)* | 2020-04-29 | 2024-01-23 | 平安科技(深圳)有限公司 | Dual-matching-based matching set acquisition method and device and computer equipment |
| CN111639163A (en)* | 2020-04-29 | 2020-09-08 | 深圳壹账通智能科技有限公司 | Problem generation model training method, problem generation method and related equipment |
| CN111897829A (en)* | 2020-05-26 | 2020-11-06 | 华瑞新智科技(北京)有限公司 | A natural language query method and device for medical software |
| CN112000805A (en)* | 2020-08-24 | 2020-11-27 | 平安国际智慧城市科技股份有限公司 | Text matching method, device, terminal and storage medium based on pre-training model |
| CN112364634B (en)* | 2020-11-02 | 2024-07-26 | 成都不问科技有限公司 | Synonym matching method based on question |
| CN112364634A (en)* | 2020-11-02 | 2021-02-12 | 成都不问科技有限公司 | Synonym matching method based on question sentence |
| JP2023547802A (en)* | 2020-11-05 | 2023-11-14 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Answer span correction |
| JP7736787B2 (en) | 2020-11-05 | 2025-09-09 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Answer span correction |
| CN112328767B (en)* | 2020-11-11 | 2022-10-14 | 重庆邮电大学 | Question-answer matching method based on BERT model and comparative aggregation framework |
| CN112328767A (en)* | 2020-11-11 | 2021-02-05 | 重庆邮电大学 | Question-answer matching method based on BERT model and comparative aggregation framework |
| CN114579714A (en)* | 2020-12-01 | 2022-06-03 | 广州视源电子科技股份有限公司 | Machine reading understanding method, device, equipment and storage medium |
| CN112632216A (en)* | 2020-12-10 | 2021-04-09 | 深圳得理科技有限公司 | Deep learning-based long text retrieval system and method |
| CN112507096A (en)* | 2020-12-16 | 2021-03-16 | 平安银行股份有限公司 | Document question-answer pair splitting method and device, electronic equipment and storage medium |
| CN112489740A (en)* | 2020-12-17 | 2021-03-12 | 北京惠及智医科技有限公司 | Medical record detection method, training method of related model, related equipment and device |
| CN112732879A (en)* | 2020-12-23 | 2021-04-30 | 重庆理工大学 | Downstream task processing method and model of question-answering task |
| CN112667797A (en)* | 2021-01-06 | 2021-04-16 | 华南师范大学 | Question-answer matching method, system and storage medium for adaptive transfer learning |
| CN112667797B (en)* | 2021-01-06 | 2023-05-30 | 华南师范大学 | Question-answer matching method, system and storage medium for adaptive transfer learning |
| CN114996415A (en)* | 2021-03-02 | 2022-09-02 | 北大方正集团有限公司 | Question answering method, device, electronic equipment, storage medium and program product |
| CN113591475A (en)* | 2021-08-03 | 2021-11-02 | 美的集团(上海)有限公司 | Unsupervised interpretable word segmentation method and device and electronic equipment |
| US12216996B2 (en) | 2021-11-02 | 2025-02-04 | International Business Machines Corporation | Reasonable language model learning for text generation from a knowledge graph |
| CN114360537A (en)* | 2021-12-27 | 2022-04-15 | 科大讯飞股份有限公司 | Scoring method, training method, computer equipment and storage medium for oral question answering |
| CN114330556A (en)* | 2021-12-29 | 2022-04-12 | 绍兴兰红智能科技有限公司 | BERT model scoring method based on attention and validity degree |
| CN114741494A (en)* | 2022-05-25 | 2022-07-12 | 北京明略昭辉科技有限公司 | Question answering method, device, equipment and medium |
| US12333554B2 (en) | 2022-09-02 | 2025-06-17 | Verint Americas Inc. | System and method for suggesting and generating a customer service template |
| CN116166775A (en)* | 2023-01-09 | 2023-05-26 | 上海工程技术大学 | Document recommendation method and system based on Google Bert |
| CN117112743A (en)* | 2023-07-25 | 2023-11-24 | 西安交通大学 | Answerability assessment method, system and storage medium for automatically generated text questions |
| CN116863935B (en)* | 2023-09-04 | 2023-11-24 | 深圳有咖互动科技有限公司 | Speech recognition method, device, electronic equipment and computer readable medium |
| CN116863935A (en)* | 2023-09-04 | 2023-10-10 | 深圳有咖互动科技有限公司 | Speech recognition method, device, electronic equipment and computer readable medium |
| Publication | Publication Date | Title |
|---|---|---|
| CN110442675A (en) | Question and answer matching treatment, model training method, device, equipment and storage medium | |
| CN111859960B (en) | Semantic matching method, device, computer equipment and medium based on knowledge distillation | |
| CN109299228B (en) | Computer-implemented text risk prediction method and device | |
| CN113869044A (en) | Automatic keyword extraction method, device, equipment and storage medium | |
| Jiang et al. | Similarity-aware multimodal prompt learning for fake news detection | |
| WO2020114373A1 (en) | Method and apparatus for realizing element recognition in judicial document | |
| CN110377733B (en) | Text-based emotion recognition method, terminal equipment and medium | |
| CN111859940B (en) | Keyword extraction method and device, electronic equipment and storage medium | |
| CN111695335B (en) | Intelligent interview method, device and terminal equipment | |
| CN112101042B (en) | Text emotion recognition method, device, terminal equipment and storage medium | |
| CN111428027B (en) | Query intention determining method and related device | |
| CN111091004B (en) | Training method and training device for sentence entity annotation model and electronic equipment | |
| CN110413992A (en) | A kind of semantic analysis recognition methods, system, medium and equipment | |
| CN114218945A (en) | Entity identification method, device, server and storage medium | |
| CN116611037B (en) | Deep neural network black box watermarking method, device and terminal | |
| CN117558270B (en) | Voice recognition method and device and keyword detection model training method and device | |
| CN115272540A (en) | Processing method and device based on virtual customer service image, equipment and medium | |
| Supraja et al. | Regularized phrase-based topic model for automatic question classification with domain-agnostic class labels | |
| CN115033683B (en) | Digest generation method, digest generation device, digest generation equipment and storage medium | |
| CN113158675B (en) | Entity extraction method, device, equipment and medium based on artificial intelligence | |
| CN119047485A (en) | Semantic feature recognition method, device, equipment and medium based on depth grammar tree | |
| CN112528657A (en) | Text intention recognition method and device based on bidirectional LSTM, server and medium | |
| CN118585641A (en) | A text summary generation method based on pre-training model | |
| US11481389B2 (en) | Generating an executable code based on a document | |
| CN116402053A (en) | Variant word processing method, device, electronic equipment and readable storage medium |
| 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 | ||
| RJ01 | Rejection of invention patent application after publication | ||
| RJ01 | Rejection of invention patent application after publication | Application publication date:20191112 |