Natural language understanding method and refrigerator
By adopting the natural language understanding method in the smart refrigerator, using the matching results of the annotated text and the preset slot database, and combining the convolutional neural network and the distillation diffusion model to process multi-source heterogeneous data, the inaccurate understanding results in the existing technology are solved. and low efficiency problems, achieving more accurate and efficient natural language understanding and improving user experience.
Patent Information
- Application Number
- PCT/CN2024/082771
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-03-23
- Filing Date
- 2024-03-20
- Publication Date
- 2024-09-26
AI Technical Summary
Existing natural language understanding methods fail to mine deep semantic, contextual and grammatical information when acquiring multi-modal data, resulting in inaccurate and inefficient understanding results, affecting the accuracy and convenience of smart refrigerators interacting with users.
A natural language understanding method is used to obtain the annotated text corresponding to the text data, perform slot extraction and matching, and use the preset slot database to fuse the matching results to characterize the word attributes and emotional connotations of the text data, combined with convolutional neural Network and distillation diffusion models process multi-source heterogeneous data to improve the accuracy and timeliness of understanding results.
It achieves fast and efficient natural language understanding, enhances the ability to understand natural language, improves the user experience effect and the accuracy of language understanding, and improves the convenience and accuracy of smart refrigerators interacting with users.
Smart Images

Figure CN2024082771_26092024_PF_FP
Abstract
Description
Natural language understanding method and refrigerator
[0001] This application is based on the Chinese patent application with application number CN202310292017.8 and application date March 23, 2023, and claims the priority of the Chinese patent application. The entire content of the above patent application is hereby introduced into this application as a reference. Technical Field
[0002] The present invention relates to the field of computer technology, and in particular to a natural language understanding method and a refrigerator. Background Art
[0003] Natural language understanding (NLU) is a part of natural language processing (NLP). It has a wide range of applications, particularly in smart home appliances such as refrigerators. For example, smart refrigerators and users can implement various human-computer interaction scenarios such as intelligent retrieval, intelligent recommendations, and intelligent question-and-answering through multimodal data such as text, voice, and images. These are all closely linked to natural language understanding methods, making them a key part of the application of artificial intelligence technology.
[0004] Existing natural language understanding methods include rule-based and statistical methods, which judge the intention of natural language by summarizing regularities and learning labeled data, or through traditional machine learning, using single data annotation to build models to achieve understanding of natural language.
[0005] The aforementioned natural language understanding methods suffer from two issues: first, they fail to mine the data's deeper semantics, context, and grammar when acquiring multimodal data, resulting in inaccurate understanding. Second, they are slow and inefficient in matching semantic information to text data. These issues can easily lead to inaccurate, incomplete, and time-sensitive language understanding methods, resulting in slow user interaction, low accuracy of feedback, poor convenience, and a poor user experience when interacting with smart refrigerators. Summary of the Invention
[0006] One of the purposes of the present invention is to provide a natural language understanding method to solve the technical problems in the existing technology that the language understanding method uses a single annotated text to construct a model in isolation, the matching semantic results are slow, the expression content is single, and it is unable to accurately and efficiently reflect the original meaning of the text data.
[0007] One of the objects of the present invention is to provide a refrigerator.
[0008] In order to achieve one of the above-mentioned purposes of the invention, the present invention provides a natural language understanding method, including: obtaining annotated text corresponding to text data; performing slot extraction on the annotated text, and matching the extracted slot information based on a preset slot database to obtain a number of matching results corresponding to the text data; identifying and fusing the several matching results to obtain understanding result information corresponding to the text data; wherein the several matching results represent the characteristics of several elements in the text data at the level of word attributes and / or word meanings, and the understanding result represents the text category, emotional connotation and / or intrinsic intention of the text data as a whole.
[0009] As a further improvement of an embodiment of the present invention, the text data includes voice text data, video text data and text data.
[0010] As a further improvement of an embodiment of the present invention, before the step of "obtaining annotated text corresponding to the text data", the method further includes: obtaining multi-source heterogeneous data and extracting data features of the multi-source heterogeneous data; wherein the multi-source heterogeneous data includes at least one of voice data and video data; inputting the data features into a convolutional neural network model to obtain corresponding first text information; aligning the sequence lengths of the first text information and the data features using a connection temporal classification algorithm, and performing a fully connected combination calculation on the first text information to obtain the text data.
[0011] As a further improvement of one embodiment of the present invention, the "inputting the data features into the convolutional neural network model to obtain the corresponding first text information" specifically includes: inputting the data features into a multi-size multi-channel convolutional neural network model or a distillation diffusion model to obtain the first text information consistent with the data features.
[0012] As a further improvement of an embodiment of the present invention, before the "extracting data features of the multi-source heterogeneous data", the method also includes: determining whether the multi-source heterogeneous data includes voice data; the "inputting the data features into the convolutional neural network model to obtain the corresponding first text information" specifically includes: if so, inputting the voice features into the multi-size multi-channel convolutional neural network model to obtain the first text information corresponding to the voice data; wherein the data features include the voice features; and / or, before the "extracting data features of the multi-source heterogeneous data", the method also includes: determining whether the multi-source heterogeneous data includes video data; the "inputting the data features into the convolutional neural network model to obtain the corresponding first text information" specifically includes: if so, inputting the video features into the distillation diffusion model to obtain the first text information corresponding to the video data; wherein the data features include the video features.
[0013] As a further improvement of an embodiment of the present invention, the method further includes: inputting the video data into a 3D deep convolutional neural network model to obtain the video features.
[0014] As a further improvement of an embodiment of the present invention, the "obtaining annotated text corresponding to the text data" specifically includes: performing pre-annotation on the text data based on preset annotation rules to obtain first annotated text information, wherein the preset annotation rules represent the annotation information corresponding to several professional field words and / or words with special meanings in the text data; performing text feature annotation on the first annotated text information to obtain the annotated text, wherein the text feature annotation includes at least one of entity annotation, relationship annotation, intention annotation, grammatical annotation and sentiment annotation; performing annotation quality inspection on the annotated text, and screening and storing the annotated text that meets preset conditions.
[0015] As a further improvement of an embodiment of the present invention, the "performing annotation quality inspection on the annotated text, screening and storing the annotated text that meets the preset conditions" specifically includes: counting and judging whether the accuracy of the text annotation is greater than or equal to a preset threshold, wherein the accuracy represents the ratio of the number of correct annotations to the total number of annotations in the annotated text; if so, saving the annotated text to a text annotation database; if not, re-performing the pre-annotation, the text feature annotation and the annotation quality inspection on the text data.
[0016] As a further improvement of an embodiment of the present invention, the "performing slot extraction on the annotated text, and matching the extracted slot information based on a preset slot database to obtain several matching results corresponding to the text information" specifically includes: performing an extraction operation on each slot according to the slot annotation information in the annotated text to obtain several slot information; querying the preset slot database according to the several slot information, and determining whether each slot information matches at least one of the query results; if so, obtaining the matching result corresponding to each slot information; if not, constructing a natural language understanding model according to the annotated text, and performing slot extraction on the annotated text based on the natural language model, performing matching on the extracted slot information, and obtaining several matching results corresponding to the text information.
[0017] As a further improvement of an embodiment of the present invention, before the step of "constructing a natural language understanding model based on the annotated text", the method also includes: using a k-fold cross-validation method to divide the annotated text into a data set to obtain a training data set and a test data set.
[0018] As a further improvement of an embodiment of the present invention, the "constructing a natural language understanding model based on the annotated text, and performing text feature prediction on the annotated text based on the natural language model to obtain a number of matching results corresponding to the text information" specifically includes: performing preprocessing on the training data set, and extracting text features on the preprocessed training data to obtain the initial features of each annotated text in the training data set; performing pooling operations and fully connected combination calculations on the initial features to obtain text features corresponding to the annotated text; inputting the text features into the pre-trained language model to perform model training to obtain the natural language understanding model; inputting the test data set into the natural language understanding model to predict a number of matching results corresponding to each annotated text in the test data.
[0019] As a further improvement of an embodiment of the present invention, the "subjecting pooling operation and full connection combination calculation to the initial features to obtain text features corresponding to the annotated text" specifically includes: converting the local area data of the initial features into several first matrices; performing splicing operations on the several first matrices according to rows to obtain a second matrix; traversing the second matrix and sequentially obtaining the maximum value of the elements in each row of the matrix to obtain a pooled feature matrix; inputting the pooled feature matrix into the fully connected layer, calculating the score of the text feature information of the annotated text, and screening the text features corresponding to the annotated text based on the score.
[0020] As a further improvement of one embodiment of the present invention, the method for constructing the natural language understanding model includes: a machine learning method, a deep learning method, a knowledge graph method, a fusion and integration method, and a large language model method.
[0021] As a further improvement of an embodiment of the present invention, the "identifying and fusing the several matching results to obtain understanding result information corresponding to the text data" specifically includes: based on a dictionary or a preset mapping file, obtaining the semantic text information corresponding to each matching result, and performing splicing on the semantic text information to obtain understanding result information corresponding to the text data.
[0022] In order to achieve one of the above-mentioned objects of the invention, the present invention also provides a refrigerator, comprising: a memory for storing executable instructions; and a processor for implementing the steps of any of the above-mentioned deep learning-based text representation methods when running the executable instructions stored in the memory.
[0023] Compared with the prior art, the embodiments of the present invention have at least one of the following beneficial effects:
[0024] The present invention adopts a natural language understanding method. By performing slot extraction on the annotated text and performing matching operations on the extracted slot information based on a preset slot database, the matching results can be obtained quickly and efficiently, which is conducive to improving the timeliness of natural language understanding. At the same time, by performing fusion on several matching results, the output understanding result information can take into account the accuracy of the content on the entity and the connection between entities, which is conducive to enhancing the ability to understand natural language, improving the accuracy of language understanding, and enhancing the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] FIG1 is a schematic diagram of the steps of a natural language understanding method according to one embodiment of the present invention.
[0026] FIG2( a ) is a schematic diagram of the steps of determining voice data and transcribing the voice data into first text information in one embodiment of the present invention.
[0027] FIG2( b ) is a schematic diagram of the steps of determining video data and transcribing the video data into first text information according to one embodiment of the present invention.
[0028] FIG3 is a schematic diagram of the steps of obtaining annotated text corresponding to text data in one embodiment of the present invention.
[0029] FIG4 is a schematic diagram of the steps of screening and storing annotated texts that meet the annotation quality inspection in one embodiment of the present invention.
[0030] FIG5 is a schematic diagram of the steps of performing slot extraction and slot information matching on annotated text in one embodiment of the present invention.
[0031] FIG6 is a schematic diagram of the steps of constructing a language understanding model in one embodiment of the present invention.
[0032] FIG7 is a principle block diagram of a preferred embodiment of a natural language understanding method in one embodiment of the present invention.
[0033] FIG8 is a data conversion diagram of a preferred embodiment of a natural language understanding method in one embodiment of the present invention. DETAILED DESCRIPTION
[0034] The present invention will be described in detail below with reference to the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional changes made by those skilled in the art based on these embodiments are all within the scope of protection of the present invention.
[0035] It should be noted that the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or apparatus. In addition, the terms "first," "second," etc. are used for descriptive purposes only and should not be understood as indicating or implying relative importance.
[0036] Natural language understanding (NLP) aims to enable machines to understand language like humans. However, due to the diversity, ambiguity, robustness, and knowledge-dependence of natural language in its grammatical and semantic structures, machines' understanding of natural language can be biased during human-computer interaction, resulting in poor interaction and low accuracy. Therefore, NLP holds significant practical significance in the field of natural language processing.
[0037] Based on this, the present invention provides a natural language understanding method, as shown in FIG1 , which specifically includes the following steps:
[0038] Step S1: Obtain annotated text corresponding to the text data.
[0039] Step S2: performing slot extraction on the annotated text, and performing matching on a plurality of extracted slot information based on a preset slot database to obtain a plurality of matching results corresponding to the text data.
[0040] Step S3: Identify and fuse the plurality of matching results to obtain understanding result information corresponding to the text data.
[0041] Among them, the several matching results represent the characteristics of several elements in the text data at the level of word attributes and / or word meanings, and the understanding results represent the text category, emotional connotation and / or intrinsic intention of the entire text data.
[0042] In this way, based on the preset slot database, matching operations are performed on several extracted slot information, which is conducive to obtaining matching results quickly and efficiently, realizing data sharing, reducing the redundancy of matching results, and ensuring the security and reliability of data; in addition, performing fusion operations on several matching results can enable the output understanding result information to take into account the accuracy of the content on the entity and the connection between entities, which is conducive to enhancing the ability to understand natural language, improving the accuracy of the understanding result information, and enhancing the user experience.
[0043] It should be emphasized that the preset slot database can be dynamically updated. When the slot information fails to match, the slot information that failed to match can be updated to the preset slot database to enrich the content in the database, thereby improving the success rate of subsequent slot matching.
[0044] For step S1, the text data includes voice text data, video text data and text data.
[0045] In this way, by obtaining multi-source heterogeneous data, on the one hand, multi-source can ensure the diversification of data sources, making the acquired text data more complete, comprehensive and reliable; on the other hand, heterogeneity can connect different types of information together from the differences in data structure, and can enrich the text content of the text data from the aspects of multi-structure and multi-type of data.
[0046] It should be noted that the multi-source heterogeneous data may include multi-source data (i.e., data with diverse sources), or heterogeneous data (i.e., data with different storage structure types), or multi-source and heterogeneous data, and the present invention does not impose specific limitations on this.
[0047] Among them, the voice text data may refer to the text content transcribed according to real-time voice data or offline voice data; the video text data may refer to the text content transcribed according to real-time video data or offline video data; the text data may include real-time text data and offline text data, specifically referring to text data related to the user's preferences, hobbies, interests or comments on food ingredients.
[0048] It is understandable that in order to enrich the training data set and facilitate the accurate construction of the natural language model, the text data may also include historical voice, video and text data, and the present invention does not impose specific restrictions on this.
[0049] Before step S1, the method may also include: obtaining multi-source heterogeneous data, extracting data features of the multi-source heterogeneous data; inputting the data features into a convolutional neural network model to obtain corresponding first text information; using a connection temporal classification algorithm to align the sequence lengths of the first text information and the data features, and performing a full connection combination calculation on the first text information to obtain the text data.
[0050] The multi-source heterogeneous data includes voice data, video data, or both voice data and video data.
[0051] In this way, a convolutional neural network model transcribes the data features of the multi-source heterogeneous data into corresponding text information, reducing the ambiguity caused by the same speech but different semantics. Furthermore, since speaking or shooting videos is often faster than typing, voice-to-text or video-to-text conversion can improve work efficiency.
[0052] In one embodiment, the voice data is a user's current interrogative or directive statement to an intelligent electronic device or a terminal device connected to the electronic device. Specifically, taking a smart refrigerator as an example, a user can ask the smart refrigerator questions such as "Excuse me, are there any vegetables in the refrigerator?" or issue directive statements such as "Please adjust the temperature of the refrigerator compartment to 2 degrees Celsius."
[0053] On the other hand, the video data is actually composed of a number of groups of continuous images. Specifically, a continuous image sequence is collected using a video acquisition device, such as a mobile phone, a camera, a Bluetooth acquisition device, etc.
[0054] In a preferred embodiment, the above two aspects can be included simultaneously, that is, the acquired multi-source heterogeneous data includes both voice data and video data, and data processing and text annotation can be performed on them respectively.
[0055] In one embodiment, step S1 can collect user voice data via a voice acquisition device such as a microphone array installed in the smart refrigerator. User video data can also be collected via a video acquisition device such as a camera installed in the refrigerator. Similarly, text data can be obtained through mini-programs, official accounts, or the web. Furthermore, the text data can also include information about the user's preferences and favorite ingredients, as well as information about ingredients of interest to the user, and user comments, such as "I used to like Kung Pao Chicken." This comment data covers the user's interests and hobbies, and can even include information related to the current text data.
[0056] In addition, the client terminal connected based on the wireless communication protocol can obtain the user's real-time voice, video, text data and / or offline voice, video, text data transmitted. Among them, the client terminal is an electronic device with an information sending function, such as a mobile phone, tablet computer, smart speaker, smart bracelet, Bluetooth headset and other smart electronic devices. During use, when the user needs to interact with the smart refrigerator, he can directly speak to the smart refrigerator or take a video. After the client terminal collects the voice, it is transmitted to the smart refrigerator via wireless communication methods such as Wi-Fi or Bluetooth. In other embodiments of the present invention, one or any combination of the above-mentioned data acquisition methods may also be used, or the multi-source heterogeneous data may also be obtained through other channels based on existing technologies, and the details will not be repeated here.
[0057] Furthermore, before the step of "extracting data features of the multi-source heterogeneous data", the data may also be pre-processed. Specifically, the speech is segmented according to a specified length (time period or number of samples), and the speech is framed and windowed. Furthermore, pre-emphasis processing can be performed before the framing process to emphasize the high-frequency part of the speech to eliminate the influence of lip radiation during the phonation process, thereby compensating for the high-frequency part of the speech signal that is suppressed by the pronunciation system and highlighting the high-frequency resonance peak. Moreover, after the windowing process, steps such as filtering audio noise points and enhancing human voices can be performed to strengthen the speech data, extract the characteristic parameters of the speech, and make the speech data meet the input requirements of the subsequent neural network model.
[0058] Furthermore, the video data can be cropped by writing a script or using a third-party video cropping tool. Specifically, the video data is loaded and the video information is read, the video is decoded according to the video information, and multiple frames of images corresponding to the video data are obtained based on the width and height of a single frame image.
[0059] Furthermore, irrelevant and duplicate data in the text dataset is deleted, and outliers and missing values are processed to clean and format the text data. Next, the text data is labeled using rule-based statistical methods, and word segmentation is performed using string matching, comprehension-based, statistical, and rule-based methods. Stop words are then removed to complete the preprocessing of the text data, ensuring that it meets the input requirements of the subsequent neural network model.
[0060] Furthermore, in one embodiment, Python language can be used to write audio and video separation scripts, or a third-party audio and video separation tool can be used to perform separation operations on data containing both video data and audio data to obtain valid voice data and video data.
[0061] The step of “inputting the data features into a convolutional neural network model to obtain corresponding first text information” may specifically include:
[0062] The data features are input into a multi-size multi-channel convolutional neural network model or a distillation diffusion model to obtain text content that matches the data features.
[0063] In this way, the convolutional neural network model can include multiple types, and the corresponding neural network model can be adjusted according to different data features, which can increase the adaptability to data features and improve the generalization recognition ability of the algorithm. In one embodiment, it can also be configured to adaptively select an appropriate neural network model for processing based on the type of the data feature to improve the efficiency and accuracy of converting the data feature into text.
[0064] It should be emphasized that, for data of different data types or different structural types, in order to improve the accuracy and adaptability of feature extraction, the present invention provides a refined operation on the data type of the multi-source heterogeneous data to give full play to the advantages of the two neural network models.
[0065] Specifically, in the first embodiment, as shown in FIG2(a), before the step of "extracting the data features of the multi-source heterogeneous data", the method may include step S01A; and the step of "inputting the data features into the convolutional neural network model to obtain the corresponding first text information" may further include step S02A corresponding to step S01A. Steps S01A and S02A are specifically as follows:
[0066] Step S01A: determining whether the multi-source heterogeneous data includes voice data.
[0067] If so, jump to step S02A, input the voice features into the multi-size multi-channel convolutional neural network model to obtain the first text information corresponding to the voice data; wherein the data features include voice features.
[0068] In this way, using a multi-size and multi-channel convolutional neural network model to process speech data can adaptively select the channels and sizes in the neural network model according to the characteristics of the speech length of the speech data itself, which can increase the adaptability of speech-to-text and improve the accuracy of speech-to-text.
[0069] In a second embodiment, as shown in FIG2( b ), before the step of “extracting data features from the multi-source heterogeneous data,” the method may further include step S01B; and the step of “inputting the data features into a convolutional neural network model to obtain corresponding first text information” may further include step S02B corresponding to step S01B. Steps S01B and S02B are specifically as follows:
[0070] Step S01B: determining whether the multi-source heterogeneous data includes video data.
[0071] If so, jump to step S02B, input the video features into the distillation diffusion model to obtain first text information corresponding to the video data; wherein the data features include the video features.
[0072] In this way, using the distillation diffusion model to process video data can achieve rapid sampling of video data by changing the weight information in the model, thereby reducing the time and cost of video-to-text conversion; in addition, using the distillation diffusion model, an image equivalent to the original model can be visually generated, and a trade-off can be made between sample diversity and quality, which is conducive to improving the timeliness and accuracy of video data text conversion.
[0073] In a preferred embodiment, the above two embodiments can be combined, that is, when the text data includes voice data and video data at the same time, different neural network models can be used to process them respectively and convert them into corresponding text information.
[0074] In practical applications, considering that sentences recognized by image text are relatively complex, such as sentences of varying lengths, pause positions or word structures, and correlations between image features, the “video features” described in step S02B may specifically include:
[0075] The video data is input into a 3D deep convolutional neural network model to obtain the video features.
[0076] In this way, the 3D convolutional neural network model can better capture the temporal and motion relationships between multiple frames of images in video data, which is conducive to improving the accuracy of video feature extraction.
[0077] Specifically, in one embodiment, video processing operations such as cropping and framing are performed on the video data to obtain a video image of a local area, and the video image of the local area is cropped and segmented to obtain multiple continuous local area image frames. The multiple continuous local area image frames are input into a 3D convolutional neural network model. By adding information in the time dimension, more expressive features can be extracted. The 3D convolutional neural network model can solve the correlation information between multiple images. It takes continuous multi-frame images as input and captures the motion information in the input frame by adding a new dimension of information, so as to better obtain its image features.
[0078] After acquiring the multi-source heterogeneous data, the attention mechanism model can be used to enhance the data features of the multi-source heterogeneous data. Preferably, the above operation can be performed on speech data to improve the speed and effectiveness of the conversion. Based on this, the present invention may also include the step of enhancing the speech features of the speech data based on the attention mechanism model. This step can be placed anywhere after "acquiring multi-source heterogeneous data" to achieve the desired effect.
[0079] In a preferred embodiment, this solution can also be combined with an embodiment including step S01A and step S02A. In this case, the step of enhancing speech features using the attention mechanism model can be specifically arranged after step S02A. In addition, the above steps are not limited to the scenario where multi-source heterogeneous data includes speech data. The present invention does not exclude the application of the attention mechanism model to other types of multi-source heterogeneous data.
[0080] In this way, by introducing the attention mechanism, it is possible to focus on the relevant features or weight information of the multi-source heterogeneous data or the voice data converted into the first text information, and ignore irrelevant features or weight information, thereby further improving the speed and effect of speech-to-text conversion and reducing computing time and cost.
[0081] Specifically, the attention mechanism is introduced into the multi-size multi-channel convolutional neural network model, so that the neural network model can not only autonomously learn the attention mechanism, focus on the key features or related features of the speech data and ignore other non-critical or non-related feature information, thereby enhancing the speech features; but also the attention mechanism can in turn help the computer to understand the neural network. The two complement each other and are conducive to improving the efficiency and effectiveness of speech-to-text conversion.
[0082] In other embodiments of the present invention, the speech feature enhancement of the speech data may also be accomplished by other algorithm models, and the present invention does not impose any specific limitation on this.
[0083] The multi-scale, multi-channel convolutional neural network model described in step S02A is composed of a multi-layer deep convolutional neural network model. The deep convolutional neural network model generally consists of several convolutional layers and several fully connected layers, and may also include several nonlinear operations and pooling operations. This model first extracts the speech features of the speech data, then calculates text features based on the speech features, and converts the speech features into corresponding text information.
[0084] In this way, computing speech features instead of the speech data reduces computational effort and easily captures the advantages of local features. Secondly, the attention mechanism and pooling operations can impart greater invariance to the model in the time or frequency domain. Furthermore, the deeper nonlinear structure also enables the model to possess powerful text representation capabilities. The distilled diffusion model described in step S02B is a type of diffusion model that, given a set of data with an unknown distribution, can characterize its underlying data distribution.
[0085] Specifically, the diffusion model can be divided into a forward diffusion process and a backward diffusion process. First, the forward diffusion process systematically perturbs the data distribution. Specifically, Gaussian noise is added to the data according to a pre-designed noise schedule until the data distribution approaches the prior distribution, i.e., a standard Gaussian distribution. The data distribution is then restored through a backward diffusion process. Starting from a given prior distribution, a parameterized Gaussian transformation kernel is used to gradually restore the original data distribution.
[0086] Furthermore, given a trained guidance model, or teacher model, the distillation diffusion model can include two steps. In the first step, a continuous-time student model is introduced to match the combined outputs of the two teacher diffusion models to obtain a distilled model. In the second step, the distilled model trained in the first step is gradually converted into a model with fewer steps. Of course, other distillation algorithm models can also be used and are not specifically limited here.
[0087] In actual applications, due to differences in human speaking speed, video shooting frame rate, or character spacing, it is difficult to align the multi-source heterogeneous data and the first text information in word units. The present invention adopts the connection time series classification algorithm to construct a mapping relationship between the multi-source heterogeneous data and the first text information.
[0088] Specifically, the Connectionist Temporal Classification (CTC) algorithm is an end-to-end training algorithm that enables a network model to automatically learn to align the lengths of input and output sequences. Preferably, the CTC algorithm can be used after a convolutional network model. This algorithm does not require pre-label alignment or annotation of input data. Instead, it is trained based on an input sequence and an output sequence, outputting a mapping relationship.
[0089] In one embodiment of the present invention, the algorithm aligns the sequence lengths of the data features (input sequence) and the first text information (output sequence), establishes a mapping relationship between the multi-source heterogeneous data and the first text information, and based on the mapping relationship, can infer the most likely text content, thereby improving the accuracy of converting multi-source heterogeneous data to text, shortening the conversion time, and reducing computational complexity.
[0090] It should be noted that the speech features described in step S02A may include Mel-scale Frequency Cepstral Coefficients (MFCCs). MFCCs are discernible components of speech signals and are cepstral parameters extracted in the Mel-scale frequency domain. The pre-processed speech data is subjected to Fourier transform to obtain the energy spectrum of multiple frames of speech data signals. The energy spectrum is then passed through a set of Mel-scale triangular filter banks to smooth the spectrum and eliminate harmonics. The MFCC coefficient features are then obtained through logarithmic operations and discrete cosine transforms. The Mel scale describes the nonlinear characteristics of the human ear's frequency response, and the MFCC parameters take into account the human ear's sensitivity to different frequencies, making them particularly suitable for speech recognition and speaker identification.
[0091] It should be emphasized that the speech features can also use feature parameters such as perceptual linear prediction features (PLP) or linear prediction coefficient features (LPC) to replace MFCC features. The specific selection can be made based on the actual model parameters and the actual application field of this method. The present invention does not impose any specific restrictions on this.
[0092] In order to facilitate understanding of the text data, the present invention performs a labeling operation on the text data after acquiring the text data. Specifically, as shown in FIG3 , step S1 may specifically include:
[0093] Step S11 , pre-annotating the text data based on preset annotation rules to obtain first annotated text information, wherein the preset annotation rules represent annotation information corresponding to several professional field words and / or words with special meanings in the text data.
[0094] Step S12: performing text feature annotation on the first annotated text information to obtain the annotated text, wherein the text feature annotation includes at least one of entity annotation, relationship annotation, intention annotation, grammar annotation and sentiment annotation.
[0095] Step S13: perform quality inspection on the annotated texts, and filter and store the annotated texts that meet preset conditions.
[0096] In this way, by performing pre-labeling, text feature labeling and labeling quality inspection operations on the text data, it is helpful to label the text data in terms of semantics, structure, context, intention and emotion, thereby creating a huge text data set, facilitating subsequent slot extraction and language understanding model training, and helping to improve the accuracy of semantic understanding of the text data.
[0097] For step S11, the preset annotation rule may specifically refer to a rule set containing multiple pre-annotation rules, which can be stored in the format of a file or a dictionary. The preset annotation rule can be targeted at special text content that cannot be achieved by ordinary annotation rules. For example, for the term "Casarte", when using traditional annotation tools, the sentence is first segmented, and it may be divided into three parts: "Ka", "Sa", and "Di". However, this term is a brand name of a refrigerator and is a special text. When performing annotation on such text, the segmentation operation does not need to be carried out. Instead, the pre-annotation operation can be directly performed on it according to the preset annotation rule to avoid annotation errors for special texts in the above-mentioned professional fields and the like.
[0098] For step S12, according to project requirements, the annotation can be divided into online annotation and offline annotation. Specifically, the online annotation may refer to uploading the text data to a data processing platform and performing annotation operations through the Internet. The offline annotation may refer to performing annotation operations through offline small tools or offline texts (such as Excel, Txt, etc.).
[0099] The text feature annotation may include at least one of entity annotation, relationship annotation, intention annotation, syntax annotation, and sentiment annotation. Specifically, the entity annotation may refer to extracting the entities in the text data for annotation; the relationship annotation can make important annotations on the syntactic and semantic associations of complex sentences; the intention annotation may refer to dividing and annotating the intention or purpose of the text data, including requests, commands, reservations, recommendations, etc.; the sentiment annotation may refer to determining the sentiment contained in the text. For example, for three-level sentiment annotation (positive, neutral, negative), keywords such as preference and sensitivity in the text data can be marked.
[0100] Further, as shown in Figure 4, the present invention refines the part of "performing annotation quality inspection on the annotated text, screening and storing the annotated text that meets the preset conditions" in step S13, which may specifically include:
[0101] Step S131, statistically determining whether the accuracy rate of the text annotation is greater than or equal to a preset threshold.
[0102] If so, jump to step S132, and save the annotated text to the text annotation database.
[0103] If not, jump to step S133, and re-perform the pre-annotation, the text feature annotation, and the annotation quality inspection on the text data.
[0104] The accuracy rate represents the ratio of the number of correct annotations in the annotated text to the total number of annotations. Specifically, determining the number of correct annotations in the text may include: verifying relevant annotation data in the annotated text according to predefined annotation rules and requirements, and determining the number of correct annotations that meet the annotation rules.
[0105] In this way, by repeatedly performing operations such as pre-annotation, text feature annotation, annotation quality inspection, and text annotation storage on the text data, it is beneficial to reduce the annotation time and improve the annotation efficiency and annotation accuracy of the text data.
[0106] In order to achieve fast slot extraction and matching, the present invention refines step S2. As shown in FIG5 , step S2 may specifically include:
[0107] Step S21 : performing an extraction operation on each slot according to the slot annotation information in the annotation text to obtain a plurality of slot information.
[0108] Step S22: query the preset slot database according to the plurality of slot information, and determine whether each slot information matches at least one of the query results.
[0109] If yes, jump to step S23 to obtain the matching result corresponding to each slot information.
[0110] If not, jump to step S24, build a natural language understanding model according to the annotated text, and perform text feature prediction on the annotated text based on the natural language model to obtain a number of matching results corresponding to the text information.
[0111] In this way, performing slot extraction operations based on the annotated text is conducive to improving the accuracy of slot extraction, and performing slot matching queries based on a preset slot database. This method is simple and easy to implement, with fast matching speed and high accuracy. In addition, building a training model based on the annotated text makes the subsequent slot extraction and matching highly automated and with small errors.
[0112] The slot information is an abstraction of the relevant annotation information in the text data. For example, when a user asks "What's the weather like in Beijing today", the slot information of location and date can be abstracted based on "today" and "weather", and slot extraction can be performed on them.
[0113] Prior to the step of “building a natural language understanding model based on the annotated text” in step S24, the method may further include:
[0114] The k-fold cross validation method is used to divide the data set of the annotated text into training data sets and test data sets.
[0115] In this way, the data set is divided through the cross-validation method to ensure that each sub-sample participates in training and is tested, reducing the generalization error, effectively avoiding the occurrence of overfitting and underfitting, and fully reflecting the idea of cross-validation, making the data set division results more convincing and stable.
[0116] Among them, the k-fold cross-validation method is to first divide the text data into k data subsets of equal size; traverse these k subsets in turn, each time using the current subset as a validation data set and the rest as sample training data sets to train and evaluate the model; finally, the average value of the k evaluation indicators is used as the final evaluation indicator, k is usually 10, and adaptive adjustments can usually be made according to actual conditions, and the present invention does not impose specific restrictions on this.
[0117] When the slot information fails to be quickly matched, the present invention can use the annotated text to build a training model. Specifically, as shown in FIG6 , step S24 can specifically include:
[0118] Step S241 , performing preprocessing on the training data set, and performing text feature extraction on the preprocessed training data to obtain initial features of each annotated text in the training data set.
[0119] Step S242: performing a pooling operation and a fully connected combination calculation on the initial features to obtain text features corresponding to the annotated text;
[0120] Step S243: Input the text features into a pre-trained language model to perform model training to obtain the natural language understanding model.
[0121] Step S244: input the test data set into the natural language understanding model, predict the text features corresponding to each annotated text in the test data, and obtain a number of matching results corresponding to the text information.
[0122] In this way, the natural language understanding model is constructed based on the annotated text data, which reduces the time and cost of processing training sample data and makes the model closer to the actual situation; and the trained model is used to realize slot extraction and slot information matching. The slot extraction and matching are fast, convenient, highly intelligent, efficient, accurate, and have strong versatility and generalizability.
[0123] The preprocessing may include standardizing the numerical features in the training data set, eliminating the dimension, unifying the value ranges of different feature items, such as using methods such as Min-Max or Z-Score to achieve data annotation; determining whether there are missing values or duplicate values; performing encoding operations on non-numerical features, etc., so that subsequent text feature extraction is more accurate. The "initial features after the pooling operation and the full connection operation are combined and calculated" in step S242 may specifically include:
[0124] The data of the initial feature local area is converted into several first matrices; a splicing operation is performed on the several first matrices along the rows to obtain a second matrix; the second matrix is traversed and the maximum value of the elements in each row of the matrix is sequentially obtained to obtain a pooled feature matrix; the pooled feature matrix is input into a fully connected layer to calculate the score of the text feature information of the annotated text, and based on the score, the text features corresponding to the annotated text are screened. In this way, the pooling operation can reduce the spatial size of each initial input feature, not only reducing the amount of computation and the consumption of computing resources, but also avoiding the overfitting problem caused by the fully connected calculation.
[0125] Among them, the methods for constructing the natural language understanding model include: machine learning methods, deep learning methods, knowledge graph methods, fusion and integration methods, and large language model methods, and no specific restrictions are made on this.
[0126] The large language model refers to a machine learning-based natural language processing technology that builds a model capable of understanding human language and automatically generating it by studying a large corpus. This model can be used to perform a variety of natural language processing tasks, such as automated question answering, machine translation, speech recognition, and text generation. The core concept of the large language model is to use deep learning algorithms to train massive corpora, enabling machines to learn the patterns and characteristics of human language, thereby automating natural language processing.
[0127] Regarding the "identifying and fusing the several matching results to obtain understanding result information corresponding to the text data" in step S3, it can specifically include: based on a dictionary or a preset mapping file, obtaining the semantic text information corresponding to each matching result, and performing splicing on the semantic text information to obtain understanding result information corresponding to the text data.
[0128] Storing the semantic text information in the form of files or dictionaries is simple, easy to configure, and manage, facilitating subsequent project maintenance and the reuse of programs or files related to new projects. Furthermore, concatenating the semantic text information allows users to more accurately understand the original meaning of the text data.
[0129] In order to facilitate users to obtain the text representation information, the method may further include: converting the understanding result information corresponding to the text data into voice for output, and / or converting the understanding result information corresponding to the text data into voice and transmitting it to the client for output, and / or converting the understanding result information corresponding to the text data into text for output, and / or converting the understanding result information corresponding to the text data into text and transmitting it to the client.
[0130] In this way, the multi-channel and multi-type information output methods, combined with the multi-channel and multi-modal data source acquisition methods provided by the present invention, enable users to directly interact with smart devices remotely, which is extremely convenient and greatly improves the user experience. In other embodiments of the present invention, only one or more of the above-mentioned understanding result information output methods may be used, or the understanding result information may be output through other channels based on existing technologies. The present invention does not impose specific limitations on this.
[0131] The above-mentioned various implementation modes, embodiments or specific examples provided by the present invention can be combined with each other to ultimately form multiple better implementation modes.
[0132] For example, Figure 7 shows a block diagram of the principles of a natural language understanding method under a preferred embodiment. Figure 8 correspondingly illustrates the conversion process of the relevant multi-source heterogeneous data or text data involved in the natural language understanding method when executing this preferred embodiment. The following summarizes the processing process of this preferred embodiment in conjunction with Figures 7 and 8.
[0133] First, multi-source heterogeneous data is acquired through multiple channels to obtain multiple types of data 101. The multiple types of data 101 specifically include text data, voice data, and video data. Text transcription operations are performed on the multiple types of data 101, for example, data preprocessing and feature extraction are performed on the voice and / or video data, and the data is transcribed into corresponding text content to generate corresponding text data 102.
[0134] The text data 102 generated after transcription is annotated by adding corresponding labels according to its text features to achieve text annotation. Specifically, the operations of pre-annotation, text feature annotation, annotation quality inspection, and annotated text storage may be performed on the text data to obtain annotated text 103.
[0135] Then, a slot extraction operation is performed on the annotated text 103 to obtain a number of slot information 104 .
[0136] Based on a preset slot database, a slot information query operation is performed on the extracted slot information, and it is determined whether each slot information matches at least one of the query results. If the match fails, a natural language understanding model is constructed, and based on the natural language understanding model, operation extraction and slot matching are performed on the annotated text to obtain several matching results 105 corresponding to the text data.
[0137] Based on the plurality of matching results 105 , a fusion result is calculated to obtain the understanding result information 106 .
[0138] The present invention also provides a refrigerator, comprising: a memory for storing executable instructions; and a processor for implementing any of the steps of the above-mentioned natural language understanding method when running the executable instructions stored in the memory.
[0139] In summary, the present invention obtains multi-source heterogeneous data through multiple channels, performs transcription operations on the multi-source heterogeneous data, converts it into text data and performs text annotation on it, and obtains the annotated text corresponding to the text data; then performs slot extraction and slot information matching operations on the annotated text to obtain a number of matching results corresponding to the text data, identifies the several matching results and fuses them to generate understanding result information corresponding to the text data. This method is based on a preset slot database for matching, which can not only quickly and efficiently obtain matching results, but also realize data sharing and reduce the redundancy of matching results to ensure the security and reliability of data; and by performing splicing on several matching results, the output understanding result information can take into account multiple aspects of information such as the accuracy of the content on the entity, the relationship between entities, and the emotional expression between entities, which is conducive to enhancing the ability to understand natural language, improving the accuracy of the understanding result information, and enhancing the user experience.
[0140] In addition, the annotated text can be further used as a training data set and a test data set for constructing the language understanding model, thereby reducing the cost of related data processing such as text annotation and improving the efficiency of model training. The model is used to extract slots and match slot information on the annotated text, and the matching results are more reasonable, efficient, accurate, and reliable.
[0141] It should be understood that although this specification is described in terms of implementation methods, not every implementation method contains only one independent technical solution. This narrative method of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each implementation method can also be appropriately combined to form other implementation methods that can be understood by those skilled in the art.
[0142] The series of detailed descriptions listed above are only specific descriptions of feasible implementation methods of the present invention. They are not intended to limit the scope of protection of the present invention. Any equivalent implementation methods or changes that do not deviate from the technical spirit of the present invention should be included in the scope of protection of the present invention.
Claims
1. A natural language understanding method, characterized in that: include: Obtaining the annotation text corresponding to the text data; Performing slot extraction on the annotated text, and performing matching on a plurality of extracted slot information based on a preset slot database to obtain a plurality of matching results corresponding to the text data; Identify and merge the plurality of matching results to obtain understanding result information corresponding to the text data; Among them, the several matching results represent the characteristics of several elements in the text data at the level of word attributes and / or word meanings, and the understanding results represent the text category, emotional connotation and / or internal intention of the text data as a whole.
2. The natural language understanding method according to claim 1, characterized in that: The text data includes voice text data, video text data and text data.
3. The natural language understanding method according to claim 1, characterized in that: Before the step of "obtaining the annotated text corresponding to the text data", the method further comprises: Acquire multi-source heterogeneous data, and extract data features of the multi-source heterogeneous data; wherein the multi-source heterogeneous data includes at least one of voice data and video data; Inputting the data features into a convolutional neural network model to obtain corresponding first text information; The first text information and the sequence length of the data feature are aligned using a connection temporal classification algorithm, and a full connection combination calculation is performed on the first text information to obtain the text data.
4. The natural language understanding method according to claim 3, characterized in that: The “inputting the data features into the convolutional neural network model to obtain the corresponding first text information” specifically includes: The data features are input into a multi-size multi-channel convolutional neural network model or a distillation diffusion model to obtain first text information consistent with the data features.
5. The natural language understanding method according to claim 4, characterized in that: Before the step of "extracting data features of the multi-source heterogeneous data", the method further includes: Determining whether the multi-source heterogeneous data includes voice data; The “inputting the data features into the convolutional neural network model to obtain the corresponding first text information” specifically includes: If so, inputting the speech feature into the multi-size multi-channel convolutional neural network model to obtain first text information corresponding to the speech data; wherein the data feature includes the speech feature; And / or, before “extracting data features of the multi-source heterogeneous data”, the method further includes: Determining whether the multi-source heterogeneous data includes video data; The “inputting the data features into the convolutional neural network model to obtain the corresponding first text information” specifically includes: If so, the video feature is input into the distillation diffusion model to obtain the first text information corresponding to the video data; wherein the data feature includes the video feature.
6. The natural language understanding method according to claim 5, characterized in that: The method further comprises: The video data is input into a 3D deep convolutional neural network model to obtain the video features.
7. The natural language understanding method according to claim 1, characterized in that: The “obtaining the annotated text corresponding to the text data” specifically includes: Based on a preset annotation rule, pre-annotate the text data to obtain first annotated text information, wherein the preset annotation rule represents annotation information corresponding to a number of professional field words and / or words with special meanings in the text data; Performing text feature annotation on the first annotated text information to obtain the annotated text, wherein the text feature annotation includes at least one of entity annotation, relationship annotation, intention annotation, grammar annotation and sentiment annotation; Perform annotation quality inspection on the annotated text, and filter and store the annotated text that meets preset conditions.
8. The natural language understanding method according to claim 7, characterized in that: The "performing annotation quality inspection on the annotated text, screening and storing the annotated text that meets the preset conditions" specifically includes: Counting and determining whether the accuracy of the text annotation is greater than or equal to a preset threshold, wherein the accuracy represents the ratio of the number of correct annotations to the total number of annotations in the annotated text; If yes, then the annotated text is saved in a text annotation database; If not, the pre-annotation, the text feature annotation and the annotation quality inspection are re-executed on the text data.
9. The natural language understanding method according to claim 1, characterized in that: The "perform slot extraction on the annotated text, and perform matching on the extracted slot information based on a preset slot database to obtain a plurality of matching results corresponding to the text information" specifically includes: According to the slot annotation information in the annotation text, an extraction operation is performed on each slot to obtain a number of slot information; Querying the preset slot database according to the plurality of slot information, and determining whether each slot information matches at least one of the query results; If yes, obtain the matching result corresponding to each slot information; If not, a natural language understanding model is constructed according to the annotated text, and text feature prediction is performed on the annotated text based on the natural language model to obtain a number of matching results corresponding to the text information.
10. The natural language understanding method according to claim 9, characterized in that: Before the step of "building a natural language understanding model according to the annotated text", the method further includes: The k-fold cross validation method is used to divide the data set of the annotated text to obtain a training data set and a test data set.
11. The natural language understanding method according to claim 10, characterized in that: The “building a natural language understanding model according to the annotated text, and performing text feature prediction on the annotated text based on the natural language model to obtain a number of matching results corresponding to the text information” specifically includes: Preprocessing the training data set, and extracting text features from the preprocessed training data to obtain initial features of each annotated text in the training data set; Performing a pooling operation and a fully connected combination calculation on the initial features to obtain text features corresponding to the annotated text; Inputting the text features into a pre-trained language model to perform model training to obtain the natural language understanding model; The test data set is input into the natural language understanding model, and the text features corresponding to each annotated text in the test data are predicted to obtain a number of matching results corresponding to the text information.
12. The natural language understanding method according to claim 11, characterized in that: The “obtaining text features corresponding to the annotated text by performing pooling operation and full connection combination calculation on the initial features” specifically includes: Converting the local area data of the initial features into a plurality of first matrices; Performing a concatenation operation on the plurality of first matrices according to rows to obtain a second matrix; Traversing the second matrix and sequentially obtaining the maximum value of the elements in each row of the matrix to obtain a pooled feature matrix; The pooled feature matrix is input into the fully connected layer, the score of the text feature information of the annotated text is calculated, and according to the score, the text feature corresponding to the annotated text is screened.
13. The natural language understanding method according to claim 9, characterized in that: Methods for constructing the natural language understanding model include: machine learning methods, deep learning methods, knowledge graph methods, fusion and integration methods, and large language model methods.
14. The natural language understanding method according to claim 1, characterized in that: The “identifying and fusing the plurality of matching results to obtain understanding result information corresponding to the text data” specifically includes: Based on a dictionary or a preset mapping file, the semantic text information corresponding to each matching result is obtained, and the semantic text information is spliced to obtain the understanding result information corresponding to the text data.
15. A refrigerator, characterized in that: include: A memory for storing executable instructions; A processor is used to implement the steps of the natural language understanding method described in any one of claims 1 to 14 when running the executable instructions stored in the memory.
Citation Information
Patent Citations
Semantic logic processing method and system
CN107315737A
Information processing method and device and computer readable storage medium
CN111723574A
Voice understanding method and device
CN112740323A
Speech recognition and classification method, device and equipment, refrigerator and storage medium
CN115062143A
Natural language understanding method and refrigerator
CN116431806A
Cited By
Data classification and grading method and system based on large language model
CN120950688A
Controllable text generation method based on diffusion language model and distillation classifier
CN121210660A
