A text matching data processing method, device, system and storage medium
By encoding, convolution, and mean-averaging a multi-view text similarity dataset, combined with normalization analysis of a multi-view linear layer, the subjectivity problem of existing text matching methods is solved, and more accurate text similarity judgment is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-30
- Publication Date
- 2026-03-24
AI Technical Summary
Existing text matching methods are subjective, resulting in low accuracy and an inability to comprehensively and objectively determine text similarity.
We use a multi-view text similarity dataset for encoding, obtain sentence pair vectors through convolution and mean-based processing, perform normalization analysis using a multi-view linear layer, and calculate similarity scores to obtain text matching results.
It achieves a more comprehensive and objective text similarity assessment, improving the accuracy of text matching.
Smart Images

Figure CN115658844B_ABST
Abstract
Description
Technical Field
[0001] This invention relates primarily to the field of language processing technology, specifically to a text matching data processing method, apparatus, system, and storage medium. Background Technology
[0002] Text matching is an important and challenging task in natural language processing, aiming to calculate the similarity score between two texts, which can be applied to scenarios such as search engines and recommendation systems. However, existing text matching methods typically judge the similarity of sentence pairs from a single perspective, which introduces subjectivity and leads to low accuracy. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a text matching data processing method, apparatus, system and storage medium to address the shortcomings of the prior art.
[0004] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: A text matching data processing method, comprising the following steps:
[0005] The original sentence pairs are obtained from the multi-view text similarity dataset and encoded to obtain the original sentence pair vector.
[0006] The original sentence vector is convolved to obtain a first text vector and a second text vector;
[0007] The first text vector and the second text vector are respectively subjected to mean-squared processing to obtain the first mean-squared vector and the second mean-squared vector respectively;
[0008] Normalization analysis is performed on the first mean-normalized vector and the second mean-normalized vector respectively to obtain multiple first target vectors and multiple second target vectors.
[0009] The similarity scores are calculated for each of the first target vectors and each of the second target vectors to obtain multiple similarity scores, and all the similarity scores are used as the text matching results.
[0010] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: A text matching data processing device, comprising:
[0011] The encoding module is used to obtain original sentence pairs from the multi-view text similarity dataset and encode the original sentence pairs to obtain original sentence pair vectors;
[0012] The convolution processing module is used to perform convolution processing on the original sentence vector to obtain a first text vector and a second text vector.
[0013] The mean-averaging module is used to perform mean-averaging on the first text vector and the second text vector respectively, so as to obtain a first mean-averaged vector and a second mean-averaged vector.
[0014] The normalization analysis module is used to perform normalization analysis on the first mean-normalized vector and the second mean-normalized vector respectively, thereby obtaining multiple first target vectors and multiple second target vectors.
[0015] The text matching result acquisition module is used to calculate the similarity score between each of the first target vectors and each of the second target vectors to obtain multiple similarity scores, and to use all the similarity scores as the text matching result.
[0016] Based on the above-mentioned text matching data processing method, the present invention also provides a text matching data processing system.
[0017] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: a text matching data processing system, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the text matching data processing method described above is implemented.
[0018] Based on the above-described text matching data processing method, the present invention also provides a computer-readable storage medium.
[0019] Another technical solution of the present invention to solve the above-mentioned technical problems is as follows: a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the text matching data processing method as described above.
[0020] The beneficial effects of this invention are as follows: by encoding the original sentence pairs to obtain the original sentence pair vector, convolution processing of the original sentence pair vector to obtain the first text vector and the second text vector, mean-normalization processing of the first text vector and the second text vector to obtain the first mean-normalized vector and the second mean-normalized vector, normalization analysis of the first mean-normalized vector and the second mean-normalized vector to obtain the first target vector and the second target vector, and similarity score calculation of the first target vector and the second target vector to obtain the text matching result, it can accurately extract the rich semantic information of the sentence pairs, realize text matching from different perspectives, and compared with the prior art, it can more comprehensively and objectively judge the similarity of text and improve the accuracy of text matching. Attached Figure Description
[0021] Figure 1 A flowchart illustrating a text matching data processing method provided in an embodiment of the present invention;
[0022] Figure 2 This is a block diagram of a text matching data processing device provided in an embodiment of the present invention. Detailed Implementation
[0023] The principles and features of the present invention are described below with reference to the accompanying drawings. The examples given are only for explaining the present invention and are not intended to limit the scope of the present invention.
[0024] Figure 1 This is a flowchart illustrating a text matching data processing method provided in an embodiment of the present invention.
[0025] like Figure 1 As shown, a text matching data processing method includes the following steps:
[0026] The original sentence pairs are obtained from the multi-view text similarity dataset and encoded to obtain the original sentence pair vector.
[0027] The original sentence vector is convolved to obtain a first text vector and a second text vector;
[0028] The first text vector and the second text vector are respectively subjected to mean-squared processing to obtain the first mean-squared vector and the second mean-squared vector respectively;
[0029] Normalization analysis is performed on the first mean-normalized vector and the second mean-normalized vector respectively to obtain multiple first target vectors and multiple second target vectors.
[0030] The similarity scores are calculated for each of the first target vectors and each of the second target vectors to obtain multiple similarity scores, and all the similarity scores are used as the text matching results.
[0031] It should be understood that, in dual encoder mode, sentence pairs (i.e., the original sentence pairs) in the Multi-Perspective Text Similarity (MPTS) dataset (i.e., the Multi-Perspective Text Similarity dataset) are encoded to obtain vector representations of the sentence pairs (i.e., the original sentence pair vectors).
[0032] It should be understood that obtaining N-gram information of sentence pairs (i.e., the original sentence pair vectors) through convolution operations allows for better extraction of semantic relevance between words.
[0033] In the above embodiments, the original sentence pair vector is obtained by encoding the original sentence pair, and the first text vector and the second text vector are obtained by convolution processing of the original sentence pair vector. The first and second text vectors are mean-normalized to obtain the first mean-normalized vector and the second mean-normalized vector, respectively. The first target vector and the second target vector are normalized to obtain the first target vector and the second target vector, respectively. The similarity score is calculated between the first target vector and the second target vector to obtain the text matching result. This method can accurately extract the rich semantic information of the sentence pair, realize text matching from different perspectives, and compared with the existing technology, can more comprehensively and objectively judge the similarity of text and improve the accuracy of text matching.
[0034] Optionally, as an embodiment of the present invention, the original sentence pair includes a first original sentence and a second original sentence, and the process of encoding the original sentence pair to obtain an original sentence pair vector includes:
[0035] The first original sentence is encoded using the BERT model to obtain the first original sentence vector;
[0036] Specifically, based on the first formula, the first original sentence is encoded to obtain the first original sentence vector, and the first formula is:
[0037] model_outputs_a = BERT(a),
[0038] The second original sentence is encoded using the BERT model to obtain the second original sentence vector;
[0039] Specifically, based on the second formula, the second original sentence is encoded to obtain the second original sentence vector. The second formula is:
[0040] model_outputs_b = BERT(b),
[0041] Where model_outputs_a is the first original sentence vector, a is the first original sentence, model_outputs_b is the second original sentence vector, b is the second original sentence, and BERT() is the BERT model;
[0042] The original sentence pair vector includes the first original sentence vector and the second original sentence vector.
[0043] Specifically, if the sentence pairs (i.e., the original sentence pairs) in the MPTS dataset are represented by a (i.e., the first original sentence) and b (i.e., the second original sentence), then:
[0044] a = {a1, a2, ..., a}m}
[0045] b = {b1, b2, ..., b} n}
[0046] Each element in a and b represents a word. In dual-encoder mode, a (i.e., the first original sentence) and b (i.e., the second original sentence) are used as inputs to the embedding layer and encoded by the BERT model to obtain the vector representation of the sentence (i.e., the first original sentence vector or the second original sentence vector), as expressed in the following formula:
[0047] model_outputs_a = BERT(a)
[0048] model_outputs_b = BERT(b)
[0049] Where model_outputs_a and model_outputs_b are the vector representations of a (i.e., the first original sentence) and b (i.e., the second original sentence) after being encoded by BERT.
[0050] In the above embodiments, encoding the original sentence pairs to obtain the original sentence pair vector can accurately extract the rich semantic information of the sentence pairs and improve the accuracy of text matching.
[0051] Optionally, as an embodiment of the present invention, the process of convolving the original sentence vectors to obtain the first text vector and the second text vector includes:
[0052] Based on the third equation, the first original sentence vector is convolved to obtain the first text vector. The third equation is:
[0053]
[0054] Based on the fourth equation, a second text vector is obtained by convolution processing on the second original sentence vector. The fourth equation is:
[0055]
[0056] Where model_outputs_a is the first original sentence vector, Conv_output_a is the first text vector, model_outputs_b is the second original sentence vector, Conv_output_b is the second text vector, W and W' are both weight matrices, and f() is the activation function. For convolution operations, both b1 and b1' are biases.
[0057] It should be understood that convolution operations are used to obtain N-gram information of sentence pairs, which allows for better extraction of semantic relevance between words. Specifically:
[0058]
[0059]
[0060] in denoted by , f is the activation function, W is the weight matrix, b is the bias, and Conv_output_a and Conv_output_b are the text vectors obtained by convolving model_outputs_a and model_outputs_b respectively (i.e., the first text vector and the second text vector).
[0061] In the above embodiments, the first text vector is obtained by convolution processing of the first original sentence vector based on the third formula, and the second text vector is obtained by convolution processing of the second original sentence vector based on the fourth formula. This can obtain the N-gram information of sentence pairs and better extract the semantic relevance between words.
[0062] Optionally, as an embodiment of the present invention, the process of performing mean-normalization on the first text vector and the second text vector respectively to obtain the first mean-normalized vector and the second mean-normalized vector includes:
[0063] Based on the fifth equation, the first text vector is subjected to mean-squared processing to obtain the first mean-squared vector. The fifth equation is:
[0064] embs_a=MeanPool(Conv_output_a),
[0065] Based on the sixth equation, the second text vector is subjected to mean-based processing to obtain the second mean-based vector. The sixth equation is:
[0066] embs_b=MeanPool(Conv_output_b),
[0067] Where embs_a is the first mean-valued vector, Conv_output_a is the first text vector, embs_b is the second mean-valued vector, Conv_output_b is the second text vector, and MeanPool() is the mean pooling function.
[0068] Understandably, mean pooling is performed on the convolution results (i.e., the first text vector and the second text vector) to further extract the main features of the sentence pairs.
[0069] Specifically, embs_a = MeanPool(Conv_output_a)
[0070] embs_b=MeanPool(Conv_output_b)
[0071] Where embs_a and embs_b are the results after mean pooling (i.e., the first mean-pooled vector and the second mean-pooled vector).
[0072] In the above embodiments, the first text vector and the second text vector are respectively subjected to mean-normalization to obtain the first mean-normalized vector and the second mean-normalized vector, which can further extract the main features of the sentence pairs.
[0073] Optionally, as an embodiment of the present invention, the process of performing normalization analysis on the first mean-normalized vector and the second mean-normalized vector respectively to obtain a plurality of first target vectors and a plurality of second target vectors includes:
[0074] Based on the seventh equation, the first mean-normalized vector is normalized to obtain the first normalized vector. The seventh equation is:
[0075] norm_a = normalize(embs_a),
[0076] Based on equation eight, the second mean-normalized vector is normalized to obtain the second normalized vector. Equation eight is:
[0077] norm_b = normalize(embs_b),
[0078] Where norm_a is the first normalized vector, embs_a is the first mean-normalized vector, norm_b is the second normalized vector, embs_b is the second mean-normalized vector, and normalize() is the normalization function.
[0079] Based on the multi-view linear layer and the ninth equation, the first normalized vector is transformed to obtain multiple first target vectors. The ninth equation is:
[0080] tmp_a i =multi_persp_linears[i](norm_a),
[0081] Based on the multi-view linear layer and the tenth equation, the second normalized vector is transformed to obtain multiple second target vectors. The tenth equation is:
[0082] tmp_b i=multi_persp_linears[i](norm_b),
[0083] Among them, tmp_a i Let be the first target vector from the i-th viewpoint, norm_a be the first normalized vector, and tmp_b be the first target vector from the i-th viewpoint. i Let be the second target vector of the i-th viewpoint, norm_b be the second normalized vector, and multi_persp_linears be the multi-view linear layer.
[0084] Preferably, i can be any number from 1 to 12.
[0085] It should be understood that the multi-perspective linear layer (i.e., the multi-view linear layer) consists of N dense linear layers that transform a single sentence embedding into N normalized embeddings corresponding to N perspectives.
[0086] It should be understood that the sentence pair vectors (i.e., the first mean-normalized vector and the second mean-normalized vector) are imported into the multi-view linear layer to convert the single sentence embedding into N normalized embeddings (i.e., the first target vector and the second target vector) corresponding to N view graphs.
[0087] Specifically, norm_a = normalize(embs_a)
[0088] norm_b = normalize(embs_b)
[0089] tmp_a=multi_persp_linears[i](norm_a)
[0090] tmp_b=multi_persp_linears[i](norm_b)
[0091] Where normalize represents the normalization of embs_a and embs_b to obtain norm_a, norm_b, tmp_a, and tmp_b respectively, which are vectors obtained after norm_a and norm_b pass through the multi_persp_linears multi-view linear layer. i represents the i-th view (there are N=12 views in total). There are N=12 linear layers in this multi-view linear layer, which are independent of each other and have the same dimension. Each view (with a different parameter matrix) corresponds to a linear layer.
[0092] In the above embodiments, normalization analysis is performed on the first mean-normalized vector and the second mean-normalized vector to obtain multiple first target vectors and multiple second target vectors, thereby realizing text matching from different perspectives. Compared with the prior art, it can more comprehensively and objectively judge the similarity of texts and improve the accuracy of text matching.
[0093] Optionally, as an embodiment of the present invention, the process of calculating similarity scores between each of the first target vectors and each of the second target vectors to obtain multiple similarity scores includes:
[0094] Based on the eleventh formula, similarity scores are calculated for each of the first target vectors and each of the second target vectors to obtain multiple similarity scores. The eleventh formula is:
[0095]
[0096] Among them, s i Let tmp_a be the similarity score for the i-th viewpoint. i Let tmp_b be the first target vector from the i-th viewpoint. i Let ||tmp_a| be the second target vector from the i-th viewpoint, · be the inner product operation, and ||tmp_a| be the second target vector from the i-th viewpoint. i ||for tmp_a i The modulus, ||tmp_b i ||For tmp_b i The model.
[0097] It should be understood that the cosine value is calculated based on the embeddings of sentence a and sentence b from the corresponding perspectives (i.e., the first target vector and the second target vector) to obtain the similarity score of semantic text matching from different perspectives.
[0098] Specifically,
[0099] Where s i Let be the cosine value corresponding to the i-th viewpoint, norm_a and norm_b be the normalized embeddings, · be the inner product operation, and ||norm_a|| and ||norm_b|| be the moduli of norm_a and norm_b, respectively.
[0100] In the above embodiments, based on the eleventh formula, the similarity scores of each first target vector and each second target vector are calculated to obtain multiple similarity scores. This can accurately extract rich semantic information of sentence pairs and realize text matching from different perspectives. Compared with the existing technology, it can more comprehensively and objectively judge the similarity of texts and improve the accuracy of text matching.
[0101] Optionally, as another embodiment of the present invention, in the dual encoder mode, sentence pairs in the Multi-View Text Similarity (MPTS) dataset are encoded to obtain vector representations of sentence pairs. N-gram information of sentence pairs is obtained through convolution operations to better extract semantic relevance between words. Mean pooling is performed on the convolution results to further extract the main features of sentence pairs. The sentence pair vectors are then imported into a multi-view linear layer to convert a single sentence embedding into N normalized embeddings corresponding to N view maps. Cosine values are calculated based on the embeddings of sentence a and sentence b in the corresponding view maps to obtain similarity scores for semantic text matching from different viewpoints. Compared with the prior art, this can improve the accuracy of text matching and make a more comprehensive and objective judgment on text similarity.
[0102] Figure 2 This is a block diagram of a text matching data processing device provided in an embodiment of the present invention.
[0103] Alternatively, as another embodiment of the present invention, such as Figure 2 As shown, a text matching data processing device includes:
[0104] The encoding module is used to obtain original sentence pairs from the multi-view text similarity dataset and encode the original sentence pairs to obtain original sentence pair vectors;
[0105] The convolution processing module is used to perform convolution processing on the original sentence vector to obtain a first text vector and a second text vector.
[0106] The mean-averaging module is used to perform mean-averaging on the first text vector and the second text vector respectively, so as to obtain a first mean-averaged vector and a second mean-averaged vector.
[0107] The normalization analysis module is used to perform normalization analysis on the first mean-normalized vector and the second mean-normalized vector respectively, thereby obtaining multiple first target vectors and multiple second target vectors.
[0108] The text matching result acquisition module is used to calculate the similarity score between each of the first target vectors and each of the second target vectors to obtain multiple similarity scores, and to use all the similarity scores as the text matching result.
[0109] Optionally, as an embodiment of the present invention, the original sentence pair includes a first original sentence and a second original sentence, and the encoding module is specifically used for:
[0110] The first original sentence is encoded using the BERT model to obtain the first original sentence vector;
[0111] Specifically, based on the first formula, the first original sentence is encoded to obtain the first original sentence vector, and the first formula is:
[0112] model_outputs_a = BERT(a),
[0113] The second original sentence is encoded using the BERT model to obtain the second original sentence vector;
[0114] Specifically, based on the second formula, the second original sentence is encoded to obtain the second original sentence vector. The second formula is:
[0115] model_outputs_b = BERT(b),
[0116] Where model_outputs_a is the first original sentence vector, a is the first original sentence, model_outputs_b is the second original sentence vector, b is the second original sentence, and BERT() is the BERT model;
[0117] The original sentence pair vector includes the first original sentence vector and the second original sentence vector.
[0118] Optionally, another embodiment of the present invention provides a text matching data processing system, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the text matching data processing method described above. This system can be a computer or similar system.
[0119] Optionally, another embodiment of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the text matching data processing method described above.
[0120] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0121] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described apparatus and unit can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0122] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.
[0123] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention, depending on actual needs.
[0124] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0125] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0126] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A text matching data processing method, characterized in that, Includes the following steps: The original sentence pairs are obtained from the multi-view text similarity dataset and encoded to obtain the original sentence pair vector. The original sentence vector is convolved to obtain a first text vector and a second text vector; The first text vector and the second text vector are respectively subjected to mean-squared processing to obtain the first mean-squared vector and the second mean-squared vector respectively; Normalization analysis is performed on the first mean-normalized vector and the second mean-normalized vector respectively to obtain multiple first target vectors and multiple second target vectors. A similarity score is calculated for each of the first target vectors and each of the second target vectors to obtain multiple similarity scores, and all the similarity scores are used as the text matching result; The original sentence pair includes a first original sentence and a second original sentence. The process of encoding the original sentence pair to obtain the original sentence pair vector includes: The first original sentence is encoded using the BERT model to obtain the first original sentence vector; Specifically, based on the first formula, the first original sentence is encoded to obtain the first original sentence vector, and the first formula is: , The second original sentence is encoded using the BERT model to obtain the second original sentence vector; Specifically, based on the second formula, the second original sentence is encoded to obtain the second original sentence vector. The second formula is: , in, This is the first original sentence vector. This is the first original sentence. This is the second original sentence vector. This is the second original sentence. For the BERT model; The original sentence pair vector includes the first original sentence vector and the second original sentence vector; The process of performing normalization analysis on the first mean-normalized vector and the second mean-normalized vector respectively to obtain multiple first target vectors and multiple second target vectors includes: Based on the seventh equation, the first mean-normalized vector is normalized to obtain the first normalized vector. The seventh equation is: , Based on equation eight, the second mean-normalized vector is normalized to obtain the second normalized vector. Equation eight is: , in, This is the first normalized vector. This is the first mean-normalized vector. This is the second normalized vector. This is the second mean-normalized vector. This is a normalization processing function; Based on the multi-view linear layer and the ninth equation, the first normalized vector is transformed to obtain multiple first target vectors. The ninth equation is: , Based on the multi-view linear layer and the tenth equation, the second normalized vector is transformed to obtain multiple second target vectors. The tenth equation is: , in, For the first The first target vector from each perspective This is the first normalized vector. For the first The second target vector from each perspective This is the second normalized vector. It is a multi-view linear layer.
2. The text matching data processing method according to claim 1, characterized in that, The process of convolving the original sentence vector to obtain the first text vector and the second text vector includes: Based on the third equation, the first original sentence vector is convolved to obtain the first text vector. The third equation is: , Based on the fourth equation, a second text vector is obtained by convolution processing on the second original sentence vector. The fourth equation is: , in, This is the first original sentence vector. The first text vector, This is the second original sentence vector. For the second text vector, and Both are weight matrices. ( ) is the activation function. For convolution operations, and All are biased.
3. The text matching data processing method according to claim 1, characterized in that, The process of performing mean-normalization on the first text vector and the second text vector respectively to obtain the first mean-normalized vector and the second mean-normalized vector includes: Based on the fifth equation, the first text vector is subjected to mean-squared processing to obtain the first mean-squared vector. The fifth equation is: , Based on the sixth equation, the second text vector is subjected to mean-based processing to obtain the second mean-based vector. The sixth equation is: , in, This is the first mean-normalized vector. The first text vector, This is the second mean-normalized vector. For the second text vector, This is the mean pooling function.
4. The text matching data processing method according to claim 1, characterized in that, The process of calculating similarity scores between each of the first target vectors and each of the second target vectors to obtain multiple similarity scores includes: Based on the eleventh formula, similarity scores are calculated for each of the first target vectors and each of the second target vectors to obtain multiple similarity scores. The eleventh formula is: in, For the first Similarity score from each perspective, For the first The first target vector from each perspective For the first The second target vector from each perspective This is an inner product operation. for The model, for The model.
5. A text matching data processing device, characterized in that, include: The encoding module is used to obtain original sentence pairs from the multi-view text similarity dataset and encode the original sentence pairs to obtain original sentence pair vectors; The convolution processing module is used to perform convolution processing on the original sentence vector to obtain a first text vector and a second text vector. The mean-averaging module is used to perform mean-averaging on the first text vector and the second text vector respectively, so as to obtain a first mean-averaged vector and a second mean-averaged vector. The normalization analysis module is used to perform normalization analysis on the first mean-normalized vector and the second mean-normalized vector respectively, thereby obtaining multiple first target vectors and multiple second target vectors. The text matching result acquisition module is used to calculate the similarity score between each of the first target vectors and each of the second target vectors to obtain multiple similarity scores, and to use all the similarity scores as the text matching result; The original sentence pair includes a first original sentence and a second original sentence, and the encoding module is specifically used for: The first original sentence is encoded using the BERT model to obtain the first original sentence vector; Specifically, based on the first formula, the first original sentence is encoded to obtain the first original sentence vector, and the first formula is: , The second original sentence is encoded using the BERT model to obtain the second original sentence vector; Specifically, based on the second formula, the second original sentence is encoded to obtain the second original sentence vector. The second formula is: , in, This is the first original sentence vector. This is the first original sentence. This is the second original sentence vector. This is the second original sentence. For the BERT model; The original sentence pair vector includes the first original sentence vector and the second original sentence vector; The normalization analysis module is specifically used for: Based on the seventh equation, the first mean-normalized vector is normalized to obtain the first normalized vector. The seventh equation is: , Based on equation eight, the second mean-normalized vector is normalized to obtain the second normalized vector. Equation eight is: , in, This is the first normalized vector. This is the first mean-normalized vector. This is the second normalized vector. This is the second mean-normalized vector. This is a normalization processing function; Based on the multi-view linear layer and the ninth equation, the first normalized vector is transformed to obtain multiple first target vectors. The ninth equation is: , Based on the multi-view linear layer and the tenth equation, the second normalized vector is transformed to obtain multiple second target vectors. The tenth equation is: , in, For the first The first target vector from each perspective This is the first normalized vector. For the first The second target vector from each perspective This is the second normalized vector. It is a multi-view linear layer.
6. A text matching data processing system, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the text matching data processing method as described in any one of claims 1 to 4.
7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the text matching data processing method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Text matching method and device, computer readable storage medium and computer equipment
CN111259113A
Chinese text matching method and system
CN111914067A