A method for matching short text sentences in conversations for intelligent voice assistants
By stacking CNN, BiLSTM and self-attention mechanism to extract text features, it solves the problems of low accuracy and slow processing speed of traditional sentence matching technology, realizes efficient sentence matching of intelligent voice assistants, and improves the accuracy and speed of sentence matching.
Patent Information
- Application Number
- CN202111422626.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-26
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2041-11-26
AI Technical Summary
Traditional sentence matching technology has low accuracy and long processing time, making it difficult to accurately understand the contextual information in the user's query, resulting in low efficiency in matching short dialogue text sentences.
Stacked CNN and parallel CNN are used to extract text phrase features, BiLSTM and self-attention mechanism are combined to extract contextual and interactive features, and features are aggregated through compression functions. Finally, MLP is input for prediction, and stratified sampling and word vector models are used to accelerate model training.
It improves the accuracy and processing speed of sentence matching, enhances the ability to represent key information and semantic associations within sentences, avoids network layer expansion and parameter overhead, and achieves efficient sentence matching for intelligent voice assistants.
Smart Images

Figure CN114281987B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of artificial intelligence technology, and relates to the fields of deep learning, natural language processing, and sentence matching technology, and specifically to a method for matching short text sentences in a conversation for an intelligent voice assistant. Background Art
[0002] Intelligent voice assistants can provide users with interesting, caring, and convenient conversational services, and conversational short text sentence matching is a core task in the conversation system. After receiving the user's query expressed in natural language, parsing the user's intention and processing the question, the voice assistant will obtain relevant knowledge and apply sentence matching technology through relevant retrieval, knowledge base matching and reasoning to finally form a natural language expression answer. Sentence matching based on conversational short text is a challenging task because the user's query is usually very short and lacks sufficient information, requiring the system to accurately understand the context before making a final judgment.
[0003] Traditional sentence matching technology has low accuracy and long processing time, so there is an urgent need for a conversation short text sentence matching method with high matching accuracy and fast processing speed. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a conversation short text sentence matching method for an intelligent voice assistant, so that the conversation short text sentence matching can have a higher accuracy, thereby solving the problems of low accuracy and long processing time of traditional sentence matching technology.
[0005] In order to achieve the above object, the present invention provides the following technical solutions:
[0006] A method for matching short text sentences of a conversation for an intelligent voice assistant comprises the following steps:
[0007] S1: Vectorize text data in the intelligent voice assistant dialogue system and extract phrase features of text using stacked CNN and parallel CNN;
[0008] S2: Use stacked BiLSTM to extract contextual features, and then use a new intra-sentence self-attention mechanism to extract key features within the text;
[0009] S3: Use the sentence-to-sentence attention mechanism to extract interactive features, and use the compression function to aggregate and compress multiple interactive effects to obtain the matching features of the text;
[0010] S4: Input the matching features into MLP, predict the text label and perform post-processing.
[0011] Furthermore, in step S1, data processing and vectorization specifically include:
[0012] S101: Divide the conversation short text data into a training set and a validation set using the holdout method. When dividing the data using the holdout method, a stratified sampling method is used, which can ensure the consistency of the distribution of positive and negative samples in the training set and the validation set, and accelerate the convergence of the model. The description of stratified sampling is as follows: assuming that the original data set is D, D is stratified and sampled into a training set S and a validation set T, so that the ratio of positive and negative samples in the S and T data sets is consistent with that in D, then the sampling is stratified sampling;
[0013] S102: Segment the text; the text segmentation includes two main steps: dictionary construction and segmentation algorithm operation; in the present invention, we construct a dictionary tree, and there are many methods for constructing a dictionary tree. In the present invention, we use a double array Trie tree for construction, and for the segmentation operation, the shortest path method is used for the segmentation operation;
[0014] S103: removing stop words (including punctuation marks, numbers and other meaningless words, such as auxiliary words, modal particles, etc.), and processing the stop words using manual rules, that is, replacing special symbols, punctuation marks, and numbers using a manually established stop word dictionary;
[0015] S104: Use the short text corpus of the intelligent voice assistant's conversation to train the Word2Vec word vector model, and then map the words in the text into word vectors of fixed dimensions;
[0016] S105: The syntactic feature vector is composed of a one-hot vector of a part-of-speech tag (POS) and a binary exact match (EM) feature vector. Exact match can be understood as if a word in one sentence appears in another sentence, then the position is set to 1.
[0017] The final vector representation of the text is:
[0018] w=[d word ;d pos ;d em ]
[0019] Among them, d word is the word vector, d pos is the part-of-speech tag vector, d em is an exact match feature vector.
[0020] Further, in step S1, the phrase features of the text are extracted using stacked CNN and parallel CNN, which specifically includes the following steps:
[0021] S111: Get the word vector and syntactic feature vector of the text. The syntactic feature vector is composed of the one-hot vector of the part-of-speech tag (POS) and the binary exact match (EM) feature vector. Exact match can be understood as if a word in one sentence appears in another sentence, then the position is set to 1. The final text vector w is expressed as:
[0022] w=[d word ;d pos ;d em ]
[0023] Among them, d word is the word vector, d pos is the part-of-speech tag vector, d em To accurately match the feature vector;
[0024] S112: Use stacked CNNs to capture phrase-level representations of length k. The convolution kernel size of each layer is k. Assuming there are n convolutional layers in total, the output of each layer is expressed as:
[0025]
[0026] The input of each layer is the output of the previous layer. is w, and the phrase feature extracted in the end is p with a length of k. d ;
[0027] S113: Use parallel CNN to extract phrase-level representations of different lengths. Each convolution layer has a different convolution kernel size. Assuming there are n convolution layers, the convolution kernel sizes are k, k+1, ..., k+n-1 respectively. The phrase features of different lengths finally extracted are in, is the output of the convolutional layer with a kernel size of k, and so on;
[0028] S114: All phrase features are concatenated, and the final phrase feature p is expressed as:
[0029]
[0030] S115: Reduce the dimensionality of the phrase feature vector through two fully connected layers. The dimensionality reduction formula is:
[0031] p l =max(0, p l-1 W1+b1)W2+b2,l=1,2
[0032] Among them, W1 and W2 are connection weight matrices, b1 and b2 are bias terms; p l is the output of the lth layer, p 0=p, and finally a vector of size [batch_size, seq_len, hidden_size] is obtained, where bbatch_size is the number of samples, seq_len is the sample length, and hidden_size is the size of the BiLSTM hidden layer.
[0033] Further, in step S2, context features and key features are extracted, which specifically includes the following steps:
[0034] S21: Use n-layer BiLSTM to extract context features, and the output of each layer is expressed as:
[0035] t h =BiLSTM h (t h-1 ), h=1,…,n
[0036] The input of each layer is the output of the previous layer, and the input of the first layer is t0 = p 2 , p represents the phrase feature;
[0037] S22: The BiLSTM+attention model is used to calculate the self-attention matching weight within the sentence. The matching calculation uses the bilinear function method. The formula is as follows:
[0038]
[0039] Among them, c is the state value of the last moment unit of the BiLSTM encoding of the lth layer, which is matched with the output h of each intermediate moment, M is the weight parameter, b is the bias term, and the matching result is softmax classified to obtain each word in the sentence (that is, each moment h t )’s self-attention weight w, and the key feature vector in the sentence is obtained by weighted summation of the calculated weights as t * ;
[0040] S23: The output of the last layer of BiLSTM n and the key eigenvector t * Concatenate as the input t of the next layer, the size of t is:
[0041] [batch_size, seq_len, hidden_size*2+1]
[0042] Further, in step S3, extracting and compressing interactive features includes:
[0043] S31: Use four sentence attention mechanisms: conca attention, bilinear attention, dotattention, and minus attention to extract interactive features and get x respectively. c 、x b 、x d and x m Four interaction eigenvectors.
[0044] Using one inter-sentence attention mechanism or alignment method will result in the captured interaction features being single and incomplete. In order to capture multi-dimensional and deep interaction features, four inter-sentence attention mechanism calculation methods are used to calculate the similarity of word pairs in two sentences, construct a similarity matrix, normalize it as weights, and combine the weights and the word vectors of the other sentence to obtain the interaction feature vector of the word.
[0045] S32: Aggregate interactive features. Inspired by the ESIM model, when aggregating different feature vectors, in order to retain the original information, enhance the mined key information, and capture reasoning relationships such as contradictions, the interactive feature vectors are aggregated in the following ways:
[0046] f c =F([t;x])
[0047] f m =F([t⊙x])
[0048] f s =F(tx)
[0049] Among them, t is the output t of the last layer of BiLSTM n and the key eigenvector t * The concatenated vector, x is the four interactive feature vectors, and F(·) is the compression function. The aggregated vector is compressed. When the attention mechanism is applied, different matching features can be obtained by adopting different attention mechanisms. In order to combine these different matching features, the traditional simple concatenation method will make the dimension very high, resulting in subsequent layer expansion and parameter overhead. Using the compression function can reduce the features to scalars while retaining the captured key information.
[0050] The calculation formula of the compression function is as follows:
[0051]
[0052] Where N is the feature dimension; x c 、x b 、x d and x mand t are input into three aggregation functions, respectively, to obtain 12 scalars;
[0053] S33: Concatenate t and 12 scalars together to obtain the matching feature z, which is expressed as:
[0054]
[0055] in, f c =F([t; x c ]), and so on.
[0056] S34: Input z obtained in step S33 into BiLSTM to integrate the matching information of the sentence from a global perspective; input the new feature vector into BiLSTM to integrate all the information and make a global analysis;
[0057] S35: Average pooling and maximum pooling operations are then used to concatenate the pooled results to form the final matching features.
[0058] Among them, the average pooling and maximum pooling operations are used. For different sentences, the length of the vector obtained is different. In order to facilitate the analysis in the last step, pooling is performed here and the result is stored in a vector of fixed length. The formula is as follows:
[0059]
[0060]
[0061] All vectors are concatenated to form the final fixed-length vector v. The formula is as follows:
[0062] v=[v q,ave ;v q,max ;v p,ave ;v p,max ]
[0063] Further, in step S4, the matching features are input into the MLP, the label of the text is predicted and post-processed, which specifically includes the following steps:
[0064] S41: Use the constructed training set to train five models, use the stacking method to fuse the models, and finally predict the label of the intelligent voice assistant dialogue text. The idea of stacking is to first train a primary learner from the initial data set, and then use the prediction results of the primary learning period as a new data set to train the secondary learner. Stacking generally uses cross-validation. The initial training set D is randomly divided into k sets of similar sizes D1, D2, ..., D k, each time k-1 parts are used to train T models, and the remaining parts generate T prediction values as features. After traversing each fold, a new feature set is obtained, and a set model is trained using the labels of the source data and the new feature set;
[0065] S42: Get the pinyin p of sentences A and B a and p b , judge p a and p b Are they equal? If they are equal, set the labels of statements A and B to 1. This method can correct typos in text.
[0066] The beneficial effects of the present invention are: the present invention can improve the learning ability of the key information within the sentence itself and the level of semantic association between sentences in the sentence matching process, while enhancing the representation ability of the key information within the sentence and the interactive information between sentences, while avoiding the expansion of the network layer and parameter overhead, and can effectively match the conversation text of the intelligent voice assistant and predict whether two texts belong to the same semantics. Specifically,
[0067] (1) The present invention utilizes the self-attention mechanism and the inter-sentence attention mechanism to capture more key information within a sentence and interactive information between sentences, thereby enhancing the representation capability of sentences and enabling the model to mine deep structural information of sentences, thereby achieving a high-level understanding of sentences and effectively improving the accuracy of the model.
[0068] (2) The present invention utilizes a compression function to aggregate and compress multiple feature vectors, thereby achieving effective integration and utilization of key information and interactive information, avoiding network layer expansion and parameter overhead, speeding up the model training process, and reducing running time.
[0069] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:
[0071] Figure 1 It is an overall flow chart of the conversation short text sentence matching method of the present invention;
[0072] Figure 2 It is a network structure diagram of the conversation short text sentence matching method of the present invention; DETAILED DESCRIPTION
[0073] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.
[0074] See also Figure 1 and Figure 2 This embodiment provides a method for matching short text sentences of conversations for an intelligent voice assistant, such as Figure 1 As shown, the specific steps include:
[0075] Step 1: Vectorize the text data in the intelligent voice assistant dialogue system and use stacked CNN and parallel CNN to extract phrase features of the text.
[0076] Among them, the short text data of the intelligent voice assistant conversation is processed and vectorized, specifically including:
[0077] (1) The conversation short text data is divided into a training set and a validation set using the holdout method. When the data is divided using the holdout method, a stratified sampling method is used, which can ensure the consistency of the distribution of positive and negative samples in the training set and the validation set, and can accelerate the convergence of the model. The description of stratified sampling is as follows: Assuming that the original data set is D, D is stratified and sampled into a training set S and a validation set T, so that the ratio of positive and negative samples in the S and T data sets is consistent with that in D. This sampling is stratified sampling.
[0078] (2) Segmenting the text; the text segmentation includes two main steps: constructing a dictionary and operating a segmentation algorithm; in the present invention, we construct a dictionary tree, and there are many methods for constructing a dictionary tree. In the present invention, we use a double-array Trie tree for construction. For the segmentation operation, the shortest path method is used for the segmentation operation;
[0079] (3) Remove stop words (including punctuation marks, numbers, and other meaningless words, such as auxiliary words, modal particles, etc.), and use artificial rules to process stop words, that is, use an artificially established stop word dictionary to replace special symbols, punctuation marks, and numbers;
[0080] (4) Use the short text corpus of intelligent voice assistant conversations to train the Word2Vec word vector model, and then map the words in the text into word vectors of fixed dimensions;
[0081] (5) The syntactic feature vector consists of the one-hot vector of the part-of-speech tag (POS) and the binary exact match (EM) feature vector. Exact match can be understood as if a word in one sentence appears in another sentence, then the position is set to 1.
[0082] The final vector representation of the text is:
[0083] w=[d word ;d pos ;d em ]
[0084] Among them, d word is the word vector, d pos is the part-of-speech tag vector, d em To accurately match the feature vector;
[0085] Use stacked CNN and parallel CNN to extract phrase features, including:
[0086] (1) Use stacked CNNs to capture phrase-level representations of length k. The convolution kernel size of each layer is k. Assuming there are n convolutional layers in total, the output of each layer is expressed as:
[0087]
[0088] The input of each layer is the output of the previous layer. is w, and the phrase feature of length k finally extracted is p d ;
[0089] (2) Use parallel CNN to extract phrase-level representations of different lengths. Each convolutional layer has a different convolutional kernel size. Assuming there are n convolutional layers, the convolutional kernel sizes are k, k+1, …, k+n-1 respectively. The final extracted phrase features of different lengths are in is the output of the convolutional layer with a kernel size of k, and so on;
[0090] (3) All phrase features are concatenated, and the final phrase feature is expressed as:
[0091]
[0092] (4) The phrase feature vector is reduced in dimension through two fully connected layers. The dimension reduction formula is:
[0093] p l =max(0, p l-1 W1+b1)W2+b2,l=1,2
[0094] Among them, p l is the output of the lth layer, p 0=p, and finally a vector of size [batch_size, seq_len, hidden_size] is obtained.
[0095] Step 2: Use stacked BiLSTM to capture contextual features, and then use the new intra-sentence self-attention mechanism to extract key features within the text, including:
[0096] (1) Use n-layer BiLSTM to extract context features. The output of each layer is expressed as:
[0097] t h =BiLSTM h (t h-1 ), h=1,…,n
[0098] Among them, the input of each layer is the output of the previous layer, t0 = p 2 ;
[0099] (2) Refer to the idea of BiLSTM+attention to calculate the self-attention matching weight within the sentence. The matching calculation adopts the bilinear function method. The formula is as follows:
[0100]
[0101] Among them, c is the state value of the last moment unit of the BiLSTM encoding of the lth layer, which is matched with the output h of each intermediate moment, M is the weight parameter, b is the bias term, and the matching result is classified by sofimax to obtain each word in the sentence (that is, each moment h t )’s self-attention weight w, and the key feature vector in the sentence is obtained by weighted summation of the calculated weights as t * ;
[0102] (3) The output t of the last layer of BiLSTM n and the key eigenvector t * Concatenate as the input t of the next layer, the size of t is:
[0103] [batch_size, seq_len, hidden_size*2+1]
[0104] Step 3: Use the sentence-to-sentence attention mechanism to extract interactive features, and aggregate and compress multiple interactive effects through a compression function to obtain matching features of the text. Extracting interactive features and aggregating and compressing them specifically includes:
[0105] (1) Four sentence attention mechanisms are used: concat attention, bilinear attention, dotattention, and minus attention to extract interactive features, and we get x respectively. c 、x b 、x d and x m Four interaction feature vectors. Using one inter-sentence attention mechanism or alignment method will result in the captured interaction features being single and incomplete. In order to capture multi-dimensional and deep interaction features, four inter-sentence attention mechanism calculation methods are used to calculate the similarity of word pairs in two sentences, construct a similarity matrix, normalize it as a weight, and combine the weight and each word vector of the other sentence to obtain the interaction feature vector of the word;
[0106] (2) Aggregate interactive features. Inspired by the ESIM model, when aggregating different feature vectors, in order to retain the original information, enhance the mined key information, and capture reasoning relationships such as contradictions, the interactive feature vectors are aggregated in the following way:
[0107] f c =F([t;x])
[0108] f m =F([t⊙x])
[0109] f s =F(tx)
[0110] Among them, x is the four interactive feature vectors, and F(·) is the compression function. The above-mentioned compression of the aggregated vector can obtain different matching features by adopting different attention mechanisms when applying the attention mechanism. In order to combine these different matching features, the traditional simple splicing method will make the dimension very high, resulting in subsequent layer expansion and parameter overhead. Using the compression function can reduce the features to scalars while retaining the captured key information. Its calculation formula is as follows:
[0111]
[0112] x c 、x b 、x d and x m and t are input into three aggregation functions, respectively, to obtain 12 scalars;
[0113] (3) Concatenate t and the 12 scalars together to obtain a new eigenvector z, which is expressed as:
[0114]
[0115] in f c =F([t; x c ]) and so on;
[0116] (4) Input z into BiLSTM to integrate the matching information of the sentence from a global perspective; input the new feature vector into BiLSTM to integrate all the information and make a global analysis;
[0117] (5) Then use average pooling and maximum pooling operations to concatenate the pooled results to form the final matching features. Using average pooling and maximum pooling operations, the vector lengths obtained for different sentences are different. In order to facilitate the analysis in the last step, pooling is performed here and the results are stored in a vector of fixed length. The formula is as follows:
[0118]
[0119]
[0120] All vectors are concatenated to form the final fixed-length vector v. The formula is as follows:
[0121] v=[v q,ave ;v q,max ;v p,ave ;v p,max ]
[0122] Step 4: Input the matching features into MLP, predict the text label and perform post-processing.
[0123] Among them, predicting labels and performing post-processing specifically include:
[0124] (1) The final network structure diagram is as follows Figure 2 As shown. Use the constructed training set to train the model, test the trained model with the validation set, use the stacking method to fuse the model, and finally match the short text of the intelligent voice assistant conversation. The idea of stacking is to first train a primary learner from the initial data set, and then use the prediction results of the primary learning period as a new data set to train the secondary learner. Stacking generally uses the cross-validation method, and the initial training set D is randomly divided into k sets of similar sizes D1, D2, ..., D k , each time k-1 parts are used to train T models, and the remaining parts generate T prediction values as features. After traversing each fold, a new feature set is obtained, and a set model is trained using the labels of the source data and the new feature set;
[0125] (2) Get the pinyin p of sentences A and Ba and p b , judge p a and p b Are they equal? If they are equal, set the labels of statements A and B to 1. This method can correct typos in text.
[0126] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.
Claims
1. A method for matching short text sentences of conversations for an intelligent voice assistant, characterized in that: The method specifically comprises the following steps: S1: Vectorize text data in the intelligent voice assistant dialogue system and extract phrase features of text using stacked CNN and parallel CNN; S2: Use stacked BiLSTM to extract contextual features, and then use a new intra-sentence self-attention mechanism to extract key features within the text; S3: Use the sentence-to-sentence attention mechanism to extract interactive features, and use the compression function to aggregate and compress multiple interactive effects to obtain the matching features of the text; S4: Input the matching features into MLP, predict the text label and perform post-processing; In step S1, the phrase features of the text are extracted using stacked CNN and parallel CNN, which specifically includes the following steps: S111: Obtain the word vector and syntactic feature vector of the text. The syntactic feature vector is composed of the one-hot vector of the part-of-speech tag and the binary exact matching feature vector. The final text vector w is expressed as: w=[d word ;d pos ;d em ] Among them, d word is the word vector, d pos is the part-of-speech tag vector, d em To accurately match the feature vector; S112: Use stacked CNNs to capture phrase-level representations of length k. The convolution kernel size of each layer is k. Assuming there are n convolutional layers in total, the output of each layer is expressed as: The input of each layer is the output of the previous layer. is w, and the phrase feature extracted in the end is p with a length of k. d ; S113: Use parallel CNN to extract phrase-level representations of different lengths. Each convolution layer has a different convolution kernel size. Assuming there are n convolution layers, the convolution kernel sizes are k, k+1, ..., k+n-1 respectively. The phrase features of different lengths finally extracted are in, is the output of the convolutional layer with a kernel size of k, and so on; S114: All phrase features are concatenated, and the final phrase feature p is expressed as: S115: Reduce the dimensionality of the phrase feature vector through two fully connected layers. The dimensionality reduction formula is: p l =max(0,p l-1 W1+b1)W2+b2,l=1,2 Among them, W1 and W2 are connection weight matrices, b1 and b2 are bias terms; p l is the output of the lth layer, p 0 =p, and finally get a vector of size [batch_size, seq_len, hidden_size], where batch_size is the number of samples, seq_len is the sample length, and hidden_size is the size of the BiLSTM hidden layer; In step S2, context features and key features are extracted, which specifically includes the following steps: S21: Use n-layer BiLSTM to extract context features, and the output of each layer is expressed as: t h =BiLSTM h (t h-1 ),h=1,…,n The input of each layer is the output of the previous layer, and the input of the first layer is t0 = p 2 , p represents the phrase feature; S22: The BiLSTM+attention model is used to calculate the self-attention matching weight within the sentence. The matching calculation uses the bilinear function method. The formula is as follows: Among them, c is the state value of the last moment unit of the BiLSTM encoding of the lth layer, which is matched with the output h of each intermediate moment, M is the weight parameter, b is the bias term, and the matching result is softmax classified to obtain the self-attention weight w of each word in the sentence. The key feature vector in the sentence is obtained by weighted summation based on the calculated weights as t * ; S23: The output of the last layer of BiLSTM n and the key eigenvector t * Concatenate as the input t of the next layer, the size of t is: [batch_size,seq_len,hidden_size*2+1] Among them, batch_size is the number of samples, seq_len is the sample length, and hidden_size is the size of the BiLSTM hidden layer; In step S3, extracting and compressing interactive features includes: S31: Use four inter-sentence attention mechanisms: concat attention, bilinear attention, dotattention, and minus attention to extract interactive features and obtain x respectively. c 、x b 、x d and x m four interaction eigenvectors; S32: Aggregate the interactive features and aggregate the interactive feature vectors in the following way: f c =F([t;x]) f m =F([t⊙x]) f s =F(t-x) Among them, t is the output t of the last layer of BiLSTM n and the key eigenvector t * The concatenated vectors, x are four interactive feature vectors, and F(·) is the compression function, which is calculated as follows: Where N is the feature dimension; x c 、x b 、x d and x m and t are input into three aggregation functions, respectively, to obtain 12 scalars; S33: Concatenate t and 12 scalars together to obtain the matching feature z, which is expressed as: in, f c =F([t; x c ]) and so on; In step S31, four interactive feature vectors are obtained, specifically including: using four inter-sentence attention mechanism calculation methods to calculate the similarity of word pairs in two sentences, constructing a similarity matrix, normalizing it as a weight, and combining the weight and each word vector of the other sentence to obtain the interactive feature vector of the word.
2. The method for matching short text sentences of a conversation according to claim 1, characterized in that: Step S3 also includes: inputting z obtained in step S33 into BiLSTM to integrate the matching information of the sentence from a global perspective; and then using average pooling and maximum pooling operations to splice the pooled results to form the final matching features.
3. The method for matching short text sentences of a conversation according to claim 1, characterized in that: In step S4, the matching features are input into the MLP to predict the text label and perform post-processing, which specifically includes the following steps: S41: Use the constructed training set to train five models, use the stacking method to fuse the models, and finally predict the label of the intelligent voice assistant dialogue text; S42: Get the pinyin p of sentences A and B a and p b , judge p a and p b Are they equal? If they are equal, set the labels of statements A and B to 1.
Citation Information
Patent Citations
A text implication relation recognition method based on multi-granularity information fusion
CN109299262A
Statement equivalence judgment method and device
CN110633359A
Similar text recommendation method and device, electronic equipment and storage medium
CN110825867A
Text event abstract generation method and device, electronic equipment and storage medium
CN111324728A
Local citation recommendation system and method based on deep correlation matching
CN111581401A
