A text semantic matching method and device, medium and electronic equipment

By combining part-of-speech feature matrix expansion with neural networks, the problem that existing text semantic matching models cannot take into account both local and global aspects is solved, thus achieving more accurate text semantic matching.

CN116415583BActive Publication Date: 2026-05-19JIANGSU WISEDU INFORMATION TECH
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JIANGSU WISEDU INFORMATION TECH
Filing Date
2022-12-30
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing text semantic matching algorithms struggle to balance the semantic focus of a single sentence with the comparative information of the entire text, resulting in inaccurate matching results.

Method used

We employ a method that combines part-of-speech feature matrix expansion, multi-angle long short-term memory neural networks, and convolutional neural networks to achieve text semantic matching through part-of-speech feature matrix fusion, feature extraction, and max pooling operations.

Benefits of technology

It improves the accuracy of text semantic matching, taking into account both local semantics and global text matching effects, thus enhancing the accuracy of matching results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116415583B_ABST
    Figure CN116415583B_ABST
Patent Text Reader

Abstract

The application discloses a text semantic matching method and device, medium and electronic equipment. The method first extracts a part-of-speech feature vector according to word segmentation, generates a text part-of-speech feature matrix, then performs interactive fusion on two text part-of-speech feature matrices to obtain two text fusion output matrices, then adopts a multi-angle long short-term memory neural network and K1 convolutional neural networks to respectively perform feature extraction on the text fusion output matrices A1 and A2 to obtain two text representation matrices, calculates a matching matrix between the two text representation matrices, and finally inputs the matching matrix to a multi-layer perceptron after maximum pooling to output a result. The application combines a representation-based algorithm model and an interaction-based algorithm model, and takes into account the focus of the text meaning and the comparison of the global text.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to natural language processing technology, and more particularly to semantic matching of natural language. Background Technology

[0002] Semantic matching is a crucial task in natural language processing, aiming to determine the semantic relationship between two given statements. It has wide applications in fields such as intelligent question answering and information retrieval. With the rise of deep learning, semantic matching has gradually shifted its focus to neural network models. Currently, there are two main algorithmic models for text semantic matching: representation-based and interaction-based models. In representation-based models, both statements are first represented using tensor encoding, and then the matching degree between the two tensors is calculated. However, this model's tensor representation represents a single statement, making it prone to missing semantic focus. While interaction-based models can capture deeper semantic information through the interaction between two statements, they tend to overlook the overall contextual information within the text. Summary of the Invention

[0003] The problem this invention aims to solve is to make text matching more consistent with the semantics of natural language itself.

[0004] To solve the above problems, the present invention adopts the following solution:

[0005] A text semantic matching method according to the present invention includes a modeling step; the modeling step includes the following steps:

[0006] Step S1: Obtain the dictionary part-of-speech matrix data and receive the input first text and second text; the dictionary part-of-speech matrix data includes the dictionary and the part-of-speech feature vector of each word in the dictionary;

[0007] Step S2: Segment the first text and the second text respectively. Extract the part-of-speech feature vectors of the corresponding words from the word part-of-speech matrix data based on the segmented words. Then, expand them with zero feature padding to obtain text part-of-speech feature matrices T1 and T2 of CM×CT respectively. In text part-of-speech feature matrix T1, rows 1 to C1 are the part-of-speech feature vectors extracted from the words obtained from the segmentation of the first text, and rows C1+1 to CM are formed by zero feature padding expansion. In text part-of-speech feature matrix T2, rows 1 to C2 are the part-of-speech feature vectors extracted from the words obtained from the segmentation of the second text, and rows C2+1 to CM are formed by zero feature padding expansion. C1 and C2 are the number of words obtained from the segmentation of the first text and the second text respectively. CT is the dimension of the part-of-speech feature vector. CM is the pre-set maximum number of text segments, and CM is not less than C1 and C2.

[0008] Step S3: Based on the text part-of-speech feature matrices T1 and T2, calculate the text fusion output matrices A1 and A2 using the following formulas:

[0009] ,

[0010] ;

[0011] in, ;in,

[0012] , , and , and , , , and These are respectively represented as elements in matrices A1, A2, T1, T2, and R. The subscript value indicates the row number of the element in the matrix, and the value in parentheses indicates the column number of the element in the matrix.

[0013] Represented as the transpose of matrix T2; e is the natural constant;

[0014] M1 is the first weight matrix, a square matrix with CT rows and columns;

[0015] b1 is the first offset matrix, a square matrix with CM rows and columns;

[0016] Step S4: Use a multi-angle long short-term memory neural network and two convolutional neural networks to extract features from the text fusion output matrices A1 and A2, respectively, to obtain the first representation matrix output by the multi-angle long short-term memory neural network and the two second representation matrices output by the two convolutional neural networks, forming text representation matrices B1 and B2, respectively; the convolution kernels of the two convolutional neural networks are 2 and 3, respectively; wherein the number of columns in the first representation matrix and the two second representation matrices is CF, and the number of rows is CM, L1, L2, respectively; wherein CM + L1 + L2 = CF; text representation matrices B1 and B2 are both square matrices with CF rows and columns;

[0017] Step S5: Based on the text representation matrices B1 and B2, calculate the matching matrix Sm using the following formula:

[0018] ;in,

[0019] This is represented as the transpose of matrix B1;

[0020] M2 is the second weight matrix, a square matrix with CF rows and columns;

[0021] b2 is the second offset matrix, a square matrix with CF rows and columns;

[0022] Step S6: Obtain K max pooling values ​​from the matching matrix Sm through max pooling, and then input the K max pooling values ​​into the multilayer perceptron for classification. The semantic matching result of the first and second texts input is the classification result of the multilayer perceptron.

[0023] In the above steps, the first weight matrix M1, the second weight matrix M2, the first offset matrix b1, and the second offset matrix b2 are model data, determined through sample training.

[0024] According to a text semantic matching device of the present invention, a model module is included; the model module includes the following modules:

[0025] Module M1 is used to: acquire dictionary part-of-speech matrix data and receive input first text and second text; the dictionary part-of-speech matrix data includes the dictionary and the part-of-speech feature vector of each word in the dictionary;

[0026] Module M2 is used to: segment the first text and the second text into words respectively; extract the part-of-speech feature vectors of the corresponding words from the word part-of-speech matrix data based on the segmented words; and then expand them by zero-feature padding to obtain text part-of-speech feature matrices T1 and T2 of CM×CT respectively; in text part-of-speech feature matrix T1, rows 1 to C1 are the part-of-speech feature vectors extracted from the words obtained from the segmentation of the first text, and rows C1+1 to CM are formed by zero-feature padding expansion; in text part-of-speech feature matrix T2, rows 1 to C2 are the part-of-speech feature vectors extracted from the words obtained from the segmentation of the second text, and rows C2+1 to CM are formed by zero-feature padding expansion; C1 and C2 are the number of words obtained from the segmentation of the first text and the second text respectively; CT is the dimension of the part-of-speech feature vector; CM is the pre-set maximum number of text segments, and CM is not less than C1, C2 and CT;

[0027] Module M3 is used to calculate the text fusion output matrices A1 and A2 based on the text part-of-speech feature matrices T1 and T2 using the following formula:

[0028] ,

[0029] ;

[0030] in, ;in,

[0031] , , and , and , , , and These are respectively represented as elements in matrices A1, A2, T1, T2, and R. The subscript value indicates the row number of the element in the matrix, and the value in parentheses indicates the column number of the element in the matrix.

[0032] Represented as the transpose of matrix T2; e is the natural constant;

[0033] M1 is the first weight matrix, a square matrix with CT rows and columns;

[0034] b1 is the first offset matrix, a square matrix with CM rows and columns;

[0035] Module M4 is used to: extract features from the text fusion output matrices A1 and A2 using a multi-angle long short-term memory neural network and two convolutional neural networks, respectively, to obtain the first representation matrix output by the multi-angle long short-term memory neural network and the two second representation matrices output by the two convolutional neural networks, which form text representation matrices B1 and B2, respectively; the convolution kernels of the two convolutional neural networks are 2 and 3, respectively; wherein the number of columns in the first representation matrix and the two second representation matrices is CF, and the number of rows are CM, L1, L2, respectively; wherein CM + L1 + L2 = CF; text representation matrices B1 and B2 are both square matrices with CF rows and columns;

[0036] Module M5 is used to calculate the matching matrix Sm based on the text representation matrices B1 and B2 using the following formula:

[0037] ;in,

[0038] This is represented as the transpose of matrix B1;

[0039] M2 is the second weight matrix, a square matrix with CF rows and columns;

[0040] b2 is the second offset matrix, a square matrix with CF rows and columns;

[0041] Module M6 is used to: obtain K max pooling values ​​from the matching matrix Sm through max pooling, and then input the K max pooling values ​​into the multilayer perceptron for classification. The semantic matching result of the first and second texts input is the classification result of the multilayer perceptron.

[0042] In the above modules, the first weight matrix M1, the second weight matrix M2, and the first offset matrix... b 1. Second offset matrix b 2 represents model data, determined through sample training.

[0043] According to a machine-readable medium of the present invention, the medium stores a set of machine-readable program instructions. When the set of program instructions stored in the medium is read and executed by a machine, the above-mentioned text semantic matching method can be realized.

[0044] An electronic device according to the present invention includes a processor and a memory connected together; the memory stores a set of program instructions, and when the set of program instructions stored in the memory is loaded and executed by the processor, the above-mentioned text semantic matching method can be implemented.

[0045] The technical effects of this invention are as follows: This invention combines a representation-based algorithm model and an interaction-based algorithm model, taking into account both the focus of the meaning and the comparison of the global text. Attached Figure Description

[0046] Figure 1 This is a flow graph of the algorithm model of the text semantic matching method of the present invention.

[0047] Figure 2 This is a structural diagram of the electronic device involved in the method of the present invention. Detailed Implementation

[0048] The present invention will now be described in further detail with reference to the accompanying drawings.

[0049] The text semantic matching method of the present invention is a process that is automatically implemented by an electronic device. Figure 2 An example is provided of an electronic device for implementing the text semantic matching method. The electronic device includes a connected processor 100 and a machine-readable medium 200. The machine-readable medium 200 stores a set of program instructions, which, when loaded and executed by the processor 100, implement the text semantic matching method of the present invention.

[0050] The text semantic matching method of this invention is a machine learning-based approach, comprising a model step, a model training step, and a text actual matching step. In the model training step, a training sample dataset is input into the model step for model computation. The model computation result is compared with the actual result, and the model data is adjusted based on the calculated loss function. This process of continuous training and model data adjustment continues until the loss function value stabilizes to an acceptable level, at which point the final model data is output. Here, the training sample dataset is a set of training samples; the training samples include two texts used for text semantic matching and the actual matching results of these two texts. The text actual matching step involves performing text semantic matching on the two input texts using the final model data through the model step, and outputting the matching result. In the above steps, both the model training step and the text actual matching step are based on the model step, and their key lies in the model step. The technical means of the model training step and the text actual matching step, apart from their key model step, are familiar to those skilled in the art and will not be described in detail here.

[0051] Reference Figure 1 The model steps of this invention include a data receiving step, a part-of-speech extraction step, an interaction fusion step, a representation extraction step, and a matching output step.

[0052] The data receiving step, also known as step S1 mentioned above, involves acquiring the dictionary part-of-speech (POS) matrix data and receiving the first and second input texts. This step indicates that the input of this invention consists of two texts to be matched and the dictionary POS matrix data. The dictionary POS matrix data includes the dictionary and the POS feature vector of each word in the dictionary. The POS feature vectors of each word in the dictionary form the POS matrix.

[0053] The part-of-speech extraction step, also known as step S2 mentioned above, involves segmenting the first and second texts into words. Based on the segmented words, the part-of-speech feature vectors of the corresponding words are extracted from the word part-of-speech matrix data. Then, zero-feature imputation is used to expand the text part-of-speech feature matrices T1 and T2 of CM×CT, respectively. This step can be specifically divided into the following three steps:

[0054] Step S21: Segment the first text and the second text into words, thereby obtaining the word set of the first text and the word set of the second text. Word segmentation is performed using a word segmenter. Word segmenters are familiar to those skilled in the art and will not be described in detail. The number of words in the word set of the first text and the word set of the second text are C1 and C2, respectively.

[0055] Step S22: Based on the word set of the first text and the word set of the second text, extract the part-of-speech feature vectors of the corresponding words from the word part-of-speech matrix data, and form the word part-of-speech feature matrix of the first text and the word part-of-speech feature matrix of the second text, respectively. The word part-of-speech feature matrix of the first text and the word part-of-speech feature matrix of the second text are C1×CT and C2×CT matrices, respectively. Each row of the matrix corresponds to the part-of-speech feature vector of a word from the dictionary part-of-speech matrix data.

[0056] Step S23: The part-of-speech (POS) feature matrices of the first and second texts are expanded with zero-feature padding to obtain CM×CT text POS feature matrices T1 and T2. In text POS feature matrix T1, rows 1 to C1 contain the data from the original first text's POS feature matrix, i.e., the POS feature vectors extracted from the words obtained from word segmentation in the first text. Rows C1+1 to CM contain zero-feature padding data. In text POS feature matrix T2, rows 1 to C2 contain the data from the original second text's POS feature matrix, i.e., the POS feature vectors extracted from the words obtained from word segmentation in the second text. Rows C2+1 to CM contain zero-feature padding data. Here, zero-feature padding data means that each element value of the corresponding POS feature vector is filled with zeros. CM is a pre-set maximum acceptable number of text segments, and CM is not less than C1 and C2.

[0057] The interactive fusion step, also known as step S3 mentioned above, calculates the text fusion output matrices A1 and A2 based on the text part-of-speech feature matrices T1 and T2. The text fusion output matrices A1 and A2 are calculated using the following formulas:

[0058] ,

[0059] ;

[0060] in,

[0061] e is the natural constant;

[0062] , , and , and , , , and These are respectively represented as elements in matrices A1, A2, T1, T2, and R. The subscript value indicates the row number of the element in the matrix, and the value in parentheses indicates the column number of the element in the matrix.

[0063] Matrix R is the interactive matrix, a square matrix with CM rows and columns, obtained by the following formula:

[0064] ;in,

[0065] Represented as the transpose of matrix T2;

[0066] M1 is the first weight matrix, a square matrix with CT rows and columns;

[0067] b1 is the first offset matrix, a square matrix with CM rows and columns.

[0068] Interactive integration steps, refer to Figure 1 The process can be divided into two steps: the interaction step and the fusion step. The interaction step is the aforementioned step of calculating the interaction matrix R. The fusion step is the step of calculating the text fusion output matrix A1 and the text fusion output matrix A2 based on the interaction matrix R.

[0069] The formula for calculating the text fusion output matrix A1 can be broken down as follows:

[0070] ;in, It is the element in the i-th row and j-th column of the text fusion output matrix A1. It is the element in the i-th row and j-th column of the text part-of-speech feature matrix T1. It is the i-th element of vector P1; i takes values ​​from 1 to CM, and j takes values ​​from 1 to CT; vector P1 is a vector with dimension CM formed by summing the columns of matrix R1; that is:

[0071] ;in, It is the element in the y-th row and i-th column of matrix R1; matrix R1 is a CM×CT matrix obtained by multiplying matrix σ1 and matrix T2, that is:

[0072] ;in, It is the element in the y-th row and t-th column of matrix σ1. It is the element in the t-th row and i-th column of matrix T2; matrix σ1 is a square matrix with CM rows and columns, obtained by calculating the softmax function on matrix R column by column, that is,

[0073] ;in, It is the element in the y-th row and t-th column of matrix R. It is the element in the k-th row and t-th column of matrix R.

[0074] In the above decomposition formula, , ,as well as After replacing them one by one, we can obtain the calculation formula for the text fusion output matrix A1, which takes matrices T1, T2, and R as input:

[0075] .

[0076] The formula for calculating the text fusion output matrix A2 can be broken down as follows:

[0077] ;in, It is the element in the i-th row and j-th column of the text fusion output matrix A2. It is the element in the i-th row and j-th column of the text part-of-speech feature matrix T2. It is the i-th element of vector P2, where i takes values ​​from 1 to CM and j takes values ​​from 1 to CT; vector P2 is the vector with dimension CM formed by summing the rows of matrix R2, which is:

[0078] ;in, It is the element in the i-th row and y-th column of matrix R2; matrix R2 is a CM×CT matrix obtained by multiplying matrix σ2 and matrix T1, that is:

[0079] ;in, It is the element in the i-th row and t-th column of matrix σ2. is the element in the t-th row and y-th column of matrix T1; matrix σ2 is a square matrix with CM rows and columns, obtained by calculating the softmax function of matrix R row by row, that is:

[0080] ;in, It is the element in the i-th row and t-th column of matrix R. It is the element in the i-th row and k-th column of matrix R.

[0081] In the above decomposition formula, , ,as well as After replacing them one by one, we can obtain the calculation formula for the text fusion output matrix A1, which takes matrices T1, T2, and R as input:

[0082] .

[0083] Furthermore, in the formula for calculating the interaction matrix R, both the first weight matrix M1 and the first offset matrix b1 are model data.

[0084] Based on the above calculation formula, the calculated text fusion output matrices A1 and A2 are both CM×CT matrices.

[0085] The representation extraction step, also known as step S4 above, uses a multi-angle long short-term memory neural network and two convolutional neural networks to extract features from the text fusion output matrices A1 and A2, respectively, to obtain the first representation matrix output by the multi-angle long short-term memory neural network and the two second representation matrices output by the two convolutional neural networks, which together form the text representation matrices B1 and B2.

[0086] Reference Figure 1 The two convolutional neural networks (CNNs) are labeled CNN_Core2 and CNN_Core3, indicating that they have 2 and 3 convolutional kernels, respectively. The feature extraction of the text fusion output matrices A1 and A2 by the two CNNs and the multi-angle long short-term memory (MLSM) neural network is performed in parallel. The first representation matrix and the two second representation matrices both have CF columns and CM, L1, and L2 rows, respectively. Specifically, the first representation matrix output by the MLSM is a CM×CF matrix; the second representation matrix output by the 2-kernel CNN is an L1×CF matrix, and the second representation matrix output by the 3-kernel CNN is an L2×CF matrix, and CM+L1+L2=CF. Therefore, the text representation matrices B1 and B2 obtained by concatenating the first representation matrix and the two second representation matrices are (CM+L1+L2)×CF numerical matrices; that is, the text representation matrices B1 and B2 are both CF×CF square matrices. Therefore, after the multi-angle long short-term memory neural network and the two convolutional neural networks extract features from the text fusion output matrix A1, a CF×CF text representation matrix B1 is obtained, consisting of a first representation matrix and two second representation matrices; after the multi-angle long short-term memory neural network and the two convolutional neural networks extract features from the text fusion output matrix A2, a CF×CF text representation matrix B2 is obtained, consisting of a first representation matrix and two second representation matrices.

[0087] The multi-angle long short-term memory neural network (MLMN) described here is a variant of the long short-term memory neural network. In a multi-angle MLMN, its output is obtained by weighted summation of the outputs of each time step of the long short-term memory neural networks it contains.

[0088] The matching output step, namely steps S5 and S6 mentioned above, firstly calculates the matching matrix Sm based on the text representation matrices B1 and B2. Then, the matching matrix Sm is pooled and input into a multilayer perceptron for classification. The classification result of the multilayer perceptron is used as the semantic matching result of the first and second texts. The matching output step can be specifically broken down into the following steps:

[0089] Step S5: Calculate the matching matrix Sm based on the text representation matrices B1 and B2;

[0090] Step S61: Perform pooling operation on the matching matrix Sm;

[0091] Step S62: Input the vector output by pooling into a multilayer perceptron for classification.

[0092] The steps S61 and S62 described above constitute the aforementioned step S6.

[0093] In step S5 above, the matching matrix Sm is calculated using the following formula:

[0094] ;in,

[0095] This is represented as the transpose of matrix B1;

[0096] M2 is the second weight matrix, a square matrix with CF rows and columns;

[0097] b2 is the second offset matrix, a square matrix with CF rows and columns.

[0098] The matching matrix Sm calculated using the above formula is a square matrix with CF rows and columns. The second weight matrix M2 and the second offset matrix b2 are both model data.

[0099] In step S61, the pooling operation performed on the matching matrix Sm uses K-max pooling. Specifically, in this invention, the matching matrix Sm is max-pooled to obtain K max-pooling values, and these K max-pooling values ​​form a pooling value vector of dimension K. This pooling value vector is the output vector of the pooling operation in step S62.

[0100] Furthermore, it should be noted that the model data for the model steps of this invention is randomly generated initially, optimized and adjusted through training, and output after training is completed. The model data includes the aforementioned first weight matrix M1 and first offset matrix b1, second weight matrix M2 and second offset matrix b2, as well as the weighting coefficients in the weighted summation of the output of the long short-term memory neural network at each time step in the multi-angle long short-term memory neural network.

[0101] Examples and Experimental Results

[0102] This embodiment is based on the aforementioned text semantic matching method, and its model steps are configured as follows:

[0103] The part-of-speech (POS) matrix data is derived from pre-trained Chinese word vectors from Wikipedia. Each word in this POS matrix contains a 100-dimensional POS feature vector, meaning the dimension CT of the POS feature vector is 100. The maximum acceptable number of text segments CM is preset to 30, i.e., CM=30.

[0104] In this embodiment, the Long Short-Term Memory Neural Network, Convolutional Neural Network, and Multilayer Perceptron are based on the open-source artificial neural network library Keras. The number of columns CF in the first and second representation matrices is 50. The number of rows L1 and L2 in both second representation matrices is 10, which means that the horizontal stride of the two convolutional neural networks is 2 and the vertical stride is 3. Therefore, the text representation matrices B1 and B2 are 50×50 square matrices.

[0105] The multilayer perceptron employs a three-layer design, with the last layer having an output dimension of 4. After calculation using the softmax function, it outputs classification values ​​of 0, 1, 2, and 3, where:

[0106] 0: Indicates no match; the first and second texts do not match semantically.

[0107] 1: Indicates a matching agreement, meaning the first and second texts have the same meaning;

[0108] 2: Question-answer matching, meaning the second text is the answer to the question in the first text;

[0109] 3: Question-answer matching, which means that the first text is the answer to the question in the second text.

[0110] The experimental dataset for this embodiment comes from WeBank's public dataset CCKS 2018. This dataset contains over 100,000 text pairs, each of which may consist of two synonymous texts or a question-and-answer text. In this embodiment, 1000 text pairs were randomly selected as the test sample dataset, and the remaining text pairs were used as the training sample dataset. The final experimental results show an accuracy rate of 77.75%.

Claims

1. A text semantic matching method, characterized in that, The modeling steps include the following steps: Step S1: Obtain the dictionary part-of-speech matrix data and receive the input first text and second text; the dictionary part-of-speech matrix data includes the dictionary and the part-of-speech feature vector of each word in the dictionary; Step S2: Segment the first text and the second text respectively. Extract the part-of-speech feature vectors of the corresponding words from the word part-of-speech matrix data based on the segmented words. Then, expand them with zero feature padding to obtain text part-of-speech feature matrices T1 and T2 of CM×CT respectively. In text part-of-speech feature matrix T1, rows 1 to C1 are the part-of-speech feature vectors extracted from the words obtained from the segmentation of the first text, and rows C1+1 to CM are formed by zero feature padding expansion. In text part-of-speech feature matrix T2, rows 1 to C2 are the part-of-speech feature vectors extracted from the words obtained from the segmentation of the second text, and rows C2+1 to CM are formed by zero feature padding expansion. C1 and C2 are the number of words obtained from the segmentation of the first text and the second text respectively. CT is the dimension of the part-of-speech feature vector. CM is the pre-set maximum number of text segments, and CM is not less than C1 and C2. Step S3: Based on the text part-of-speech feature matrices T1 and T2, calculate the text fusion output matrices A1 and A2 using the following formulas: , ; in, ;in, , , and , and , , , and These are respectively represented as elements in matrices A1, A2, T1, T2, and R. The subscript value indicates the row number of the element in the matrix, and the value in parentheses indicates the column number of the element in the matrix. Represented as the transpose of matrix T2; e is the natural constant; M1 is the first weight matrix, a square matrix with CT rows and columns; b1 is the first offset matrix, a square matrix with CM rows and columns; Step S4: Use a multi-angle long short-term memory neural network and two convolutional neural networks to extract features from the text fusion output matrices A1 and A2, respectively, to obtain the first representation matrix output by the multi-angle long short-term memory neural network and the two second representation matrices output by the two convolutional neural networks, forming text representation matrices B1 and B2, respectively; the convolution kernels of the two convolutional neural networks are 2 and 3, respectively; wherein the number of columns in the first representation matrix and the two second representation matrices is CF, and the number of rows is CM, L1, L2, respectively; wherein CM + L1 + L2 = CF; text representation matrices B1 and B2 are both square matrices with CF rows and columns; Step S5: Based on the text representation matrices B1 and B2, calculate the matching matrix Sm using the following formula: ;in, This is represented as the transpose of matrix B1; M2 is the second weight matrix, a square matrix with CF rows and columns; b2 is the second offset matrix, a square matrix with CF rows and columns; Step S6: Obtain K max pooling values ​​from the matching matrix Sm through max pooling, and then input the K max pooling values ​​into the multilayer perceptron for classification. The semantic matching result of the first and second texts input is the classification result of the multilayer perceptron. In the above steps, the first weight matrix M1, the second weight matrix M2, the first offset matrix b1, and the second offset matrix b2 are model data, determined through sample training.

2. A text semantic matching device, characterized in that, Includes a model module; the model module includes the following modules: Module M1 is used to: acquire dictionary part-of-speech matrix data and receive input first text and second text; the dictionary part-of-speech matrix data includes the dictionary and the part-of-speech feature vector of each word in the dictionary; Module M2 is used to: segment the first text and the second text into words respectively; extract the part-of-speech feature vectors of the corresponding words from the word part-of-speech matrix data based on the segmented words; and then expand them by zero-feature padding to obtain text part-of-speech feature matrices T1 and T2 of CM×CT respectively; in text part-of-speech feature matrix T1, rows 1 to C1 are the part-of-speech feature vectors extracted from the words obtained from the segmentation of the first text, and rows C1+1 to CM are formed by zero-feature padding expansion; in text part-of-speech feature matrix T2, rows 1 to C2 are the part-of-speech feature vectors extracted from the words obtained from the segmentation of the second text, and rows C2+1 to CM are formed by zero-feature padding expansion; C1 and C2 are the number of words obtained from the segmentation of the first text and the second text respectively; CT is the dimension of the part-of-speech feature vector; CM is the pre-set maximum number of text segments, and CM is not less than C1, C2 and CT; Module M3 is used to calculate the text fusion output matrices A1 and A2 based on the text part-of-speech feature matrices T1 and T2 using the following formula: , ; in, ;in, , , and , and , , , and These are respectively represented as elements in matrices A1, A2, T1, T2, and R. The subscript value indicates the row number of the element in the matrix, and the value in parentheses indicates the column number of the element in the matrix. Represented as the transpose of matrix T2; e is the natural constant; M1 is the first weight matrix, a square matrix with CT rows and columns; b1 is the first offset matrix, a square matrix with CM rows and columns; Module M4 is used to: extract features from the text fusion output matrices A1 and A2 using a multi-angle long short-term memory neural network and two convolutional neural networks, respectively, to obtain the first representation matrix output by the multi-angle long short-term memory neural network and the two second representation matrices output by the two convolutional neural networks, which form text representation matrices B1 and B2, respectively; the convolution kernels of the two convolutional neural networks are 2 and 3, respectively; wherein the number of columns in the first representation matrix and the two second representation matrices is CF, and the number of rows are CM, L1, L2, respectively; wherein CM + L1 + L2 = CF; text representation matrices B1 and B2 are both square matrices with CF rows and columns; Module M5 is used to calculate the matching matrix Sm based on the text representation matrices B1 and B2 using the following formula: ;in, This is represented as the transpose of matrix B1; M2 is the second weight matrix, a square matrix with CF rows and columns; b2 is the second offset matrix, a square matrix with CF rows and columns; Module M6 is used to: obtain K max pooling values ​​from the matching matrix Sm through max pooling, and then input the K max pooling values ​​into the multilayer perceptron for classification. The semantic matching result of the first and second texts input is the classification result of the multilayer perceptron. In the above modules, the first weight matrix M1, the second weight matrix M2, and the first offset matrix... b 1. Second offset matrix b 2 represents model data, determined through sample training.

3. A machine-readable medium storing a machine-readable program instruction set, characterized in that, When the program instruction set stored in the medium is read and executed by the machine, the text semantic matching method as described in claim 1 can be implemented.

4. An electronic device comprising a processor and a memory connected together; the memory storing a program instruction set, characterized in that, When the program instruction set stored in the memory is loaded and executed by the processor, the text semantic matching method as described in claim 1 can be implemented.