Text matching processing method and device

By constructing a difference discriminant matrix and a deep neural network model, and integrating context and differential semantic representation, the problem of expression differences in text matching in vertical fields is solved, the accuracy of text matching is improved, and the cost is reduced.

CN115204139BActive Publication Date: 2025-09-09工银科技有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210716652.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-23
Publication Date
2025-09-09
Estimated Expiration
2042-06-23

AI Technical Summary

Technical Problem

In vertical fields, the expression difference between the target text and the matching text is the main difficulty of text matching technology. Introducing external interpretation knowledge requires a lot of crawling and cleaning work, which increases costs. How to improve the text matching effect while avoiding the construction of external interpretation knowledge.

Method used

By determining the contextual semantic representation vector and similarity and dissimilarity score matrix of the text, a difference discrimination matrix is ​​constructed, and a preset difference semantic representation model is trained using a deep neural network. The difference and contextual semantic representation vectors are integrated to obtain the text matching results.

Benefits of technology

It improves the accuracy of text matching in vertical fields, avoids the cost of building external interpretation knowledge, and simplifies the processing flow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115204139B_ABST
    Figure CN115204139B_ABST
Patent Text Reader

Abstract

The present invention provides a text matching processing method and device, which relates to the field of text processing technology and can be used in the financial field or other technical fields. The method includes: determining the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between texts, and constructing a difference discrimination matrix between texts based on the word comparison results of corresponding positions between texts; determining the difference score matrix based on the similarity score matrix, the dissimilarity score matrix and the difference discrimination matrix; determining the difference semantic representation vector of the text based on the difference score matrix, the contextual semantic representation vector and the preset difference semantic representation model, fusing the difference semantic representation vector and the contextual semantic representation vector to obtain the text matching result between texts. The device executes the above method. The method and device provided by the embodiment of the present invention can improve the accuracy of text matching in vertical fields.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of text processing, and in particular to a text matching processing method and device. Background Art

[0002] With the development of artificial intelligence (AI), more and more natural language processing (NLP) problems are being solved. Among them, text matching technology has found widespread application in real life. For example, text matching technology is used in many scenarios, including question-answering robots, plagiarism detection, and web search.

[0003] Generally, text matching technologies are categorized into public domain-based and specialized domain-based text matching technologies, depending on the scope of the application scenario. Public domain-based text matching technologies are more suitable for casual Q&A scenarios, while specialized domain-based text matching technologies are more suitable for more specialized Q&A scenarios, such as Q&A and search in the financial sector.

[0004] Currently, in vertical domain scenarios, the discrepancy between target and matching text is a major challenge in text matching technology. This can be effectively addressed by introducing external interpretation knowledge. However, introducing external interpretation knowledge not only requires extensive crawling and cleaning work, but also requires expert inspection and organization, significantly increasing investment costs.

[0005] Therefore, how to improve the text matching effect in vertical fields while avoiding the construction of external interpretation knowledge has become a technical problem that needs to be solved urgently. Summary of the Invention

[0006] In response to the problems in the prior art, embodiments of the present invention provide a text matching processing method and apparatus, which can at least partially solve the problems in the prior art.

[0007] In one aspect, the present invention provides a text matching processing method, comprising:

[0008] Determine the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between the texts, and construct the difference discrimination matrix between the texts based on the word comparison results at corresponding positions between the texts;

[0009] Determining a difference score matrix based on the similarity score matrix, the dissimilarity score matrix, and the difference discrimination matrix;

[0010] Determining a differential semantic representation vector of a text based on the differential score matrix, the contextual semantic representation vector, and a preset differential semantic representation model, fusing the differential semantic representation vector and the contextual semantic representation vector to obtain a text matching result between the texts;

[0011] The preset difference semantic representation model is obtained by training a deep neural network.

[0012] The step of constructing a difference discriminant matrix between texts based on the word comparison results at corresponding positions between texts includes:

[0013] If it is determined that the words at the corresponding positions are identical in literal sense, then the value of the corresponding matrix element in the difference discrimination matrix is ​​determined to be a dissimilarity score;

[0014] If it is determined that the words at the corresponding positions are not consistent in their literal meanings, the value of the corresponding matrix element in the difference discrimination matrix is ​​determined as the similarity score.

[0015] The determining of the difference score matrix according to the similarity score matrix, the dissimilarity score matrix and the difference discrimination matrix includes:

[0016] According to the score type of the matrix elements to be extracted from the difference discrimination matrix, a corresponding similarity representation matrix is ​​constructed;

[0017] The difference score matrix is ​​determined according to the similarity representation matrix, the similarity score matrix and the dissimilarity score matrix.

[0018] The step of extracting the score type of matrix elements according to the difference discriminant matrix and constructing a corresponding similarity representation matrix includes:

[0019] If it is determined that the score type is a dissimilarity score, a dissimilarity representation matrix is ​​constructed; wherein the value of the position of the matrix element in the dissimilarity representation matrix is ​​1; and the values ​​of the remaining positions are all 0;

[0020] If it is determined that the score type is a similarity score, a similarity representation matrix is ​​constructed; wherein the value of the position of the matrix element in the similarity representation matrix is ​​1; and the values ​​of the other positions are all 0.

[0021] The determining of the difference score matrix according to the similarity representation matrix, the similarity score matrix and the dissimilarity score matrix includes:

[0022] Performing a positional multiplication on the dissimilarity representation matrix and the dissimilarity score matrix to obtain a first positional multiplication result;

[0023] Performing a positional multiplication on the similarity representation matrix and the similarity score matrix to obtain a second positional multiplication result;

[0024] The first bitwise multiplication result and the second bitwise multiplication result are added bitwise to obtain the difference score matrix.

[0025] The step of determining the difference semantic representation vector of the text according to the difference score matrix, the context semantic representation vector, and a preset difference semantic representation model includes:

[0026] Using the difference score matrix as a weight and multiplying it with the context semantic representation vector to obtain an initial input vector for inputting into the preset difference semantic representation model;

[0027] The initial input vector is semantically represented based on the preset difference semantic representation model to obtain the difference semantic representation vector.

[0028] Wherein, the deep neural network is a convolutional neural network.

[0029] In one aspect, the present invention provides a text matching processing device, comprising:

[0030] A construction unit is used to determine the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between the texts, and to construct a difference discrimination matrix between the texts based on the word comparison results at corresponding positions between the texts;

[0031] a determining unit, configured to determine a difference score matrix based on the similarity score matrix, the dissimilarity score matrix, and the difference discrimination matrix;

[0032] a fusion unit, configured to determine a differential semantic representation vector of a text based on the differential score matrix, the contextual semantic representation vector, and a preset differential semantic representation model, and fuse the differential semantic representation vector with the contextual semantic representation vector to obtain a text matching result between the texts;

[0033] The preset difference semantic representation model is obtained by training a deep neural network.

[0034] On the other hand, an embodiment of the present invention provides an electronic device, comprising: a processor, a memory, and a bus, wherein:

[0035] The processor and the memory communicate with each other via the bus;

[0036] The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the following method:

[0037] Determine the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between the texts, and construct the difference discrimination matrix between the texts based on the word comparison results at corresponding positions between the texts;

[0038] Determining a difference score matrix based on the similarity score matrix, the dissimilarity score matrix, and the difference discrimination matrix;

[0039] Determining a differential semantic representation vector of a text based on the differential score matrix, the contextual semantic representation vector, and a preset differential semantic representation model, fusing the differential semantic representation vector and the contextual semantic representation vector to obtain a text matching result between the texts;

[0040] The preset difference semantic representation model is obtained by training a deep neural network.

[0041] An embodiment of the present invention provides a non-transitory computer-readable storage medium, including:

[0042] The non-transitory computer-readable storage medium stores computer instructions, which cause the computer to execute the following method:

[0043] Determine the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between the texts, and construct the difference discrimination matrix between the texts based on the word comparison results at corresponding positions between the texts;

[0044] Determining a difference score matrix based on the similarity score matrix, the dissimilarity score matrix, and the difference discrimination matrix;

[0045] Determining a differential semantic representation vector of a text based on the differential score matrix, the contextual semantic representation vector, and a preset differential semantic representation model, fusing the differential semantic representation vector and the contextual semantic representation vector to obtain a text matching result between the texts;

[0046] The preset difference semantic representation model is obtained by training a deep neural network.

[0047] The text matching processing method and device provided by the embodiment of the present invention determine the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between texts, and construct a difference discrimination matrix between texts based on the word comparison results of corresponding positions between texts; determine the difference score matrix based on the similarity score matrix, the dissimilarity score matrix and the difference discrimination matrix; determine the difference semantic representation vector of the text based on the difference score matrix, the contextual semantic representation vector and a preset difference semantic representation model, and fuse the difference semantic representation vector and the contextual semantic representation vector to obtain a text matching result between texts; wherein, the preset difference semantic representation model is obtained by training a deep neural network, which can improve the accuracy of text matching in vertical fields. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0049] Figure 1 It is a flowchart of a text matching processing method provided by one embodiment of the present invention.

[0050] Figure 2 It is a flowchart of a text matching processing method provided by another embodiment of the present invention.

[0051] Figure 3 It is a flowchart of a text matching processing method provided by another embodiment of the present invention.

[0052] Figure 4 It is a structural diagram of a text matching processing device provided by an embodiment of the present invention.

[0053] Figure 5 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0054] To make the purpose, technical solutions and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention. It should be noted that, unless there is a conflict, the embodiments and features in the embodiments of this application can be combined with each other in any manner.

[0055] The relevant professional terms are explained as follows:

[0056] Deep contextual semantics: A text representation method based on deep networks learned on massive text data.

[0057] Differential semantics: the representation of the semantics of the same text in terms of the degree of deviation; the representation of the semantics of different texts in terms of the degree of proximity.

[0058] Gating mechanism: By setting the gating unit, important input information is selectively remembered and unimportant information is forgotten.

[0059] Attention mechanism: Selecting more critical information for the current task goal from a large amount of information in deep network learning.

[0060] Figure 1 FIG. 1 is a flow chart of a text matching processing method provided by an embodiment of the present invention. Figure 1As shown, the text matching processing method provided by the embodiment of the present invention includes:

[0061] Step S1: Determine the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between the texts, and construct the difference discrimination matrix between the texts based on the word comparison results at corresponding positions between the texts.

[0062] Step S2: determining a difference score matrix according to the similarity score matrix, the dissimilarity score matrix and the difference discrimination matrix.

[0063] Step S3: determining a differential semantic representation vector of the text according to the differential score matrix, the contextual semantic representation vector, and a preset differential semantic representation model, fusing the differential semantic representation vector and the contextual semantic representation vector to obtain a text matching result between the texts;

[0064] The preset difference semantic representation model is obtained by training a deep neural network.

[0065] In step S1, the apparatus determines the contextual semantic representation vectors of the texts, as well as the similarity score matrix and dissimilarity score matrix between the texts, and constructs a difference discriminant matrix between the texts based on the word comparison results at corresponding positions between the texts. The apparatus may be a computer device that executes the method, such as a server.

[0066] Selecting the BERT series pre-trained model as the baseline model for text vector representation and outputting the semantic representation of text with the BERT series pre-trained model is the current mainstream method for obtaining text semantic representation. Compared with the previous word2vec vector representation and Glove vector representation, its technical means is that it can adjust the vector representation according to the word in different contexts, which is a dynamic vector representation method.

[0067] Furthermore, within the BERT model framework, a network structure based on the self-attention mechanism outputs an attention score matrix between texts. Since this score is calculated via the inner product of the matrix, it can be used as a similarity measure. Therefore, the attention score matrix is ​​equivalent to the similarity score matrix. In this case, the values ​​in the similarity score matrix range from 0 to 1. Subtracting the similarity score matrix from 1 yields the dissimilarity score matrix. Similarly, the values ​​in the dissimilarity score matrix also range from 0 to 1.

[0068] The reference standard for discrimination is the difference in literal meaning, which is a key point of the embodiment of the present invention: Under normal circumstances, the more similar the literal meaning of two texts is, the more similar their semantic meanings are. However, in the vertical domain scenario, the target text and the matching text may have different literal meanings but similar semantic meanings, or similar literal meanings but different semantic meanings. For example:

[0069] Example 1: The literal expressions between texts are different, but the semantics are similar:

[0070] Target text: "How old are you?"

[0071] Matched text: "What's your age this year?"

[0072] Explanation: There are many differences in the literal expressions between the target text and the matched text, but the semantics are the same, both asking about the age.

[0073] Example 2: The literal expressions between texts are similar, but the semantics are different:

[0074] Target text: "I want to buy an Apple."

[0075] Matched text: "I want to buy a pound of apples."

[0076] Explanation: There is only one character difference between the target text and the matched text, but the semantics are different. Because "Apple" in the target text represents the mobile phone brand "Apple", while "apples" in the matched text represents the fruit "apples".

[0077] The above target text and matched text can be tokenized respectively to obtain each token.

[0078] According to the comparison results of the words at the corresponding positions between texts, constructing a difference discrimination matrix between texts, including:

[0079] If it is determined that the words at the corresponding positions are literally the same, then determine that the value of the corresponding matrix element in the difference discrimination matrix is the dissimilarity score; referring to the above example, the word "I" in "I want to buy an Apple" and the word "I" in "I want to buy a pound of apples" at the corresponding positions are literally the same, determine that the value of the corresponding matrix element is the dissimilarity score, that is, determine that the value of the corresponding matrix element is 0.

[0080] If it is determined that the words at the corresponding positions are literally different, then determine that the value of the corresponding matrix element in the difference discrimination matrix is the similarity score. Referring to the above example, the word "piece" in "I want to buy an Apple" and the word "pound" in "I want to buy a pound of apples" at the corresponding positions are literally different, determine that the value of the corresponding matrix element is the similarity score, that is, determine that the value of the corresponding matrix element is 1.

[0081] As Figure 2 shown, the difference discrimination matrix corresponds to Figure 2 the difference information discrimination matrix in

[0082] In the above step S2, the device determines a difference score matrix according to the similarity score matrix, the dissimilarity score matrix, and the difference discrimination matrix.

[0083] Determining a difference score matrix according to the similarity score matrix, the dissimilarity score matrix, and the difference discrimination matrix includes:

[0084] According to the difference discriminant matrix, the score type of the matrix elements is extracted and the corresponding similarity representation matrix is ​​constructed; specifically, the steps include:

[0085] If it is determined that the score type is a dissimilar score, a dissimilar representation matrix is ​​constructed; wherein the value of the position of the matrix element in the dissimilar representation matrix is ​​1; the values ​​of the remaining positions are all 0; Matrix_dissim: represents the dissimilar representation matrix (when the score type of the matrix element to be extracted is determined to be a dissimilar score in the difference discrimination matrix, that is, the value in the difference discrimination matrix is ​​0. In the dissimilar representation matrix, the value of the corresponding position is 1, and the rest are 0).

[0086] If the score type is determined to be a similarity score, a similarity representation matrix is ​​constructed; wherein the value of the position of the matrix element in the similarity representation matrix is ​​1; the values ​​of the remaining positions are 0. Matrix_sim: represents the similarity representation matrix (when the score type of the matrix element to be extracted is determined to be a similarity score in the difference discriminant matrix, that is, the value in the difference discriminant matrix is ​​1. In the similarity representation matrix, the value of the corresponding position is 1, and the values ​​of the remaining positions are 0).

[0087] Determining the difference score matrix based on the similarity representation matrix, the similarity score matrix, and the dissimilarity score matrix. Specifically comprising:

[0088] Performing a positional multiplication on the dissimilarity representation matrix and the dissimilarity score matrix to obtain a first positional multiplication result;

[0089] Performing a positional multiplication on the similarity representation matrix and the similarity score matrix to obtain a second positional multiplication result;

[0090] The first bitwise multiplication result and the second bitwise multiplication result are added to obtain the difference score matrix. That is, the difference score matrix Diff_score can be calculated by the following formula:

[0091]

[0092] Among them, Dissim_score: represents the dissimilarity score matrix, Sim_score: represents the similarity score matrix; Indicates bitwise multiplication, Indicates counterpoint addition.

[0093] In the above step S3, the device determines the difference semantic representation vector of the text according to the difference score matrix, the context semantic representation vector and the preset difference semantic representation model, and fuses the difference semantic representation vector and the context semantic representation vector to obtain a text matching result between the texts;

[0094] The preset difference semantic representation model is obtained by training a deep neural network.

[0095] Determining the difference semantic representation vector of the text according to the difference score matrix, the context semantic representation vector, and a preset difference semantic representation model includes:

[0096] Using the difference score matrix as a weight and multiplying it with the context semantic representation vector to obtain an initial input vector for inputting into the preset difference semantic representation model;

[0097] The initial input vector is semantically represented based on the preset differential semantic representation model to obtain the differential semantic representation vector. The initial input vector is input into the preset differential semantic representation model, and the output of the preset differential semantic representation model is used as the differential semantic representation vector. The vector representation at this point does not sufficiently represent the extracted differential information, and further effective representation is required through training a deep neural network.

[0098] Due to the multi-layer transformer stacking architecture in the BERT series of models, the initial input vector is also multi-layered. Based on this, we can refer to the multi-channel input of images to construct a multi-layer input for text. Accordingly, a convolutional neural network (CNN) can be used to perform convolution and pooling on the multi-layer input, learn key differential information, and output the final differential semantic representation vector for the text.

[0099] The difference semantic representation vector and the context semantic representation vector are integrated to obtain the text matching result between the texts, as described below:

[0100] The weights corresponding to the difference semantic representation vector and the context semantic representation vector can be set to achieve the fusion of the difference semantic representation vector and the context semantic representation vector according to the actual situation and obtain the text matching result between the texts.

[0101] That is, the contextual semantic representation and differential semantic representation of the text are fused based on the gating mechanism. The gating mechanism can be achieved by controlling the proportion of contextual semantic representation information and the proportion of differential semantic representation information that are useful for text matching.

[0102] The text matching processing method provided by the embodiment of the present invention determines the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between the texts, and constructs a difference discrimination matrix between the texts based on the word comparison results of the corresponding positions between the texts; determines the difference score matrix based on the similarity score matrix, the dissimilarity score matrix and the difference discrimination matrix; determines the difference semantic representation vector of the text based on the difference score matrix, the contextual semantic representation vector and the preset difference semantic representation model, and fuses the difference semantic representation vector and the contextual semantic representation vector to obtain a text matching result between the texts; wherein, the preset difference semantic representation model is obtained by training a deep neural network, which can improve the accuracy of text matching in vertical fields.

[0103] like Figure 3 As shown, the method of the embodiment of the present invention can be implemented based on modularization, specifically including:

[0104] 1. Contextual semantic encoding module

[0105] The function of the contextual semantic encoding module is to obtain the similarity score matrix and dissimilarity score matrix matching between the vector representation of each word in the text in a specific context and the words in the text.

[0106] 2. Difference Information Discrimination Module

[0107] The function of the difference information discrimination module is to output a difference discrimination matrix by discriminating the type of score to be extracted between two words in the target text and the matching text (similar score or dissimilar score).

[0108] 3. Difference Information Extraction Module

[0109] The difference information extraction module is based on the text context semantic representation obtained by the context semantic encoding module, the similarity score matrix, the dissimilarity score matrix and the difference discrimination matrix obtained by the difference information discrimination module, and extracts the initial input vector

[0110] 4. Difference Information Encoding Module

[0111] The function of the difference information encoding module is to take the initial input vector as input, input it into the deep neural network for training, and then output the final difference semantic representation vector of the text.

[0112] 5. Information coding fusion module

[0113] The function of the information encoding fusion module is to fuse the contextual semantic representation and differential semantic representation of the text based on the gating mechanism, make probabilistic predictions on the matching labels of the target text and the matching text based on the fusion results, and output the final matching score.

[0114] To address the problems of matching failures caused by differences in wording between user questions and domain knowledge in vertical fields, as well as the increased costs associated with the difficulty of introducing external interpretation knowledge, in scenarios based on text matching technology, this paper proposes a text matching method that integrates deep contextual semantic information and differential semantic information.

[0115] By designing a difference discrimination matrix, extracting and encoding the difference information of the text, a difference semantic representation of the text is obtained, and then after fusion learning with the contextual semantic representation of the text, the final text matching score is obtained. The implementation of this invention is divided into five modules, among which the difference information discrimination module, the difference information extraction module and the difference information encoding module are the core. Its innovative points are as follows:

[0116] 1. Design a complete process for obtaining the semantic representation of the differences between the target text and the matching text, including "discrimination" to "extraction" and then to "encoding" of the difference information.

[0117] 2. A design idea is proposed to reversely extract the difference information between the texts by constructing a difference discriminant matrix based on the literal differences between the target text and the matching text.

[0118] Furthermore, the construction of a difference discrimination matrix between texts based on the word comparison results at corresponding positions between texts includes:

[0119] If it is determined that the words at the corresponding positions are identical in literal sense, the value of the corresponding matrix element in the difference discrimination matrix is ​​determined to be a dissimilarity score; reference may be made to the above description and no further details will be given.

[0120] If it is determined that the words at the corresponding positions are not consistent, the value of the corresponding matrix element in the difference discrimination matrix is ​​determined as the similarity score.

[0121] The text matching processing method provided by the embodiment of the present invention can further improve the accuracy of text matching in vertical fields by reasonably constructing a difference discrimination matrix between texts.

[0122] Furthermore, determining a difference score matrix according to the similarity score matrix, the dissimilarity score matrix and the difference discrimination matrix includes:

[0123] According to the difference discrimination matrix, the score type of the matrix elements is extracted and the corresponding similarity representation matrix is ​​constructed; the above description can be referred to and will not be repeated here.

[0124] The difference score matrix is ​​determined based on the similarity representation matrix, the similarity score matrix, and the dissimilarity score matrix.

[0125] The text matching processing method provided by the embodiment of the present invention can further improve the accuracy of text matching in vertical fields by reasonably determining the difference score matrix.

[0126] Furthermore, extracting the score types of matrix elements according to the difference discriminant matrix and constructing a corresponding similarity representation matrix includes:

[0127] If it is determined that the score type is a dissimilarity score, a dissimilarity representation matrix is ​​constructed; wherein the value of the position of the matrix element in the dissimilarity representation matrix is ​​1; the values ​​of the remaining positions are all 0; please refer to the above description and will not repeat it again.

[0128] If the score type is determined to be a similarity score, a similarity representation matrix is ​​constructed, wherein the value of the position of the matrix element in the similarity representation matrix is ​​1, and the values ​​of the remaining positions are 0. Please refer to the above description and will not repeat it again.

[0129] The text matching processing method provided by the embodiment of the present invention can further improve the accuracy of text matching in vertical fields by reasonably constructing a corresponding similarity representation matrix.

[0130] Furthermore, determining the difference score matrix according to the similarity representation matrix, the similarity score matrix and the dissimilarity score matrix includes:

[0131] The dissimilarity representation matrix and the dissimilarity score matrix are multiplied in a position-by-position manner to obtain a first position-by-position multiplication result. Please refer to the above description and no further details will be given.

[0132] The similarity representation matrix and the similarity score matrix are multiplied in a position-by-position manner to obtain a second position-by-position multiplication result; please refer to the above description and no further details will be given.

[0133] The first bitwise multiplication result and the second bitwise multiplication result are added bitwise to obtain the difference score matrix.

[0134] The text matching processing method provided in the embodiment of the present invention can further improve the accuracy of text matching in vertical fields by further reasonably calculating and obtaining a difference score matrix.

[0135] Furthermore, determining the difference semantic representation vector of the text according to the difference score matrix, the context semantic representation vector and a preset difference semantic representation model includes:

[0136] The difference score matrix is ​​used as a weight and multiplied with the context semantic representation vector to obtain an initial input vector for inputting the preset difference semantic representation model; please refer to the above description and will not repeat it here.

[0137] The initial input vector is semantically represented based on the preset difference semantic representation model to obtain the difference semantic representation vector.

[0138] The text matching processing method provided by the embodiment of the present invention can further improve the accuracy of text matching in vertical fields by reasonably determining the difference semantic representation vector.

[0139] Furthermore, the deep neural network is a convolutional neural network. Please refer to the above description and do not elaborate on it again.

[0140] The text matching processing method provided by the embodiment of the present invention can further improve the accuracy of text matching in vertical fields by training convolutional neural networks.

[0141] It should be noted that the text matching processing method provided in the embodiment of the present invention can be used in the financial field, and can also be used in any technical field other than the financial field. The embodiment of the present invention does not limit the application field of the text matching processing method.

[0142] Figure 4 FIG. 1 is a structural diagram of a text matching processing device provided by an embodiment of the present invention. Figure 4 As shown, the text matching processing device provided by the embodiment of the present invention includes a construction unit 401, a determination unit 402 and a fusion unit 403, wherein:

[0143] The construction unit 401 is used to determine the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between the texts, and construct the difference discrimination matrix between the texts based on the word comparison results of the corresponding positions between the texts; the determination unit 402 is used to determine the difference score matrix based on the similarity score matrix, the dissimilarity score matrix and the difference discrimination matrix; the fusion unit 403 is used to determine the difference semantic representation vector of the text based on the difference score matrix, the contextual semantic representation vector and the preset difference semantic representation model, and fuse the difference semantic representation vector and the contextual semantic representation vector to obtain the text matching result between the texts; wherein, the preset difference semantic representation model is obtained by training a deep neural network.

[0144] Specifically, the construction unit 401 in the device is used to determine the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between texts, and construct a difference discrimination matrix between texts based on the word comparison results of corresponding positions between texts; the determination unit 402 is used to determine the difference score matrix based on the similarity score matrix, the dissimilarity score matrix and the difference discrimination matrix; the fusion unit 403 is used to determine the difference semantic representation vector of the text based on the difference score matrix, the contextual semantic representation vector and the preset difference semantic representation model, and fuse the difference semantic representation vector and the contextual semantic representation vector to obtain a text matching result between texts; wherein, the preset difference semantic representation model is obtained by training a deep neural network.

[0145] The text matching processing device provided by the embodiment of the present invention determines the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between the texts, and constructs a difference discrimination matrix between the texts based on the word comparison results of corresponding positions between the texts; determines the difference score matrix based on the similarity score matrix, the dissimilarity score matrix and the difference discrimination matrix; determines the difference semantic representation vector of the text based on the difference score matrix, the contextual semantic representation vector and the preset difference semantic representation model, and fuses the difference semantic representation vector and the contextual semantic representation vector to obtain a text matching result between the texts; wherein, the preset difference semantic representation model is obtained by training a deep neural network, which can improve the accuracy of text matching in vertical fields.

[0146] Furthermore, the construction unit 401 is specifically configured to:

[0147] If it is determined that the words at the corresponding positions are identical in literal sense, then the value of the corresponding matrix element in the difference discrimination matrix is ​​determined to be a dissimilarity score;

[0148] If it is determined that the words at the corresponding positions are not consistent in their literal meanings, the value of the corresponding matrix element in the difference discrimination matrix is ​​determined as the similarity score.

[0149] The text matching processing device provided by the embodiment of the present invention can further improve the accuracy of text matching in vertical fields by reasonably constructing a difference discrimination matrix between texts.

[0150] Furthermore, the determining unit 402 is specifically configured to:

[0151] According to the score type of the matrix elements to be extracted from the difference discrimination matrix, a corresponding similarity representation matrix is ​​constructed;

[0152] The difference score matrix is ​​determined according to the similarity representation matrix, the similarity score matrix and the dissimilarity score matrix.

[0153] The text matching processing device provided by the embodiment of the present invention can further improve the accuracy of text matching in vertical fields by reasonably determining the difference score matrix.

[0154] Furthermore, the determining unit 402 is further specifically configured to:

[0155] If it is determined that the score type is a dissimilarity score, a dissimilarity representation matrix is ​​constructed; wherein the value of the position of the matrix element in the dissimilarity representation matrix is ​​1; and the values ​​of the remaining positions are all 0;

[0156] If it is determined that the score type is a similarity score, a similarity representation matrix is ​​constructed; wherein the value of the position of the matrix element in the similarity representation matrix is ​​1; and the values ​​of the other positions are all 0.

[0157] The text matching processing device provided by the embodiment of the present invention can further improve the accuracy of text matching in vertical fields by reasonably constructing a corresponding similarity representation matrix.

[0158] Furthermore, the determining unit 402 is further specifically configured to:

[0159] Performing a positional multiplication on the dissimilarity representation matrix and the dissimilarity score matrix to obtain a first positional multiplication result;

[0160] Performing a positional multiplication on the similarity representation matrix and the similarity score matrix to obtain a second positional multiplication result;

[0161] The first bitwise multiplication result and the second bitwise multiplication result are added bitwise to obtain the difference score matrix.

[0162] The text matching processing device provided by the embodiment of the present invention can further improve the accuracy of text matching in vertical fields by further reasonably calculating and obtaining a difference score matrix.

[0163] Furthermore, the fusion unit 403 is specifically configured to:

[0164] Using the difference score matrix as a weight and multiplying it with the context semantic representation vector to obtain an initial input vector for inputting into the preset difference semantic representation model;

[0165] The initial input vector is semantically represented based on the preset difference semantic representation model to obtain the difference semantic representation vector.

[0166] The text matching processing device provided by the embodiment of the present invention can further improve the accuracy of text matching in vertical fields by reasonably determining the difference semantic representation vector.

[0167] Furthermore, the deep neural network is a convolutional neural network.

[0168] The text matching processing device provided by the embodiment of the present invention can further improve the accuracy of text matching in vertical fields by training convolutional neural networks.

[0169] The text matching processing device provided in the embodiment of the present invention can be used to execute the processing flow of the above-mentioned method embodiments. Its functions are not described in detail here, and reference can be made to the detailed description of the above-mentioned method embodiments.

[0170] Figure 5 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as Figure 5 As shown, the electronic device includes: a processor 501, a memory 502 and a bus 503;

[0171] The processor 501 and the memory 502 communicate with each other via a bus 503.

[0172] The processor 501 is configured to call the program instructions in the memory 502 to execute the methods provided by the above method embodiments, for example, including:

[0173] Determine the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between the texts, and construct the difference discrimination matrix between the texts based on the word comparison results at corresponding positions between the texts;

[0174] Determining a difference score matrix based on the similarity score matrix, the dissimilarity score matrix, and the difference discrimination matrix;

[0175] Determining a differential semantic representation vector of a text based on the differential score matrix, the contextual semantic representation vector, and a preset differential semantic representation model, fusing the differential semantic representation vector and the contextual semantic representation vector to obtain a text matching result between the texts;

[0176] The preset difference semantic representation model is obtained by training a deep neural network.

[0177] This embodiment discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions. When the program instructions are executed by a computer, the computer can perform the methods provided in the above-mentioned method embodiments, for example, including:

[0178] Determine the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between the texts, and construct the difference discrimination matrix between the texts based on the word comparison results at corresponding positions between the texts;

[0179] Determining a difference score matrix based on the similarity score matrix, the dissimilarity score matrix, and the difference discrimination matrix;

[0180] Determining a differential semantic representation vector of a text based on the differential score matrix, the contextual semantic representation vector, and a preset differential semantic representation model, fusing the differential semantic representation vector and the contextual semantic representation vector to obtain a text matching result between the texts;

[0181] The preset difference semantic representation model is obtained by training a deep neural network.

[0182] This embodiment provides a computer-readable storage medium storing a computer program. The computer program enables the computer to execute the methods provided in the above method embodiments, for example, including:

[0183] Determine the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between the texts, and construct the difference discrimination matrix between the texts based on the word comparison results at corresponding positions between the texts;

[0184] Determining a difference score matrix based on the similarity score matrix, the dissimilarity score matrix, and the difference discrimination matrix;

[0185] Determining a differential semantic representation vector of a text based on the differential score matrix, the contextual semantic representation vector, and a preset differential semantic representation model, fusing the differential semantic representation vector and the contextual semantic representation vector to obtain a text matching result between the texts;

[0186] The preset difference semantic representation model is obtained by training a deep neural network.

[0187] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0188] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0189] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0190] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.

[0191] Throughout this specification, reference to terms such as "one embodiment," "a specific embodiment," "some embodiments," "for example," "example," "specific example," or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.

[0192] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A text matching processing method, characterized in that: include: Determine the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between the texts, and construct the difference discrimination matrix between the texts based on the word comparison results at corresponding positions between the texts; Determining a difference score matrix based on the similarity score matrix, the dissimilarity score matrix, and the difference discrimination matrix; Determining a differential semantic representation vector of a text based on the differential score matrix, the contextual semantic representation vector, and a preset differential semantic representation model, fusing the differential semantic representation vector and the contextual semantic representation vector to obtain a text matching result between the texts; The preset difference semantic representation model is obtained by training a deep neural network.

2. The text matching processing method according to claim 1, characterized in that: The method of constructing a difference discriminant matrix between texts based on the word comparison results of corresponding positions between texts includes: If it is determined that the words at the corresponding positions are identical in literal sense, then the value of the corresponding matrix element in the difference discrimination matrix is ​​determined to be a dissimilarity score; If it is determined that the words at the corresponding positions are not consistent in their literal meanings, the value of the corresponding matrix element in the difference discrimination matrix is ​​determined as the similarity score.

3. The text matching processing method according to claim 1, characterized in that: Determining a difference score matrix according to the similarity score matrix, the dissimilarity score matrix, and the difference discrimination matrix includes: According to the score type of the matrix elements to be extracted from the difference discrimination matrix, a corresponding similarity representation matrix is ​​constructed; The difference score matrix is ​​determined according to the similarity representation matrix, the similarity score matrix and the dissimilarity score matrix.

4. The text matching processing method according to claim 3, characterized in that: The step of extracting the score type of the matrix elements according to the difference discriminant matrix and constructing the corresponding similarity representation matrix includes: If it is determined that the score type is a dissimilarity score, a dissimilarity representation matrix is ​​constructed; wherein the value of the position of the matrix element in the dissimilarity representation matrix is ​​1; and the values ​​of the remaining positions are all 0; If it is determined that the score type is a similarity score, a similarity representation matrix is ​​constructed; wherein the value of the position of the matrix element in the similarity representation matrix is ​​1; and the values ​​of the other positions are all 0.

5. The text matching processing method according to claim 4, characterized in that: The determining the difference score matrix according to the similarity representation matrix, the similarity score matrix and the dissimilarity score matrix comprises: Performing a positional multiplication on the dissimilarity representation matrix and the dissimilarity score matrix to obtain a first positional multiplication result; Performing a positional multiplication on the similarity representation matrix and the similarity score matrix to obtain a second positional multiplication result; The first bitwise multiplication result and the second bitwise multiplication result are added bitwise to obtain the difference score matrix.

6. The text matching processing method according to claim 1, characterized in that: Determining the difference semantic representation vector of the text according to the difference score matrix, the context semantic representation vector, and a preset difference semantic representation model includes: Using the difference score matrix as a weight and multiplying it with the context semantic representation vector to obtain an initial input vector for inputting into the preset difference semantic representation model; The initial input vector is semantically represented based on the preset difference semantic representation model to obtain the difference semantic representation vector.

7. The text matching processing method according to claim 6, characterized in that: The deep neural network is a convolutional neural network.

8. A text matching processing device, characterized in that: include: A construction unit is used to determine the contextual semantic representation vector of the text, as well as the similarity score matrix and dissimilarity score matrix between the texts, and to construct a difference discrimination matrix between the texts based on the word comparison results at corresponding positions between the texts; a determining unit, configured to determine a difference score matrix based on the similarity score matrix, the dissimilarity score matrix, and the difference discrimination matrix; a fusion unit, configured to determine a differential semantic representation vector of a text based on the differential score matrix, the contextual semantic representation vector, and a preset differential semantic representation model, and fuse the differential semantic representation vector with the contextual semantic representation vector to obtain a text matching result between the texts; The preset difference semantic representation model is obtained by training a deep neural network.

9. An electronic device comprising 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 steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Computer-assisted computing method of semantic distance between short texts

    CN102622338A

  • Diagnosis recommendation method, electronic equipment and storage device

    CN112635050A