Semantic text similarity calculation method based on multi-angle enhanced network

Through the multi-angle enhanced network method, combined with Bi-SRU and soft alignment attention, global similarity modeling is performed, which solves the problem that the semantic information of Chinese text is not fully utilized in the existing technology, and significantly improves the efficiency of semantic text similarity calculation. Accuracy and efficiency.

CN116663523BActive Publication Date: 2024-09-24HANGZHOU ZHONGZHANG DATA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310565889.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-19
Publication Date
2024-09-24
Estimated Expiration
2043-05-19

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively capture the contextual multi-angle semantic interaction characteristics of Chinese text, resulting in the semantic information of Chinese text being underutilized, and the lack of global similarity modeling when calculating from a single perspective, affecting the accuracy of semantic text similarity calculation.

Method used

Adopting a multi-angle enhanced network method, through the fusion of character embedding and word embedding, using Bi-SRU network for encoding, combined with soft alignment attention and global similarity modeling, to capture the rich global similarity of text from three perspectives: semantic, time and space. sexual information, and perform classification prediction through MLP.

Benefits of technology

It improves the accuracy of semantic text similarity calculation of Chinese text, reduces the model calculation time, makes full use of the semantic information of Chinese text, and significantly improves the prediction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116663523B
    Figure CN116663523B
Patent Text Reader

Abstract

The present invention relates to a method for calculating semantic text similarity of a multi-angle enhanced network, including: segmenting Chinese text, obtaining text representation using character embedding and word embedding, training character embedding and word embedding in a corpus; fusing character embedding and word embedding to obtain a fusion vector, encoding the fusion vector using Bi-SRU; using soft alignment attention to further capture the similarity and difference of two texts; modeling the global similarity of the text to capture richer global similarity information; representing the result vector as a fixed vector through a pooling layer, inputting it into an MLP multi-classifier for classification; predicting the similarity of the two texts through the softmax of the MLP multi-classifier, and outputting the prediction probability. The problem that the rich semantics of Chinese cannot be fully utilized and the contextual semantic interaction features cannot be effectively captured from a single angle can be solved, thereby improving the accuracy of the model in calculating semantic text similarity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention mainly relates to the fields of natural language processing technology and computer artificial intelligence technology, and in particular to a method for calculating semantic text similarity of a multi-angle enhanced network. Background Art

[0002] Text semantic matching is a core issue in natural language processing, also known as semantic text similarity (STS) calculation, which is used to measure the similarity between two texts and can be applied to a large number of natural language processing tasks, such as information retrieval, automatic question answering, machine translation, recommendation systems, etc. These natural language processing tasks can be abstracted as text matching problems to a large extent. Specifically, information retrieval tasks compare the similarity between user queries and answers to find matching documents; automatic question answering tasks find the best candidate answers related to questions; machine translation matches the relevance of two languages; and recommendation systems match relevant metrics that users may be interested in through user behavior characteristics.

[0003] The model architecture that summarizes and analyzes semantic text similarity calculations can be mainly summarized into the following three categories.

[0004] 1. The first framework is a representation framework. The main idea is the "Siamese structure". Two identical encoders are used to map text pairs into the same space, and only the distance between vectors is used to calculate the similarity of two text vectors. However, the two texts are independent of each other during the encoding process, lacking clear interactive information, resulting in the loss of important information.

[0005] 2. The second is based on the "matching-aggregation" architecture, which usually uses encoders such as RNN or CNN to encode two texts into vectors of the same length, capture the matching signals of smaller units of the two texts (such as characters, words, or contextual information), and then aggregate the matching results to analyze the similarity from a global perspective. This framework essentially interacts through some technology or method in the "Siamese network", so the interactive ability has been significantly improved, and the semantic focus and interactive information are better grasped.

[0006] 3. The third framework is based on a pre-trained model. It completes specific text matching tasks by fine-tuning the pre-trained Bert model, and has achieved good results in a variety of NLP tasks. Although this method has improved accuracy, it has a higher order of magnitude of parameter size and time cost than the first two methods, and there are major problems in balancing model capacity and accuracy.

[0007] Due to the complexity and ambiguity of Chinese text semantics, more semantic information is not fully utilized, and the semantic interaction features of multiple context angles cannot be effectively captured from a single perspective. The current model architecture and methods need to further solve this problem.

[0008] The above-mentioned record of background technical knowledge is intended to help ordinary technicians in this field understand the existing technologies that are relatively close to the present invention, and at the same time facilitate the understanding of the inventive concept and technical solution of this application. It should be clear that in the absence of clear evidence that the above-mentioned content has been disclosed before the filing date of this patent application, the above-mentioned background technology should not be used to evaluate the novelty of the technical solution of this application. Summary of the invention

[0009] In order to solve at least one of the technical problems mentioned in the above background technology, the purpose of the present invention is to provide a semantic text similarity calculation method based on a multi-angle enhanced network of a simple recurrent unit, which can solve the problem that the rich semantics of Chinese cannot be fully utilized and the contextual semantic interaction features cannot be effectively captured from a single angle. It models the global similarity of text from three angles of semantics, time and space, captures richer global similarity information, and thus improves the accuracy of calculating semantic text similarity.

[0010] The semantic text similarity calculation method of the multi-angle enhanced network includes:

[0011] Segment Chinese text, use character embedding and word embedding to obtain text representation, and train character embedding and word embedding in the corpus;

[0012] Fuse character embedding and word embedding to obtain a fused vector, and use Bi-SRU to encode the fused vector;

[0013] Use soft-aligned attention to further capture the similarities and differences between two texts;

[0014] Model the global similarity of texts to capture richer global similarity information;

[0015] The result vector is represented as a fixed vector through the pooling layer and input into the MLP multi-classifier for classification;

[0016] The similarity between two texts is predicted through the softmax of the MLP multi-classifier, and the output is the predicted probability of the semantic similarity of the texts.

[0017] As a preferred embodiment of the technical solution of the present application, the word segmentation of the Chinese text is performed using the jieba word segmentation tool.

[0018] As a preferred embodiment of the technical solution of the present application, the corpus includes Wikipedia and / or Baidu Encyclopedia.

[0019] As a preferred embodiment of the technical solution of the present application, the training of character embedding and word embedding in the corpus performs the following steps:

[0020] Character embeddings and word embeddings are trained by Word2Vec;

[0021] Set the character vector dimension to 300 and the word vector dimension to 300 to get the word vector matrix of two texts a and b and Among them, d is the dimension of the word vector, is the embedding of the vector, m is the length of text a, and n is the length of text b. During the training process, it was found that trainable word embeddings may lead to overfitting, so word embeddings are fixed.

[0022] As a preferred embodiment of the technical solution of the present application, the following steps are performed to encode the fusion vector using Bi-SRU:

[0023] Input the fusion vector into Bi-SRU;

[0024] Lightweight computation is performed in Bi-SRU to remove the dependency of the gate structure on the hidden state of the previous moment to reduce the degree of recursion. At the same time, skip connections are used;

[0025] The feature sequence obtained after Bi-SRU is: and The subscript t is the time step, h t is the hidden state vector at time t, and the feature vector is obtained by connecting the two.

[0026] As a preferred embodiment of the technical solution of the present application, the formula for inputting the fusion vector into Bi-SRU is as follows:

[0027]

[0028]

[0029] in, is the i-th encoding vector of A after encoding; is the jth encoding vector of B after encoding; A i is the i-th word vector of A; B j is the j-th word vector of B.

[0030] As a preferred embodiment of the technical solution of the present application, the soft alignment attention is used to further capture the similarities and differences between the two texts and perform the following steps:

[0031] Use soft-aligned attention to compute the hidden state group between text pairs to associate the relevant parts between two texts: s ij is the attention weight, which is used to obtain the local relevance of two texts;

[0032] for and Use s ij To identify and combine related semantics in another text, the specific formula is as follows:

[0033]

[0034]

[0035] in, yes The weighted sum of Zhongyu The relevant information is selected and represented as

[0036] for The same calculation operations are used.

[0037] As a preferred embodiment of the technical solution of the present application, the use of soft alignment attention to further capture the similarities and differences between the two texts further performs the following steps:

[0038] By calculating the tuple and The difference and element-wise product of , and then the original vector and as well as and Connect with the difference and element product respectively to obtain local similarity information. The calculation formula is as follows:

[0039]

[0040]

[0041] Among them, ⊙ represents element-by-element multiplication, I A and I B are the concatenated vectors respectively.

[0042] As a preferred embodiment of the technical solution of the present application, the global similarity modeling of text is performed from three perspectives: semantics, time and space.

[0043] As a preferred embodiment of the technical solution of the present application, the global similarity modeling of the text is performed to capture richer global similarity information by performing the following steps:

[0044] The above local similarity information is synthesized and input into at least two layers of Bi-SRU to capture the semantic and temporal global similarity information of the text respectively. The specific formula includes:

[0045]

[0046]

[0047] Where G is a 1-layer feed-forward neural network with ReLU activation, t Represents the output of Bi-SRU at time t. After fully capturing the global similarity information from the temporal and semantic perspectives, it is necessary to further capture the global similarity information from the spatial perspective.

[0048] As a preferred embodiment of the technical solution of the present application, the global similarity modeling of the text is performed to capture richer global similarity information and further perform the following steps:

[0049] Output the result of the previous step It is expressed as:

[0050]

[0051] Among them, k0 is the hidden state size, For the connection operation, l i:i+j for (l i ,l i+1 ,...l i+j ) and input it into NIN;

[0052] Based on the output of convolution, maximum pooling and column-wise average pooling are performed to capture the most valuable features for each feature map, and these vectors are connected to represent the final vector. The overall NIN formula is:

[0053]

[0054] in, is the output of the NIN module. After fully capturing the global similarity information from the temporal and semantic perspectives, the CNN layer is used to further capture the global similarity information from the spatial perspective. At the same time, the “NIN” idea, i.e. “NetworkInNetwork”, is introduced to improve CNN to achieve better performance.

[0055] As a preferred embodiment of the technical solution of the present application, the result vector is represented as a fixed vector through the pooling layer and input into the MLP multi-classifier for classification, specifically performing the following steps:

[0056] The vector result is obtained by using the average pooling operation and the maximum pooling operation, and the obtained vector result is connected with the output of the NIN layer to form the final fixed vector o. The formula is as follows:

[0057]

[0058]

[0059]

[0060]

[0061]

[0062] in, yes The vector after average pooling; yes The vector after average pooling; yes Vector after max pooling; yes Vector after max pooling; and It is the result of the concatenated vector of Bi-GRU output passing through the NIN module.

[0063] Input o into the multi-layer perceptron classifier: y = MLP(o);

[0064] Here, the MLP consists of a hidden layer with tanh activation and an output layer with softmax.

[0065] As a preferred embodiment of the technical solution of this application, the operation of the training model is as follows:

[0066] Create a loss function: Use the sigmoid cross entropy loss function for training. The formula is as follows:

[0067]

[0068] Select optimizer: After experimental comparison, we choose to use Adam optimizer to update parameters through back propagation, and the learning rate is set to 0.0002;

[0069] When the model has not been trained, it needs to be trained and the model parameters are saved at the optimal time; when the model training is completed, it can be determined whether the semantics of the input text are similar.

[0070] A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by a processor, wherein when the computer program is executed by the processor, at least one step of the aforementioned method for calculating semantic text similarity of the multi-angle enhanced network is executed.

[0071] A computer device, comprising a memory, a processor, a communication interface and a communication bus; wherein the memory, the processor and the communication interface communicate with each other via the communication bus; the memory is used to store computer programs; the processor is used to execute the computer programs stored in the memory, and when the processor executes the computer program, at least one step of the aforementioned method for calculating semantic text similarity of the multi-angle enhanced network is implemented.

[0072] The beneficial effects of this application are:

[0073] (i) The present invention uses a fusion of character-level embedding and word-level embedding to capture finer-grained semantic feature information in Chinese text through embedding of two granularities, making full use of the semantic information of Chinese text;

[0074] (ii) Using the easily scalable simple recurrent unit network (Bi-SRU) instead of Bi-LSTM to extract text grammatical and semantic information, reducing model calculation time and improving accuracy;

[0075] (iii) Model the global similarity of texts from the perspectives of semantics, time, and space to capture richer global similarity information, thereby improving the accuracy of text semantic similarity prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0076] In order to make the above and / or other purposes, features, advantages and examples of the present invention more obvious and easy to understand, the drawings required for use in the specific implementation of the present invention will be briefly introduced below. 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 paying creative work.

[0077] Figure 1 It is a flow chart of the semantic text similarity calculation method of the multi-angle enhanced network proposed by the present invention;

[0078] Figure 2 It is a technical flow chart of the semantic text similarity calculation method of the multi-angle enhanced network proposed in the present invention. DETAILED DESCRIPTION

[0079] Those skilled in the art can refer to the content of this article and appropriately replace and / or modify the process parameters to achieve the same. However, it should be particularly noted that all similar replacements and / or modifications are obvious to those skilled in the art and are considered to be included in the present invention. The products and preparation methods described in the present invention have been described through preferred examples. It is obvious that relevant personnel can modify or appropriately change and combine the products and preparation methods described herein without departing from the content, spirit and scope of the present invention to implement and apply the technology of the present invention.

[0080] Unless otherwise defined, technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the invention belongs. The present invention uses the methods and materials described herein; however, other suitable methods and materials known in the art may also be used. The materials, methods, and examples described herein are illustrative only and are not intended to be limiting. All publications, patent applications, patents, provisional applications, database entries, and other references mentioned herein are incorporated herein by reference in their entirety. In the event of a conflict, the present specification, including definitions, shall prevail.

[0081] Unless specifically stated, the materials, methods, and examples described herein are illustrative only and not limiting. Although methods and materials similar or equivalent to those described herein can be used in the practice or testing of the present invention, suitable methods and materials are still described herein.

[0082] In order to facilitate understanding of the embodiments of the present invention, abbreviations and key terms that may be involved in the embodiments of the present invention are first explained or defined.

[0083] Bi-SRU: Bidirectional SRU network;

[0084] MLP: Multilayer Perceptron, also known as artificial neural network;

[0085] Word2Vec: A family of related models for generating word embeddings, specifically a shallow, two-layer neural network trained to reconstruct linguistic word texts;

[0086] ReLU: Linear rectification function, also known as the rectified linear unit, is a commonly used activation function in artificial neural networks;

[0087] CNN: Convolutional Neural Networks, convolutional neural network;

[0088] tanh: hyperbolic tangent activation function;

[0089] Softmax: normalized exponential function;

[0090] decomposable attention: decomposable attention model;

[0091] ABCNN: Attention-Based Convolutional Neural Network, an attention-based convolutional neural network model;

[0092] BiMPM: bilateral multi-perspective matching model, bidirectional multi-perspective matching model;

[0093] ESIM: Enhanced Sequential Inference Model, a model that combines BiLSTM and attention mechanism;

[0094] RE2: A model mentioned in a 2019 text matching paper published by Alibaba and Nanjing University: Simple and Effective Text Matching with Richer Alignment Features. It does not use LSTM for feature extraction, supports parallel processing, and has fewer parameters.

[0095] ERCNN: Error feedback based recurrent convolutional neural network.

[0096] The present invention is described in detail below.

[0097] Embodiment 1:

[0098] A method for calculating semantic text similarity based on a multi-angle enhanced network of simple recurrent units is provided. The flowchart is as follows: Figure 1 As shown, the brief process of the method is as follows:

[0099] First, Chinese text is segmented, and text representation is obtained using character embedding and word embedding. Character embedding and word embedding are pre-trained on Wikipedia and Baidu Encyclopedia. The embeddings of two granularities are used to capture finer-grained semantic feature information in Chinese text.

[0100] Secondly, the easily scalable simple recurrent unit network (Bi-SRU) is used instead of Bi-LSTM to extract text grammatical and semantic information from the fusion vector obtained after fusing character embedding and word embedding, and encode the text.

[0101] Soft-aligned attention is used again to further capture the similarities and differences between the two texts.

[0102] Finally, the global similarity of text is modeled from the perspectives of semantics, time and space to capture richer global similarity information.

[0103] Finally, the result vector is represented as a fixed vector through the pooling layer and input into the MLP multi-classifier for classification, the similarity between the two texts is predicted, and the predicted probability of semantic similarity is output.

[0104] Embodiment 2:

[0105] Based on the above embodiments, the semantic text similarity calculation method based on the multi-angle enhanced network of simple recurrent unit is further described in detail. The technical flow chart is as follows: Figure 2 As shown, the specific steps are as follows.

[0106] Step 1:

[0107] Use the jieba word segmentation tool to segment the two Chinese texts, and use word embedding and character embedding to obtain text representation. Word embedding and character embedding are pre-trained by Word2Vec using relevant corpora. During the training process, it was found that trainable word embedding may cause overfitting, so word embedding is fixed. Set the character vector dimension to 300 and the word vector dimension to 300. Get the word vector matrix of the two texts and in is the embedding of the vector, d is the dimension of the word vector, m is the length of text a, and n is the length of text b.

[0108] Step 2:

[0109] The word embedding and character embedding are fused, and the fused vector is input into the bidirectional SRU network (Bi-SRU) for encoding. Lightweight calculation is performed in SRU to remove the dependence of the gate structure on the hidden state of the previous moment to reduce the degree of recursion. At the same time, skip connections are used. The feature sequence obtained after Bi-SRU is and The feature vector is obtained by connecting the two, where t is the time step and h is t is the hidden state vector at time t.

[0110] The obtained text representations A and B are input into Bi-SRU, and the formula is as follows:

[0111]

[0112]

[0113] in, is the i-th encoding vector of A after encoding, is the jth encoding vector of B after encoding, A i represents the i-th word vector of A, B j Represents the j-th word vector of B.

[0114] Step 3:

[0115] Use soft-aligned attention to compute the hidden state group between text pairs to associate the relevant parts between two texts: s ij is the attention weight, which is used to obtain the local correlation between two texts.

[0116] for and Use s ij To identify and combine relevant semantics in another text, the specific formula is as follows;

[0117]

[0118]

[0119] in, yes The weighted sum of, intuitively speaking, Zhongyu The relevant information is selected and represented as for Using the same calculation operation, that is, yes The weighted sum of Zhongyu The relevant information is selected and represented as

[0120] Step 4:

[0121] By calculating the tuple and The difference and element-wise product of , and then the original vector and as well as and Connect with the difference and element product respectively, and the calculation formula is as follows:

[0122]

[0123]

[0124] Among them, ⊙ represents element-by-element multiplication, I A and I B is the concatenated vector.

[0125] Step 5:

[0126] The above local similarity information is synthesized and input into the 2-layer Bi-SRU to capture the semantic and temporal global similarity information of the text respectively. The specific formula is:

[0127]

[0128]

[0129] Where G is a 1-layer feed-forward neural network with ReLU activation, t Represents the output of Bi-SRU at time t.

[0130] Step 6:

[0131] After fully capturing the global similarity information from the temporal and semantic perspectives, the CNN layer is used to further capture the global similarity information from the spatial perspective. At the same time, the "NIN" idea, i.e. "Network In Network", is introduced to improve CNN to achieve better performance. It is expressed as: Among them, k0 is the hidden state size, This is a connection operation. i:i+j for (l i ,l i+1 ,...l i+j ) and input it into the improved CNN, namely NIN.

[0132] Based on the output of convolution, maximum pooling and column-wise average pooling are performed to capture the most valuable features for each feature map, and these vectors are connected to represent the final vector. The overall NIN formula is: It is the output of the NIN module.

[0133] Step 7:

[0134] The vector results of the two-layer Bi-SRU are processed into a fixed-length vector through the pooling layer, specifically using the average pooling operation and the maximum pooling operation, and the obtained vector results are connected with the output of the NIN layer to form the final fixed-length vector o. The operation formula is as follows:

[0135]

[0136]

[0137]

[0138]

[0139]

[0140] in, yes The vector after average pooling, yes The vector after average pooling, yes The vector after max pooling, yes The vector after max pooling, and It is the result of the concatenated vector of Bi-GRU output passing through the NIN module.

[0141] Input o into the multi-layer perceptron classifier: y = MLP(o); where MLP includes a hidden layer with tanh activation and an output layer with softmax.

[0142] The similarity between two texts is predicted through softmax, and the output of MLP is the predicted probability of the semantic similarity between text A and B.

[0143] The operations of training the model are as follows:

[0144] Create a loss function: Use the sigmoid cross entropy loss function for training. The formula is as follows:

[0145]

[0146] Select optimizer: After experimental comparison, we choose to use Adam optimizer to update parameters through back propagation, and the learning rate is set to 0.0002;

[0147] When the model has not been trained, it needs to be trained and the model parameters are saved at the optimal time; when the model training is completed, it can be determined whether the semantics of the input text are similar.

[0148] The method of the present invention first performs word segmentation on the text, uses word embedding and character embedding to represent the text, and fuses character granularity embedding and word granularity embedding, captures finer-grained semantic feature information in the Chinese text through the embedding of the two granularities, and makes full use of the semantic information of the Chinese text, and then replaces the Bi-LSTM with a simple recurrent unit network (Bi-SRU) to extract text grammar and semantic information, reducing the model calculation time by not less than 30%, aiming at capturing richer global similarity information from the three perspectives of semantics, time and space after the global similarity modeling of the text by the present application scheme, thereby significantly improving the accuracy of text semantic text similarity prediction. Table 1 shows the comparison of the verification results of the present application scheme with the traditional model, and it can be seen that the present application model (SMAEN) has an accuracy rate of 85.88% and an F1 value of 86.62%, which are both better than the traditional model of the prior art.

[0149] Table 1 - Model validation results

[0150]

[0151] Embodiment 3:

[0152] On the basis of the aforementioned embodiment, a computer-readable storage medium is provided, in which a computer program executable by a processor is stored. When the computer program is executed by the processor, the various steps of the aforementioned method for calculating the semantic text similarity of the multi-angle enhanced network are run, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0153] Embodiment 4:

[0154] On the basis of the aforementioned embodiment, a computer device is provided, which includes a memory, a processor, a communication interface and a communication bus; wherein the memory, the processor and the communication interface communicate with each other via the communication bus; the memory is used to store computer programs; the processor is used to execute the computer programs stored in the memory, and when the processor executes the computer program, each step in the aforementioned method for calculating semantic text similarity of the multi-angle enhanced network is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0155] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PR AM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0156] The conventional techniques in the above embodiments are prior arts known to those skilled in the art, and thus will not be described in detail here.

[0157] The specific embodiments described herein are merely examples of the spirit of the present invention. Those skilled in the art may make various modifications or additions to the specific embodiments described or replace them in similar ways, but they will not deviate from the spirit of the present invention or exceed the scope defined by the appended claims.

[0158] Although the present invention has been described in detail and some specific embodiments have been cited, it is obvious to those skilled in the art that various changes and modifications can be made without departing from the spirit and scope of the present invention.

[0159] Although the above-mentioned specific embodiments have been shown, described and pointed out the novel features applied to various embodiments, it should be understood that various omissions, substitutions and changes can be made to the form and details of the described device or method without departing from the spirit of the present disclosure. In addition, the above-mentioned various features and methods can be used independently of each other, or can be combined in various ways. All possible combinations and sub-combinations are intended to fall within the scope of the present disclosure. Many of the above-mentioned embodiments include similar components, and therefore, these similar components are interchangeable in different embodiments. Although the present invention has been disclosed in the context of certain embodiments and examples, it should be understood by those skilled in the art that the present invention can extend beyond the specifically disclosed embodiments to other alternative embodiments and / or applications and obvious modifications and equivalents thereof. Therefore, the present invention is not intended to be limited by the specific disclosure of the preferred embodiments herein.

[0160] Matters not covered in the present invention are all known technologies.

Claims

1. A semantic text similarity calculation method based on a multi-angle enhanced network, characterized in that: include: Segment the Chinese text, use character embedding and word embedding to get text representation, train character embedding and word embedding in the corpus, including: character embedding and word embedding are trained by Word2Vec; set the character vector dimension to 300 and the word vector dimension to 300, and get two texts and The word vector matrix and ,in, is the dimension of the word vector, is the embedding of the vector, is text Length, is text Length; The character embedding and word embedding are combined to obtain a fused vector, and the fused vector is encoded using Bi-SRU, including: inputting the fused vector into Bi-SRU: The formula is as follows: in, After encoding No. encoding vectors; After encoding No. encoding vectors; No. word vectors; No. word vectors; lightweight calculations are performed in Bi-SRU to remove the dependence of the gate structure on the hidden state of the previous moment to reduce the degree of recursion. At the same time, skip connections are used; the feature sequence obtained after Bi-SRU is and , subscript is the time step, It's time The hidden state vector of , and the feature vector is obtained by connecting the two; Use soft alignment attention to further capture the similarities and differences between two texts. Perform the following steps: Use soft-aligned attention to compute the hidden state group between text pairs to associate the relevant parts between two texts: , is the attention weight, which is used to obtain the local correlation of two texts; and ,use To identify and combine related semantics in another text, the specific formula is as follows: in, yes The weighted sum of Zhongyu The relevant information is selected and represented as ;for Using the same calculation operations; By calculating the tuple and The difference and element-wise product of , and then the original vector and as well as and Connect with the difference and element product respectively to obtain local similarity information. The calculation formula is as follows: in, represents element-wise multiplication, and are the concatenated vectors respectively; Model the global similarity of text from the perspectives of semantics, time, and space to capture richer global similarity information. Perform the following steps: The above local similarity information is synthesized and input into at least two layers of Bi-SRU to capture the semantic and temporal global similarity information of the text respectively. The specific formula includes: in, is a 1-layer feed-forward neural network with ReLU activation, Indicates that Bi-SRU Output at the moment; further perform the following operations: output the result of the previous step It is expressed as: in, is the hidden state size, For the connection operation, for , and input it into NIN; Based on the output of convolution, maximum pooling and column-wise average pooling are performed to capture the most valuable features for each feature map, and these vectors are connected to represent the final vector. The overall NIN formula is: in, is the output of the NIN module; The result vector is represented as a fixed vector through the pooling layer and input into the MLP multi-classifier for classification: the vector result is obtained by using the average pooling operation and the maximum pooling operation, and the obtained vector result is connected with the output of the NIN layer to form the final fixed vector o; The similarity between two texts is predicted through the softmax of the MLP multi-classifier, and the output is the predicted probability of the semantic similarity of the texts.

2. The method for calculating semantic text similarity of a multi-angle enhanced network according to claim 1, characterized in that: The result vector is represented as a fixed vector through the pooling layer and input into the MLP multi-classifier for classification. Specifically, the following steps are performed: Use average pooling and maximum pooling operations to obtain the vector result, and connect the obtained vector result with the output of the NIN layer to form the final fixed vector , the formula is as follows: in, yes The vector after average pooling; yes The vector after average pooling; yes Vector after max pooling; yes Vector after max pooling; and It is the result of the concatenated vector of Bi-GRU output passing through the NIN module.

3. A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program executable by a processor, wherein: When the computer program is executed by a processor, the method for calculating semantic text similarity of a multi-angle enhanced network according to claim 1 or 2 is executed.

4. A computer device, comprising a memory, a processor, a communication interface and a communication bus; wherein: The memory, processor, and communication interface communicate with each other via the communication bus; the memory is used to store computer programs; the processor is used to execute the computer programs stored in the memory, and when the processor executes the computer program, the semantic text similarity calculation method of the multi-angle enhanced network described in claim 1 or 2 is implemented.