A text matching method based on data augmentation and graph matching network

By combining dependency syntactic analysis and graph matching networks, the problems of syntactic structure differences and insufficient data in question text matching are solved, achieving more accurate question semantic matching and model robustness.

CN115510841BActive Publication Date: 2025-09-30WUHAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211131717.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-16
Publication Date
2025-09-30
Estimated Expiration
2042-09-16

AI Technical Summary

Technical Problem

Existing question-text matching models are not effective in handling semantic differences caused by differences in syntactic structure, and insufficient datasets make the models ineffective in real-world scenarios.

Method used

A method based on data augmentation and graph matching network is adopted. The graph is constructed through dependency syntactic analysis, the syntactic structure is learned in combination with the attention mechanism, and the graph matching network is used to predict the similarity between graph-level representation vectors.

Benefits of technology

It improves the robustness and matching effect of the question-sentence matching task, surpassing the performance of existing baseline models on the BUSTM and LCQMC datasets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115510841B_ABST
    Figure CN115510841B_ABST
Patent Text Reader

Abstract

The present invention discloses a text matching method based on data enhancement and graph matching network, which introduces dependency syntactic analysis to establish dependency relationships between text semantic units. The self-attention mechanism is used to make the model focus on core semantic units. Through the graph matching network, a connection is established between any words in two texts, and full interaction is carried out through the attention mechanism to better grasp the semantic focus and learn the similarity between texts. Data enhancement of question matching datasets is achieved from the granularity of words and sentences. The design of entity replacement algorithm, synonym replacement and random insertion algorithm, word noise enhancement algorithm and back translation algorithm improves the diversity of the dataset and solves the problem of insufficient corpus. The present invention combines dependency syntactic analysis with graph matching network, surpasses multiple current baseline models on question text datasets, and the proposed data enhancement algorithm for question matching can effectively improve the robustness and matching effect of the model on question matching tasks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of natural language processing and relates to a text matching method, and in particular to a question text semantic matching method based on data enhancement and a graph matching network. Background Art

[0002] A vast amount of knowledge has accumulated online, often in the form of questions and answers. With the continuous growth of internet users, question-and-answer services are no longer limited to websites, but have a wider range of applications. Understanding users' true intentions, selecting more accurate and high-quality answers from a vast database of questions and answers, and achieving accurate matching of question text to results are crucial for question-and-answer communities.

[0003] Question text matching is a fundamental natural language processing task, falling within the scope of text matching. It has been widely used in fields such as information retrieval and community question answering. Since its inception, new solutions have been continuously proposed. Traditional matching models based on manually constructed features use methods such as TF-IDF and BM25 to calculate shallow correlations between question texts, ignoring the deeper semantic information of the text. With breakthrough advances in deep learning, some researchers have begun to explore using deep learning methods to solve the question text matching problem. However, existing methods are primarily based on convolutional neural networks and recurrent neural networks. Convolutional neural networks can only extract local features, while recurrent neural networks suffer from long-term dependency issues and cannot capture dependencies between arbitrary words, resulting in limited model performance. Furthermore, existing datasets lack sufficient and diverse samples, making it difficult for some models that perform well on these datasets to achieve the same results in real-world scenarios.

[0004] Semantic matching is a widely used core technology in natural language processing. Information retrieval, question-answering systems, and dialogue systems can all be abstracted to a certain extent as semantic matching tasks. Therefore, it has been a research focus in academia, with numerous methods proposed, including those based on artificial features and deep learning. Deep learning-based methods can be further categorized as representational and interactive. In recent years, researchers have focused primarily on deep learning-based methods. Representative representational methods, such as DSSM, CDSSM, MV-LSTM, and Sentence-BERT, use deep learning models to generate high-dimensional dense vectors representing the semantics of the text to be matched. These methods then calculate the semantic similarity between texts by calculating cosine distance, Jaccard distance, and Euclidean distance between these vectors. Interactive methods, such as DeepMatch, ESIM, and RE2, differ from representational methods in that they tend to interact with texts earlier, extracting local matching features to express the global matching degree. However, existing models often ignore syntactic structure in question-sentence semantic matching, resulting in poor performance on texts with semantically distinct syntactic structures.

[0005] Graph neural networks have achieved excellent results in tasks such as text summarization, question-answering systems, and relationship extraction. Compared with convolutional neural networks and recurrent neural networks, graph neural networks can establish and capture the dependency relationships between any words and have stronger learning capabilities. Inspired by these works, the present invention first performs dependency syntactic analysis on the text, constructs a dependency graph between the semantic units of the sentences, and combines the attention mechanism to guide the model to learn the contribution of different types of dependency relationships in the syntactic structure to the semantic information and matching results, giving greater attention to key syntactic components, reducing the interference of redundant information, and using a graph matching network to learn the similarity between graphs. Summary of the Invention

[0006] The goal of this paper is to develop a more accurate question semantic matching model and a data augmentation method to improve the robustness of the model, based on the BUSTM and LCQMC question text matching datasets. To achieve this goal, this paper proposes a conversation text semantic matching method based on data augmentation and a graph matching network.

[0007] The technical solution adopted by the present invention is: a text matching method based on data enhancement and graph matching network, comprising the following steps:

[0008] Step 1: Identify and annotate the parts of speech and proper nouns of the two texts to be matched, and perform data augmentation on the two texts at the word and sentence levels.

[0009] Step 2: After data augmentation, the two pieces of text to be matched are context-encoded, the text is mapped into a semantic encoding representation, and a pooling operation is performed to obtain the word representation;

[0010] Step 3: Perform dependency syntactic analysis on the two texts to be matched, and obtain the dependency relationship graph between different semantic units in the text;

[0011] Step 4: On the dependency graph of the two texts to be matched, perform convolution operations on the neighborhood nodes of the graph nodes and assign different weights to the neighborhood nodes through the self-attention mechanism to obtain the message vector;

[0012] Step 5: Perform cross-graph information interaction between the message vector in step 4 and the dependency graph nodes of the reference text, and obtain a cross-graph information matching message vector through the attention mechanism;

[0013] Step 6: Use the message vector from step 4 and the cross-graph information matching message vector from step 5 to aggregate and update the nodes. After several rounds of message propagation and aggregate updates, the final representation of the graph nodes is obtained.

[0014] Step 7: The graph matching network predicts the similarity between graph-level representation vectors and obtains the matching results.

[0015] This paper combines dependency syntactic analysis with graph matching networks, surpassing multiple current baseline models on question text datasets. The proposed data augmentation algorithm for question matching can effectively improve the robustness and matching effect of the model on question matching tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flow chart of a method according to an embodiment of the present invention;

[0017] Figure 2 A block diagram of the method principle of an embodiment of the present invention;

[0018] Figure 3 This is an example diagram of question text matching according to an embodiment of the present invention;

[0019] Figure 4 This is an example diagram of dependency parsing according to an embodiment of the present invention;

[0020] Figure 5 Schematic diagram of FocalLoss parameter settings according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] In order to facilitate ordinary technicians in this field to understand and implement the present invention, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the implementation examples described herein are only used to illustrate and explain the present invention and are not used to limit the present invention.

[0022] Please see Figure 1 and Figure 2 The present invention provides a text matching method based on data enhancement and graph matching network, comprising the following steps:

[0023] Step 1: Identify and annotate the parts of speech and proper nouns of the two texts to be matched, and perform data augmentation on the two texts at the word and sentence levels.

[0024] In this embodiment, the named entity recognition method of BERT+BiLSTM-CRF is used to identify and annotate text parts of speech and proper nouns; the specific implementation includes the following steps:

[0025] (1) First, use BERT as an encoder to obtain the word embedding representation of the input text;

[0026] (2) Use BiLSTM to calculate the probability of the character output being each candidate label, and obtain the final sequence labeling result through the CRF layer.

[0027] In this embodiment, a text replacement and insertion method based on the masked prediction language model Bert-MLM and a word-granular noise enhancement method are used to perform data enhancement processing on the two text segments to be matched at the word-granularity.

[0028] The text replacement and insertion method based on the masked prediction language model includes the following steps:

[0029] (1) Sentence preprocessing;

[0030] First, the given text is segmented to obtain its segmentation results, which is achieved using the Jieba Chinese word segmentation tool; and the stop words are deleted, using the Harbin Institute of Technology stop word list as the screening basis.

[0031] (2) Random insertion and synonym replacement;

[0032] The words in the sentence are sorted by semantic importance, then traversed, and phrases with importance greater than a threshold are selected for replacement. The word is replaced with "[MASK]" (a label), and "[MASK]" is randomly inserted to the left or right of it. The replaced "[MASK]" is sent to Bert-MLM, which is obtained by fine-tuning Bert through the mask prediction task. During training, the sentence is randomly masked and some words are replaced with MASK. The word at the "[MASK]" position is then predicted based on the context information, thereby learning the context information before and after the word; then, a set of synonym candidates is obtained based on the context information, and the top K synonyms are selected and replaced to obtain a set of new samples, which together with the input samples form a new enhanced dataset;

[0033] In this embodiment, semantic importance The calculation formula is:

[0034]

[0035] in, Indicates w i In x 1 The importance of Indicates that x 1 Remove the w i The text after G y (x 1 ,x 2 ) is when the input is (x 1 ,x 2 ), the confidence score of the mask prediction language model, G y′ (x 1 ,x 2 ) represents two classification results (specifically (x 1 , x 2 )and( x 2 ))When they are inconsistent, the second method is used for calculation.

[0036] In this embodiment, Bert-MLM is obtained by fine-tuning Bert through the mask prediction task, which is based on the prediction score EmissionScore ij Make fine adjustments; O i =θ(y i W p +d); where θ(), W p , d is the learnable parameter of the line layer, y i is the final hidden layer output vector.

[0037] The word-level noise enhancement method of this embodiment includes word-level enhancement and word-level enhancement; word-level enhancement is to randomly perform noise enhancement operations, including redundant word replacement operations, word missing replacement operations, word order error replacement operations and word selection error replacement operations, wherein the editing distance between the generated text and the original text does not exceed 3; redundant word replacement operations are to randomly insert and expand words into the text; word missing replacement operations are to delete the words to simulate text missing errors; word order error replacement operations are to randomly select words and perform order swaps to simulate word order errors; word selection error replacement operations are to randomly select words and perform order swaps to simulate word order errors. The replacement operation involves random substitutions to simulate word selection errors. Word-level enhancement includes redundant word replacement, missing word replacement, incorrect word order replacement, and incorrect word selection replacement, where the edit distance between the generated text and the original text does not exceed 3. Redundant word replacement involves random word insertion and expansion; missing word replacement involves deleting the word to simulate missing text errors; incorrect word order replacement involves randomly swapping words to simulate word order errors; and incorrect word selection replacement involves random substitutions using lists of similar-sounding and similar-sounding words to simulate incorrect word selection. Furthermore, considering that question texts may contain grammatical errors caused by dialect accents, such as front and back nasals and confusion between rolled and flat tongues, the text is recognized as pinyin, and its initials or finals are randomly replaced to simulate dialect pronunciation.

[0038] In this embodiment, a back-translation algorithm is used to perform data enhancement processing on the two matching texts at the sentence level. The specific implementation includes the following steps:

[0039] (1) Translate the original data into other languages ​​through the neural network model;

[0040] (2) The translation is translated back to the original language through a neural network model to obtain a new text with the same semantics.

[0041] Step 2: After data augmentation, the two pieces of text to be matched are context-encoded, the text is mapped into a semantic encoding representation, and a pooling operation is performed to obtain the word representation;

[0042] In this embodiment, the Bert model is used to encode the text context. The Bert model is a bidirectional encoding representation based on Transformer. That is, before the two text segments to be matched are input into the context encoding layer, they are first spliced ​​into a whole. This whole is sent to the BERT model and first passes through the embedding layer composed of word embedding (Token Embedding), segment embedding (Segment Embedding) and position embedding (Position Embedding) to obtain the vector representation V, V∈R n×768, and then send the obtained embedding vector V into a Transformer consisting of 12 self-attention multi-head attention layers. There are 12 such Transformers in total to obtain the encoded output matrix.

[0043] BERT obtains word-level representations. After performing dependency syntactic analysis on the word segmentation results of the two texts, a relationship graph consisting of text words can be obtained.

[0044] Step 3: Perform dependency syntactic analysis on the two texts to be matched, and obtain the dependency relationship graph between different semantic units in the text;

[0045] In this embodiment, dependency parsing extracts the dependencies between different semantic units in a sentence, expressing the sentence's syntactic structure and defining semantic subordination between different words, such as subject-verb relationships and preposition-object relationships. Dependency relationships can be represented in two ways: as a directed arc graph and as a tree-structured graph.

[0046] Step 4: On the dependency graph of the two texts to be matched, perform convolution operations on the neighborhood nodes of the graph nodes and assign different weights to the neighborhood nodes through the self-attention mechanism to obtain the message vector;

[0047] Step 5: Perform cross-graph information interaction between the message vector in step 4 and the dependency graph nodes of the reference text, and obtain a cross-graph information matching message vector through the attention mechanism;

[0048] Step 6: Use the message vector from step 4 and the cross-graph information matching message vector from step 5 to aggregate and update the nodes. After several rounds of message propagation and aggregate updates, the final representation of the graph nodes is obtained.

[0049] In this embodiment, node updates use the multi-perspective cosine distance to first calculate the similarity between neighbor node messages and cross-graph node matching messages. The neighbor node messages are then concatenated with the multi-perspective similarity calculation results and fed into a two-layer feedforward neural network to update the node state feature vector. The update ends when the final representation of the graph node includes neighbor node information and comparison information with all nodes in the other graph.

[0050] Step 7: The graph matching network predicts the similarity between graph-level representation vectors and obtains the matching results.

[0051] In this embodiment, the graph matching network includes an encoder, an information propagation layer, a similarity calculation layer, and a Softmax layer connected sequentially;

[0052] Encoder, used to map graph node feature vectors and edge feature vectors to corresponding initial node state vectors and edge vectors;

[0053] The information propagation layer is used to map the node state of round t to a new state vector. The node aggregates neighbor features, the node's own state vector, the neighbor node state vector, and the edge feature vector through a message function. After T rounds of message propagation and update, the obtained message vector is used as input to obtain a graph-level representation. It needs to meet the requirements of differentiability and permutation invariance. Different readout functions are selected according to the specific task.

[0054] Similarity calculation layer, used to use similarity function s h Calculate the similarity between the node on another graph and the current node;

[0055] The Softmax layer is used to obtain the attention weight matrix as the cross-graph matching vector through Softmax, which represents the degree of matching between the nodes of the current graph and another graph.

[0056] The present invention is based on the graph node message propagation and update steps in the matching network of graph node interaction. It not only considers the aggregated messages of its own neighbor nodes, but also uses the cross-graph matching vector to represent the matching degree between the nodes of the current graph and the other graph. The obtained cross-graph matching vector is used to add the other graph to the node status update process. In this way, the differences between the graphs are captured into the matching vector and continuously amplified during the propagation process, making the matching model more sensitive to these differences. Similarity functions such as cosine similarity, Euclidean similarity, Jaccard similarity, and Hamming distance are used. h Calculate the similarity between the node on the other graph and the current node, and obtain the attention weight matrix as the cross-graph matching vector through Softmax.

[0057] The masked prediction language model used in this embodiment randomly masks sentences during training, replacing some words with masks. The model then predicts the word at the mask position based on contextual information, thereby learning the contextual information before and after the word. The next sentence prediction task (NSP) is used to capture the relationship between sentence pairs. Specifically, it determines whether one sentence is the next sentence of another and whether the two sentences are coherent. During training, for a given sentence, the model has a 50% probability of selecting the real sentence as the next sentence and a 50% probability of selecting a random sentence as the next sentence.

[0058] Please see Figure 3, is an example diagram of question text matching in an embodiment of the present invention. The model consists of a context encoding layer, a graph matching network layer, and a classification output layer from bottom to top. The two texts to be matched are fed into the model. First, the texts are mapped into semantic encoding representations through the context encoding layer, and the representations of the words are obtained through pooling operations. Then, dependency syntactic analysis is performed on the two texts respectively to obtain a dependency graph between different semantic units in the text. On the dependency graph, convolution operations are performed on the neighborhood nodes of the graph nodes, and different weights are assigned to the neighborhood nodes through the self-attention mechanism to obtain message vectors; cross-graph information interaction is performed between the dependency graph nodes of the comparison text, and a cross-graph information matching message vector is obtained through the attention mechanism; the two message vectors are used to aggregate and update the nodes, and after multiple rounds of message propagation and aggregation updates, the final representation of the graph nodes is obtained. Finally, the classification output layer constructed by two layers of FFN is used to predict the similarity between the graph-level representation vectors.

[0059] Please see Figure 4 , which is an example diagram of dependency parsing according to an embodiment of the present invention, Figure 4 It is the result of syntactic analysis of "Hi! How about putting out the first rice fragrance?", among which ROOT is the added virtual root node, "how about" is the core word of this sentence (Head, HED), "put out" and "how about" have a subject-verb relationship (Subject-Verb, SBV), "Hi" and "how about" have a clause relationship (Independent Clause, IC), "!" and "Hi" have a function word relationship (MT), "Rice fragrance" and "put out" have a verb-object relationship (Verb-Object, VOB), and "first" and "Rice fragrance" have a subject-predicate relationship (Attribute, ATT).

[0060] This paper combines dependency parsing with graph matching networks, surpassing multiple current baseline models on a question text dataset (please provide the specific experimental dataset and experimental structure to support the effectiveness of this technology). The model's performance was evaluated using BUSTM and LCQMC. The BUSTM dataset is from a voice assistant that provides convenient conversational services for various Oppo mobile phone brands and IoT smart devices. The content is collected from conversation records of hundreds of millions of users, with an average text length of 8 characters, the longest text containing 20 characters, and the shortest text containing 3 characters.

[0061] The LCQMC dataset is collected from Chinese questions posted by users in the Baidu Zhidao community. The average length of the text is 11 characters, with the longest text containing 49 characters and the shortest containing 2 characters. The BUSTM training set contains a total of 167,173 question-sentence pairs, while the LCQMC training set contains 238,766 question-sentence pairs. Both datasets exhibit a certain degree of data imbalance, with the BUSTM dataset being more severely imbalanced, with negative examples approximately 2.2 times the positive examples.

[0062] The F1 score and accuracy are used as evaluation metrics. The F1 score is a statistical metric used to measure the accuracy of a classification model, combining both precision and recall. Accuracy is the ratio of the number of samples correctly predicted by the model to the total number of samples. The calculation process is shown below.

[0063]

[0064]

[0065]

[0066]

[0067] TP indicates the number of data predicted to be matched and whose label value is also matched; FP indicates the number of data predicted to be mismatched and whose label value is actually matched; TN indicates the number of data predicted to be matched and whose label value is actually mismatched; and FN indicates the number of data predicted to be mismatched and whose label value is also mismatched.

[0068] The experimental hyperparameter settings and their meanings are shown in the table. DDparser was used as the dependency parser in the experiment, and Focal Loss was used as the loss function to address the imbalance in the dataset.

[0069] Experimental hyperparameter setting table

[0070]

[0071]

[0072] Focal Loss was first used to solve the data imbalance problem caused by too many negative samples in target detection tasks. Specifically, Focal Loss is modified based on the standard cross entropy to reduce the weight of easy-to-classify samples, so that the model can focus more on difficult-to-classify samples during training. The calculation process is as follows: FL(p t )=-(1-pt ) γ log(p t ), where γ represents the focus parameter, p t Indicates the probability value of correct classification, (1-p t ) γ Represents the modulation coefficient, which is used to control the weight of easy-to-classify samples. When γ = 0, Focal Loss degenerates into a common cross entropy loss function.

[0073] The experiment selected γ=[0.0,0.2,0.5,1.0,2.0,5.0] for the experiment, and the results are as follows Figure 5 In the left-hand graph, the horizontal axis represents the number of training steps. Each run updates the model's parameter weights, and the vertical axis represents the model's accuracy on the validation set. It can be seen that when γ = 0.2, the model achieves optimal accuracy, improving by approximately 0.5 percentage points compared to the standard cross-entropy loss function. When γ > = 0.5, the model accuracy decreases. In the right-hand graph, the vertical axis represents the loss value, and the horizontal axis represents the number of training steps. It can be seen that as the γ value increases, the model's convergence speed also increases.

[0074] Models that have performed well in text matching tasks in recent years were selected as benchmark models, including representational matching models and interactive matching models. They were trained and tested on the BUSTM and LCQMC datasets, and the experimental results were compared.

[0075] The comparative experimental results are shown in the following table, including the accuracy and F1 scores of all models on the BUSTM test set and the LCQMC test set.

[0076] Model test set experimental results (%) table

[0077]

[0078] According to the comparative experimental results, it can be clearly seen that the model proposed in this invention has achieved obvious advantages over other baseline models in terms of various indicators.

[0079] The data enhancement algorithm for question matching proposed in this invention can effectively improve the robustness and matching effect of the model in question matching tasks.

[0080] It should be understood that the above description of the preferred embodiment is relatively detailed and cannot be regarded as limiting the scope of protection of the patent of the present invention. Under the guidance of the present invention, ordinary technicians in this field can also make substitutions or modifications without departing from the scope of protection of the claims of the present invention, which all fall within the scope of protection of the present invention. The scope of protection requested by the present invention shall be based on the attached claims.

Claims

1. A text matching method based on data augmentation and graph matching network, characterized in that: The following steps are involved: Step 1: Identify and annotate the parts of speech and proper nouns of the two texts to be matched, and perform data augmentation on the two texts at the word and sentence levels. Step 2: After data augmentation, the two pieces of text to be matched are context-encoded, the text is mapped into a semantic encoding representation, and a pooling operation is performed to obtain the word representation; Step 3: Perform dependency syntactic analysis on the two texts to be matched, and obtain the dependency relationship graph between different semantic units in the text; Step 4: On the dependency graph of the two texts to be matched, perform convolution operations on the neighborhood nodes of the graph nodes and assign different weights to the neighborhood nodes through the self-attention mechanism to obtain the message vector; Step 5: Perform cross-graph information interaction between the message vector in step 4 and the dependency graph nodes of the reference text, and obtain a cross-graph information matching message vector through the attention mechanism; Step 6: Use the message vector from step 4 and the cross-graph information matching message vector from step 5 to aggregate and update the nodes. After several rounds of message propagation and aggregate updates, the final representation of the graph nodes is obtained. Step 7: The graph matching network predicts the similarity between graph-level representation vectors and obtains the matching results.

2. The text matching method based on data augmentation and graph matching network according to claim 1, characterized in that: In step 1, the named entity recognition method of BERT+BiLSTM-CRF is used to identify and annotate the parts of speech and proper nouns in the text. The specific implementation includes the following steps: (1) First, use BERT as an encoder to obtain the word embedding representation of the input text; (2) Use BiLSTM to calculate the probability of the character output being each candidate label, and obtain the final sequence labeling result through the CRF layer.

3. The text matching method based on data augmentation and graph matching network according to claim 1, characterized in that: In step 1, a text replacement and insertion method based on the masked predictive language model Bert-MLM and a word-level noise enhancement method are used to perform data enhancement processing on the two matching texts at the word level. The text replacement and insertion method based on the mask prediction language model is specifically implemented by the following steps: (1) Sentence preprocessing; First, perform word segmentation on the given text to obtain its word segmentation results and delete the stop words in it; (2) Random insertion and synonym replacement; The words in the sentence are sorted by semantic importance and then traversed. Phrases with importance greater than a threshold are selected for replacement. The word is replaced with "[MASK]" and "[MASK]" is randomly inserted to the left or right of it. The replaced "[MASK]" is fed into the Bert-MLM obtained by fine-tuning Bert on the mask prediction task. The word at the "[MASK]" position is predicted based on the context information, thereby learning the context information before and after the word. Then, a set of synonym candidates is obtained based on the context information. The top K synonyms are selected and replaced to obtain a set of new samples, which together with the input samples form a new enhanced dataset. The noise enhancement method at the word granularity includes word-level enhancement and word-level enhancement; the word-level enhancement is a random noise enhancement operation, including a redundant word replacement operation, a missing word replacement operation, a word order error replacement operation and a word selection error replacement operation, wherein the editing distance between the generated text and the original text does not exceed 3; the redundant word replacement operation is a random word insertion and expansion of the text; the missing word replacement operation deletes the word to simulate a text missing error; the word order error replacement operation is a random selection of words, performing a sequence swap to simulate a word order error; the word selection error replacement operation is a random replacement to simulate a word selection error; the word-level enhancement includes a redundant word replacement operation, a missing word replacement operation, a word order error replacement operation and a word selection error replacement operation, wherein the editing distance between the generated text and the original text does not exceed 3; the redundant word replacement operation is a random word insertion and expansion of the word; the missing word replacement operation is to delete the word to simulate a text missing error; the word order error replacement operation is to randomly swap the word to simulate a word order error; the word selection error replacement operation is a random replacement to simulate a word selection error.

4. The text matching method based on data enhancement and graph matching network according to claim 3 is characterized in that: The semantic importance The calculation formula is: in, Indicates w i In x 1 The importance of Indicates that x 1 Remove the w i The text after G y (x 1 ,x 2 ) is when the input is (x 1 ,x 2 ), the confidence score of the mask prediction language model; G y′ (x 1 ,x 2 ) represents two classification results, specifically (x 1 , x 2 )and If there is inconsistency, the second method is used for calculation.

5. The text matching method based on data augmentation and graph matching network according to claim 3, characterized in that: The Bert-MLM obtained by fine-tuning Bert through the mask prediction task is based on the prediction score EmissionScore ij Make fine adjustments; O i =θ(y i W p +d); where θ(), W p , d is the learnable parameter of the line layer, y i is the final hidden layer output vector.

6. The text matching method based on data augmentation and graph matching network according to claim 1, characterized in that: In step 1, a back-translation algorithm is used to perform data augmentation on the two matching texts at the sentence level. The specific implementation includes the following steps: (1) Translate the original data into other languages ​​through the neural network model; (2) The translation is translated back into the original language through a neural network model to obtain a new text with the same semantics.

7. The text matching method based on data augmentation and graph matching network according to claim 1, characterized in that: In step 2, the Bert model is used to encode the text context; The BERT model is a bidirectional encoding representation based on Transformer. That is, before the two text segments to be matched are input into the context encoding layer, they are first spliced ​​into a whole. This whole is sent to the BERT model, first passing through an embedding layer consisting of word embedding, segment embedding, and position embedding to obtain a vector representation. The obtained embedding vector is then sent to a Transformer consisting of a multi-head attention layer consisting of 12 self-attention layers to obtain an encoding output matrix.

8. The text matching method based on data augmentation and graph matching network according to claim 1, characterized in that: The dependency syntactic analysis described in step 3 extracts the dependency relationships between different semantic units in a sentence, expresses the syntactic structure of the sentence, and defines the semantic subordination relationships between different words; There are two ways to express dependency relationships: directed arc relationship graph and tree structure relationship graph.

9. The text matching method based on data augmentation and graph matching network according to claim 1, characterized in that: The node update in step 6 first calculates the similarity between the neighbor node message and the cross-graph node matching message; then the neighbor node message and the multi-view similarity calculation result are spliced ​​together and sent to a two-layer feedforward neural network to update the node state feature vector; The update is completed when the final representation of the graph node includes the neighbor node information and the comparison information with all nodes in the other graph.

10. The text matching method based on data augmentation and graph matching network according to any one of claims 1 to 9, characterized in that: In step 7, the graph matching network includes a sequentially connected encoder, information propagation layer, similarity calculation layer and Softmax layer. The encoder is used to map the graph node feature vector and the edge feature vector to the corresponding initial node state vector and edge vector; The information propagation layer is used to map the node state of round t to a new state vector. The node aggregates neighbor features, the node's own state vector, the neighbor node state vector, and the edge feature vector through a message function. After T rounds of message propagation and update, the obtained message vector is used as input to obtain a graph-level representation, which needs to meet the requirements of differentiability and permutation invariance. Different readout functions are selected according to specific tasks. The similarity calculation layer is used to use the similarity function s h Calculate the similarity between the node on another graph and the current node; The Softmax layer is used to obtain an attention weight matrix as a cross-graph matching vector through Softmax, and the cross-graph matching vector represents the degree of matching between the nodes of the current graph and another graph.

Citation Information

Patent Citations

  • Chinese statement similarity calculation method based on neural network

    CN111611809A

  • Short text classification and intelligent analysis system for multi-granularity demand

    CN114840677A