AI-based voice intention recognition method and device
Through the speech intent recognition model based on deep learning, the features of speech signals and manually recognized texts are extracted and processed, and the principal component differences are calculated, which solves the problem of inaccurate speech intent recognition in the existing technology and achieves higher recognition accuracy and robustness.
Patent Information
- Application Number
- CN202411161623.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2044-08-23
AI Technical Summary
Existing speech intent recognition methods are not satisfactory in speech intent recognition, and no effective solution has yet been proposed.
Using a speech intent recognition model based on deep learning, by acquiring speech signals and manually recognized text, extracting sentence vectors of the speech recognized text and manually recognized text, performing tensor conversion and decomposition, calculating principal component differences, enhancing decision boundaries, and updating model parameters , until the loss reaches the preset threshold.
It improves the accuracy and robustness of speech intent recognition, and improves the generalization performance and recognition accuracy of the model.
Smart Images

Figure CN118692464B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a method and device for recognizing speech intention based on AI. Background Art
[0002] With the rapid development of artificial intelligence (AI) technology, AI technology has been widely used in many fields, such as in the scenario of intelligent voice assistants. Intelligent voice assistants can significantly improve the convenience of services. When a user inputs a sentence by voice, the system will convert the voice into natural language text through automatic speech recognition technology, then recognize the user's intention and perform the corresponding service. The accuracy of intention recognition is crucial for the intelligent question-and-answer system to accurately respond to user questions.
[0003] Existing speech intent recognition methods usually adopt pipeline processing, that is, first converting speech into text through Automatic Speech Recognition (ASR) technology, and then analyzing the text through the intent recognition model. However, the current trained intent recognition model is still not satisfactory in speech intent recognition.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method and device for recognizing speech intent based on AI, so as to at least solve the technical problem of inaccurate speech intent recognition in the prior art.
[0006] According to one aspect of an embodiment of the present invention, there is provided a method for recognizing speech intention based on AI, comprising: obtaining speech to be recognized; based on the speech to be recognized, using a speech intention recognition model based on deep learning to recognize the intention of the speech to be recognized; wherein the speech intention recognition model is obtained by iteratively executing the following steps until the loss of the speech intention recognition model reaches a preset loss threshold: obtaining a training sample, the training sample comprising a speech recognition text and an artificial recognition text corresponding to a speech signal; using the speech intention recognition model to respectively extract a first sentence vector of the speech recognition text and a second sentence vector of the artificial recognition text, and respectively performing tensor conversion on the first sentence vector and the second sentence vector to obtain a first sentence tensor and a second sentence tensor; respectively performing tensor decomposition on the first sentence tensor and the second sentence tensor, calculating the principal component difference between the decomposed first sentence tensor and the decomposed second sentence tensor, and performing decision boundary enhancement on the training sample based on the principal component difference to obtain the loss of the speech intention recognition model; and updating the network parameters of the speech intention recognition model based on the loss of the speech intention recognition model.
[0007] According to another aspect of an embodiment of the present invention, there is also provided an AI-based speech intention recognition device, comprising: an acquisition module configured to acquire a speech to be recognized; and a recognition module configured to recognize the intention of the speech to be recognized based on the speech to be recognized, using a speech intention recognition model based on deep learning. Wherein, the speech intention recognition model is obtained by iteratively executing the following steps until the loss of the speech intention recognition model reaches a preset loss threshold: obtaining a training sample, the training sample comprising a speech recognition text and an artificial recognition text corresponding to a speech signal; using the speech intention recognition model to extract the first sentence vector of the speech recognition text and the second sentence vector of the artificial recognition text respectively, and performing tensor conversion on the first sentence vector and the second sentence vector to obtain a first sentence tensor and a second sentence tensor respectively; performing tensor decomposition on the first sentence tensor and the second sentence tensor respectively, calculating the principal component difference between the decomposed first sentence tensor and the decomposed second sentence tensor, and performing decision boundary enhancement on the training sample based on the principal component difference to obtain the loss of the speech intention recognition model; updating the network parameters of the speech intention recognition model based on the loss of the speech intention recognition model.
[0008] In an embodiment of the present invention, a speech intention recognition model is trained in the following manner: obtaining training samples, the training samples including speech recognition text and artificial recognition text corresponding to a speech signal; using the speech intention recognition model to respectively extract a first sentence vector of the speech recognition text and a second sentence vector of the artificial recognition text, and respectively performing tensor conversion on the first sentence vector and the second sentence vector to obtain a first sentence tensor and a second sentence tensor; respectively performing tensor decomposition on the first sentence tensor and the second sentence tensor, calculating the principal component difference between the decomposed first sentence tensor and the decomposed second sentence tensor, and performing decision boundary enhancement on the training samples based on the principal component difference to obtain the loss of the speech intention recognition model; updating the network parameters of the speech intention recognition model based on the loss of the speech intention recognition model, thereby solving the technical problem of inaccurate speech intention recognition in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0010] Figure 1 is a flow chart of a method for recognizing speech intent based on AI according to an embodiment of the present invention;
[0011] Figure 2 is a flow chart of a method for training a speech intent recognition model according to an embodiment of the present invention;
[0012] Figure 3 is a flow chart of another AI-based voice intent recognition method according to an embodiment of the present invention;
[0013] Figure 4 is a flowchart of another method for training a speech intent recognition model according to an embodiment of the present invention;
[0014] Figure 5 is a structural schematic diagram of a voice intention recognition device based on AI according to an embodiment of the present invention;
[0015] Figure 6 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0016] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0017] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0018] According to an embodiment of the present invention, a method embodiment of an AI-based voice intent recognition method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0019] Figure 1 is a method for recognizing speech intention based on AI according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0020] Step S102: Acquire the speech to be recognized.
[0021] Step S104: Based on the speech to be recognized, a speech intention recognition model based on deep learning is used to recognize the intention of the speech to be recognized.
[0022] Among them, the speech intent recognition model based on deep learning is iteratively executed as follows Figure 2 The method shown is obtained until the loss of the speech intent recognition model reaches a preset loss threshold:
[0023] Step S1042: Acquire training samples, where the training samples include speech recognition text and manual recognition text corresponding to the speech signal.
[0024] Step S1044, using the speech intention recognition model to respectively extract the first sentence vector of the speech recognition text and the second sentence vector of the manually recognized text, and respectively perform tensor conversion on the first sentence vector and the second sentence vector to obtain a first sentence tensor and a second sentence tensor.
[0025] First, the speech intention recognition model is used to extract the first sentence vector of the speech recognition text and the second sentence vector of the manual recognition text. For example, for the speech recognition text, the model will extract its corresponding feature vector, that is, the first sentence vector; this vector represents the semantic features of the speech recognition text in a high-dimensional space. Similarly, for the manual recognition text, the model will extract its feature vector, that is, the second sentence vector, which also reflects the semantic features of the manual recognition text. By extracting these sentence vector representations, the model can capture the core semantic information of the text, providing a basis for subsequent tensor transformation and intent recognition.
[0026] Then, according to the preset expansion dimension, the tensor dimension of the first sentence vector and the second sentence vector are expanded respectively, and the first sentence vector and the second sentence vector after the dimension expansion are fused and activated respectively. For example, each dimension in the expansion dimension is used as a feature channel, and through the convolution operation, the multi-dimensional features of the first sentence vector and the second sentence vector after the dimension expansion are fused respectively to obtain the fused first sentence vector and the fused second sentence vector; then, the fused first sentence vector and the fused second sentence vector are activated respectively to introduce nonlinear features, and the activated first sentence vector and the activated second sentence vector are obtained. By expanding the dimension of the sentence vector and performing feature fusion and nonlinear activation, the present application can enhance the semantic expression ability of speech recognition text and artificial recognition text, thereby improving the accuracy and robustness of the speech intention recognition model.
[0027] Finally, the fused and activated first sentence vector and the second sentence vector are subjected to tensor normalization processing to obtain the first sentence tensor and the second sentence tensor.
[0028] Step S1046, performing tensor decomposition on the first sentence tensor and the second sentence tensor respectively, calculating the principal component difference between the decomposed first sentence tensor and the decomposed second sentence tensor, and enhancing the decision boundary of the training sample based on the principal component difference to obtain the loss of the speech intent recognition model.
[0029] First, the first sentence tensor and the second sentence tensor are respectively decomposed into tensors. For example, the first sentence tensor and the second sentence tensor are respectively expanded along the direction of the expansion dimension to obtain multiple matrices of the first sentence tensor and multiple matrices of the second sentence tensor; singular value decomposition is performed on each of the multiple matrices of the first sentence tensor and the multiple matrices of the second sentence tensor to obtain multiple factor matrices of the first sentence tensor and multiple factor matrices of the second sentence tensor; the core vector of the first sentence tensor is calculated based on the multiple factor matrices of the first sentence tensor, and the core vector of the second sentence tensor is calculated based on the multiple factor matrices of the second sentence tensor; the core vector of the first sentence tensor and the multiple factor matrices of the first sentence tensor are used as the first sentence tensor after decomposition, and the core vector of the second sentence tensor and the multiple factor matrices of the second sentence tensor are used as the second sentence tensor after decomposition. The embodiment of the present application decomposes the sentence tensor to extract the core vector and the factor matrix, thereby effectively reducing feature redundancy, enhancing the accuracy and compactness of the semantic representation, and thus improving the performance and efficiency of the speech intent recognition model.
[0030] Next, calculate the principal component differences between the decomposed first sentence tensor and the decomposed second sentence tensor. Calculate the similarity between the core vector of the first sentence tensor and the core vector of the second sentence tensor; match and compare the principal components in the factor matrix of the first sentence tensor and the factor matrix of the second sentence tensor to obtain the difference in the factor matrix; calculate the principal component differences based on the similarity and the difference in the factor matrix. The present application helps to accurately capture the subtle differences between speech recognition text and manual recognition text by calculating the principal component differences between the decomposed sentence tensors, combining the similarity of the core vectors and the difference in the factor matrix, thereby optimizing the model's discrimination ability and improving the accuracy and reliability of speech intent recognition.
[0031] Finally, the decision boundary of the training sample is enhanced based on the principal component difference to obtain the loss of the speech intent recognition model. For example, based on the principal component difference, the loss function of the speech intent recognition model is adjusted to enhance the decision boundary of the training sample; based on the loss function, the loss of the speech intent recognition model is calculated. The embodiment of the present application enhances the decision boundary of the training sample by adjusting the loss function of the model based on the principal component difference, which helps to improve the model's ability to distinguish boundary samples, enhance the generalization performance of the model, and ultimately improve the accuracy and robustness of speech intent recognition.
[0032] Step S1048, updating the network parameters of the speech intent recognition model based on the loss of the speech intent recognition model.
[0033] After calculating the loss, the backpropagation algorithm is used to calculate the gradient of the loss function relative to each network parameter (such as weight and bias). The gradient indicates how to adjust the network parameters to reduce the loss value of the model.
[0034] Using the calculated gradient, the network parameters are updated according to the optimization algorithm. For example, the optimization algorithm may include Gradient Descent, Stochastic Gradient Descent (SGD), Adaptive Moment Estimation (Adam), etc. These algorithms use the gradient information to adjust the network parameters according to a certain step size or learning rate.
[0035] When the network parameters are updated, the structure and weights of the model are adjusted to make it closer to the optimal state. Through continuous iterative training, the model will gradually optimize its parameters and eventually achieve the goal of minimizing the loss. After multiple iterations, as the network parameters are updated, the loss of the model will gradually decrease. When the loss value reaches the preset loss threshold, or when the loss value decreases below a certain threshold, the training process will terminate, indicating that the model has converged and reached the optimal state. Through the above steps, the network parameters are updated based on the loss of the speech intent recognition model, which can effectively improve the speech intent recognition performance of the model.
[0036] Figure 3 is another AI-based voice intent recognition method according to an embodiment of the present invention, such as Figure 3 As shown, the method comprises the following steps:
[0037] Step S302: training a speech intent recognition model.
[0038] like Figure 4 As shown, the method for training a speech intent recognition model includes the following steps:
[0039] Step S3022, extracting sentence vectors from training samples.
[0040] First, the system receives a speech signal. The speech signal is converted into corresponding speech recognition text through a speech recognition module. The artificial recognition text can be a text that is manually annotated and matches the semantic content of the speech signal. The training sample includes the speech recognition text corresponding to the speech signal and the artificial recognition text.
[0041] Next, the speech intention recognition model will perform feature extraction on the speech recognition text and the manual recognition text respectively. The speech intention recognition model can adopt a neural network model based on the Transformer architecture, such as a BERT or GPT model. The input layer of the model receives text data and converts it into a word embedding vector, which represents the semantic information of each word.
[0042] Specifically, first, the speech intent recognition model inputs the speech recognition text into the embedding layer to generate a word embedding matrix representing the text. Each row in the matrix corresponds to the embedding vector of a word. Then, after being processed by multiple self-attention layers, the model can capture the long-distance dependencies between words in the text and generate the first sentence vector. The first sentence vector is obtained by performing a pooling operation on the embedding matrix output by the self-attention layer. The operation can be average pooling or maximum pooling, thereby compressing the embedding matrix into a vector of fixed dimension.
[0043] The same process is also applied to the human-recognized text. After the human-recognized text is processed by the embedding layer and the self-attention layer, the second sentence vector is generated.
[0044] The generation process of the first sentence vector and the second sentence vector ensures that the model can capture the semantic information between the speech recognition text and the manual recognition text in a high-dimensional space. Specifically, the generated sentence vector is a semantic feature representation of the text, and each dimension of the vector corresponds to a specific semantic feature. These features can include grammatical structure, lexical relations, context associations, and other information. By learning these features, the model can better understand the semantics of the text.
[0045] Step S3024, convert the sentence vector into a sentence tensor.
[0046] After the sentence vectors are extracted, the generated first sentence vector (from speech recognition text) and second sentence vector (from manual recognition text) need to be further converted into tensor representations suitable for subsequent processing.
[0047] Specifically, first, the system inputs the first sentence vector and the second sentence vector into the tensor conversion module respectively. The tensor conversion module performs dimension expansion on each sentence vector according to the preset expansion dimension. The expanded vector represents the multi-dimensional features of the sentence in the high-dimensional space, enhancing the semantic expression ability.
[0048] Next, the expanded sentence vector is subjected to feature fusion operation. Feature fusion can be achieved through convolution operation, where each dimension in the expanded dimension is used as a feature channel, and the features of each dimension are extracted and combined through the convolution kernel to obtain the fused first sentence vector and the second sentence vector.
[0049] Finally, the fused sentence vector is activated to introduce nonlinear features. The activation function can be ReLU, which can enhance the expressiveness of the model and enable the tensor to better capture complex semantic relationships. After the activation operation, the generated sentence tensor will contain richer semantic information, laying the foundation for subsequent decision boundary enhancement.
[0050] Step S3026, performing decision boundary enhancement based on the sentence tensor.
[0051] After the sentence tensors are generated, the sentence tensors are further processed to enhance the decision boundary of the model. This embodiment enhances the distinguishing ability of the model in the speech intent recognition task by decomposing and comparing the features of the sentence tensors.
[0052] First, tensor decomposition operations are performed on the first sentence tensor and the second sentence tensor respectively. Tensor decomposition can be achieved by singular value decomposition and principal component analysis methods. The decomposition process decomposes the sentence tensor into multiple factor matrices and core vectors, thereby extracting the most representative features.
[0053] Next, the principal component differences between the first sentence tensor and the second sentence tensor after decomposition are calculated. The principal component differences are calculated by comparing the similarity of the core vectors and the differences between the factor matrices. These differences reflect the subtle differences in semantics between the speech recognition text and the manual recognition text, which helps the model to accurately divide the decision boundary. Specifically, by calculating the cosine similarity of the decomposed core vectors, the similarity of the two sentence tensors on their main feature vectors is evaluated. The cosine similarity reflects the angle between the two vectors, and the closer the value is to 1, the more similar the two vectors are. Through the above steps, the proximity of the two sentence tensors in the semantic space can be identified. After that, the differences in the structural features of the two sentence tensors are quantified by comparing the elements of the factor matrix after decomposition. For example, the difference in the element of the factor matrix or the difference in the matrix norm can be calculated to evaluate the semantic differences between the two tensors in different dimensions. Finally, the core vector similarity and the factor matrix difference are combined to form the principal component difference.
[0054] Finally, based on the calculated principal component differences, the decision boundary of the model is enhanced. Specifically, the following steps are included:
[0055] 1) Generate difference weight coefficient.
[0056] Based on the above principal component differences, a difference weight coefficient is generated to adjust the weight of the loss function. The difference weight coefficient α can be defined in the following way:
[0057]
[0058] Among them, β is a hyperparameter used to control the influence of the principal component difference on the weight of the loss function; cosine_similarity represents the difference of the i-th principal component, P is the core vector similarity, Q i is the difference of the i-th factor matrix, and n is the number of factor matrices. When the similarity between the principal component vectors of the two sentence tensors is low (i.e., the difference is large), the value of α will increase, thereby increasing the loss function weight of the corresponding sample.
[0059] In some embodiments, the difference weight coefficient can also be obtained by:
[0060]
[0061] Among them, γ is the initial weight coefficient, which sets the baseline value of the weight; λ is the adjustment coefficient, which controls the influence of the principal component difference on the exponential function; δ is the difference amplification factor, which is used to increase or decrease the influence of the principal component difference.
[0062] This embodiment effectively enhances the sensitivity of the model to the differences in principal components between samples by introducing a difference weight coefficient. When the similarity of two sentence tensors is low, the value of α is dynamically increased to increase the weight of these samples in the loss function. In addition, the initial weight coefficient ensures that the model has a baseline weight at the beginning of training to avoid neglecting difference samples; the adjustment coefficient controls the intensity of the influence of the principal component difference on the exponential function, so that the model can fine-tune the sensitivity to difference samples; the difference amplification factor is used to enhance or reduce the influence of the principal component difference, allowing the model to choose to pay more attention to high-difference samples or maintain balanced processing of samples based on task requirements. In summary, the above method can make the model pay more attention to processing samples with significant differences, which helps to optimize the decision boundary of the model, thereby improving the accuracy and robustness of the overall model.
[0063] 2) Adjust the loss function.
[0064] The difference weight coefficient α is introduced into the loss function to adjust the loss function. Assuming the loss function is L(θ), the adjusted loss function L′(θ) can be expressed as:
[0065]
[0066] Here, θ represents the model parameters. Under this adjustment, the weight of the loss function for samples with large differences will increase, prompting the model to learn more deeply on these samples, thereby improving the model's ability to distinguish on the decision boundary.
[0067] This application is achieved by adjusting the loss function of the model so that the model can better handle boundary samples, thereby improving the accuracy and robustness of speech intent recognition.
[0068] Step S3028, update the network parameters of the speech intent recognition model.
[0069] After calculating the loss of the model, the network parameters of the speech intent recognition model are updated to continuously optimize the performance of the model. This step is implemented through the back propagation algorithm. The specific steps are as follows: First, the system calculates the gradient of the loss function relative to each network parameter. These gradients indicate how to adjust the network parameters to reduce the loss of the model. Then, using these gradients, the network parameters are updated using an optimization algorithm. For example, gradient descent, stochastic gradient descent (SGD), and adaptive moment estimation (Adam). Through these algorithms, the system applies gradient information to the adjustment of network parameters, gradually optimizes the structure and weights of the model, and gradually improves its performance. After multiple iterations of training, as the network parameters are continuously updated, the loss value of the model gradually decreases. When the loss value reaches the preset threshold or convergence standard, the training process terminates. At this time, the model has reached the optimal state and has stronger speech intent recognition capabilities.
[0070] Step S304: input the speech to be recognized into a speech intention recognition model to obtain the corresponding speech intention.
[0071] The present application also provides an AI-based voice intent recognition device, such as Figure 5 As shown, it includes: an acquisition module 52, which is configured to acquire a speech to be recognized; and a recognition module 54, which is configured to recognize the intention of the speech to be recognized based on the speech to be recognized, using a speech intention recognition model based on deep learning. Wherein, the speech intention recognition model is obtained by iteratively executing the following steps until the loss of the speech intention recognition model reaches a preset loss threshold: obtaining a training sample, the training sample includes a speech recognition text and an artificial recognition text corresponding to the speech signal; using the speech intention recognition model to extract the first sentence vector of the speech recognition text and the second sentence vector of the artificial recognition text respectively, and performing tensor conversion on the first sentence vector and the second sentence vector to obtain a first sentence tensor and a second sentence tensor respectively; performing tensor decomposition on the first sentence tensor and the second sentence tensor respectively, calculating the principal component difference between the decomposed first sentence tensor and the decomposed second sentence tensor, and enhancing the decision boundary of the training sample based on the principal component difference to obtain the loss of the speech intention recognition model; updating the network parameters of the speech intention recognition model based on the loss of the speech intention recognition model.
[0072] It should be noted that the AI-based voice intent recognition device provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the AI-based voice intent recognition device provided in the above embodiment and the AI-based voice intent recognition method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0073] Figure 6 FIG. 1 shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present disclosure. It should be noted that: Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0074] like Figure 6 As shown, the electronic device includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage part 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for system operation are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0075] The following components are connected to the I / O interface 1005: an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1010 as needed, so that a computer program read therefrom is installed into the storage section 1008 as needed.
[0076] In particular, according to an embodiment of the present disclosure, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1009, and / or installed from the removable medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, various functions defined in the method and apparatus of the present application are executed. In some embodiments, the electronic device may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0077] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0078] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0079] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0080] As another aspect, the present application further provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device.
[0081] The computer-readable medium carries one or more programs, and when the one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiments. For example, the electronic device can implement each step of the method embodiment.
[0082] As another aspect, the present application further provides an electronic device, comprising: at least one processor; and a memory connected to the at least one processor in communication. The memory stores a computer program executable by the at least one processor, and the computer program is used to enable the electronic device to perform the method of the embodiment of the present application when executed by the at least one processor.
[0083] As another aspect, the present application further provides a computer program product, including a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to execute the method of the embodiment of the present application.
[0084] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0085] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.
[0086] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0087] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0088] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0089] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc., which can store program code.
[0090] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for recognizing speech intention based on AI, characterized in that: include: Obtain the speech to be recognized; Based on the speech to be recognized, using a speech intention recognition model based on deep learning to recognize the intention of the speech to be recognized; The speech intention recognition model is obtained by iteratively executing the following steps until the loss of the speech intention recognition model reaches a preset loss threshold: Acquire a training sample, wherein the training sample includes a speech recognition text and an artificial recognition text corresponding to the speech signal; Using the speech intention recognition model, respectively extracting a first sentence vector of the speech recognition text and a second sentence vector of the manual recognition text, and respectively performing tensor conversion on the first sentence vector and the second sentence vector to obtain a first sentence tensor and a second sentence tensor; Performing tensor decomposition on the first sentence tensor and the second sentence tensor respectively, calculating the principal component difference between the decomposed first sentence tensor and the decomposed second sentence tensor, and enhancing the decision boundary of the training sample based on the principal component difference to obtain the loss of the speech intent recognition model; Updating network parameters of the speech intent recognition model based on the loss of the speech intent recognition model; The first sentence vector and the second sentence vector are respectively converted into tensors to obtain the first sentence tensor and the second sentence tensor, including: according to a preset expansion dimension, the first sentence vector and the second sentence vector are respectively expanded in tensor dimension, and the first sentence vector and the second sentence vector after the expansion in dimension are respectively fused and activated; the first sentence vector and the second sentence vector that have been fused and activated are subjected to tensor normalization processing to obtain the first sentence tensor and the second sentence tensor; The first sentence vector and the second sentence vector after dimension expansion are respectively fused and activated, including: taking each dimension in the expanded dimension as a feature channel, and fusing the first sentence vector and the second sentence vector after dimension expansion with multi-dimensional features through a convolution operation to obtain the fused first sentence vector and the fused second sentence vector; respectively activating the fused first sentence vector and the fused second sentence vector to introduce nonlinear features to obtain the activated first sentence vector and the activated second sentence vector; Among them, tensor decomposition is performed on the first sentence tensor and the second sentence tensor respectively, including: respectively expanding the first sentence tensor and the second sentence tensor along the expansion dimension direction to obtain multiple matrices of the first sentence tensor and multiple matrices of the second sentence tensor; respectively performing singular value decomposition on each of the multiple matrices of the first sentence tensor and the multiple matrices of the second sentence tensor to obtain multiple factor matrices of the first sentence tensor and multiple factor matrices of the second sentence tensor; calculating the core vector of the first sentence tensor based on the multiple factor matrices of the first sentence tensor, and calculating the core vector of the second sentence tensor based on the multiple factor matrices of the second sentence tensor; using the core vector of the first sentence tensor and the multiple factor matrices of the first sentence tensor as the decomposed first sentence tensor, and using the core vector of the second sentence tensor and the multiple factor matrices of the second sentence tensor as the decomposed second sentence tensor.
2. The method according to claim 1, characterized in that Calculating the principal component difference between the decomposed first sentence tensor and the decomposed second sentence tensor, including: Calculating the similarity between the core vector of the first sentence tensor and the core vector of the second sentence tensor; Matching and comparing principal components in the factor matrix of the first sentence tensor and the factor matrix of the second sentence tensor to obtain a difference in the factor matrices; The principal component difference is calculated based on the similarity and the difference of the factor matrix.
3. The method according to claim 1, characterized in that Performing decision boundary enhancement on the training sample based on the principal component difference to obtain the loss of the speech intent recognition model includes: Based on the principal component difference, adjusting the loss function of the speech intention recognition model to enhance the decision boundary of the training sample; Based on the loss function, the loss of the speech intent recognition model is calculated.
4. A speech intention recognition device based on AI, characterized in that: include: An acquisition module, configured to acquire speech to be recognized; A recognition module is configured to recognize the intent of the speech to be recognized based on the speech to be recognized using a speech intent recognition model based on deep learning The speech intention recognition model is obtained by iteratively executing the following steps until the loss of the speech intention recognition model reaches a preset loss threshold: Acquire a training sample, wherein the training sample includes a speech recognition text and an artificial recognition text corresponding to the speech signal; Using the speech intention recognition model, respectively extracting a first sentence vector of the speech recognition text and a second sentence vector of the manual recognition text, and respectively performing tensor conversion on the first sentence vector and the second sentence vector to obtain a first sentence tensor and a second sentence tensor; Performing tensor decomposition on the first sentence tensor and the second sentence tensor respectively, calculating the principal component difference between the decomposed first sentence tensor and the decomposed second sentence tensor, and enhancing the decision boundary of the training sample based on the principal component difference to obtain the loss of the speech intent recognition model; Updating network parameters of the speech intent recognition model based on the loss of the speech intent recognition model; The first sentence vector and the second sentence vector are respectively converted into tensors to obtain the first sentence tensor and the second sentence tensor, including: according to a preset expansion dimension, the first sentence vector and the second sentence vector are respectively expanded in tensor dimension, and the first sentence vector and the second sentence vector after the expansion in dimension are respectively fused and activated; the first sentence vector and the second sentence vector that have been fused and activated are subjected to tensor normalization processing to obtain the first sentence tensor and the second sentence tensor; The first sentence vector and the second sentence vector after dimension expansion are respectively fused and activated, including: taking each dimension in the expanded dimension as a feature channel, and fusing the first sentence vector and the second sentence vector after dimension expansion with multi-dimensional features through a convolution operation to obtain the fused first sentence vector and the fused second sentence vector; respectively activating the fused first sentence vector and the fused second sentence vector to introduce nonlinear features to obtain the activated first sentence vector and the activated second sentence vector; Among them, tensor decomposition is performed on the first sentence tensor and the second sentence tensor respectively, including: respectively expanding the first sentence tensor and the second sentence tensor along the expansion dimension direction to obtain multiple matrices of the first sentence tensor and multiple matrices of the second sentence tensor; respectively performing singular value decomposition on each of the multiple matrices of the first sentence tensor and the multiple matrices of the second sentence tensor to obtain multiple factor matrices of the first sentence tensor and multiple factor matrices of the second sentence tensor; calculating the core vector of the first sentence tensor based on the multiple factor matrices of the first sentence tensor, and calculating the core vector of the second sentence tensor based on the multiple factor matrices of the second sentence tensor; using the core vector of the first sentence tensor and the multiple factor matrices of the first sentence tensor as the decomposed first sentence tensor, and using the core vector of the second sentence tensor and the multiple factor matrices of the second sentence tensor as the decomposed second sentence tensor.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 3.
6. A computer device, characterized in that: include: Memory and processor, The memory stores a computer program; The processor is used to execute the computer program stored in the memory, and when the computer program is run, the processor is enabled to execute the method according to any one of claims 1 to 3.
7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
