WO2020124959A1 - 基于交叉注意力机制的语义相似度匹配方法及其装置 - Google Patents

基于交叉注意力机制的语义相似度匹配方法及其装置 Download PDF

Info

Publication number
WO2020124959A1
WO2020124959A1 PCT/CN2019/089483 CN2019089483W WO2020124959A1 WO 2020124959 A1 WO2020124959 A1 WO 2020124959A1 CN 2019089483 W CN2019089483 W CN 2019089483W WO 2020124959 A1 WO2020124959 A1 WO 2020124959A1
Authority
WO
WIPO (PCT)
Prior art keywords
matrix
vector
vectors
column
stitching
Prior art date
Application number
PCT/CN2019/089483
Other languages
English (en)
French (fr)
Inventor
周涛涛
周宝
陈远旭
肖京
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020124959A1 publication Critical patent/WO2020124959A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/279Recognition of textual entities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks

Definitions

  • the present invention relates to the field of voice interaction technology, and in particular, to a semantic similarity matching method, device, computer device, and storage medium based on a cross-attention mechanism.
  • the currently accepted semantic similarity matching methods based on deep learning include: 1) Siamese structure, that is, two sentences or texts are respectively characterized by convolutional neural networks (CNN), LSTM and other neural networks to obtain two sentence vectors, and then Carry out similarity calculation; 2) Interactive matching method, that is, first perform inner product operation between word vectors of two sentences to obtain a three-dimensional matrix, and then input it into neural networks such as CNN and LSTM.
  • CNN convolutional neural networks
  • LSTM convolutional neural networks
  • Interactive matching method that is, first perform inner product operation between word vectors of two sentences to obtain a three-dimensional matrix, and then input it into neural networks such as CNN and LSTM.
  • the Siamese structure only characterizes two sentences independently, and fails to accurately characterize the interaction between the two sentences.
  • the interactive matching method only considers the point-to-point inner product operation, and can only express the local correlation between two sentences, and cannot effectively represent the semantic relationship.
  • the object of the present invention is to provide a semantic similarity matching method, device, computer equipment and storage medium based on a cross-attention mechanism, for solving the problems in the prior art.
  • the present invention provides a semantic similarity matching method based on a cross-attention mechanism, including:
  • the first maximization matrix and the second maximization matrix are spliced and input into the fully connected layer and the pooling layer to obtain the matching value of the first basic sentence and the second basic sentence.
  • the present invention also provides a semantic similarity matching device based on a cross-attention mechanism, including:
  • the basic word acquisition module obtains multiple first basic words in the first basic sentence and multiple second basic words in the second basic sentence;
  • the word vector characterization module is adapted to perform word vector characterization on each of the first basic word and the second basic word to obtain multiple first basic vectors and multiple second basic vectors;
  • a bidirectional LSTM module adapted to pass the plurality of first basis vectors and the plurality of second basis vectors through a bidirectional LSTM model to obtain a plurality of first stitching vectors and a plurality of second stitching vectors; wherein the first stitching vector It is formed by combining the first forward input vector and the first backward input vector obtained after the first base vector passes through the bidirectional LSTM model; the second splicing vector is the Two forward input vectors and second backward output vectors are combined;
  • the stitching module is adapted to generate a first stitching matrix according to the plurality of first stitching vectors, the column vector of the first stitching matrix is the first stitching vector; generate a second stitching according to the plurality of second stitching vectors Matrix, the column vector of the second splicing matrix is the second splicing vector;
  • a cross-characterization module adapted to cross-characterize each column vector in the first splicing matrix with all the column vectors in the second splicing matrix to obtain a first characterization matrix; use the first splicing matrix All the column vectors of are cross-characterized separately for each column vector in the second splicing matrix to obtain a second characterization matrix;
  • the maximization module is adapted to maximize the first characterization matrix and the second characterization matrix, respectively, to obtain a first maximization matrix and a second maximization matrix;
  • the matching module is adapted to join the first maximization matrix and the second maximization matrix to the fully connected layer and the pooling layer to obtain the matching value of the first basic sentence and the second basic sentence.
  • the present invention also provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor.
  • a computer program stored on the memory and executable on the processor.
  • the first maximization matrix and the second maximization matrix are spliced and input into the fully connected layer and the pooling layer to obtain the matching value of the first basic sentence and the second basic sentence.
  • the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are performed:
  • the first maximization matrix and the second maximization matrix are spliced and input into the fully connected layer and the pooling layer to obtain the matching value of the first basic sentence and the second basic sentence.
  • the present invention separately characterizes the two sentences, so that the interaction of the two sentences on the semantic level has been achieved in the representation stage.
  • the present invention has the following beneficial effects:
  • the present invention uses bidirectional LSTM to pre-represent the sentences, as the input of the cross-representation layer, can abstract the long program sequence structure of the sentences, so that the cross-representation layer can mine the long-range matching between semantics.
  • the present invention uses an attention mechanism to calculate the representation of each word in one sentence under another sentence. Compared with the traditional point-to-point semantic similarity matching method, this method not only includes the local relationship between the word and each word and phrase in another sentence, but also includes the representation of the word at the semantic level.
  • the present invention uses the max pooling method to encode the cross-matched sentences into a vector. Compared with the traditional coding method using CNN or LSTM, on the basis of ensuring the model representation ability, the number of model parameters is significantly reduced, thereby reducing the training time of the model.
  • Embodiment 1 is a flowchart of Embodiment 1 of the semantic similarity matching method of the present invention
  • FIG. 2 is a schematic diagram of a program module of Embodiment 1 of the semantic similarity matching device of the present invention
  • Embodiment 3 is a schematic diagram of the hardware structure of Embodiment 1 of the semantic similarity matching device of the present invention.
  • the semantic similarity matching method, device, computer equipment and storage medium based on the cross-attention mechanism provided by the present invention are applicable to the field of voice interaction technology, and can realize the cross-representation of two sentences on the semantic level.
  • the present invention firstly uses word2vec to characterize each participle in the two sentences, and then obtains two splicing matrices after bidirectional LSTM, so that the two splicing matrices can cross-represent each other to obtain each of the arbitrary sentences.
  • the importance of word segmentation relative to another sentence On this basis, the maximum processing is performed and the fully connected layer is input, and the matching score between the two sentences is finally obtained.
  • the above solution proposed by the present invention overcomes the limitations in the prior art when using LSTM alone or interactive matching, and makes the calculation of the matching degree between two sentences more accurate and complete, and approaches the real situation.
  • a semantic similarity matching method based on a cross-attention mechanism in this embodiment includes the following steps:
  • S1 Acquire multiple first basic words in the first basic sentence, and acquire multiple second basic words in the second basic sentence.
  • sentence 1 is “I am Chinese”, and it can be divided into three basic words “I”, “Yes” and “Chinese”.
  • sentence 2 is "Iam Chinese”, and the three basic words “I”, “am” and “Chinese” can be obtained by dividing it.
  • S2 Perform word vector characterization on each of the first basic word and the second basic word to obtain multiple first basic vectors and multiple second basic vectors.
  • the word2vec word vector model is preferably used to characterize each word in the sentence.
  • the advantage is that the word2vec word vector model reduces the input dimension on the one hand, and on the other hand, the word vector trained by the word2vec model is compared with the traditional one. -hot-encoder or topic model, make full use of the context of words and provide richer semantic information.
  • Each basic word trained by the word2vec model is characterized as a vector form that the computer can understand, for example [0.792, -0.177, -0.107, ...].
  • the vectors obtained after the word2vec model are called basic vectors.
  • the basic words "I”, “Yes”, and “Chinese” in sentence 1 are characterized by vectors to obtain three first basic vectors, respectively: with
  • the basic words "I”, “am” and “Chinese” in Sentence 2 are characterized by vectors to obtain three second basic vectors, respectively: with
  • a plurality of first basis vectors and a plurality of second basis vectors are respectively passed through a bidirectional LSTM model to obtain a plurality of first stitching vectors and a plurality of second stitching vectors; wherein the first stitching vector is determined by the first basis
  • the vector is formed by combining the first forward input vector obtained after the bidirectional LSTM model and the first backward input vector; the second splicing vector is composed of the second forward input vector obtained after the second base vector passes through the bidirectional LSTM model.
  • the second backward output vector is combined.
  • the i-th first basis vector After going through the bidirectional LSTM model, the outputs are respectively with among them Is the first forward input vector obtained by forward input LSTM, Is the first backward input vector obtained by backward input of LSTM, then the first stitching vector is For example, sentence 1 contains with There are three first basic vectors, of which After bidirectional LSTM model, output separately with Then the first basis vector The corresponding first splicing vector p 1 is
  • the i-th second basis vector After bidirectional LSTM model, output separately with among them Is the second forward input vector obtained by forward input LSTM, Is the second backward input vector obtained by backward input of LSTM, then the second splicing vector is
  • sentence 2 contains with A total of three second basis vectors, of which After bidirectional LSTM model, output separately with Then the second basis vector The corresponding second splicing vector q 1 is
  • S4 Generate a first mosaic matrix according to the plurality of first mosaic vectors, the column vector of the first mosaic matrix is the first mosaic vector; generate a second mosaic matrix according to the plurality of second mosaic vectors, The column vector of the second splicing matrix is the second splicing vector.
  • the first stitching matrix and the second stitching matrix are obtained by using the first stitching vector and the second stitching vector obtained in the foregoing.
  • sentence 1 includes three first splicing vectors p 1 , p 2 and p 3 , and the first splicing matrix composed of the three first splicing vectors is [p 1 , p 2 , p 3 ].
  • Sentence 2 includes three second splicing vectors q 1 , q 2 and q 3 , and the first splicing matrix composed of these three first splicing vectors is [q 1 , q 2 , q 3 ].
  • the first characterization matrix P′ is composed of the first characterization vector p′ i , and the calculation formula of the first characterization vector p′ i is as follows:
  • ⁇ ij represents the cosine similarity between the i-th first splicing vector p i in the first splicing matrix P and each second splicing vector q j in the second splicing matrix Q, and N is the second splicing vector The number of q j .
  • the first stitching matrix P corresponding to sentence 1 includes three first stitching vectors p 1 , p 2, and p 3
  • the second stitching matrix Q corresponding to sentence 2 includes three second stitching vectors q 1 , q 2 And q 3
  • the first characterization matrix P′ can be expressed as [p′ 1 , p′ 2 , p′ 3 ].
  • the second representation matrix Q′ is composed of the second representation vector q′ i , and the calculation formula of the second representation vector q′ i is as follows:
  • ⁇ ij represents the cosine similarity between the i-th second splicing vector q i in the second splicing matrix Q and each second splicing vector p j in the first splicing matrix P, and N is the first splicing vector The number of p j .
  • the first stitching matrix P corresponding to sentence 1 includes three first stitching vectors p 1 , p 2, and p 3
  • the second stitching matrix Q corresponding to sentence 2 includes three second stitching vectors q 1 , q 2 And q 3
  • the second characterization matrix Q′ can be expressed as [q′ 1 , q′ 2 , q′ 3 ].
  • the maximum value is taken for each column in the first characterization matrix P′ and the second characterization matrix Q′, that is, the maximum value of each characterization vector is selected.
  • the vector p′ i includes k values, and the maximum value p′ imax among the k values is selected as the value of the vector p′ i .
  • the first maximization matrix P′ max obtained after maximum pooling is expressed as [p′ 1max , p′ 2max , p′ 3max ], because p′ 1max , p'2max and p'3max are all single values, and the above-mentioned first maximization matrix P'max is a one-dimensional matrix.
  • the second maximization matrix Q′ max obtained after maximum pooling is expressed as [q′ 1max , q′ 2max , q′ 3max ]. Since q′ 1max , q′ 2max and q′ 3max are all single values, the above-mentioned second maximization matrix Q′ max is a one-dimensional matrix.
  • S7 Splicing the first matrix and the second maximization matrix into the fully connected layer and the pooling layer to obtain the matching value of the first basic sentence and the second basic sentence.
  • the first maximized matrix P′ max and the second maximized matrix Q′ max are spliced to obtain the spliced matrix P′ max Q′ max can be expressed as [p′ 1max , p′ 2max , p′ 3max , q′ 1max , q′ 2max , q′ 3max ].
  • the stitching matrix P′ max Q′ max can output the similarity matching value of sentence 1 and sentence 2 after the fully connected network layer and softmax layer.
  • the semantic similarity matching device 10 may include or be divided into one or more program modules, and one or more program modules are stored. In a storage medium and executed by one or more processors to complete the present invention, and can implement the above semantic similarity matching method.
  • the program module referred to in the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable for describing the execution process of the semantic similarity matching device 10 in the storage medium than the program itself. The following description will specifically introduce the functions of the program modules of this embodiment:
  • the basic word acquisition module 11 acquires multiple first basic words in the first basic sentence and multiple second basic words in the second basic sentence;
  • the word vector characterization module 12 is adapted to perform word vector characterization on each of the first basic word and the second basic word to obtain multiple first basic vectors and multiple second basic vectors;
  • the bidirectional LSTM module 13 is adapted to pass the plurality of first basis vectors and the plurality of second basis vectors through the bidirectional LSTM model to obtain a plurality of first stitching vectors and a plurality of second stitching vectors; wherein the first stitching The vector is formed by combining the first forward input vector and the first backward input vector obtained after the first basic vector passes the bidirectional LSTM model; the second splicing vector is obtained after the second basic vector passes the bidirectional LSTM model The second forward input vector and the second backward output vector are combined;
  • the stitching module 14 is adapted to generate a first stitching matrix according to the plurality of first stitching vectors, the column vector of the first stitching matrix is the first stitching vector; generate a second according to the plurality of second stitching vectors A stitching matrix, the column vector of the second stitching matrix is the second stitching vector;
  • the cross-characterization module 15 is adapted to cross-characterize each column vector in the first splicing matrix with all the column vectors in the second splicing matrix to obtain a first characterization matrix; use the first splicing matrix All the column vectors in the cross-characterize each column vector in the second splicing matrix to obtain a second characterization matrix;
  • the maximization module 16 is adapted to maximize the first characterization matrix and the second characterization matrix, respectively, to obtain a first maximization matrix and a second maximization matrix;
  • the matching module 17 is adapted to splice the first maximization matrix and the second maximization matrix into the fully connected layer and the pooling layer to obtain the matching value of the first basic sentence and the second basic sentence .
  • bidirectional LSTM module 13 includes:
  • the first bidirectional LSTM sub-module 131 is suitable for converting the i-th first basis vector After bidirectional LSTM model, output separately with among them Is the first forward input vector obtained by forward input LSTM, Is the first backward input vector obtained by backward input of LSTM, then the first stitching vector is
  • the second bidirectional LSTM sub-module 132 is suitable for converting the ith second basis vector After bidirectional LSTM model, output separately with among them Is the second forward input vector obtained by forward input LSTM, Is the second backward input vector obtained by backward input of LSTM, then the second splicing vector is
  • This embodiment also provides a computer device, such as a smartphone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server, or a rack server (including an independent server, or A server cluster composed of multiple servers).
  • the computer device 20 of this embodiment includes at least but not limited to: a memory 21 and a processor 22 that can be connected to each other through a system bus, as shown in FIG. 3. It should be noted that FIG. 3 only shows the computer device 20 having components 21-22, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
  • the memory 21 (ie, readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), Read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, etc.
  • the memory 21 may be an internal storage unit of the computer device 20, such as a hard disk or memory of the computer device 20.
  • the memory 21 may also be an external storage device of the computer device 20, for example, a plug-in hard disk equipped on the computer device 20, a smart memory card (Smart Media (SMC), Secure Digital, Secure Digital, SD) card, flash memory card (Flash Card), etc.
  • the memory 21 may also include both the internal storage unit of the computer device 20 and its external storage device.
  • the memory 21 is generally used to store the operating system and various application software installed in the computer device 20, such as the program code of the semantic similarity matching device 10 of the first embodiment.
  • the memory 21 may also be used to temporarily store various types of data that have been output or will be output.
  • the processor 22 may be a central processing unit (CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments.
  • the processor 22 is generally used to control the overall operation of the computer device 20.
  • the processor 22 is used to run the program code or process data stored in the memory 21, for example, to run the semantic similarity matching device 10, so as to implement the semantic similarity matching method of Embodiment 1.
  • This embodiment also provides a computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), only Read memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, server, App store, etc., on which computer programs are stored, When the program is executed by the processor, the corresponding function is realized.
  • the computer-readable storage medium of this embodiment is used to store the semantic similarity matching device 10, and when executed by a processor, implements the semantic similarity matching method of Embodiment 1.
  • Any process or method description in a flowchart or otherwise described herein may be understood as representing a module, segment, or portion of code that includes one or more executable instructions for implementing specific logical functions or steps of a process , And the scope of the preferred embodiment of the present invention includes additional implementations, in which the functions may not be performed in the order shown or discussed, including performing the functions in a substantially simultaneous manner or in reverse order according to the functions involved, which shall It is understood by those skilled in the art to which the embodiments of the present invention belong.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computational Linguistics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Data Mining & Analysis (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Machine Translation (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种基于交叉注意力机制的语义相似度匹配方法、装置、计算机设备及存储介质,适用于语音交互技术领域,能够实现在语义层面上对两个语句进行交叉表征。首先通过word2vec对两个语句中的每个分词进行词向量表征,分别通过双向LSTM后得到两个拼接矩阵,进而使两个拼接矩阵之间相互进行交叉表征,得到任意句子中的每个分词相对于另一个句子的重要程度。在此基础上再进行最大化处理并输入全连接层,最终获取两个语句之间的匹配度得分。该方法克服了现有技术中单独使用LSTM或者交互式匹配时存在的局限性,使得两个语句之间的匹配度计算更为精确完整,趋近真实情境。

Description

基于交叉注意力机制的语义相似度匹配方法及其装置
相关申请的交叉引用
本申请申明享有2018年12月21日递交的申请号为CN201811573321.5、名称为“基于交叉注意力机制的语义相似度匹配方法及其匹配装置”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本发明涉及语音交互技术领域,尤其涉及一种基于交叉注意力机制的语义相似度匹配方法、装置、计算机设备及存储介质。
背景技术
目前公认的基于深度学习的语义相似度匹配方法包括:1)Siamese结构,即先将两个句子或文本分别通过卷积神经网络(CNN)、LSTM等神经网络进行表征得到两个句子向量,再进行相似度计算;2)交互式匹配的方法,即先将两个句子的词向量之间进行内积操作,得到一个三维矩阵作,再输入CNN、LSTM等神经网络中。然而Siamese结构仅对两个句子进行独立的表征,未能精确表征两者之间的交互关系。另一方面,交互式匹配的方法仅考虑到点对点的内积操作,仅能够表达两个句子间的局部相关性,无法有效地进行语义关系的表征。
发明内容
本发明的目的是提供一种基于交叉注意力机制的语义相似度匹配方法、装置、计算机设备及存储介质,用于解决现有技术存在的问题。
为实现上述目的,本发明提供一种基于交叉注意力机制的语义相似度匹配方法,包括:
获取第一基础语句中的多个第一基础词,获取第二基础语句中的多个第二 基础词;
对每个所述第一基础词和所述第二基础词进行词向量表征,得到多个第一基础向量和多个第二基础向量;
将所述多个第一基础向量和多个第二基础向量分别通过双向LSTM模型,得到多个第一拼接向量和多个第二拼接向量;其中所述第一拼接向量由所述第一基础向量通过双向LSTM模型后得到的第一向前输入向量和第一向后输入向量组合而成;所述第二拼接向量由第二基础向量通过双向LSTM模型后得到的第二向前输入向量和第二向后输出向量组合而成;
根据所述多个第一拼接向量生成第一拼接矩阵,所述第一拼接矩阵的列向量为所述第一拼接向量;根据所述多个第二拼接向量生成第二拼接矩阵,所述第二拼接矩阵的列向量为所述第二拼接向量;
用所述第二拼接矩阵中的所有列向量分别对所述第一拼接矩阵中的每个列向量进行交叉表征,得到第一表征矩阵;用所述第一拼接矩阵中的所有列向量分别对所述第二拼接矩阵中的每个列向量进行交叉表征,得到第二表征矩阵;
分别对所述第一表征矩阵和所述第二表征矩阵进行最大化处理,得到第一最大化矩阵和第二最大化矩阵;
将所述第一最大化矩阵和所述第二最大化矩阵拼接后输入全连接层和池化层,得到所述第一基础语句和所述第二基础语句的匹配值。
为实现上述目的,本发明还提供一种基于交叉注意力机制的语义相似度匹配装置,包括:
基础词获取模块,获取第一基础语句中的多个第一基础词,获取第二基础语句中的多个第二基础词;
词向量表征模块,适用于对每个所述第一基础词和所述第二基础词进行词向量表征,得到多个第一基础向量和多个第二基础向量;
双向LSTM模块,适用于将所述多个第一基础向量和多个第二基础向量分别通过双向LSTM模型,得到多个第一拼接向量和多个第二拼接向量;其中所 述第一拼接向量由所述第一基础向量通过双向LSTM模型后得到的第一向前输入向量和第一向后输入向量组合而成;所述第二拼接向量由第二基础向量通过双向LSTM模型后得到的第二向前输入向量和第二向后输出向量组合而成;
拼接模块,适用于根据所述多个第一拼接向量生成第一拼接矩阵,所述第一拼接矩阵的列向量为所述第一拼接向量;根据所述多个第二拼接向量生成第二拼接矩阵,所述第二拼接矩阵的列向量为所述第二拼接向量;
交叉表征模块,适用于用所述第二拼接矩阵中的所有列向量分别对所述第一拼接矩阵中的每个列向量进行交叉表征,得到第一表征矩阵;用所述第一拼接矩阵中的所有列向量分别对所述第二拼接矩阵中的每个列向量进行交叉表征,得到第二表征矩阵;
最大化模块,适用于分别对所述第一表征矩阵和所述第二表征矩阵进行最大化处理,得到第一最大化矩阵和第二最大化矩阵;
匹配模块,适用于将所述第一最大化矩阵和所述第二最大化矩阵拼接后输入全连接层和池化层,得到所述第一基础语句和所述第二基础语句的匹配值。
为实现上述目的,本发明还提供一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:
获取第一基础语句中的多个第一基础词,获取第二基础语句中的多个第二基础词;
对每个所述第一基础词和所述第二基础词进行词向量表征,得到多个第一基础向量和多个第二基础向量;
将所述多个第一基础向量和多个第二基础向量分别通过双向LSTM模型,得到多个第一拼接向量和多个第二拼接向量;其中所述第一拼接向量由所述第一基础向量通过双向LSTM模型后得到的第一向前输入向量和第一向后输入向量组合而成;所述第二拼接向量由第二基础向量通过双向LSTM模型后得到的第二向前输入向量和第二向后输出向量组合而成;
根据所述多个第一拼接向量生成第一拼接矩阵,所述第一拼接矩阵的列向量为所述第一拼接向量;根据所述多个第二拼接向量生成第二拼接矩阵,所述第二拼接矩阵的列向量为所述第二拼接向量;
用所述第二拼接矩阵中的所有列向量分别对所述第一拼接矩阵中的每个列向量进行交叉表征,得到第一表征矩阵;用所述第一拼接矩阵中的所有列向量分别对所述第二拼接矩阵中的每个列向量进行交叉表征,得到第二表征矩阵;
分别对所述第一表征矩阵和所述第二表征矩阵进行最大化处理,得到第一最大化矩阵和第二最大化矩阵;
将所述第一最大化矩阵和所述第二最大化矩阵拼接后输入全连接层和池化层,得到所述第一基础语句和所述第二基础语句的匹配值。
为实现上述目的,本发明还提供计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时以下步骤:
获取第一基础语句中的多个第一基础词,获取第二基础语句中的多个第二基础词;
对每个所述第一基础词和所述第二基础词进行词向量表征,得到多个第一基础向量和多个第二基础向量;
将所述多个第一基础向量和多个第二基础向量分别通过双向LSTM模型,得到多个第一拼接向量和多个第二拼接向量;其中所述第一拼接向量由所述第一基础向量通过双向LSTM模型后得到的第一向前输入向量和第一向后输入向量组合而成;所述第二拼接向量由第二基础向量通过双向LSTM模型后得到的第二向前输入向量和第二向后输出向量组合而成;
根据所述多个第一拼接向量生成第一拼接矩阵,所述第一拼接矩阵的列向量为所述第一拼接向量;根据所述多个第二拼接向量生成第二拼接矩阵,所述第二拼接矩阵的列向量为所述第二拼接向量;
用所述第二拼接矩阵中的所有列向量分别对所述第一拼接矩阵中的每个列向量进行交叉表征,得到第一表征矩阵;用所述第一拼接矩阵中的所有列向 量分别对所述第二拼接矩阵中的每个列向量进行交叉表征,得到第二表征矩阵;
分别对所述第一表征矩阵和所述第二表征矩阵进行最大化处理,得到第一最大化矩阵和第二最大化矩阵;
将所述第一最大化矩阵和所述第二最大化矩阵拼接后输入全连接层和池化层,得到所述第一基础语句和所述第二基础语句的匹配值。
本发明基于交叉注意力机制的语义相似度匹配方案,分别对两个句子进行相互表征,从而在表征阶段已实现对两个句子在语义层面上的交互作用。与现有技术相比,本发明具有以下有益效果:
(1)本发明采用双向LSTM对语句进行预表征,作为交叉表征层的输入,能够抽象出语句的长程序列结构,从而使交叉表征层能够挖掘语义间的长程匹配性。
(2)本发明采用注意力机制,计算一个句子的每个单词在另一个句子下的表征。相比于传统的基于点对点的语义相似度匹配方法,该方法不但包含词语与另一个语句中的每个词语、短语的局部关系,还包含词语在语义层面下的表征。
(3)本发明采用最大池化(max pooling)的方法将交叉匹配后的语句编码为一个向量。相比于传统的采用CNN或LSTM编码的方法,在保证模型表征能力的基础上,显著降低了模型参数数量,从而降低了模型的训练时间。
附图说明
图1为本发明的语义相似度匹配方法实施例一的流程图;
图2为本发明的语义相似度匹配装置实施例一的程序模块示意图;
图3为本发明的语义相似度匹配装置实施例一的硬件结构示意图。
具体实施方式
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实 施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明提供的基于交叉注意力机制的语义相似度匹配方法、装置、计算机设备及存储介质,适用于语音交互技术领域,能够实现在语义层面上对两个语句进行交叉表征。本发明首先通过word2vec对两个语句中的每个分词进行词向量表征,分别通过双向LSTM后得到两个拼接矩阵,进而使两个拼接矩阵之间相互进行交叉表征,得到任意句子中的每个分词相对于另一个句子的重要程度。在此基础上再进行最大化处理并输入全连接层,最终获取两个语句之间的匹配度得分。本发明提出的上述方案克服了现有技术中单独使用LSTM或者交互式匹配时存在的局限性,使得两个语句之间的匹配度计算更为精确完整,趋近真实情境。
实施例1
请参阅图1,本实施例的一种基于交叉注意力机制的语义相似度匹配方法,包括以下步骤:
S1:获取第一基础语句中的多个第一基础词,获取第二基础语句中的多个第二基础词。
本步骤用于对包含在句子中的所有单词进行划分。例如,句子1为“我是中国人”,对其进行划分可得到“我”、“是”和“中国人”共三个基础词。又例如句子2为“I am Chinese”,对其进行划分可得到“I”、“am”和“Chinese”共三个基础词。
S2:对每个所述第一基础词和所述第二基础词进行词向量表征,得到多个第一基础向量和多个第二基础向量。
本步骤优选采用word2vec词向量模型对句子中的每个词进行表征,其优点在于word2vec词向量模型一方面降低了输入的维度,另一方面经word2vec 模型训练好的词向量相比于传统的one-hot-encoder或者主题模型,充分利用了词的上下文并提供更加丰富的语义信息。
经word2vec模型训练后的每个基础词被表征为计算机可以理解的向量形式,例如[0.792,-0.177,-0.107,……]。本发明将经过word2vec模型后得到的向量称为基础向量,例如,句子1中的基础词“我”、“是”、“中国人”经向量表征后得到三个第一基础向量分别为
Figure PCTCN2019089483-appb-000001
Figure PCTCN2019089483-appb-000002
句子2中的基础词“I”、“am”和“Chinese”经向量表征后得到三个第二基础向量分别为
Figure PCTCN2019089483-appb-000003
Figure PCTCN2019089483-appb-000004
S3:将多个第一基础向量和多个第二基础向量分别通过双向LSTM模型,得到多个第一拼接向量和多个第二拼接向量;其中所述第一拼接向量由所述第一基础向量通过双向LSTM模型后得到的第一向前输入向量和第一向后输入向量组合而成;所述第二拼接向量由第二基础向量通过双向LSTM模型后得到的第二向前输入向量和第二向后输出向量组合而成。
本步骤中,将第i个第一基础向量
Figure PCTCN2019089483-appb-000005
经过双向LSTM模型后分别输出为
Figure PCTCN2019089483-appb-000006
Figure PCTCN2019089483-appb-000007
其中
Figure PCTCN2019089483-appb-000008
是向前输入LSTM得到的第一向前输入向量,
Figure PCTCN2019089483-appb-000009
是向后输入LSTM得到的第一向后输入向量,则第一拼接向量为
Figure PCTCN2019089483-appb-000010
例如句子1中包含
Figure PCTCN2019089483-appb-000011
Figure PCTCN2019089483-appb-000012
共三个第一基础向量,其中
Figure PCTCN2019089483-appb-000013
经过双向LSTM模型后分别输出
Figure PCTCN2019089483-appb-000014
Figure PCTCN2019089483-appb-000015
则第一基础向量
Figure PCTCN2019089483-appb-000016
所对应的第一拼接向量p 1
Figure PCTCN2019089483-appb-000017
本步骤中,将第i个第二基础向量
Figure PCTCN2019089483-appb-000018
经过双向LSTM模型后分别输出
Figure PCTCN2019089483-appb-000019
Figure PCTCN2019089483-appb-000020
其中
Figure PCTCN2019089483-appb-000021
是向前输入LSTM得到的第二向前输入向量,
Figure PCTCN2019089483-appb-000022
是向后输入LSTM得到的第二向后输入向量,则第二拼接向量为
Figure PCTCN2019089483-appb-000023
例如句子2中包含
Figure PCTCN2019089483-appb-000024
Figure PCTCN2019089483-appb-000025
共三个第二基础向量,其中
Figure PCTCN2019089483-appb-000026
经过双向LSTM模型后分别输出
Figure PCTCN2019089483-appb-000027
Figure PCTCN2019089483-appb-000028
则第二基础向量
Figure PCTCN2019089483-appb-000029
所对应的第二拼接向量q 1
Figure PCTCN2019089483-appb-000030
S4:根据所述多个第一拼接向量生成第一拼接矩阵,所述第一拼接矩阵的列向量为所述第一拼接向量;根据所述多个第二拼接向量生成第二拼接矩阵,所述第二拼接矩阵的列向量为所述第二拼接向量。
本步骤利用前文中得到的第一拼接向量和第二拼接向量分别得到第一拼接矩阵和第二拼接矩阵。例如,句子1包括三个第一拼接向量p 1、p 2和p 3,则 根据这三个第一拼接向量组成的第一拼接矩阵为[p 1,p 2,p 3]。句子2包括三个第二拼接向量q 1、q 2和q 3,则根据这三个第一拼接向量组成的第一拼接矩阵为[q 1,q 2,q 3]。
S5:用所述第二拼接矩阵中的所有列向量分别对所述第一拼接矩阵中的每个列向量进行交叉表征,得到第一表征矩阵;用所述第一拼接矩阵中的所有列向量分别对所述第二拼接矩阵中的每个列向量进行交叉表征,得到第二表征矩阵。
本步骤中,第一表征矩阵P′由第一表征向量p′ i组成,第一表征向量p′ i的计算公式如下:
Figure PCTCN2019089483-appb-000031
其中:
上式中,α ij表示第一拼接矩阵P中的第i个第一拼接向量p i与第二拼接矩阵Q中的每一个第二拼接向量q j的余弦相似度,N为第二拼接向量q j的个数。例如,句子1对应的第一拼接矩阵P中包括三个第一拼接向量p 1、p 2和p 3,句子2对应的第二拼接矩阵Q中包括三个第二拼接向量q 1、q 2和q 3,则第一拼接向量p 1所对应的第一表征向量p′ 1为:p′ 1=α 11q 112q 213q 3。相应的,当包含三个第一表征向量p′ i时,第一表征矩阵P′可以表示为[p′ 1,p′ 2,p′ 3]。
本步骤中,第二表征矩阵Q′由第二表征向量q′ i组成,第二表征向量q′ i的计算公式如下:
Figure PCTCN2019089483-appb-000032
其中:
上式中,α ij表示第二拼接矩阵Q中的第i个第二拼接向量q i与第一拼接矩阵P中的每一个第二拼接向量p j的余弦相似度,N为第一拼接向量p j的个数。例如,句子1对应的第一拼接矩阵P中包括三个第一拼接向量p 1、p 2和p 3,句子2对应的第二拼接矩阵Q中包括三个第二拼接向量q 1、q 2和q 3,则第二拼接向量q 1所对应的第一表征向量q′ 1为:q′ 1=α 11p 112p 213p 3。相应的,当包含三个第二表征向量q′ i时,第二表征矩阵Q′可以表示为[q′ 1,q′ 2,q′ 3]。
S6:分别对所述第一表征矩阵和所述第二表征矩阵进行最大化处理,得到第一最大化矩阵和第二最大化矩阵。
本步骤中,分别对于第一表征矩阵P′和第二表征矩阵Q′中的每一列取最大值,即选取每个表征向量的最大值。例如向量p′ i中包括k个数值,选取这k个数值中的最大值p′ imax作为向量p′ i的值。对于包含三个第一表征向量的第一表征矩阵P′,经最大池化后得到的第一最大化矩阵P′ max表示为[p′ 1max,p′ 2max,p′ 3max],由于p′ 1max、p′ 2max和p′ 3max均为单个数值,上述第一最大化矩阵P′ max是一维矩阵。
类似的,对于包含三个第二表征向量的第二表征矩阵Q′,经最大池化后得到的第二最大化矩阵Q′ max表示为[q′ 1max,q′ 2max,q′ 3max]。由于q′ 1max、q′ 2max和q′ 3max均为单个数值,上述第二最大化矩阵Q′ max是一维矩阵。
S7:将所述第一矩阵和所述第二最大化矩阵拼接后输入全连接层和池化层,得到所述第一基础语句和所述第二基础语句的匹配值。
本步骤将第一最大化矩阵P′ max和第二最大化矩阵Q′ max进行拼接,得到拼接矩阵P′ maxQ′ max可表示为[p′ 1max,p′ 2max,p′ 3max,q′ 1max,q′ 2max,q′ 3max]。拼接矩阵P′ maxQ′ max经过全连接网络层和softmax层后便可输出句子1与句子2的相似度匹配值。上述全连接网络层和池化层的处理方式属于现有技术,本文不再赘述。
请继续参阅图2,示出了一种语义相似度匹配装置,在本实施例中,语义相似度匹配装置10可以包括或被分割成一个或多个程序模块,一个或者多个程序模块被存储于存储介质中,并由一个或多个处理器所执行,以完成本发明,并可实现上述语义相似度匹配方法。本发明所称的程序模块是指能够完成特定功能的一系列计算机程序指令段,比程序本身更适合于描述语义相似度匹配装置10在存储介质中的执行过程。以下描述将具体介绍本实施例各程序模块的功能:
基础词获取模块11,获取第一基础语句中的多个第一基础词,获取第二基础语句中的多个第二基础词;
词向量表征模块12,适用于对每个所述第一基础词和所述第二基础词进行词向量表征,得到多个第一基础向量和多个第二基础向量;
双向LSTM模块13,适用于将所述多个第一基础向量和多个第二基础向量 分别通过双向LSTM模型,得到多个第一拼接向量和多个第二拼接向量;其中所述第一拼接向量由所述第一基础向量通过双向LSTM模型后得到的第一向前输入向量和第一向后输入向量组合而成;所述第二拼接向量由第二基础向量通过双向LSTM模型后得到的第二向前输入向量和第二向后输出向量组合而成;
拼接模块14,适用于根据所述多个第一拼接向量生成第一拼接矩阵,所述第一拼接矩阵的列向量为所述第一拼接向量;根据所述多个第二拼接向量生成第二拼接矩阵,所述第二拼接矩阵的列向量为所述第二拼接向量;
交叉表征模块15,适用于用所述第二拼接矩阵中的所有列向量分别对所述第一拼接矩阵中的每个列向量进行交叉表征,得到第一表征矩阵;用所述第一拼接矩阵中的所有列向量分别对所述第二拼接矩阵中的每个列向量进行交叉表征,得到第二表征矩阵;
最大化模块16,适用于分别对所述第一表征矩阵和所述第二表征矩阵进行最大化处理,得到第一最大化矩阵和第二最大化矩阵;
匹配模块17,适用于将所述第一最大化矩阵和所述第二最大化矩阵拼接后输入全连接层和池化层,得到所述第一基础语句和所述第二基础语句的匹配值。
进一步,所述双向LSTM模块13包括:
第一双向LSTM子模块131,适用于将第i个第一基础向量
Figure PCTCN2019089483-appb-000033
经过双向LSTM模型后分别输出
Figure PCTCN2019089483-appb-000034
Figure PCTCN2019089483-appb-000035
其中
Figure PCTCN2019089483-appb-000036
是向前输入LSTM得到的第一向前输入向量,
Figure PCTCN2019089483-appb-000037
是向后输入LSTM得到的第一向后输入向量,则第一拼接向量为
Figure PCTCN2019089483-appb-000038
第二双向LSTM子模块132,适用于将第i个第二基础向量
Figure PCTCN2019089483-appb-000039
经过双向LSTM模型后分别输出
Figure PCTCN2019089483-appb-000040
Figure PCTCN2019089483-appb-000041
其中
Figure PCTCN2019089483-appb-000042
是向前输入LSTM得到的第二向前输入向量,
Figure PCTCN2019089483-appb-000043
是向后输入LSTM得到的第二向后输入向量,则第二拼接向量为
Figure PCTCN2019089483-appb-000044
本实施例还提供一种计算机设备,如可以执行程序的智能手机、平板电脑、笔记本电脑、台式计算机、机架式服务器、刀片式服务器、塔式服务器或机柜式服务器(包括独立的服务器,或者多个服务器所组成的服务器集群)等。本 实施例的计算机设备20至少包括但不限于:可通过系统总线相互通信连接的存储器21、处理器22,如图3所示。需要指出的是,图3仅示出了具有组件21-22的计算机设备20,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
本实施例中,存储器21(即可读存储介质)包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器21可以是计算机设备20的内部存储单元,例如该计算机设备20的硬盘或内存。在另一些实施例中,存储器21也可以是计算机设备20的外部存储设备,例如该计算机设备20上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器21还可以既包括计算机设备20的内部存储单元也包括其外部存储设备。本实施例中,存储器21通常用于存储安装于计算机设备20的操作系统和各类应用软件,例如实施例一的语义相似度匹配装置10的程序代码等。此外,存储器21还可以用于暂时地存储已经输出或者将要输出的各类数据。
处理器22在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器22通常用于控制计算机设备20的总体操作。本实施例中,处理器22用于运行存储器21中存储的程序代码或者处理数据,例如运行语义相似度匹配装置10,以实现实施例一的语义相似度匹配方法。
本实施例还提供一种计算机可读存储介质,如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,其上存储有计算机程序,程序被处理器执行时实现相应功能。本实施 例的计算机可读存储介质用于存储语义相似度匹配装置10,被处理器执行时实现实施例一的语义相似度匹配方法。
上述本发明实施例序号仅仅为了描述,不代表实施例的优劣。
流程图中或在此以其它方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。
本技术领域的普通技术人员可以理解,实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。
以上仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (20)

  1. 一种基于交叉注意力机制的语义相似度匹配方法,其特征在于,包括:
    获取第一基础语句中的多个第一基础词,获取第二基础语句中的多个第二基础词;
    对每个所述第一基础词和所述第二基础词进行词向量表征,得到多个第一基础向量和多个第二基础向量;
    将所述多个第一基础向量和多个第二基础向量分别通过双向LSTM模型,得到多个第一拼接向量和多个第二拼接向量;其中所述第一拼接向量由所述第一基础向量通过双向LSTM模型后得到的第一向前输入向量和第一向后输入向量组合而成;所述第二拼接向量由第二基础向量通过双向LSTM模型后得到的第二向前输入向量和第二向后输出向量组合而成;
    根据所述多个第一拼接向量生成第一拼接矩阵,所述第一拼接矩阵的列向量为所述第一拼接向量;根据所述多个第二拼接向量生成第二拼接矩阵,所述第二拼接矩阵的列向量为所述第二拼接向量;
    用所述第二拼接矩阵中的所有列向量分别对所述第一拼接矩阵中的每个列向量进行交叉表征,得到第一表征矩阵;用所述第一拼接矩阵中的所有列向量分别对所述第二拼接矩阵中的每个列向量进行交叉表征,得到第二表征矩阵;
    分别对所述第一表征矩阵和所述第二表征矩阵进行最大化处理,得到第一最大化矩阵和第二最大化矩阵;
    将所述第一最大化矩阵和所述第二最大化矩阵拼接后输入全连接层和池化层,得到所述第一基础语句和所述第二基础语句的匹配值。
  2. 根据权利要求1所述的语义相似度匹配方法,其特征在于,所述词向量表征是通过word2vec模型得到的。
  3. 根据权利要求2所述的语义相似度匹配方法,其特征在于,将所述多个第一基础向量和多个第二基础向量分别通过双向LSTM模型,得到多个第一拼接向量和多个第二拼接向量的步骤包括:
    将第i个第一基础向量
    Figure PCTCN2019089483-appb-100001
    经过双向LSTM模型后分别输出
    Figure PCTCN2019089483-appb-100002
    Figure PCTCN2019089483-appb-100003
    其中
    Figure PCTCN2019089483-appb-100004
    是向前输入LSTM得到的第一向前输入向量,
    Figure PCTCN2019089483-appb-100005
    是向后输入LSTM得到的第一向后输入向量,则第一拼接向量为
    Figure PCTCN2019089483-appb-100006
    将第i个第二基础向量
    Figure PCTCN2019089483-appb-100007
    经过双向LSTM模型后分别输出
    Figure PCTCN2019089483-appb-100008
    Figure PCTCN2019089483-appb-100009
    其中
    Figure PCTCN2019089483-appb-100010
    是向前输入LSTM得到的第二向前输入向量,
    Figure PCTCN2019089483-appb-100011
    是向后输入LSTM得到的第二向后输入向量,则第二拼接向量为
    Figure PCTCN2019089483-appb-100012
  4. 根据权利要求3所述的语义相似度匹配方法,其特征在于:
    用所述第二拼接矩阵中的所有列向量分别对所述第一拼接矩阵中的每个列向量进行交叉表征,得到第一表征矩阵的步骤包括:
    计算第一拼接矩阵P中的第i个列向量p i与第二拼接矩阵Q中的每一个列向量q j的余弦相似度α ij,并进行加权求和后得到P中的第i个列向量p i在第二拼接矩阵Q中的第一表征向量p′ i
    Figure PCTCN2019089483-appb-100013
    其中N为列向量q j的个数;
    将所有的第一表征向量p′ i作为列向量形成第一表征矩阵P’;
    用所述第一拼接矩阵中的所有列向量分别对所述第二拼接矩阵中的每个列向量进行交叉表征,得到第二表征矩阵的步骤包括:
    计算第二拼接矩阵Q中的第i个列向量q i与第一拼接矩阵P中的每一个列向量p j的余弦相似度α ij,并进行加权求和后得到Q中的第i个列向量q i在第一拼接矩阵P中的第二表征向量q′ i
    Figure PCTCN2019089483-appb-100014
    其中N为列向量p j的个数;
    将所有的第二表征向量q′ i作为列向量形成第二表征矩阵Q’。
  5. 根据权利要求3所述的语义相似度匹配方法,其特征在于:所述分别对所述第一表征矩阵和所述第二表征矩阵进行最大化处理,得到第一最大化矩阵和第二最大化矩阵的步骤包括:
    对于第一表征矩阵中的每个列向量p′ i,选取该列的最大值p′ imax作为该列向量的值,得到第一最大化矩阵(p′ 1max,p′ 2max,…p′ Nmax);
    对于第二表征矩阵中的每个列向量q′ i,选取该列的最大值q′ imax作为该列向量的值,得到第二最大化矩阵(q′ 1max,q′ 2max,…q′ Nmax)。
  6. 一种基于交叉注意力机制的语义相似度匹配装置,其特征在于,包括:
    基础词获取模块,获取第一基础语句中的多个第一基础词,获取第二基础语句中的多个第二基础词;
    词向量表征模块,适用于对每个所述第一基础词和所述第二基础词进行词向量表征,得到多个第一基础向量和多个第二基础向量;
    双向LSTM模块,适用于将所述多个第一基础向量和多个第二基础向量分别通过双向LSTM模型,得到多个第一拼接向量和多个第二拼接向量;其中所述第一拼接向量由所述第一基础向量通过双向LSTM模型后得到的第一向前输入向量和第一向后输入向量组合而成;所述第二拼接向量由第二基础向量通过双向LSTM模型后得到的第二向前输入向量和第二向后输出向量组合而成;
    拼接模块,适用于根据所述多个第一拼接向量生成第一拼接矩阵,所述第一拼接矩阵的列向量为所述第一拼接向量;根据所述多个第二拼接向量生成第二拼接矩阵,所述第二拼接矩阵的列向量为所述第二拼接向量;
    交叉表征模块,适用于用所述第二拼接矩阵中的所有列向量分别对所述第一拼接矩阵中的每个列向量进行交叉表征,得到第一表征矩阵;用所述第一拼接矩阵中的所有列向量分别对所述第二拼接矩阵中的每个列向量进行交叉表征,得到第二表征矩阵;
    最大化模块,适用于分别对所述第一表征矩阵和所述第二表征矩阵进行最大化处理,得到第一最大化矩阵和第二最大化矩阵;
    匹配模块,适用于将所述第一最大化矩阵和所述第二最大化矩阵拼接后输入全连接层和池化层,得到所述第一基础语句和所述第二基础语句的匹配值。
  7. 根据权利要求6所述的语义相似度匹配装置,其特征在于,所述双向LSTM模块包括:
    第一双向LSTM子模块,适用于将第i个第一基础向量
    Figure PCTCN2019089483-appb-100015
    经过双向LSTM模型后分别输出
    Figure PCTCN2019089483-appb-100016
    Figure PCTCN2019089483-appb-100017
    其中
    Figure PCTCN2019089483-appb-100018
    是向前输入LSTM得到的第一向前输入向量,
    Figure PCTCN2019089483-appb-100019
    是向后输入LSTM得到的第一向后输入向量,则第一拼接向量为
    Figure PCTCN2019089483-appb-100020
    第二双向LSTM子模块,适用于将第i个第二基础向量
    Figure PCTCN2019089483-appb-100021
    经过双向LSTM 模型后分别输出
    Figure PCTCN2019089483-appb-100022
    Figure PCTCN2019089483-appb-100023
    其中
    Figure PCTCN2019089483-appb-100024
    是向前输入LSTM得到的第二向前输入向量,
    Figure PCTCN2019089483-appb-100025
    是向后输入LSTM得到的第二向后输入向量,则第二拼接向量为
    Figure PCTCN2019089483-appb-100026
  8. 根据权利要求7所述的语义相似度匹配装置,其特征在于,所述交叉表征模块包括第一交叉表征子模块和第二交叉表征子模块,其中:
    第一交叉子模块适用于计算第一拼接矩阵P中的第i个列向量p i与第二拼接矩阵Q中的每一个列向量q j的余弦相似度α ij,并进行加权求和后得到P中的第i个列向量p i在第二拼接矩阵Q中的第一表征向量p′ i
    Figure PCTCN2019089483-appb-100027
    其中N为列向量q j的个数;
    将所有的第一表征向量p′ i作为列向量形成第一表征矩阵P’;
    第二交叉表征子模块适用于计算第二拼接矩阵Q中的第i个列向量q i与第一拼接矩阵P中的每一个列向量p j的余弦相似度α ij,并进行加权求和后得到Q中的第i个列向量q i在第一拼接矩阵P中的第二表征向量q′ i
    Figure PCTCN2019089483-appb-100028
    其中N为列向量p j的个数;
    将所有的第二表征向量q′ i作为列向量形成第二表征矩阵Q’。
  9. 根据权利要求6所述的语义相似度匹配装置,其特征在于,所述词向量表征模块包括word2vec子模块,适用于通过word2vec模型对每个所述第一基础词和所述第二基础词进行词向量表征。
  10. 根据权利要求8所述的语义相似度匹配装置,其特征在于,所述最大化模块包括:
    第一最大化子模块,适用于对于第一表征矩阵中的每个列向量p′ i,选取该列的最大值p′ imax作为该列向量的值,得到第一最大化矩阵(p′ 1max,p′ 2max,…p′ Nmax);
    第二最大化子模块,适用于对于第二表征矩阵中的每个列向量q′ i,选取该列的最大值q′ imax作为该列向量的值,得到第二最大化矩阵(q′ 1max,q′ 2max,…q′ Nmax)。
  11. 一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现以下步骤:
    获取第一基础语句中的多个第一基础词,获取第二基础语句中的多个第二 基础词;
    对每个所述第一基础词和所述第二基础词进行词向量表征,得到多个第一基础向量和多个第二基础向量;
    将所述多个第一基础向量和多个第二基础向量分别通过双向LSTM模型,得到多个第一拼接向量和多个第二拼接向量;其中所述第一拼接向量由所述第一基础向量通过双向LSTM模型后得到的第一向前输入向量和第一向后输入向量组合而成;所述第二拼接向量由第二基础向量通过双向LSTM模型后得到的第二向前输入向量和第二向后输出向量组合而成;
    根据所述多个第一拼接向量生成第一拼接矩阵,所述第一拼接矩阵的列向量为所述第一拼接向量;根据所述多个第二拼接向量生成第二拼接矩阵,所述第二拼接矩阵的列向量为所述第二拼接向量;
    用所述第二拼接矩阵中的所有列向量分别对所述第一拼接矩阵中的每个列向量进行交叉表征,得到第一表征矩阵;用所述第一拼接矩阵中的所有列向量分别对所述第二拼接矩阵中的每个列向量进行交叉表征,得到第二表征矩阵;
    分别对所述第一表征矩阵和所述第二表征矩阵进行最大化处理,得到第一最大化矩阵和第二最大化矩阵;
    将所述第一最大化矩阵和所述第二最大化矩阵拼接后输入全连接层和池化层,得到所述第一基础语句和所述第二基础语句的匹配值。
  12. 根据权利要求11所述的计算机设备,其特征在于,所述词向量表征是通过word2vec模型得到的。
  13. 根据权利要求11所述的计算机设备,其特征在于,将所述多个第一基础向量和多个第二基础向量分别通过双向LSTM模型,得到多个第一拼接向量和多个第二拼接向量的步骤包括:
    将第i个第一基础向量
    Figure PCTCN2019089483-appb-100029
    经过双向LSTM模型后分别输出
    Figure PCTCN2019089483-appb-100030
    Figure PCTCN2019089483-appb-100031
    其中
    Figure PCTCN2019089483-appb-100032
    是向前输入LSTM得到的第一向前输入向量,
    Figure PCTCN2019089483-appb-100033
    是向后输入LSTM得到的第一向后输入向量,则第一拼接向量为
    Figure PCTCN2019089483-appb-100034
    将第i个第二基础向量
    Figure PCTCN2019089483-appb-100035
    经过双向LSTM模型后分别输出
    Figure PCTCN2019089483-appb-100036
    Figure PCTCN2019089483-appb-100037
    其中
    Figure PCTCN2019089483-appb-100038
    是向前输入LSTM得到的第二向前输入向量,
    Figure PCTCN2019089483-appb-100039
    是向后输入LSTM得到的第二向后输入向量,则第二拼接向量为
    Figure PCTCN2019089483-appb-100040
  14. 根据权利要求13所述的计算机设备,其特征在于,用所述第二拼接矩阵中的所有列向量分别对所述第一拼接矩阵中的每个列向量进行交叉表征,得到第一表征矩阵的步骤包括:
    计算第一拼接矩阵P中的第i个列向量p i与第二拼接矩阵Q中的每一个列向量q j的余弦相似度α ij,并进行加权求和后得到P中的第i个列向量p i在第二拼接矩阵Q中的第一表征向量p′ i
    Figure PCTCN2019089483-appb-100041
    其中N为列向量q j的个数;
    将所有的第一表征向量p′ i作为列向量形成第一表征矩阵P’;
    用所述第一拼接矩阵中的所有列向量分别对所述第二拼接矩阵中的每个列向量进行交叉表征,得到第二表征矩阵的步骤包括:
    计算第二拼接矩阵Q中的第i个列向量q i与第一拼接矩阵P中的每一个列向量p j的余弦相似度α ij,并进行加权求和后得到Q中的第i个列向量q i在第一拼接矩阵P中的第二表征向量q′ i
    Figure PCTCN2019089483-appb-100042
    其中N为列向量p j的个数;
    将所有的第二表征向量q′ i作为列向量形成第二表征矩阵Q’。
  15. 根据权利要求13所述的计算机设备,其特征在于,所述分别对所述第一表征矩阵和所述第二表征矩阵进行最大化处理,得到第一最大化矩阵和第二最大化矩阵的步骤包括:
    对于第一表征矩阵中的每个列向量p′ i,选取该列的最大值p′ imax作为该列向量的值,得到第一最大化矩阵(p′ 1max,p′ 2max,…p′ Nmax);
    对于第二表征矩阵中的每个列向量q′ i,选取该列的最大值q′ imax作为该列向量的值,得到第二最大化矩阵(q′ 1max,q′ 2max,…q′ Nmax)。
  16. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利以下步骤:
    获取第一基础语句中的多个第一基础词,获取第二基础语句中的多个第二 基础词;
    对每个所述第一基础词和所述第二基础词进行词向量表征,得到多个第一基础向量和多个第二基础向量;
    将所述多个第一基础向量和多个第二基础向量分别通过双向LSTM模型,得到多个第一拼接向量和多个第二拼接向量;其中所述第一拼接向量由所述第一基础向量通过双向LSTM模型后得到的第一向前输入向量和第一向后输入向量组合而成;所述第二拼接向量由第二基础向量通过双向LSTM模型后得到的第二向前输入向量和第二向后输出向量组合而成;
    根据所述多个第一拼接向量生成第一拼接矩阵,所述第一拼接矩阵的列向量为所述第一拼接向量;根据所述多个第二拼接向量生成第二拼接矩阵,所述第二拼接矩阵的列向量为所述第二拼接向量;
    用所述第二拼接矩阵中的所有列向量分别对所述第一拼接矩阵中的每个列向量进行交叉表征,得到第一表征矩阵;用所述第一拼接矩阵中的所有列向量分别对所述第二拼接矩阵中的每个列向量进行交叉表征,得到第二表征矩阵;
    分别对所述第一表征矩阵和所述第二表征矩阵进行最大化处理,得到第一最大化矩阵和第二最大化矩阵;
    将所述第一最大化矩阵和所述第二最大化矩阵拼接后输入全连接层和池化层,得到所述第一基础语句和所述第二基础语句的匹配值。
  17. 根据权利要求16所述的计算机可读存储介质,其特征在于,所述词向量表征是通过word2vec模型得到的。
  18. 根据权利要求17所述的计算机可读存储介质,其特征在于,将所述多个第一基础向量和多个第二基础向量分别通过双向LSTM模型,得到多个第一拼接向量和多个第二拼接向量的步骤包括:
    将第i个第一基础向量
    Figure PCTCN2019089483-appb-100043
    经过双向LSTM模型后分别输出
    Figure PCTCN2019089483-appb-100044
    Figure PCTCN2019089483-appb-100045
    其中
    Figure PCTCN2019089483-appb-100046
    是向前输入LSTM得到的第一向前输入向量,
    Figure PCTCN2019089483-appb-100047
    是向后输入LSTM得到的第一向后输入向量,则第一拼接向量为
    Figure PCTCN2019089483-appb-100048
    将第i个第二基础向量
    Figure PCTCN2019089483-appb-100049
    经过双向LSTM模型后分别输出
    Figure PCTCN2019089483-appb-100050
    Figure PCTCN2019089483-appb-100051
    其中
    Figure PCTCN2019089483-appb-100052
    是向前输入LSTM得到的第二向前输入向量,
    Figure PCTCN2019089483-appb-100053
    是向后输入LSTM得到的第二向后输入向量,则第二拼接向量为
    Figure PCTCN2019089483-appb-100054
  19. 根据权利要求18所述的计算机可读存储介质,其特征在于,用所述第二拼接矩阵中的所有列向量分别对所述第一拼接矩阵中的每个列向量进行交叉表征,得到第一表征矩阵的步骤包括:
    计算第一拼接矩阵P中的第i个列向量p i与第二拼接矩阵Q中的每一个列向量q j的余弦相似度α ij,并进行加权求和后得到P中的第i个列向量p i在第二拼接矩阵Q中的第一表征向量p′ i
    Figure PCTCN2019089483-appb-100055
    其中N为列向量q j的个数;
    将所有的第一表征向量p′ i作为列向量形成第一表征矩阵P’;
    用所述第一拼接矩阵中的所有列向量分别对所述第二拼接矩阵中的每个列向量进行交叉表征,得到第二表征矩阵的步骤包括:
    计算第二拼接矩阵Q中的第i个列向量q i与第一拼接矩阵P中的每一个列向量p j的余弦相似度α ij,并进行加权求和后得到Q中的第i个列向量q i在第一拼接矩阵P中的第二表征向量q′ i
    Figure PCTCN2019089483-appb-100056
    其中N为列向量p j的个数;
    将所有的第二表征向量q′ i作为列向量形成第二表征矩阵Q’。
  20. 根据权利要求18所述的计算机可读存储介质,其特征在于,所述分别对所述第一表征矩阵和所述第二表征矩阵进行最大化处理,得到第一最大化矩阵和第二最大化矩阵的步骤包括:
    对于第一表征矩阵中的每个列向量p′ i,选取该列的最大值p′ imax作为该列向量的值,得到第一最大化矩阵(p′ 1max,p′ 2max,…p′ Nmax);
    对于第二表征矩阵中的每个列向量q′ i,选取该列的最大值q′ imax作为该列向量的值,得到第二最大化矩阵(q′ 1max,q′ 2max,…q′ Nmax)。
PCT/CN2019/089483 2018-12-21 2019-05-31 基于交叉注意力机制的语义相似度匹配方法及其装置 WO2020124959A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811573321.5A CN109815484B (zh) 2018-12-21 2018-12-21 基于交叉注意力机制的语义相似度匹配方法及其匹配装置
CN201811573321.5 2018-12-21

Publications (1)

Publication Number Publication Date
WO2020124959A1 true WO2020124959A1 (zh) 2020-06-25

Family

ID=66602262

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/089483 WO2020124959A1 (zh) 2018-12-21 2019-05-31 基于交叉注意力机制的语义相似度匹配方法及其装置

Country Status (2)

Country Link
CN (1) CN109815484B (zh)
WO (1) WO2020124959A1 (zh)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112085091A (zh) * 2020-09-07 2020-12-15 中国平安财产保险股份有限公司 基于人工智能的短文本匹配方法、装置、设备及存储介质
CN112364666A (zh) * 2020-11-12 2021-02-12 虎博网络技术(上海)有限公司 文本表征方法、装置及计算机设备
CN112836010A (zh) * 2020-10-22 2021-05-25 长城计算机软件与系统有限公司 用于专利的检索方法、存储介质及装置
CN114330355A (zh) * 2020-10-09 2022-04-12 腾讯科技(深圳)有限公司 文本处理方法、装置、电子设备及存储介质
CN114492451A (zh) * 2021-12-22 2022-05-13 马上消费金融股份有限公司 文本匹配方法、装置、电子设备及计算机可读存储介质
CN116563147A (zh) * 2023-05-04 2023-08-08 北京联合大学 一种水下图像增强系统及方法

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815484B (zh) * 2018-12-21 2022-03-15 平安科技(深圳)有限公司 基于交叉注意力机制的语义相似度匹配方法及其匹配装置
CN110543549B (zh) * 2019-08-30 2022-02-22 北京百分点科技集团股份有限公司 语义等价性判断方法和装置
CN110543551B (zh) * 2019-09-04 2022-11-08 北京香侬慧语科技有限责任公司 一种问题语句处理方法和装置
CN110941951B (zh) * 2019-10-15 2022-02-15 平安科技(深圳)有限公司 文本相似度计算方法、装置、介质及电子设备
CN111241851A (zh) * 2020-04-24 2020-06-05 支付宝(杭州)信息技术有限公司 语义相似度确定方法、装置及处理设备
CN112541362B (zh) * 2020-12-08 2022-08-23 北京百度网讯科技有限公司 一种泛化处理的方法、装置、设备和计算机存储介质
CN113033170B (zh) * 2021-04-23 2023-08-04 中国平安人寿保险股份有限公司 表格标准化处理方法、装置、设备及存储介质
CN115456176B (zh) * 2022-10-10 2023-07-21 延边大学 一种基于知识增强的文本匹配方法及系统
CN116069606B (zh) * 2023-01-10 2023-07-07 山东大学 一种软件系统性能故障预测方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180129931A1 (en) * 2016-11-04 2018-05-10 Salesforce.Com, Inc. Quasi-recurrent neural network based encoder-decoder model
CN108132931A (zh) * 2018-01-12 2018-06-08 北京神州泰岳软件股份有限公司 一种文本语义匹配的方法及装置
CN108268643A (zh) * 2018-01-22 2018-07-10 北京邮电大学 一种基于多粒度lstm网络的深层语义匹配实体链接方法
CN109815484A (zh) * 2018-12-21 2019-05-28 平安科技(深圳)有限公司 基于交叉注意力机制的语义相似度匹配方法及其匹配装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104699667A (zh) * 2015-02-15 2015-06-10 深圳市前海安测信息技术有限公司 改进的基于语义词典的词语相似度计算方法和装置
CN106372055B (zh) * 2016-08-23 2019-10-29 北京谛听机器人科技有限公司 一种人机自然语言交互中的语义相似处理方法及系统
CN107291699B (zh) * 2017-07-04 2020-11-24 湖南星汉数智科技有限公司 一种句子语义相似度计算方法
CN108614815A (zh) * 2018-05-07 2018-10-02 华东师范大学 句子交互方法和装置
CN108875074B (zh) * 2018-07-09 2021-08-10 北京慧闻科技发展有限公司 基于交叉注意力神经网络的答案选择方法、装置和电子设备
CN108932342A (zh) * 2018-07-18 2018-12-04 腾讯科技(深圳)有限公司 一种语义匹配的方法、模型的学习方法及服务器

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180129931A1 (en) * 2016-11-04 2018-05-10 Salesforce.Com, Inc. Quasi-recurrent neural network based encoder-decoder model
CN108132931A (zh) * 2018-01-12 2018-06-08 北京神州泰岳软件股份有限公司 一种文本语义匹配的方法及装置
CN108268643A (zh) * 2018-01-22 2018-07-10 北京邮电大学 一种基于多粒度lstm网络的深层语义匹配实体链接方法
CN109815484A (zh) * 2018-12-21 2019-05-28 平安科技(深圳)有限公司 基于交叉注意力机制的语义相似度匹配方法及其匹配装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
FAN, YIXING ET AL.: "A Context-Aware Deep Sentence Matching Model", JOURNAL OF CHINESE INFORMATION PROCESSING, vol. 31, no. 5, 30 September 2017 (2017-09-30), XP055714668, ISSN: 1003-0077, DOI: 20190911110109A *

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112085091A (zh) * 2020-09-07 2020-12-15 中国平安财产保险股份有限公司 基于人工智能的短文本匹配方法、装置、设备及存储介质
CN112085091B (zh) * 2020-09-07 2024-04-26 中国平安财产保险股份有限公司 基于人工智能的短文本匹配方法、装置、设备及存储介质
CN114330355A (zh) * 2020-10-09 2022-04-12 腾讯科技(深圳)有限公司 文本处理方法、装置、电子设备及存储介质
CN112836010A (zh) * 2020-10-22 2021-05-25 长城计算机软件与系统有限公司 用于专利的检索方法、存储介质及装置
CN112836010B (zh) * 2020-10-22 2024-04-05 新长城科技有限公司 用于专利的检索方法、存储介质及装置
CN112364666A (zh) * 2020-11-12 2021-02-12 虎博网络技术(上海)有限公司 文本表征方法、装置及计算机设备
CN112364666B (zh) * 2020-11-12 2023-12-08 虎博网络技术(上海)有限公司 文本表征方法、装置及计算机设备
CN114492451A (zh) * 2021-12-22 2022-05-13 马上消费金融股份有限公司 文本匹配方法、装置、电子设备及计算机可读存储介质
CN114492451B (zh) * 2021-12-22 2023-10-24 马上消费金融股份有限公司 文本匹配方法、装置、电子设备及计算机可读存储介质
CN116563147A (zh) * 2023-05-04 2023-08-08 北京联合大学 一种水下图像增强系统及方法
CN116563147B (zh) * 2023-05-04 2024-03-26 北京联合大学 一种水下图像增强系统及方法

Also Published As

Publication number Publication date
CN109815484A (zh) 2019-05-28
CN109815484B (zh) 2022-03-15

Similar Documents

Publication Publication Date Title
WO2020124959A1 (zh) 基于交叉注意力机制的语义相似度匹配方法及其装置
WO2021217935A1 (zh) 问题生成模型的训练方法、问题生成方法及其相关设备
CN107273356B (zh) 基于人工智能的分词方法、装置、服务器和存储介质
WO2023134082A1 (zh) 图像描述语句生成模块的训练方法及装置、电子设备
WO2021212601A1 (zh) 一种基于图像的辅助写作方法、装置、介质及设备
WO2020244065A1 (zh) 基于人工智能的字向量定义方法、装置、设备及存储介质
US20230394866A1 (en) Person re-identification method and apparatus, device, and readable storage medium
WO2021174922A1 (zh) 语句情感分类方法及相关设备
JP7430820B2 (ja) ソートモデルのトレーニング方法及び装置、電子機器、コンピュータ可読記憶媒体、コンピュータプログラム
CN110598210B (zh) 实体识别模型训练、实体识别方法、装置、设备及介质
CN112380837A (zh) 基于翻译模型的相似句子匹配方法、装置、设备及介质
US20220414400A1 (en) Multi-dimensional language style transfer
CN113590784A (zh) 三元组信息抽取方法、装置、电子设备、及存储介质
WO2021000491A1 (zh) 问句实体识别与链接方法、装置、计算机设备及存储介质
US11900517B2 (en) Image manipulation by text instruction
CN111444313A (zh) 基于知识图谱的问答方法、装置、计算机设备和存储介质
CN109657127B (zh) 一种答案获取方法、装置、服务器及存储介质
WO2021000400A1 (zh) 导诊相似问题对生成方法、系统及计算机设备
JP2024515199A (ja) 要素テキスト処理方法、装置、電子機器及び記憶媒体
WO2022073341A1 (zh) 基于语音语义的疾病实体匹配方法、装置及计算机设备
WO2020052060A1 (zh) 用于生成修正语句的方法和装置
US11276249B2 (en) Method and system for video action classification by mixing 2D and 3D features
US20230120410A1 (en) Generating neural network outputs using insertion operations
CN112347242B (zh) 摘要生成方法、装置、设备及介质
CN113656555B (zh) 嵌套命名实体识别模型的训练方法、装置、设备和介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 07.10.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19900388

Country of ref document: EP

Kind code of ref document: A1