A full-cross visual angle text matching method and a storage medium

By employing a multi-representation convolutional fully cross-perspective text matching method, the problems of insufficient semantic information within the text and weak interactive matching strength are solved, thereby improving the accuracy of Chinese text matching and enhancing the semantic interaction capabilities between texts.

CN116933095BActive Publication Date: 2026-03-27THE 54TH RESEARCH INSTITUTE OF CHINA ELECTRONICS TECHNOLOGY GROUP CORPORATION +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-16
Publication Date
2026-03-27

Smart Images

  • Figure CN116933095B_ABST
    Figure CN116933095B_ABST
Patent Text Reader

Abstract

The application discloses a full-cross visual angle text matching method, which comprises the following steps: firstly, five semantic division modes, i.e., character mode, accurate mode, full mode, search engine mode and Paddle mode, are used to extract three text granularity information, i.e., characters, words and associated phrases, in the text; the division result of each division mode is a representation of the text; the five representations of the text are initially coded; and the context semantic information in the coding is preliminarily extracted by using a bidirectional gate recurrent unit. Then, the initial coding vectors under the five representations are reconstructed into a high-dimensional coding matrix, and the feature information in the high-dimensional matrix is deeply mined by using a convolutional neural network, so that the multi-representation semantic of the text is effectively captured, and the information interaction between the representations is improved. Finally, the multi-representation convolution matrices of two texts are cross-cosine matched by using a full-cross visual angle matching mode, the matching strength of the multi-representation information is strengthened, and the accuracy of the text matching task is improved as a whole.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of Chinese semantic matching, and particularly relates to a multi-representation convolution full-cross-view text matching method and a storage medium. BACKGROUND

[0002] The core of the Chinese text matching task is to mine the deep semantic information inside the text, to explore the semantic similarity and difference relationship between different texts, and to analyze the semantic similarity between two texts to be matched, which is of great significance to the effective recognition and understanding of human language semantics by machines. The research on text matching can be applied to language translation, information retrieval, intelligent question answering, and semantic recognition, etc. In related researches, there are problems such as insufficient extraction of potential semantic information inside the text, weak information interaction matching between texts, and insufficient capture of deep relationship between different sentences, which affect the accuracy of the text matching task. SUMMARY

[0003] In order to solve the problems of single text representation, insufficient capture of potential semantic information of the text, and weak interaction matching of the encoded features, the present application provides a multi-representation convolution full-cross-view text matching method to improve the accuracy of the text matching task.

[0004] Firstly, five semantic division modes of character mode, accurate mode, full mode, search engine mode and Paddle mode in the word segmentation technology are used to extract three text granularity information of characters, words and associated phrases in the text. The division result of each division mode is a representation of the text. The initial encoding is carried out for the five representations of the text, and the context semantic information in the encoding is preliminarily extracted by using the bidirectional gate recurrent unit. Then, the initial encoding vectors under the five representations are reconstructed into a high-dimensional encoding matrix, and the feature information in the high-dimensional matrix is deeply mined by using the convolutional neural network, so as to effectively capture the multi-representation semantic information of the text and improve the information interaction between the representations. Finally, the multi-representation convolution matrix of the two texts is cross-cosine matched by using the full-cross-view matching mode, the matching strength of the multi-representation information is strengthened, and the accuracy of the text matching task is improved as a whole.

[0005] The full-cross-view text matching method provided by the present application mainly includes the following steps:

[0006] (1) Firstly, four semantic segmentation modes of accurate mode, full mode, Paddle mode and search engine mode in the Jieba word segmentation technology are used to divide the text to generate four representations of the text. On the basis of the four representations, a more fine-grained pure character division mode is added, which directly divides the characters in the text sequence. The word segmentation results under the five representations include three granularity information of character level, word level and associated phrase.

[0007] (2) Five representations of the text S1, S2 are divided by character mode, precision mode, full mode, Paddle mode and search engine mode, represented by c, p, f, pa and s respectively. The Word2Vec word vector technology is used to preliminarily encode each representation to obtain cw, pw, fw, paw and sw. The encoding result of each representation is a [30*300] dimensional feature vector matrix, representing the initial encoding result of each representation.

[0008] (3) The bidirectional gate recurrent unit is used to preliminarily extract the upper and lower semantic information in the five initial encoding vectors cw, pw, fw, paw and sw, respectively, to produce five 30*600 dimensional feature matrices. The five 30*600 feature matrices are reconstructed into a 5*18000 dimensional feature matrix. The text S1, S2 respectively produces its own 5*18000 dimensional feature matrix g s1 , g s2 after calculation, and then a convolution calculation layer conforming to the data characteristics of g s1 , g s2 is constructed.

[0009] (4) In the convolution calculation process for the text, the Conv1D convolution structure regards each 1*18000 dimensional feature vector in the feature matrix as a representation matrix, and Conv1D performs convolution calculation on the five representation matrices. The text S1, S2 respectively obtains the convolution vectors X, Y of the corresponding multi-representation feature matrix, which are both 4*300 dimensional feature matrices.

[0010] (5) X is represented by the sequence [x1, x2, x3, …, x n ], and Y is represented by the sequence [y1, y2, y3, …, y n ], where x i , y i represents a feature vector with a length of 300. The multi-angle calculation and matching of x i and y k is performed by using the function f m , and the calculation formula of f m is f cos (x i , y k ) e =Cosine(W e ·x i , W e ·y k ), i, k ∈ 1, 2, 3, …, n; wherein: W is a trainable weight matrix with g*h dimensions, W e is the e-th row feature vector in the weight matrix W, and f cos (xi y k ) e x i y k Cosine is a cosine similarity calculation function of two feature vectors.

[0011] (6) The depth cosine matching calculation of full cross view angle is performed on two feature matrices X and Y, and two matching vectors V x and V y are obtained, and the calculation formulas are V x =f cos (x i →y k ; W x ) and V y =f cos (y k →x i ; W y ), respectively, i, k ∈ 1, 2, 3, …, n; wherein W x and W y are trainable weight matrices when x i →y k and y k →x i matching are performed. The two matching vectors V x and V y are connected into a vector V xy , and the BiLSTM is used to internally fuse the vector V xy to generate a final vector representation V.

[0012] (7) The vector V passes through the MLP Layer1 and MLP Layer2 layers with 600 neurons in sequence to obtain R L1 and R L2 , the R L2 passes through the MLP Layer3 layer with one neuron to obtain R L3 , the output value of the single neuron of the MLP Layer3 layer is activated by using the activation function Sigmoid to obtain R s , and finally the semantic matching result R of the texts S1 and S2 is calculated through R s .

[0013] The application also provides a non-transitory computer readable storage medium having a computer program stored thereon, and the computer program is executed by a processor to implement the steps of the full cross view angle text matching method.

[0014] The technical features and beneficial effects of the application are as follows:

[0015] The application provides a full-cross-view matching model based on multi-representation convolution, which comprises three core modules of multi-representation initial coding structure, multi-representation convolution structure and full-cross-view matching structure. The model firstly completes initial coding of multi-representation semantics by multi-mode division combined with Word2Vec technology. Then, the bidirectional gate recurrent unit is used to preliminarily extract context semantic information, and the convolutional neural network is used to capture semantic information in the high-dimensional feature matrix, so as to improve the capturing ability of multi-representation text semantic information and enrich the semantic expression of the feature vector. Finally, the cosine matching of full-cross-view is carried out for the feature matrices of two texts, the BiLSTM is used to complete the fusion of matching vectors, the semantic interaction degree between the two texts is strengthened, and then the accuracy of the text matching task is overall improved. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 It is a model overall structure in the application;

[0017] Figure 2 It is a multi-representation initial coding structure in the application;

[0018] Figure 3 It is a multi-representation semantic convolution structure in the application;

[0019] Figure 4 It is a full-cross-view matching structure in the application. DETAILED DESCRIPTION

[0020] The application will be further described in detail below, so as to fully understand the technical scheme of the application.

[0021] (1) Model overall structure in the application

[0022] The model overall structure in the application is shown in Figure 1 The model adopts multi-mode word segmentation technology combined with Word2Vec word vector technology to complete initial coding of multi-representation information of the text, uses CNN convolution to capture multi-representation semantic information of the text, and enhances the interaction degree of semantic features between two texts through full-cross-view matching. Overall, the full-cross-view matching model based on multi-representation convolution comprises four core modules of multi-representation initial coding structure, multi-representation convolution structure, full-cross-view matching structure and MLP layer structure.

[0023] (2) Multi-representation initial coding structure

[0024] This structure first generates four representations of texts S1 and S2 using the four semantic segmentation modes in Jieba segmentation technology, namely the Precise Mode, the Full Mode, the Search Mode, and the Paddle Mode. Based on these four representations, a finer-grained pure character segmentation mode is added. In this mode, the text sequence is directly segmented between characters, resulting in a segmentation result at the pure character granularity. Taking the text "China's electronic technology is developing forward at a rapid pace" as an example, the segmentation results of the four segmentation modes of Jieba segmentation and the character segmentation mode are shown in Table 1.

[0025] Table 1 Segmentation results of five modes

[0026]

[0027] The word segmentation results under the five representations include three granularity features: character level, word level, and associated phrase level. In the text "China's electronic technology is developing forward at a rapid pace", the granularity summary covered by the five representations is shown in Table 2.

[0028] Table 2 Granularity summary of segmentation

[0029]

[0030] The multi-representation information initial encoding structure of texts S1 and S2 first generates the multi-representation information in the text, and then constructs feature vector matrices for the multi-representation information of texts S1 and S2 respectively. At this stage, the initial encoding of texts S1 and S2 is carried out independently, and there is no information interaction between texts. The multi-representation encoding process is as Figure 2 shown. The five representations of text S1 / S2 are represented by c, p, f, pa, and s respectively. The Word2Vec word vector technology is used to preliminarily encode each representation to obtain cw, pw, fw, paw, and sw. The encoding result of each representation is a 30*300-dimensional feature vector matrix.

[0031] (3) Multi-representation semantic convolution structure

[0032] The multi-representation convolution structure is as Figure 3 shown. First, the bidirectional gated recurrent unit is used to preliminarily extract the upper and lower semantic information in the five initial encoding vectors cw, pw, fw, paw, and sw respectively, generating 5 30*600-dimensional feature matrices. The 5 30*600 feature matrices are overall reconstructed into a 5*18000-dimensional feature matrix. Texts S1 and S2 respectively generate their own 5*18000-dimensional feature matrices g s1 、g s2 , and then construct to conform to g s1 、gs2 Convolutional computation layer of data features. In Figure 3 The convolutional computation layer structure contains two core convolutional layers. The Conv1D convolution kernel size of each convolutional layer is 2, the fixed width of the convolution kernel is 18000, and the number of convolution kernels is 300. The convolution computation method is shown in formula (1).

[0033]

[0034] where g i1 g i2 … g in represents the feature vector representation of the i-th representation, where i = 1, 2, 3, 4, 5, and n = 18000. represents the j-th convolution kernel matrix, where j = 1, 2, 3, …, 300. The sequence x h1 x h2 … x hk represents the product result of the h-th and h+1-th representation vectors and the 300 two-dimensional convolution matrix, where h = 4 and k = 300.

[0035] Texts S1 and S2 independently pass through the multi-representation feature initial encoding structure and the multi-representation convolution structure to obtain their respective multi-representation convolution vectors X and Y, which are both 4*300-dimensional feature matrices containing multi-representation convolution semantic information within the text sequence and have strong semantic expression ability.

[0036] (4) Full cross-view angle matching structure

[0037] The full cross-view angle matching structure is a deep cross-view angle matching computation of the multi-representation convolution feature vectors X and Y of the two texts, which is used to enhance the representation ability of the feature vectors for the semantic similarity and difference relationship between the two texts, and finally produces a multi-representation convolution interaction matching vector representation. The full cross-view angle semantic matching structure is shown in Figure 4 The full cross-view angle semantic matching structure receives two convolution feature vectors X and Y, which are two multi-dimensional feature matrices. In the full cross-view angle matching layer, each dimension feature vector in the multi-dimensional feature matrix X is calculated with the weighted matching value of each dimension feature vector in Y through the function f cos . X is represented by the sequence [x1, x2, x3, …, x n ], and Y is represented by the sequence [y1, y2, y3, …, y n ], where x i , y i represents a feature vector with a length of 300. x i performs cosine similarity calculation with each feature vector z in the sequence [y1, y2, y3, …, y n ]. fcos To compute the cosine matching function, for two feature vectors x i With y k Perform multi-angle calculation matching, and the calculation formula is shown in (2).

[0038] f cos (x i ,y k ) e =Cosine(W e ·x i W e ·y k (2);

[0039] Where W is a g*h dimensional trainable weight matrix, W e f is the eigenvector of the e-th row in the weight matrix W. cos (x i ,y k ) e That is, x i With y k The cosine matching value of the e-th viewpoint. Cosine is the cosine similarity calculation function of two feature vectors, and the calculation formula is shown in (3), where a and b are two feature vectors of h dimensions.

[0040]

[0041] In the matching layer, two sequences [x1,x2,x3,…,x] n ]、[y1,y2,y3,…,y n Perform cross-matching from two perspectives to obtain two cosine matching vectors V. x V y The formulas are described as shown in (4) and (5).

[0042] V x =f cos (x i →y k W x (i,k∈1,2,3,…n) (4);

[0043] V y =f cos (y k →x i W y (i,k∈1,2,3,…n) (5);

[0044] Among them W x W y In x respectively i →y k yk → x i Trainable weight matrix when matching. V x , V y Two feature vectors contain the deep interaction information between two sequences X, Y. Two matching vectors V x , V y are concatenated into a vector V xy , and the vector V xy is internally fused by BiLSTM to generate the final vector representation V, as shown in equations (6) and (7).

[0045] V xy = Concat ([V x , V y ]) (6);

[0046] V = BiLSTM (V xy ) (7);

[0047] The vector V generated by the multi-representation feature convolution and the full cross-view semantic matching structure not only contains the multi-representation semantic information of the two text sequences, but also embeds the deep interaction information of the two text sequences, so the vector V has strong representation ability for the semantic matching information between the two texts.

[0048] (5) MLP structure

[0049] For the vector V output by the full cross-view semantic matching structure, an MLP fully connected neural network is used to train and calculate the final semantic similarity matching result. The MLP fully connected neural network structure includes three fully connected layers: MLP Layer1, MLP Layer2, and MLP Layer3, and one Sigmoid activation layer. The calculation formula after the vector V is input into the MLP structure is shown in equation (8).

[0050]

[0051] where the vector V first passes through the MLP Layer1 and MLP Layer2 layers with 600 neurons to obtain R L1 , R L2 , and R L2 passes through the MLP Layer3 layer with one neuron to obtain R L3 , and the output value of the single neuron of the MLP Layer3 layer is activated by the activation function Sigmoid to obtain R s , and finally the semantic matching result R of the texts S1 and S2 is calculated by R s , as shown in equation (9). Where R = 0 represents text semantic mismatch, and R = 1 represents text semantic match.

[0052]

Claims

1. A full cross-view text matching method, characterized in that, The method comprises the following steps: (1) The text is divided by using the accurate mode, full mode, paddle mode and search engine mode in the Jieba word segmentation technology to generate four representations of the text S1 and S2; a more fine-grained pure character division mode is added on the basis of the four representations to generate five text representations; (2) The five representations of the text S1 and S2 are divided by using the character division mode, the accurate mode, the full mode, the paddle mode and the search engine mode, and are respectively represented by c, p, f, pa and s; the Word2Vec word vector technology is used to preliminarily encode each representation to obtain five initial encoding vectors cw, pw, fw, paw and sw; the encoding result of each representation is a feature vector matrix with a dimension of [30*300]; (3) using bidirectional gate cycle control unit to preliminarily extract the upper and lower semantic information in the five initial encoding vectors cw, pw, fw, paw, sw respectively, to generate five 30*600 dimensional feature matrices, and to reconstruct the five 30*600 feature matrices into a 5*18000 dimensional feature matrix; the text S1, S2 respectively generates a 5*18000 dimensional feature matrix g s1 、 s2 , then a convolution calculation layer conforming to the data characteristics of g s1 、 s2 is constructed; (4) The Conv1D convolution structure is adopted to regard each 1*18000-dimensional feature vector in the feature matrix as a representation matrix; the Conv1D performs convolution calculation on the five representation matrices; the text S1 and S2 respectively obtain the convolution vectors X and Y of the respective corresponding multi-representation feature matrices, which are both feature matrices with a dimension of 4*300; (5) X, Y are represented by sequences [x1, x2, x3, …, x n ] and [y1, y2, y3, …, y n ] respectively, wherein x i , y i represent a feature vector with a length of 300 respectively; multi-angle calculation matching is performed on x i and y k using a function f m , and the calculation formula of f m is f cos (x i , y k ) e = Cosine (W e ·x i , W e ·y k ), i, k ∈ 1, 2, 3, …, n; wherein: W is a trainable weight matrix with g*h dimensions, W e is the e-th row feature vector in the weight matrix W, f cos (x i , y k ) e is the cosine matching value of the e-th view angle of x i and y k , and Cosine is a cosine similarity calculation function of two feature vectors; (6) Perform depth cosine matching calculation for X and Y with full cross-view perspective to obtain two matching vectors V. x V y The calculation formulas are V x =f cos (x i →y k W x ) and V y =f cos (y k →x i W y ), i,k∈1,2,3,…,n; where W x W y In x respectively i →y k y k →x i The trainable weight matrix for matching; the two matching vectors V x V y Connect as vector V xy Using BiLSTM to transform vector V xy Internal deep fusion produces the final vector representation V; (7) The vector V passes through the MLPLayer1 layer with 600 neurons, the MLPLayer2 layer in succession to obtain R L1 , R L2 , R L2 passes through the MLPLayer3 layer with one neuron to obtain R L3 , and the output value of the single neuron of the MLPLayer3 layer is activated by using the activation function Sigmoid to obtain R s , and finally the semantic matching result R of the texts S1 and S2 is calculated through R s .

2. A non-transitory computer readable storage medium having stored thereon a computer program, which, when executed by a processor, implements the steps of the full cross-view text matching method according to claim 1.

Citation Information

Patent Citations

  • Document retrieval method under input containing error information scene

    CN116226357A

  • Unsupervised hashing method for cross-modal video-text retrieval with clip

    WO2023004206A1