Intention recognition method, device, apparatus and storage medium

By concatenating and encoding multiple translated texts, and combining feature fusion transformation of the encoding layer and feature transformation layer, the translation error problem of the automatic speech recognition module is solved, and the accuracy of intent recognition is improved.

CN116258148BActive Publication Date: 2026-05-01PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PING AN TECH (SHENZHEN) CO LTD
Filing Date
2023-02-10
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing intent recognition solutions, the automatic speech recognition module may make translation errors when generating translated text, resulting in an inability to accurately recognize user intent.

Method used

By acquiring multiple translated texts, a pre-trained generative model is used for splicing and encoding. The encoding layer and multiple feature transformation layers are combined to perform feature fusion transformation, generating target text that matches the audio to be recognized, and then performing intent recognition.

Benefits of technology

It improves the accuracy of audio intent recognition by comprehensively representing text fragments and fusing contextual information, thereby enhancing the accuracy of target text translation and intent information recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116258148B_ABST
    Figure CN116258148B_ABST
Patent Text Reader

Abstract

The present application relates to artificial intelligence, and provide a kind of intention recognition method, device, equipment and storage medium.The method splices multiple translation texts, obtains text segment, carries out encoding processing to text segment, obtains text encoding vector, carries out feature fusion transformation processing to text encoding vector, obtains target text, carries out intention recognition to target text, improves the accuracy of intention information.In addition, the present application also relates to blockchain technology, and the intention information can be stored in blockchain.
Need to check novelty before this filing date? Find Prior Art

Description

Intent recognition methods, apparatus, devices and storage media Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to an intent recognition method, apparatus, device, and storage medium. Background Technology

[0002] In current intent recognition solutions, the automatic speech recognition module has a certain percentage of translation errors when generating translated text, which makes it impossible to accurately identify the user's intent.

[0003] Therefore, how to improve the accuracy of transcribing audio to improve the accuracy of audio intent recognition has become an urgent technical problem to be solved. Summary of the Invention

[0004] In view of the above, it is necessary to provide an intent recognition method, apparatus, device, and storage medium that can solve the technical problem of how to improve the translation accuracy of audio to be recognized, so as to improve the accuracy of audio intent recognition.

[0005] On one hand, the present invention proposes an intent recognition method, the intent recognition method comprising:

[0006] Obtain multiple translated texts of the audio to be recognized;

[0007] Obtain a pre-trained generative model, which includes an encoding layer and multiple feature transformation layers;

[0008] Based on the aforementioned generation model, the multiple translated texts are concatenated to obtain a text fragment;

[0009] The text segment is encoded based on the encoding layer to obtain a text encoding vector;

[0010] Based on the multiple feature transformation layers, the text encoding vector is subjected to feature fusion transformation processing to obtain the target text that matches the audio to be identified;

[0011] The intent information of the audio to be identified is obtained by performing intent recognition on the target text.

[0012] According to a preferred embodiment of the present invention, the step of concatenating the multiple translated texts based on the generation model to obtain a text fragment includes:

[0013] Obtain the preset start label and preset end label of the generated model;

[0014] Each translated text and the preset termination tag are concatenated to obtain an initial segment corresponding to each translated text;

[0015] The initial segments are spliced ​​together to obtain the target segment.

[0016] The text segment is obtained by concatenating the preset starting tag and the target segment.

[0017] According to a preferred embodiment of the present invention, the step of encoding the text segment based on the encoding layer to obtain a text encoding vector includes:

[0018] The text segment is encoded to obtain a character vector;

[0019] Sentence encoding is performed on each character in the text segment to obtain the sentence vector of each character in the text segment;

[0020] Each character in the text segment is positionally encoded to obtain the position vector of each character in the text segment;

[0021] Based on the character vector, the sentence vector, and the position vector, generate the target vector for each character in the text segment;

[0022] The target vector is concatenated to obtain the text encoding vector.

[0023] According to a preferred embodiment of the present invention, the plurality of feature transformation layers include a first transformation layer and a plurality of second transformation layers, and the step of performing feature fusion transformation processing on the text encoding vector based on the plurality of feature transformation layers to obtain target text matching the audio to be identified includes:

[0024] The text encoding vector is transformed based on the parameter matrix in the first transformation layer to obtain multiple text matrices;

[0025] Generate a mask matrix based on the text encoding vector;

[0026] Based on the mask matrix, the multiple text matrices are masked to obtain an initial feature vector;

[0027] The initial feature vector is input into any one of the plurality of second transformation layers for transformation processing until all of the plurality of second transformation layers participate in the transformation processing to obtain the target feature vector.

[0028] The target feature vector is mapped to obtain the target text.

[0029] According to a preferred embodiment of the present invention, the step of performing intent recognition on the target text to obtain intent information of the audio to be recognized includes:

[0030] The target text is re-encoded to obtain a text vector;

[0031] The intent information is obtained by performing intent recognition on the text vector.

[0032] According to a preferred embodiment of the present invention, the step of re-encoding the target text to obtain a text vector includes:

[0033] The target text is subjected to lexical encoding to obtain an initial vector;

[0034] The initial vector is subjected to attention activation processing, including:

[0035] The initial vector is self-attention encoded to obtain the attention vector;

[0036] The attention vector is processed by a fully connected layer to obtain an activation vector, and the encoding rounds of the initial vector are accumulated.

[0037] If the number of encoding rounds is less than a preset round threshold, the activation vector is used as the initial vector for repeated attention activation processing until the number of encoding rounds is greater than or equal to the preset round threshold, thus obtaining the text vector.

[0038] According to a preferred embodiment of the present invention, the step of performing intent recognition on the text vector to obtain the intent information includes:

[0039] Extract the forward and backward features of the text vector;

[0040] Based on the forward features and the backward features, semantic analysis is performed on the text vector to obtain a semantic vector;

[0041] Information matching the semantic vector is obtained from the configuration intent library as the intent information.

[0042] On the other hand, the present invention also proposes an intent recognition device, the intent recognition device comprising:

[0043] The acquisition unit is used to acquire multiple translated texts of the audio to be recognized;

[0044] The acquisition unit is also used to acquire a pre-trained generative model, which includes an encoding layer and multiple feature transformation layers.

[0045] The splicing unit is used to splice the multiple translated texts based on the generation model to obtain a text fragment;

[0046] An encoding unit is used to encode the text segment based on the encoding layer to obtain a text encoding vector;

[0047] The processing unit is used to perform feature fusion transformation processing on the text encoding vector based on the multiple feature transformation layers to obtain target text that matches the audio to be identified.

[0048] The recognition unit is used to perform intent recognition on the target text to obtain intent information of the audio to be recognized.

[0049] On the other hand, the present invention also proposes an electronic device, the electronic device comprising:

[0050] Memory, which stores computer-readable instructions; and

[0051] The processor executes computer-readable instructions stored in the memory to implement the intent recognition method.

[0052] On the other hand, the present invention also proposes a computer-readable storage medium storing computer-readable instructions, which are executed by a processor in an electronic device to implement the intent recognition method.

[0053] As can be seen from the above technical solutions, this application can improve the comprehensiveness of the text encoding vector in representing the text segment by encoding the text segment through the encoding layer. Furthermore, by performing feature fusion transformation processing on the text encoding vector through the multiple feature transformation layers, the vector representation of contextual information can be fused on different feature transformation layers, thereby improving the translation accuracy of the target text for the audio to be recognized, and thus improving the recognition accuracy of the intent information. Attached Figure Description

[0054] Figure 1 is a flowchart of a preferred embodiment of the intent recognition method of the present invention.

[0055] Figure 2 is a functional block diagram of a preferred embodiment of the intent recognition device of the present invention.

[0056] Figure 3 is a schematic diagram of the structure of an electronic device implementing the intent recognition method of the present invention. Detailed Implementation

[0057] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be described in detail below with reference to the accompanying drawings and specific embodiments.

[0058] Figure 1 shows a flowchart of a preferred embodiment of the intent recognition method of the present invention. The order of the steps in this flowchart can be changed, and some steps can be omitted, depending on different requirements.

[0059] The intent recognition method can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) is the theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results.

[0060] Foundational technologies for artificial intelligence generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies mainly encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0061] The intent recognition method is applied to one or more electronic devices, which are devices capable of automatically performing numerical calculations and / or information processing according to pre-set or stored computer-readable instructions. Their hardware includes, but is not limited to, microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.

[0062] The electronic device can be any electronic product that can interact with the user, such as a personal computer, tablet computer, smartphone, personal digital assistant (PDA), game console, interactive network television (IPTV), smart wearable device, etc.

[0063] The electronic devices may include network devices and / or user devices. The network devices include, but are not limited to, single network electronic devices, groups of multiple network electronic devices, or cloud computing-based systems consisting of a large number of hosts or network electronic devices.

[0064] The network in which the electronic device is located includes, but is not limited to: the Internet, wide area network, metropolitan area network, local area network, virtual private network (VPN), etc.

[0065] 101, Obtain multiple translated texts of the audio to be recognized.

[0066] In at least one embodiment of the present invention, the audio to be identified can be audio information from any business scenario, and the audio format of the audio to be identified is not limited.

[0067] The multiple translated texts are text information generated by the Automatic Speech Recognition (ASR) module after performing speech recognition on the audio to be recognized. For example, the translated text recognized by the ASR module for audio A is: First security, restricted reporting, first reporting, restricted security, etc.

[0068] In at least one embodiment of the present invention, due to the non-standard pronunciation of the user and the certain error in the automatic speech recognition module when performing audio translation, the audio to be recognized has multiple translated texts.

[0069] 102. Obtain a pre-trained generative model, which includes an encoding layer and multiple feature transformation layers.

[0070] In at least one embodiment of the present invention, the generation model is used to identify the text information that best matches the audio to be identified from the plurality of translated texts. The generation model stores preset start tags and preset end tags, wherein the preset start tags are used to indicate the beginning of a text segment, and the preset end tags are used to indicate the end of each translated text in the text segment.

[0071] The plurality of feature transformation layers include a first transformation layer and a plurality of second transformation layers. The network structure of the first transformation layer is identical to the network structure of each of the second transformation layers.

[0072] In at least one embodiment of the present invention, before obtaining the pre-trained generative model, the method further includes:

[0073] Audio samples with user ratings greater than a preset value are obtained from the automatic speech recognition module and used as training samples. The recognition results of the automatic speech recognition module on the training samples are used as the annotation results of the training samples.

[0074] The preset learner is adjusted based on the training samples and the annotation results until the loss value of the preset learner is less than the preset loss value, and the adjusted preset learner is determined as the generative model.

[0075] The preset score and the preset loss value can be set according to actual needs.

[0076] By selecting audio samples with user ratings greater than the preset score as training samples, it is evident that the automatic speech recognition module has high recognition accuracy for the audio samples since the user ratings are greater than the preset score. Therefore, directly using the recognition results of the training samples in the automatic speech recognition module as annotation results can quickly generate the annotation results, thereby improving the training efficiency of the generative model.

[0077] 103. Based on the generation model, the multiple translated texts are concatenated to obtain a text fragment.

[0078] In at least one embodiment of the present invention, the text fragment includes the preset start tag, the plurality of translated texts, and the preset end tag.

[0079] In this invention, when there are multiple different transliterated texts of the transliterated words of the audio to be identified, a text matching the audio to be identified can be quickly generated by concatenating the multiple transliterated texts.

[0080] In at least one embodiment of the present invention, the electronic device, based on the generation model, concatenates the plurality of translated texts to obtain text fragments including:

[0081] Obtain the preset start label and preset end label of the generated model;

[0082] Each translated text and the preset termination tag are concatenated to obtain an initial segment corresponding to each translated text;

[0083] The initial segments are spliced ​​together to obtain the target segment.

[0084] The text segment is obtained by concatenating the preset starting tag and the target segment.

[0085] The above implementation method enables the generation model to quickly identify different translated texts.

[0086] 104. The text segment is encoded based on the encoding layer to obtain a text encoding vector.

[0087] In at least one embodiment of the present invention, the text encoding vector is used to characterize the text segment.

[0088] In at least one embodiment of the present invention, the electronic device encodes the text segment based on the encoding layer to obtain a text encoding vector, including:

[0089] The text segment is encoded to obtain a character vector;

[0090] Sentence encoding is performed on each character in the text segment to obtain the sentence vector of each character in the text segment;

[0091] Each character in the text segment is positionally encoded to obtain the position vector of each character in the text segment;

[0092] Based on the character vector, the sentence vector, and the position vector, generate the target vector for each character in the text segment;

[0093] The target vector is concatenated to obtain the text encoding vector.

[0094] The character vector is used to represent different characters in the text segment, the sentence vector is used to distinguish the sentence in which each character is located in the text segment, and the position vector is used to distinguish the different positions of each character in the text segment.

[0095] By combining the character vector, the sentence vector, and the position vector, each character in the text segment can be represented from different levels, thereby improving the representation accuracy of the text encoding vector.

[0096] Specifically, the electronic device calculates the average value of the same element positions in the word vector, the sentence vector, and the position vector to obtain the target vector.

[0097] 105. Based on the multiple feature transformation layers, the text encoding vector is subjected to feature fusion transformation processing to obtain the target text that matches the audio to be identified.

[0098] In at least one embodiment of the present invention, the target text refers to the audio text of the audio to be identified.

[0099] In at least one embodiment of the present invention, the electronic device performs feature fusion transformation processing on the text encoding vector based on the plurality of feature transformation layers to obtain target text that matches the audio to be identified, including:

[0100] The text encoding vector is transformed based on the parameter matrix in the first transformation layer to obtain multiple text matrices;

[0101] Generate a mask matrix based on the text encoding vector;

[0102] Based on the mask matrix, the multiple text matrices are masked to obtain an initial feature vector;

[0103] The initial feature vector is input into any one of the plurality of second transformation layers for transformation processing until all of the plurality of second transformation layers participate in the transformation processing to obtain the target feature vector.

[0104] The target feature vector is mapped to obtain the target text.

[0105] The parameter matrix refers to the parameters that have been adjusted and configured in the first transformation layer.

[0106] The mask matrix is ​​generated by concatenating the mask vectors corresponding to the encoded elements in the text encoding vector.

[0107] The target text refers to the target feature vector generated based on the same generation mapping table as the character vector.

[0108] The parameter matrix enables the generation of multiple text matrices from different perspectives. Furthermore, based on the mask matrix, the generation accuracy of the initial feature vector can be improved. By mapping the target feature vector to a generation mapping table with the same dimension as the character vector, the generation accuracy of the target text can be improved.

[0109] Specifically, the electronic device calculates the product of each parameter matrix and the text encoding vector to obtain the plurality of text matrices, wherein the number of the plurality of text matrices is the same as the number of the plurality of parameter matrices.

[0110] Specifically, the electronic device generates a mask matrix based on the text encoding vector, including:

[0111] Identify the encoding position of the encoded element in the text encoding vector;

[0112] For any encoded element, the encoded elements before the encoded position are set to the first configuration value, and the encoded elements after the encoded position are set to the second configuration value, to obtain the mask vector corresponding to the encoded element.

[0113] The mask matrix is ​​obtained by concatenating the mask vector based on the encoded position.

[0114] The first configuration value can be 0, and the second configuration value can be infinity.

[0115] Specifically, the formula for generating the initial feature vector is:

[0116]

[0117] Where Z represents the initial feature vector, A, B, and C represent the multiple text matrices, M represents the mask matrix, and T represents the row dimension information of any text matrix.

[0118] The mask matrix can improve the accuracy of generating the initial feature vector.

[0119] Specifically, the mapping process of the target feature vector to obtain the target text includes:

[0120] Obtain the generation mapping table of the character vectors;

[0121] The target feature vector is mapped based on the generated mapping table to obtain the target text.

[0122] 106. Perform intent recognition on the target text to obtain the intent information of the audio to be recognized.

[0123] It should be emphasized that, to further ensure the privacy and security of the aforementioned intent information, the intent information can also be stored in a node of a blockchain.

[0124] In at least one embodiment of the present invention, the intent information refers to the intent indicated by the audio to be identified.

[0125] In at least one embodiment of the present invention, the electronic device performs intent recognition on the target text to obtain intent information of the audio to be recognized, including:

[0126] The target text is re-encoded to obtain a text vector;

[0127] The intent information is obtained by performing intent recognition on the text vector.

[0128] By re-encoding the target text, it is easier to recognize the text vector and improve the accuracy of the intent information.

[0129] Specifically, the electronic device performs re-encoding processing on the target text to obtain a text vector including:

[0130] The target text is subjected to lexical encoding to obtain an initial vector;

[0131] The initial vector is subjected to attention activation processing, including:

[0132] The initial vector is self-attention encoded to obtain the attention vector;

[0133] The attention vector is processed by a fully connected layer to obtain an activation vector, and the encoding rounds of the initial vector are accumulated.

[0134] If the number of encoding rounds is less than a preset round threshold, the activation vector is used as the initial vector for repeated attention activation processing until the number of encoding rounds is greater than or equal to the preset round threshold, thus obtaining the text vector.

[0135] The preset round threshold can be set according to actual needs.

[0136] By performing multiple attention activation processes on the target text, the ability of the text vector to represent the target text can be improved.

[0137] Specifically, the formula for generating the attention vector is:

[0138]

[0139] Where Z represents the attention vector, D represents the product of the initial vector and the first configuration matrix, and E T Let F be the transpose of the product of the initial vector and the second configuration matrix, and let F be the product of the initial vector and the third configuration matrix. The first configuration matrix, the second configuration matrix, and the third configuration matrix can be set according to actual needs. L represents the column dimension information of the first configuration matrix, the second configuration matrix, or the third configuration matrix.

[0140] Specifically, the formula for generating the activation vector is:

[0141] y = max(0, KW1+b1)W2+b2;

[0142] y represents the activation vector, K represents the attention vector, and W1, W2, b1, and b2 represent the set parameters, respectively.

[0143] Specifically, the electronic device performs intent recognition on the text vector to obtain the intent information, including:

[0144] Extract the forward and backward features of the text vector;

[0145] Based on the forward features and the backward features, semantic analysis is performed on the text vector to obtain a semantic vector;

[0146] Information matching the semantic vector is obtained from the configuration intent library as the intent information.

[0147] The forward features refer to the features generated after processing the text vector based on the forward propagation network, and the backward features refer to the features generated after processing the text vector based on the backward propagation network.

[0148] The semantic vector is obtained by performing attention analysis on the text vector based on the forward features and the backward features.

[0149] The configuration intent library can be a pre-configured database, which stores multiple mapping relationships between configuration vectors and configuration intents.

[0150] By combining the forward and backward features to perform contextual analysis on the text vector, the accuracy of semantic vector generation can be improved, thereby improving the accuracy of the intent information.

[0151] As can be seen from the above technical solutions, this application can improve the comprehensiveness of the text encoding vector in representing the text segment by encoding the text segment through the encoding layer, and further improve the accuracy of the target text in translating the audio to be recognized by the target text by performing feature fusion transformation processing on the text encoding vector through the multiple feature transformation layers. This can improve the accuracy of the recognition of the intent information by fusing the vector representation of context information on different feature transformation layers.

[0152] Figure 2 shows a functional block diagram of a preferred embodiment of the intent recognition device of the present invention. The intent recognition device 11 includes an acquisition unit 110, a splicing unit 111, an encoding unit 112, a processing unit 113, a recognition unit 114, and an adjustment unit 115. The module / unit referred to in this invention refers to a series of computer-readable instruction segments that can be acquired by the processor 13 and perform a fixed function, and are stored in the memory 12. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.

[0153] The acquisition unit 110 acquires multiple translated texts of the audio to be recognized.

[0154] In at least one embodiment of the present invention, the audio to be identified can be audio information from any business scenario, and the audio format of the audio to be identified is not limited.

[0155] The multiple translated texts are text information generated by the Automatic Speech Recognition (ASR) module after performing speech recognition on the audio to be recognized. For example, the translated text recognized by the ASR module for audio A is: First security, restricted reporting, first reporting, restricted security, etc.

[0156] In at least one embodiment of the present invention, due to the non-standard pronunciation of the user and the certain error in the automatic speech recognition module when performing audio translation, the audio to be recognized has multiple translated texts.

[0157] The acquisition unit 110 acquires a pre-trained generative model, which includes an encoding layer and multiple feature transformation layers.

[0158] In at least one embodiment of the present invention, the generation model is used to identify the text information that best matches the audio to be identified from the plurality of translated texts. The generation model stores preset start tags and preset end tags, wherein the preset start tags are used to indicate the beginning of a text segment, and the preset end tags are used to indicate the end of each translated text in the text segment.

[0159] The plurality of feature transformation layers include a first transformation layer and a plurality of second transformation layers. The network structure of the first transformation layer is identical to the network structure of each of the second transformation layers.

[0160] In at least one embodiment of the present invention, before obtaining the pre-trained generative model, the acquisition unit 110 obtains audio with a user rating greater than a preset score from the automatic speech recognition module as training samples, and uses the recognition result of the automatic speech recognition module on the training samples as the annotation result of the training samples.

[0161] The adjustment unit 115 adjusts the preset learner based on the training samples and the annotation results until the loss value of the preset learner is less than the preset loss value, and then determines the adjusted preset learner as the generative model.

[0162] The preset score and the preset loss value can be set according to actual needs.

[0163] By selecting audio samples with user ratings greater than the preset score as training samples, it is evident that the automatic speech recognition module has high recognition accuracy for the audio samples since the user ratings are greater than the preset score. Therefore, directly using the recognition results of the training samples in the automatic speech recognition module as annotation results can quickly generate the annotation results, thereby improving the training efficiency of the generative model.

[0164] Based on the generation model, splicing unit 111 splices the multiple translated texts to obtain a text fragment.

[0165] In at least one embodiment of the present invention, the text fragment includes the preset start tag, the plurality of translated texts, and the preset end tag.

[0166] In this invention, when there are multiple different transliterated texts of the transliterated words of the audio to be identified, a text matching the audio to be identified can be quickly generated by concatenating the multiple transliterated texts.

[0167] In at least one embodiment of the present invention, the splicing unit 111 splices the plurality of translated texts based on the generation model to obtain text fragments including:

[0168] Obtain the preset start label and preset end label of the generated model;

[0169] Each translated text and the preset termination tag are concatenated to obtain an initial segment corresponding to each translated text;

[0170] The initial segments are spliced ​​together to obtain the target segment.

[0171] The text segment is obtained by concatenating the preset starting tag and the target segment.

[0172] The above implementation method enables the generation model to quickly identify different translated texts.

[0173] The encoding unit 112 encodes the text segment based on the encoding layer to obtain a text encoding vector.

[0174] In at least one embodiment of the present invention, the text encoding vector is used to characterize the text segment.

[0175] In at least one embodiment of the present invention, the encoding unit 112 performs encoding processing on the text segment based on the encoding layer to obtain a text encoding vector including:

[0176] The text segment is encoded to obtain a character vector;

[0177] Sentence encoding is performed on each character in the text segment to obtain the sentence vector of each character in the text segment;

[0178] Each character in the text segment is positionally encoded to obtain the position vector of each character in the text segment;

[0179] Based on the character vector, the sentence vector, and the position vector, generate the target vector for each character in the text segment;

[0180] The target vector is concatenated to obtain the text encoding vector.

[0181] The character vector is used to represent different characters in the text segment, the sentence vector is used to distinguish the sentence in which each character is located in the text segment, and the position vector is used to distinguish the different positions of each character in the text segment.

[0182] By combining the character vector, the sentence vector, and the position vector, each character in the text segment can be represented from different levels, thereby improving the representation accuracy of the text encoding vector.

[0183] Specifically, the encoding unit 112 calculates the average value of the same element positions in the word vector, the sentence vector, and the position vector to obtain the target vector.

[0184] The processing unit 113 performs feature fusion transformation processing on the text encoding vector based on the multiple feature transformation layers to obtain target text that matches the audio to be identified.

[0185] In at least one embodiment of the present invention, the target text refers to the audio text of the audio to be identified.

[0186] In at least one embodiment of the present invention, the processing unit 113 performs feature fusion transformation processing on the text encoding vector based on the plurality of feature transformation layers to obtain target text that matches the audio to be identified, including:

[0187] The text encoding vector is transformed based on the parameter matrix in the first transformation layer to obtain multiple text matrices;

[0188] Generate a mask matrix based on the text encoding vector;

[0189] Based on the mask matrix, the multiple text matrices are masked to obtain an initial feature vector;

[0190] The initial feature vector is input into any one of the plurality of second transformation layers for transformation processing until all of the plurality of second transformation layers participate in the transformation processing to obtain the target feature vector.

[0191] The target feature vector is mapped to obtain the target text.

[0192] The parameter matrix refers to the parameters that have been adjusted and configured in the first transformation layer.

[0193] The mask matrix is ​​generated by concatenating the mask vectors corresponding to the encoded elements in the text encoding vector.

[0194] The target text refers to the target feature vector generated based on the same generation mapping table as the character vector.

[0195] The parameter matrix enables the generation of multiple text matrices from different perspectives. Furthermore, based on the mask matrix, the generation accuracy of the initial feature vector can be improved. By mapping the target feature vector to a generation mapping table with the same dimension as the character vector, the generation accuracy of the target text can be improved.

[0196] Specifically, the processing unit 113 calculates the product of each parameter matrix and the text encoding vector to obtain the plurality of text matrices, wherein the number of the plurality of text matrices is the same as the number of the plurality of parameter matrices.

[0197] Specifically, the processing unit 113 generates a mask matrix based on the text encoding vector, including:

[0198] Identify the encoding position of the encoded element in the text encoding vector;

[0199] For any encoded element, the encoded elements before the encoded position are set to the first configuration value, and the encoded elements after the encoded position are set to the second configuration value, to obtain the mask vector corresponding to the encoded element.

[0200] The mask matrix is ​​obtained by concatenating the mask vector based on the encoded position.

[0201] The first configuration value can be 0, and the second configuration value can be infinity.

[0202] Specifically, the formula for generating the initial feature vector is:

[0203]

[0204] Where Z represents the initial feature vector, A, B, and C represent the multiple text matrices, M represents the mask matrix, and T represents the row dimension information of any text matrix.

[0205] The mask matrix can improve the accuracy of generating the initial feature vector.

[0206] Specifically, the processing unit 113 performs mapping processing on the target feature vector to obtain the target text, including:

[0207] Obtain the generation mapping table of the character vectors;

[0208] The target feature vector is mapped based on the generated mapping table to obtain the target text.

[0209] The recognition unit 114 performs intent recognition on the target text to obtain the intent information of the audio to be recognized.

[0210] It should be emphasized that, to further ensure the privacy and security of the aforementioned intent information, the intent information can also be stored in a node of a blockchain.

[0211] In at least one embodiment of the present invention, the intent information refers to the intent indicated by the audio to be identified.

[0212] In at least one embodiment of the present invention, the recognition unit 114 performs intent recognition on the target text to obtain intent information of the audio to be recognized, including:

[0213] The target text is re-encoded to obtain a text vector;

[0214] The intent information is obtained by performing intent recognition on the text vector.

[0215] By re-encoding the target text, it is easier to recognize the text vector and improve the accuracy of the intent information.

[0216] Specifically, the recognition unit 114 performs re-encoding processing on the target text to obtain a text vector including:

[0217] The target text is subjected to lexical encoding to obtain an initial vector;

[0218] The initial vector is subjected to attention activation processing, including:

[0219] The initial vector is self-attention encoded to obtain the attention vector;

[0220] The attention vector is processed by a fully connected layer to obtain an activation vector, and the encoding rounds of the initial vector are accumulated.

[0221] If the number of encoding rounds is less than a preset round threshold, the activation vector is used as the initial vector for repeated attention activation processing until the number of encoding rounds is greater than or equal to the preset round threshold, thus obtaining the text vector.

[0222] The preset round threshold can be set according to actual needs.

[0223] By performing multiple attention activation processes on the target text, the ability of the text vector to represent the target text can be improved.

[0224] Specifically, the formula for generating the attention vector is:

[0225]

[0226] Where Z represents the attention vector, D represents the product of the initial vector and the first configuration matrix, and E TLet F be the transpose of the product of the initial vector and the second configuration matrix, and let F be the product of the initial vector and the third configuration matrix. The first configuration matrix, the second configuration matrix, and the third configuration matrix can be set according to actual needs. L represents the column dimension information of the first configuration matrix, the second configuration matrix, or the third configuration matrix.

[0227] Specifically, the formula for generating the activation vector is:

[0228] y = max(0, KM1 + b1)W2 + b2;

[0229] y represents the activation vector, K represents the attention vector, and W1, W2, b1, and b2 represent the set parameters, respectively.

[0230] Specifically, the recognition unit 114 performs intent recognition on the text vector to obtain the intent information, including:

[0231] Extract the forward and backward features of the text vector;

[0232] Based on the forward features and the backward features, semantic analysis is performed on the text vector to obtain a semantic vector;

[0233] Information matching the semantic vector is obtained from the configuration intent library as the intent information.

[0234] The forward features refer to the features generated after processing the text vector based on the forward propagation network, and the backward features refer to the features generated after processing the text vector based on the backward propagation network.

[0235] The semantic vector is obtained by performing attention analysis on the text vector based on the forward features and the backward features.

[0236] The configuration intent library can be a pre-configured database, which stores multiple mapping relationships between configuration vectors and configuration intents.

[0237] By combining the forward and backward features to perform contextual analysis on the text vector, the accuracy of semantic vector generation can be improved, thereby improving the accuracy of the intent information.

[0238] As can be seen from the above technical solutions, this application can improve the comprehensiveness of the text encoding vector in representing the text segment by encoding the text segment through the encoding layer, and further improve the accuracy of the target text in translating the audio to be recognized by the target text by performing feature fusion transformation processing on the text encoding vector through the multiple feature transformation layers. This can improve the accuracy of the recognition of the intent information by fusing the vector representation of context information on different feature transformation layers.

[0239] Figure 3 shows a schematic diagram of the structure of an electronic device that implements the intent recognition method of the present invention.

[0240] In one embodiment of the present invention, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and computer-readable instructions, such as an intent recognition program, stored in the memory 12 and executable on the processor 13.

[0241] Those skilled in the art will understand that the schematic diagram is merely an example of electronic device 1 and does not constitute a limitation on electronic device 1. It may include more or fewer components than shown in the diagram, or combine certain components, or different components. For example, electronic device 1 may also include input / output devices, network access devices, buses, etc.

[0242] The processor 13 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor. The processor 13 is the computing core and control center of the electronic device 1, connecting various parts of the electronic device 1 through various interfaces and lines, and executing the operating system of the electronic device 1, as well as various installed application programs and program code.

[0243] For example, the computer-readable instructions can be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present invention. The one or more modules / units can be a series of computer-readable instruction segments capable of performing a specific function, which describe the execution process of the computer-readable instructions in the electronic device 1. For example, the computer-readable instructions can be divided into an acquisition unit 110, a splicing unit 111, an encoding unit 112, a processing unit 113, an identification unit 114, and an adjustment unit 115.

[0244] The memory 12 can be used to store the computer-readable instructions and / or modules. The processor 13 implements various functions of the electronic device 1 by running or executing the computer-readable instructions and / or modules stored in the memory 12 and calling the data stored in the memory 12. The memory 12 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. The memory 12 may include non-volatile and volatile memory, such as: hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other storage devices.

[0245] The memory 12 can be the external memory and / or internal memory of the electronic device 1. Furthermore, the memory 12 can be a physical memory, such as a memory module, a TF card (Trans-flash Card), etc.

[0246] If the modules / units integrated in the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by instructing related hardware through computer-readable instructions. The computer-readable instructions can be stored in a computer-readable storage medium, and when executed by a processor, the computer-readable instructions can implement the steps of the various method embodiments described above.

[0247] The computer-readable instructions include computer-readable instruction code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer-readable instruction code, recording medium, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), and random access memory (RAM).

[0248] The blockchain referred to in this invention is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked together using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include an underlying blockchain platform, a platform product service layer, and an application service layer.

[0249] Referring to Figure 1, the memory 12 in the electronic device 1 stores computer-readable instructions to implement an intent recognition method, and the processor 13 can execute the computer-readable instructions to achieve:

[0250] Obtain multiple translated texts of the audio to be recognized;

[0251] Obtain a pre-trained generative model, which includes an encoding layer and multiple feature transformation layers;

[0252] Based on the aforementioned generation model, the multiple translated texts are concatenated to obtain a text fragment;

[0253] The text segment is encoded based on the encoding layer to obtain a text encoding vector;

[0254] Based on the multiple feature transformation layers, the text encoding vector is subjected to feature fusion transformation processing to obtain the target text that matches the audio to be identified;

[0255] The intent information of the audio to be identified is obtained by performing intent recognition on the target text.

[0256] Specifically, the specific implementation method of the above-mentioned computer-readable instructions by the processor 13 can be referred to the description of the relevant steps in the embodiment corresponding to FIG1, which will not be repeated here.

[0257] In the several embodiments provided by this invention, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and other division methods may be used in actual implementation.

[0258] The computer-readable storage medium stores computer-readable instructions, which, when executed by the processor 13, are used to perform the following steps:

[0259] Obtain multiple translated texts of the audio to be recognized;

[0260] Obtain a pre-trained generative model, which includes an encoding layer and multiple feature transformation layers;

[0261] Based on the aforementioned generation model, the multiple translated texts are concatenated to obtain a text fragment;

[0262] The text segment is encoded based on the encoding layer to obtain a text encoding vector;

[0263] Based on the multiple feature transformation layers, the text encoding vector is subjected to feature fusion transformation processing to obtain the target text that matches the audio to be identified;

[0264] The intent information of the audio to be identified is obtained by performing intent recognition on the target text.

[0265] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0266] Furthermore, the functional modules in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in the form of hardware plus software functional modules.

[0267] Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be embraced within the invention. No appended diagram markings in the claims should be construed as limiting the scope of the claims.

[0268] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. The multiple units or devices described may also be implemented by a single unit or device through software or hardware. Terms such as "first," "second," etc., are used to indicate names and do not indicate any specific order.

[0269] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. An intent recognition method, characterized in that, The intent recognition method includes: acquiring multiple translated texts of the audio to be recognized; acquiring a pre-trained generative model, the generative model including an encoding layer and multiple feature transformation layers; concatenating the multiple translated texts based on the generative model to obtain a text segment; encoding the text segment based on the encoding layer to obtain a text encoding vector; performing feature fusion transformation on the text encoding vector based on the multiple feature transformation layers to obtain a target text matching the audio to be recognized; and performing intent recognition on the target text to obtain intent information of the audio to be recognized, including: re-encoding the target text to obtain a text vector; and performing intent recognition on the text vector to obtain the intent information.

2. The intent recognition method as described in claim 1, characterized in that, The step of concatenating the multiple translated texts based on the generation model to obtain a text fragment includes: obtaining a preset start label and a preset end label of the generation model; concatenating each translated text and the preset end label to obtain an initial fragment corresponding to each translated text; concatenating multiple initial fragments to obtain a target fragment; and concatenating the preset start label and the target fragment to obtain the text fragment.

3. The intent recognition method as described in claim 1, characterized in that, The step of encoding the text segment based on the encoding layer to obtain a text encoding vector includes: encoding the text segment by character to obtain a character vector; encoding each character in the text segment by sentence to obtain a sentence vector for each character in the text segment; encoding each character in the text segment by position to obtain a position vector for each character in the text segment; generating a target vector for each character in the text segment based on the character vector, the sentence vector, and the position vector; and concatenating the target vectors to obtain the text encoding vector.

4. The intent recognition method as described in claim 1, characterized in that, The plurality of feature transformation layers include a first transformation layer and a plurality of second transformation layers. The step of performing feature fusion transformation processing on the text encoding vector based on the plurality of feature transformation layers to obtain target text matching the audio to be identified includes: transforming the text encoding vector based on the parameter matrix in the first transformation layer to obtain a plurality of text matrices; generating a mask matrix based on the text encoding vector; masking the plurality of text matrices based on the mask matrix to obtain an initial feature vector; inputting the initial feature vector into any one of the plurality of second transformation layers for transformation processing until all the plurality of second transformation layers participate in the transformation processing to obtain a target feature vector; and mapping the target feature vector to obtain the target text.

5. The intent recognition method as described in claim 1, characterized in that, The re-encoding process of the target text to obtain a text vector includes: performing lexical encoding on the target text to obtain an initial vector; performing attention activation processing on the initial vector, including: performing self-attention encoding on the initial vector to obtain an attention vector; performing fully connected processing on the attention vector to obtain an activation vector, and accumulating the encoding rounds of the initial vector; if the encoding rounds are less than a preset round threshold, then using the activation vector as the initial vector to repeatedly perform attention activation processing until the encoding rounds are greater than or equal to the preset round threshold, thereby obtaining the text vector.

6. The intent recognition method as described in claim 1, characterized in that, The step of performing intent recognition on the text vector to obtain the intent information includes: extracting forward and backward features of the text vector; performing semantic analysis on the text vector based on the forward and backward features to obtain a semantic vector; and obtaining information matching the semantic vector from the configuration intent library as the intent information.

7. An intent recognition device, characterized in that, The intent recognition device includes: an acquisition unit for acquiring multiple translated texts of the audio to be recognized; the acquisition unit is further configured to acquire a pre-trained generative model, the generative model including an encoding layer and multiple feature transformation layers; a concatenation unit for concatenating the multiple translated texts based on the generative model to obtain a text segment; an encoding unit for encoding the text segment based on the encoding layer to obtain a text encoding vector; a processing unit for performing feature fusion transformation processing on the text encoding vector based on the multiple feature transformation layers to obtain a target text matching the audio to be recognized; and a recognition unit for performing intent recognition on the target text to obtain intent information of the audio to be recognized, including: re-encoding the target text to obtain a text vector; and performing intent recognition on the text vector to obtain the intent information.

8. An electronic device, characterized in that, The electronic device includes: a memory storing computer-readable instructions; and a processor executing the computer-readable instructions stored in the memory to implement the intent recognition method as described in any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions that are executed by a processor in an electronic device to implement the intent recognition method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Voice information processing method and device

    CN110010131A

  • Voice intention recognition method and device, computer equipment and storage medium

    CN112699213A