A text data processing method and intelligent device
By obtaining the skill request words and user statements of the target skill in the voice assistant, the semantic implicit representation and weight of each intention is calculated, and based on the attention mechanism at the intention level, the performance difference caused by text length differences in the prior art is solved. The problem improves the accuracy and efficiency of semantic consistency judgments.
Patent Information
- Application Number
- CN202011143373.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-23
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2040-10-23
AI Technical Summary
In the prior art, when processing semantic consistency between skill request words and user statements, the large difference in text length leads to poor performance, especially in voice assistants, it is difficult to effectively call out the required skills and achieve relevant intentions.
By obtaining the skill request words and user statements of the target skill, the semantic implicit representation and weight of each intention are determined separately, the target summary semantics are calculated based on the intention-level attention mechanism, the text length gap is narrowed, and the interference of unimportant intentions is reduced. In turn, the matching degree between the skill request words and the user statement set is determined.
It improves the accuracy and efficiency of semantic consistency judgment of skill request words and user statement sets, reduces interference with unimportant intentions, and enhances the semantic consistency evaluation ability of voice assistants.
Smart Images

Figure CN114492447B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to a text semantic consistency method and an intelligent device. Background Art
[0002] A voice assistant (VA) (or intelligent virtual assistant, such as Huawei's Xiaoyi, Xiaomi's Xiaoai, etc.) is an application that recognizes the user's voice commands to perform corresponding operations. In addition to providing its own voice services, voice assistants can also provide services for third-party applications. The services provided by these third-party applications are called skills, and skills are used to realize various intentions for users. For example, the skill "High-speed Rail Butler" helps users realize intentions such as "buying tickets, exiting the interface, refunding tickets, and checking order status".
[0003] In order to call out the required skills and realize the relevant intents, the developer provides skill request words and user statements. Users can read out the skill request words on the voice assistant to call out the corresponding skills. For example, read out "I want to buy a high-speed rail ticket", the voice assistant recognizes "high-speed rail", and the "High-speed Rail Butler" skill can be called out. After calling out the skill, the user can read out the user statement on the voice assistant to realize the required intent, for example, "I want to refund the ticket" can realize the "refund" intent, for example, "Please check my order" can realize the "check order" intent.
[0004] Skill request words are one of the few or even the only channels for users to perceive the services provided by this skill. Therefore, the skill request words and the service content that the skill can provide (i.e., the user's statement) need to have a high degree of semantic consistency. Currently, for the semantic consistency between skill request words and user statements, the two texts can be first mapped to the same semantic space to obtain two vectors, and then the similarity of the two vectors is calculated to determine the semantic consistency between the two texts. However, the text length of the skill request words and the user's statement differs greatly, and the above method has poor processing performance for two texts with a large difference in text length. Summary of the invention
[0005] The embodiments of the present application provide a text data processing method and an intelligent device for confirming the semantic consistency of a skill request word and a user statement set.
[0006] The first aspect of the present application provides a text data processing method, including: a smart device obtains a skill request word and a user statement set of a target skill, the user statement set including at least one user statement for each intent in the target skill; the smart device determines the semantic implicit representation and weight of each intent according to the skill request word and the user statement set; the smart device determines the target summary semantics of the user statement set according to the semantic implicit representation and weight of each intent; the smart device determines the matching degree between the skill request word and the user statement set according to the skill request word and the target summary semantics.
[0007] In an embodiment of the present application, a skill request word and a user statement set of a target skill are obtained, the user statement set includes at least one user statement for each intent in the target skill, the semantic implicit representation and weight of each intent are determined respectively according to the skill request word and the user statement set, and the target summary semantics of the user statement set are determined according to the semantic implicit representation and weight of each intent, and the matching degree of the skill request word and the user statement set is determined according to the skill request word and the target summary semantics, thereby narrowing the length difference between two paragraphs of text that need to be calculated, and reducing the interference caused by unimportant intents by determining the target summary semantics based on the attention mechanism at the intent level.
[0008] In some possible implementations, the smart device determines the semantic implicit representation of each of the intents according to the user utterance set, and performs text processing on the skill request words based on a deep recurrent neural network to obtain the semantic implicit representation of the skill request words. Finally, the smart device determines the weight of each intent according to the semantic implicit representation of each intent and the semantic implicit representation of the skill request words, thereby determining the weight of each intent, and an attention mechanism based on the intent level can be implemented according to the weight of the intent.
[0009] In some possible implementations, the smart device determines the user statements for each intent in the user statement set, and concatenates all the user statements for each intent to obtain a concatenated text of the user statements for each intent, and finally performs text processing on the concatenated text of the user statements for each intent based on a deep recurrent neural network, thereby obtaining a semantic latent representation of each intent.
[0010] In some possible implementations, the smart device calculates the similarity between the semantic implicit representation of each intent and the semantic implicit representation of the skill request word as the weight of each intent, thereby determining the importance of each intent, laying the foundation for implementing an intent-level-based attention mechanism.
[0011] In some possible implementations, the smart device maps the semantic latent representation of the skill request word and the target summary semantics into the same semantic space to obtain a first semantic vector and a second semantic vector, and then the smart device calculates the similarity between the first semantic vector and the second semantic vector as the matching degree between the skill request word and the user statement set, thereby realizing the determination of the semantic consistency between the skill request word and the user statement set.
[0012] The second aspect of the present application provides an intelligent device for executing the method in the first aspect or any possible implementation of the first aspect. Specifically, the intelligent device includes a module or unit for executing the method in the first aspect or any possible implementation of the first aspect.
[0013] The third aspect of the present application provides an intelligent device, comprising: at least one processor, a memory, a transceiver, and computer execution instructions stored in the memory and executable on the processor. When the computer execution instructions are executed by the processor, the processor executes a method as described in the first aspect or any possible implementation of the first aspect.
[0014] The fourth aspect of the present application provides a computer-readable storage medium storing one or more computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor executes a method as described in the first aspect or any possible implementation of the first aspect.
[0015] The fifth aspect of the present application provides a computer program product storing one or more computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor executes the method of the above-mentioned first aspect or any possible implementation of the first aspect.
[0016] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0017] The smart device obtains a skill request word and a user statement set of a target skill, wherein the user statement set includes at least one user statement for each intent in the target skill, determines the semantic implicit representation and weight of each intent according to the skill request word and the user statement set respectively, determines the target summary semantics of the user statement set according to the semantic implicit representation and weight of each intent, determines the matching degree of the skill request word and the user statement set according to the skill request word and the target summary semantics, thereby narrowing the length difference between two texts that need to be calculated, and reducing the interference caused by unimportant intents by determining the target summary semantics based on the attention mechanism at the intent level. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1A structural diagram of the main framework of artificial intelligence;
[0019] Figure 2a It is a natural language processing system;
[0020] Figure 2b is another natural language processing system;
[0021] Figure 2c A schematic diagram of a natural language processing device provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of a system architecture provided for an embodiment of the present application;
[0023] Figure 4 A text data processing method provided in the embodiment of the present application
[0024] Figure 5 A schematic diagram of a smart device provided in an embodiment of the present application;
[0025] Figure 6 This is a schematic diagram of the structure of another computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] The embodiments of the present application provide a text data processing method and an intelligent device for confirming the semantic consistency of a skill request word and a user statement set.
[0027] The following describes the embodiments of the present application in conjunction with the accompanying drawings. Obviously, the described embodiments are only embodiments of a part of the present application, rather than all embodiments. It is known to those skilled in the art that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0028] The terms "first", "second", etc. in the specification and claims of the present application 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 interchangeable where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" and "having" and any of their variations 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.
[0029] First, the overall workflow of the artificial intelligence system is described. Figure 1 , Figure 1The figure shows a structural diagram of the main framework of artificial intelligence. The following is an explanation of the above artificial intelligence theme framework from the two dimensions of "intelligent information chain" (horizontal axis) and "IT value chain" (vertical axis). Among them, the "intelligent information chain" reflects a series of processes from data acquisition to processing. For example, it can be a general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, intelligent execution and output. In this process, the data has undergone a condensation process of "data-information-knowledge-wisdom". The "IT value chain" reflects the value that artificial intelligence brings to the information technology industry from the underlying infrastructure of human intelligence, information (providing and processing technology implementation) to the industrial ecology process of the system.
[0030] (1) Infrastructure
[0031] The infrastructure provides computing power support for the AI system, enables communication with the outside world, and supports it through the basic platform. It communicates with the outside world through sensors; computing power is provided by smart chips (CPU, NPU, GPU, ASIC, FPGA and other hardware acceleration chips); the basic platform includes distributed computing frameworks and networks and other related platform guarantees and support, which can include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to obtain data, and these data are provided to the smart chips in the distributed computing system provided by the basic platform for calculation.
[0032] (2) Data
[0033] The data on the upper layer of the infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, text, and IoT data of traditional devices, including business data of existing systems and perception data such as force, displacement, liquid level, temperature, and humidity.
[0034] (3) Data processing
[0035] Data processing usually includes data training, machine learning, deep learning, search, reasoning, decision-making and other methods.
[0036] Among them, machine learning and deep learning can symbolize and formalize data for intelligent information modeling, extraction, preprocessing, and training.
[0037] Reasoning refers to the process of simulating human intelligent reasoning in computers or intelligent systems, using formalized information to perform machine thinking and solve problems based on reasoning control strategies. Typical functions are search and matching.
[0038] Decision-making refers to the process of making decisions after intelligent information is reasoned, usually providing functions such as classification, sorting, and prediction.
[0039] (4) General ability
[0040] After the data has undergone the data processing mentioned above, some general capabilities can be further formed based on the results of the data processing, such as an algorithm or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.
[0041] (5) Smart products and industry applications
[0042] Smart products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of the overall artificial intelligence solution, which productizes intelligent information decision-making and realizes practical applications. Its application areas mainly include: smart terminals, smart transportation, smart medical care, autonomous driving, safe cities, etc.
[0043] Next, several application scenarios of this application are introduced.
[0044] Figure 2a A natural language processing system is shown, which includes an intelligent device and a data processing device. The intelligent device includes an intelligent terminal such as a mobile phone, a personal computer or an information processing center. The intelligent device is the initiator of natural language data processing, and is the initiator of language questions or queries. Usually, users initiate requests through intelligent devices.
[0045] The above-mentioned data processing device can be a device or server with data processing function such as a cloud server, a network server, an application server and a management server. The data processing device receives query sentences / voice / text and other questions from the intelligent terminal through an interactive interface, and then performs language data processing in the form of machine learning, deep learning, search, reasoning, decision-making, etc. through the memory for storing data and the processor for data processing. The memory in the data processing device can be a general term, including local storage and databases for storing historical data. The database can be on the data processing device or on other network servers.
[0046] exist Figure 2aIn the natural language processing system shown, the smart device can receive the user's instructions. For example, the smart device can receive a paragraph of text input by the user, and then initiate a request to the data processing device, so that the data processing device executes a natural language processing application (such as text classification, text reasoning, named entity recognition, translation, etc.) for the paragraph of text obtained by the smart device, thereby obtaining the processing result of the corresponding natural language processing application for the paragraph of text (such as processing result, reasoning result, named entity recognition result, translation result, etc.). Exemplarily, the smart device can receive a paragraph of Chinese input by the user, and then initiate a request to the data processing device, so that the data processing device performs entity classification on the paragraph of Chinese, thereby obtaining the entity processing result for the paragraph of Chinese; Exemplarily, the smart device can receive a paragraph of Chinese input by the user, and then initiate a request to the data processing device, so that the data processing device translates the paragraph of Chinese into English, thereby obtaining the English translation for the paragraph of Chinese.
[0047] exist Figure 2a In the embodiment of the present application, the data processing device can execute the text data processing method of the embodiment of the present application.
[0048] Figure 2b Another natural language processing system is shown. Figure 2b In this case, the smart device directly acts as a data processing device. The smart device can directly receive input from the user and process it directly by the hardware of the smart device itself. The specific process is similar to Figure 2a Similarly, please refer to the above description and will not repeat them here.
[0049] exist Figure 2b In the natural language processing system shown, the smart device can receive user instructions. For example, the smart device can receive voice uttered by the user, and then generate a piece of text corresponding to the voice. The smart device itself then executes a natural language processing application (such as text classification, text reasoning, named entity recognition, translation, etc.) on the piece of text, thereby obtaining the corresponding natural language processing application processing result for the piece of text (such as processing result, reasoning result, named entity recognition result, translation result, etc.).
[0050] exist Figure 2b In the embodiment of the present application, the smart device itself can execute the text data processing method.
[0051] Figure 2c It is a schematic diagram of the natural language processing related equipment provided in the embodiment of the present application.
[0052] Above Figure 2a and Figure 2b The smart devices in the Figure 2c The local device 301 or the local device 302 in Figure 2a The data processing device in the embodiment may be Figure 2c The execution device 210 in the embodiment, wherein the data storage system 250 can store the data to be processed by the execution device 210, and the data storage system 250 can be integrated on the execution device 210, or can be set on the cloud or other network servers.
[0053] Figure 2a and Figure 2b The processor in the system can perform data training / machine learning / deep learning through a neural network model or other models (for example, a model based on a support vector machine), and use the model finally trained or learned from the data to perform natural language processing applications (such as text classification, sequence labeling, reading comprehension, text generation, text reasoning, translation, etc.) on the text sequence to obtain corresponding processing results.
[0054] Figure 3 is a schematic diagram of a system 100 architecture provided in an embodiment of the present application. Figure 3 In the embodiment, the execution device 110 is configured with an input / output (I / O) interface 112 for data interaction with an external device. The user can input data to the I / O interface 112 through the client device 140. The input data may include: various tasks to be scheduled, callable resources and other parameters in the embodiment of the application.
[0055] When the execution device 110 preprocesses the input data, or when the computing module 111 of the execution device 110 performs calculation and other related processing (such as implementing the function of the neural network in the present application), the execution device 110 can call the data, code, etc. in the data storage system 150 for the corresponding processing, and can also store the data, instructions, etc. obtained by the corresponding processing in the data storage system 150.
[0056] Finally, the I / O interface 112 returns the processing result to the client device 140 so as to provide it to the user.
[0057] It is worth noting that the training device 120 can generate corresponding target models / rules based on different training data for different goals or tasks, and the corresponding target models / rules can be used to achieve the above goals or complete the above tasks, thereby providing the user with the desired results. The training data can be stored in the database 130 and come from the training samples collected by the data collection device 160.
[0058] exist Figure 3In the case shown in the figure, the user can manually give input data, and the manual giving can be operated through the interface provided by the I / O interface 112. In another case, the client device 140 can automatically send input data to the I / O interface 112. If the client device 140 is required to automatically send input data and needs to obtain the user's authorization, the user can set the corresponding authority in the client device 140. The user can view the results output by the execution device 110 on the client device 140, and the specific presentation form can be a specific method such as display, sound, action, etc. The client device 140 can also be used as a data acquisition terminal to collect the input data of the input I / O interface 112 and the output results of the output I / O interface 112 as shown in the figure as new sample data, and store them in the database 130. Of course, it is also possible not to collect through the client device 140, but the I / O interface 112 directly stores the input data of the input I / O interface 112 and the output results of the output I / O interface 112 as new sample data in the database 130.
[0059] It is worth noting that Figure 3 This is only a schematic diagram of a system architecture provided by an embodiment of the present application. The positional relationship between the devices, components, modules, etc. shown in the figure does not constitute any limitation. For example, in Figure 3 In the embodiment, the data storage system 150 is an external memory relative to the execution device 110. In other cases, the data storage system 150 may also be placed in the execution device 110. Figure 3 As shown, a neural network can be obtained by training according to the training device 120.
[0060] The present application also provides a chip including a neural network processor NPU. The chip can be arranged in Figure 3 The execution device 110 shown in FIG. 1 is used to complete the calculation work of the calculation module 111. The chip can also be set in Figure 3 The training device 120 shown is used to complete the training work of the training device 120 and output the target model / rule.
[0061] Neural network processor NPU, NPU is mounted on the main central processing unit (CPU) (host CPU) as a coprocessor, and the main CPU assigns tasks. The core part of NPU is the operation circuit, and the controller controls the operation circuit to extract data from the memory (weight memory or input memory) and perform operations.
[0062] In some implementations, the arithmetic circuit includes multiple processing units (process engines, PEs) inside. In some implementations, the arithmetic circuit is a two-dimensional systolic array. The arithmetic circuit can also be a one-dimensional systolic array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit is a general-purpose matrix processor.
[0063] For example, suppose there is an input matrix A, a weight matrix B, and an output matrix C. The operation circuit takes the corresponding data of matrix B from the weight memory and caches it on each PE in the operation circuit. The operation circuit takes the matrix A data from the input memory and performs matrix operations with matrix B. The partial results or final results of the matrix are stored in the accumulator.
[0064] The vector computing unit can further process the output of the operation circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. For example, the vector computing unit can be used for network calculations of non-convolutional / non-FC layers in neural networks, such as pooling, batch normalization, local response normalization, etc.
[0065] In some implementations, the vector computation unit can store the processed output vector to a unified buffer. For example, the vector computation unit can apply a nonlinear function to the output of the computation circuit, such as a vector of accumulated values, to generate an activation value. In some implementations, the vector computation unit generates a normalized value, a merged value, or both. In some implementations, the processed output vector can be used as an activation input to the computation circuit, such as for use in a subsequent layer in a neural network.
[0066] The unified memory is used to store input data and output data.
[0067] The weight data is directly transferred from the external memory to the input memory and / or the unified memory through the direct memory access controller (DMAC), the weight data in the external memory is stored in the weight memory, and the data in the unified memory is stored in the external memory.
[0068] The bus interface unit (BIU) is used to implement interaction between the main CPU, DMAC and instruction fetch memory through the bus.
[0069] An instruction fetch buffer connected to the controller, used to store instructions used by the controller;
[0070] The controller is used to call the instructions cached in the memory to control the working process of the computing accelerator.
[0071] Generally, the unified memory, input memory, weight memory and instruction fetch memory are all on-chip memories, and the external memory is a memory outside the NPU, which can be a double data rate synchronous dynamic random access memory (DDRSDRAM), a high bandwidth memory (HBM) or other readable and writable memory.
[0072] A voice assistant (VA) (or intelligent virtual assistant, such as Huawei's Xiaoyi, Xiaomi's Xiaoai, etc.) is an application that recognizes the user's voice commands to perform corresponding operations. In addition to providing its own voice services, voice assistants can also provide services for third-party applications. The services provided by these third-party applications are called skills, and skills are used to realize various intentions for users. For example, the skill "High-speed Rail Butler" helps users realize intentions such as "buying tickets, exiting the interface, refunding tickets, and checking order status".
[0073] In order to call out the required skills and realize the relevant intents, the developer provides skill request words and user statements. Users can read out the skill request words on the voice assistant to call out the corresponding skills. For example, read out "I want to buy a high-speed rail ticket", the voice assistant recognizes "high-speed rail", and the "High-speed Rail Butler" skill can be called out. After calling out the skill, the user can read out the user statement on the voice assistant to realize the required intent, for example, "I want to refund the ticket" can realize the "refund" intent, for example, "Please check my order" can realize the "check order" intent.
[0074] Skill request words are one of the few or even the only channels for users to perceive the services provided by this skill. Therefore, the skill request words and the service content that the skill can provide (i.e., the user's statement) need to have a high degree of semantic consistency. Currently, for the semantic consistency between skill request words and user statements, the two texts can be first mapped to the same semantic space to obtain two vectors, and then the similarity of the two vectors is calculated to determine the semantic consistency between the two texts. However, the text length of the skill request words and the user's statement differs greatly, and the above method has poor processing performance for two texts with a large difference in text length.
[0075] In an embodiment of the present application, a skill request word and a user statement set of a target skill are obtained, the user statement set includes at least one user statement for each intent in the target skill, the semantic implicit representation and weight of each intent are determined respectively according to the skill request word and the user statement set, and the target summary semantics of the user statement set are determined according to the semantic implicit representation and weight of each intent, and the matching degree of the skill request word and the user statement set is determined according to the skill request word and the target summary semantics, thereby narrowing the length difference between two paragraphs of text that need to be calculated, and reducing the interference caused by unimportant intents by determining the target summary semantics based on the attention mechanism at the intent level.
[0076] For details, please refer to Figure 4 , which is a text data processing method, comprising:
[0077] 401. Obtain a skill request word and a user utterance set of a target skill, where the user utterance set includes at least one user utterance for each intent in the target skill.
[0078] When developing a skill, developers can provide skill request words for the target skill. For example, "I want to buy a high-speed rail ticket", the voice assistant recognizes "high-speed rail" as the skill request word, and the "High-speed Rail Butler" skill can be called up. It should be noted that the target skill can be configured with multiple different skill request words, or it can be configured with only one skill request word, which is not limited here. For example, the skill request words for the skill "High-speed Rail Butler" can be "high-speed rail", "buy tickets", "tickets", "travel", "fares", etc., which are not limited here.
[0079] The target skill can have multiple intents, including "enter the interface", "buy tickets", "refund tickets", "query orders", etc. Developers can provide multiple different user statements for various intents in the target skill. For example, for the "exit interface" intent, the user can input voice "return to the original interface", "return to the previous position", "back", "close" (that is, user statements), etc., to achieve the "exit interface" intent.
[0080] The user statement set includes multiple user statements, and each user statement has a corresponding intent. That is, each intent can be realized by multiple user statements, but one user statement can only realize one intent.
[0081] When developing skills, developers can provide relevant documents to the voice assistant platform. The document records the skill request words and user utterance sets. After the staff of the voice assistant platform obtains the document, they can evaluate the text semantic consistency of the skill request words and user utterance sets.
[0082] 402. Filter the skill request words.
[0083] It should be noted that during the development process, there are some inappropriate skill request words, such as mixed Chinese and English words, brand company names, rare words, etc. Therefore, optionally, the skill request words can be screened before evaluating the text semantic consistency of the skill request words and the user statement set. For skill request words that meet the relevant rules, the text semantic consistency of the skill request words and the user statement set can be evaluated. For skill request words that do not meet the relevant rules, the developer can modify the skill request words again, or directly abandon the skill request words.
[0084] For example, the selection can be performed in the following two ways.
[0085] (1) Word form identification.
[0086] In this way, some rules can be defined to constrain the word form of skill request words, which in turn serve as the data preprocessing process of the skill request word consistency verification method. This preprocessing process will also play a positive role in the subsequent data modeling process.
[0087] For example, the following three rules are taken as examples. It should be noted that, in addition to the following three rules, there may be more rules to constrain the word form of the skill request word, which is not limited here.
[0088] Rule 1: Constraint skill request words cannot be a mixture of Chinese and foreign languages.
[0089] When a user invokes a skill request word through voice, a mixture of Chinese and foreign languages (e.g., Chinese and English) will increase the difficulty of automatic speech recognition (ASR) and natural language processing, and will also have a negative impact on user habits and business. Therefore, in some possible implementations, it is possible to first identify whether the skill request word contains a mixture of Chinese and foreign languages. If so, the skill request word cannot pass the screening.
[0090] Rule 2: The number of characters / words in the skill request word is within the preset range.
[0091] For example, the number of words in a skill request word cannot be more than 10 words, nor less than 2 words; for another example, the number of characters in a skill request word cannot be more than 20 characters, nor less than 2 characters. This makes it easier for users to remember the skill request word and for the skill request word to express the actual service scope of the target skill.
[0092] Rule 3: Skill request words need to pass the whitelist detection.
[0093] For example, if the skill is not created by Tencent, the skill request words cannot contain words such as "WeChat" or "Tencent". The mechanism of whitelist detection mainly restricts the conflict between skill request words and corporate brands, preventing skill request words from misusing the brand names of other companies to mislead users, which will greatly damage the user experience.
[0094] The above three rules are for reference only, and there can be other rules, which are not limited here.
[0095] (2) Rare character discrimination.
[0096] The recognition of skill request words in this way is mainly used to prevent the situation of difficult-to-remember and difficult-to-recognize skill request words. The occurrence of such situations will greatly hinder users from effectively accessing skills and reduce the user experience.
[0097] In some possible implementation manners, the discrimination of rare characters can be solved based on statistical natural language processing methods.
[0098] Specifically, the skill request words can be first processed by N-gram representation (N can be 2 or 3). It should be noted that N-gram representation may represent the skill request words as multiple words with a length of N. For example, after processing the sentence "Please query the high-speed rail tickets from Shenzhen to Beijing" by N-gram representation, the words "Please", "query", "from", "Shenzhen", "to", "Beijing", "the", "high-speed rail tickets" are obtained.
[0099] Then, the term frequency–inverse document frequency (TF-IDF) values of these words will be calculated in a pre-prepared dialogue system text library. It should be noted that the calculation method of TF-IDF can reflect the semantic importance of a word to a document. Generally, the TF-IDF values of words like "the" and "please" are relatively small, while the TF-IDF values of words like "high-speed rail tickets" and "query" are relatively high. During the text processing, we generally set a threshold (threshold) according to experience and data set in advance. Those with TF-IDF values less than this threshold are removed, and those with TF-IDF values greater than this threshold are retained. This can remove the influence of some "noises".
[0100] Finally, the frequencies of each word are counted. It should be noted that if the occurrence frequencies of some of these words are lower than the preset value, these word groups will be considered rare characters, and the skill request words containing rare characters need to be modified. In addition, a whitelist screening mechanism can also be retained. This whitelist lists some common complex word groups, such as obvious difficult-to-remember and difficult-to-recognize words like "taotie" and "maodie", as well as some traditional Chinese word groups.
[0101] In summary, the present application allows skill request words to clearly express the business service content while allowing users to remember the skill request words concisely and clearly so that users can invoke the service the next time they use it. The above various screening methods are only examples, and there may be other screening methods, which are not limited here.
[0102] 403. Determine the user statement for each intent in the user statement set.
[0103] It should be noted that the user statement set includes multiple user statements, each of which has its own intent. For example, the user statement set with the intent of "query order" may have three user statements: "Please help me check the tickets I have bought", "What tickets did I buy", and "Confirm my ticket".
[0104] In an embodiment of the present application, after obtaining a set of user statements, the intent to which each user statement in the set of user statements belongs can be determined, and the user statement for each intent in the set of user statements can be obtained.
[0105] For example, assume that the target skill has m intentions, which are Figure 1 , intention 2, …, intention m, then the user statements of each intention i can be expressed as wi1, i2, wi3, …, wi(ni), that is, intention i has a total of ni user statements, that is, the user statements of each intent in the user statement set are obtained.
[0106] 404. Concatenate all user statements for each intent to obtain a concatenated text of the user statements for each intent.
[0107] For example, in the user statement set, there may be three user statements for the intent of "query order": "Please help me check the tickets I have bought", "What tickets did I buy", "Confirm my ticket", so after concatenation, we get "Please help me check the tickets I have bought, what tickets did I buy, confirm my ticket". Continuing with the example 203 above, by concatenating intent i with a total of ni user statements, we get the user statement concatenation text for intent i, where i = 1, 2, ..., m.
[0108] 405. Based on the deep recurrent neural network, the user's utterance concatenation text of each intent is processed respectively to obtain the semantic implicit representation of each intent.
[0109] In the embodiment of the present application, the deep recurrent neural network is a time recurrent neural network, which is specially designed to solve the long-term dependency problem existing in general RNN (recurrent neural network). All RNNs have a chain form of repeated neural network modules. For example, long short-term memory network (LSTM). The following is an example of LSTM.
[0110] Optionally, since many meanings in Chinese are composed of words, in some feasible implementations, the user statement concatenation text can be segmented into Chinese words. For example, "Please help me check the tickets I have bought. What tickets did I buy? Confirm my ticket" is divided into "please", "help", "me", "query", "already", "bought", "of", "ticket", "I", "bought", "what", "ticket", "confirm", "me", "of", "ticket". After the above text segmentation, the user statement concatenation text obtains ni words, and a deep recurrent neural network can be used to generate a summary of the user statement concatenation text as the semantic latent representation of each intent.
[0111] It should be noted that before text processing, the user's utterance concatenation text can be mapped to the semantic space to obtain x_i,j, where j = 1, 2, ..., ni.
[0112] Then, LSTM is used to process the text of the user's utterance concatenation of intent i, and the following is obtained:
[0113] h_i,j=LSTM([h_i,j-1;x_i,j]·W+b)(j=1,2,…,ni)
[0114] Among them, h_i,j represents the semantic latent representation of the jth word in the concatenated text of the user's utterance with intention i.
[0115] It should be noted that [h_i,j-1; x_i,j] is used to concatenate vectors h_i,j-1 and x_i,j. h_i,j-1 is the semantic latent representation of the j-1th word (previous step) after text processing by LSTM, and W and b are the neural network parameters from the input layer to the hidden layer in the LSTM module.
[0116] In the embodiment of the present application, j=ni, that is, the semantic latent representation h_i,ni corresponding to the ni-th word (the last word) of intention i, is taken as the semantic latent representation of intention i.
[0117] 406. Perform text processing on the skill request words based on the deep recurrent neural network to obtain the semantic latent representation of the skill request words.
[0118] In the embodiment of the present application, the skill request words are first segmented into Chinese words. For example, "Please open the high-speed rail butler" is segmented into "please", "open", "high-speed rail", and "butler". Generally, the input of the skill request word is represented as (r1, r2, ..., rm), where m is the number of words after the skill request word segmentation.
[0119] The LSTM is used to process the text of the skill request word after word segmentation to obtain h_r,j (j=1,2,…,m), where j=m is taken to obtain h_r,m as the semantic latent representation of the skill request word.
[0120] 407. Calculate the similarity between the semantic latent representation of each intent and the semantic latent representation of the skill request word as the weight of each intent.
[0121] For example, the similarity between the semantic latent representation of intent i and the semantic latent representation of the skill request word can be calculated by the softmax() function as the weight of intent i:
[0122] α i =softmax(h_i,ni·h_r)
[0123] Among them, α i represents the weight of intention i, α i The smaller it is, the smaller the semantic influence of intention i on the target skill, such as the "welcome" intention. i The larger the value is, the greater the influence of intention i on the semantics of the target skill is, and this intention needs to be considered in detail, such as "high-speed rail ticket", "ticket booking" and "ticket refund". This is also called an intention-based attention mechanism. It should be noted that Softmax is an activation function used for classification in neural networks or deep learning. Its value is between 0 and 1, and the sum is 1, indicating the probability distribution.
[0124] It should be noted that when calculating the weight of intention i, it is obtained through h_i,ni·hr. Then, the semantic latent representation of the skill request word is used as a global information to supervise intention i. Only when the dot product calculation value of the semantic latent representation of intention i and the semantic latent representation of the skill request word is larger, its weight is larger.
[0125] 408. Determine the target summary semantics of the user statement set according to the semantic implicit representation and weight of each intent.
[0126] The semantic latent representation h_i,ni and weight α of intention i are determined through the above steps 205 and 207. i After that, the target summary semantics of the user's utterance set can be calculated as follows:
[0127]
[0128] After obtaining h_w, we add another layer of fully connected neural network to obtain the target summary semantics h_s of the user's statement set:
[0129] h_s=F1(h_w·W s +b s )
[0130] Among them, F() is the activation function, such as sigmoid(), W s and b s It is the relevant parameter of the fully connected layer function.
[0131] 409. Mapping the semantic latent representation of the skill request word and the target summary semantics into the same semantic space to obtain a first semantic vector and a second semantic vector.
[0132] After the calculations in the above steps, we get the semantic latent representation h_r of the skill request word and the target summary semantics h_s of the user utterance set. Then we can calculate the matching degree H between the two in the following way:
[0133] H=F2(W·[h_r;h_s]+b)
[0134] For example, F1() is an activation function, such as sigmoid(). The function value of sigmoid() is close to 0 and 1, 0 indicates the lowest similarity, and the function value close to 1 indicates a high similarity.
[0135] Please refer to Figure 5 , the present application also proposes a smart device 500, including:
[0136] An acquisition module 510 is provided for acquiring a skill request word and a user statement set of a target skill, wherein the user statement set includes at least one user statement for each intent of the target skill;
[0137] A processing module 520, for determining a semantic latent representation and a weight of each intent according to the skill request words and the user utterance set;
[0138] Processing module 520, used to determine the target summary semantics of the user's utterance set according to the semantic implicit representation and weight of each intention;
[0139] The processing module 520 is used to determine the matching degree between the skill request word and the user utterance set according to the skill request word and the target summary semantics.
[0140] In some possible implementations, the processing module 520 is specifically configured to:
[0141] Determine the semantic latent representation of each intent according to the user's statement set; perform text processing on the skill request words based on a deep recurrent neural network to obtain the semantic latent representation of the skill request words; determine the weight of each intent according to the semantic latent representation of each intent and the semantic latent representation of the skill request words.
[0142] In some possible implementations, the processing module 520 is specifically configured to:
[0143] Determine the user statements for each intent in the user statement set; concatenate all user statements for each intent to obtain the user statement concatenation text for each intent; perform text processing on the user statement concatenation text for each intent based on a deep recurrent neural network to obtain the semantic latent representation of each intent.
[0144] In some possible implementations, the processing module 520 is specifically configured to:
[0145] The similarity between the semantic latent representation of each intent and the semantic latent representation of the skill request word is calculated as the weight of each intent.
[0146] In some possible implementations, the processing module 520 is specifically configured to:
[0147] According to the semantic latent representation of the skill request word and the target summary semantics, they are mapped into the same semantic space to obtain a first semantic vector and a second semantic vector; the similarity between the first semantic vector and the second semantic vector is calculated as the matching degree between the skill request word and the user statement set.
[0148] It should be noted that the management device described above is based on the same concept as the method embodiment of the present application, and the technical effect it brings is the same as the method embodiment of the present application. For specific contents, please refer to the description of the management device in the method embodiment shown above in the present application, and it will not be repeated here.
[0149] An embodiment of the present application also provides a computer storage medium, wherein the computer storage medium stores a program, and the program executes some or all of the steps recorded in the above method embodiment.
[0150] like Figure 6 As shown, it is a structural schematic diagram of another computer device of an embodiment of the present application. The computer device can be the intelligent device in the above-mentioned embodiment, the computer device can be a server, or other devices that can realize the functions of the present application. The computer device can also be a terminal, such as a personal computer (PC), a laptop computer, a mobile phone and other terminal devices.
[0151] The computer device may include: a processor 601 (e.g., a CPU), a memory 602, a transmitter 604, and a receiver 603; the transmitter 604 and the receiver 603 are coupled to the processor 601, and the processor 601 controls the sending action of the transmitter 604 and the receiving action of the receiver 603. The memory 602 may include a high-speed RAM memory, and may also include a non-volatile memory NVM, such as at least one disk memory, and the memory 602 may store various instructions for completing various processing functions and implementing the method steps of the embodiment of the present application. Among them, the above-mentioned processor 601 and memory 602 can be implemented in a virtualized manner.
[0152] Optionally, the computer device involved in the embodiment of the present application may further include: a power supply 605, and one or more of a communication port 606. Figure 6 The devices described in the figure may be connected via a communication bus or other connection methods, which is not limited in the embodiments of the present application. The receiver 603 and the transmitter 604 may be integrated in a transceiver of a computer device, or may be separate receiving and transmitting antennas on the computer device. The communication bus is used to realize communication connection between components. The above-mentioned communication port 606 is used to realize connection and communication between the computer device and other peripherals.
[0153] The present application also provides a chip system, which includes a processor for supporting the above-mentioned smart device to implement its functions, for example, receiving or processing the data and / or information involved in the above-mentioned method embodiment. In one possible design, the chip system also includes a memory, which is used to store program instructions and data necessary for the computer device. The chip system can be composed of a chip, or it can include a chip and other discrete devices.
[0154] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0155] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, a computer, a server, or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server, or data center. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0156] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0157] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as 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 an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0158] 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 network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0159] 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.
[0160] 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 is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program codes.
Claims
1. A text data processing method, characterized in that: include: The smart device obtains a skill request word and a user utterance set of a target skill, wherein the user utterance set includes at least one user utterance for each intent in the target skill; The smart device determines the semantic implicit representation and weight of each of the intentions according to the skill request words and the user utterance set; The smart device determines the target summary semantics of the user utterance set according to the semantic implicit representation and weight of each intention; The smart device determines the matching degree between the skill request word and the user utterance set according to the skill request word and the target summary semantics; The smart device determines the semantic implicit representation and weight of each intention according to the skill request word and the user statement set, including: The smart device determines the semantic implicit representation of each of the intentions according to the user statement set; The smart device performs text processing on the skill request word based on a deep recurrent neural network to obtain a semantic latent representation of the skill request word; The smart device determines the weight of each intent according to the implicit semantic representation of each intent and the implicit semantic representation of the skill request word.
2. The method according to claim 1, characterized in that: The smart device determines the semantic implicit representation of each of the intentions according to the user utterance set, including: The smart device determines a user statement for each intention in the user statement set; The smart device concatenates all user statements of each intention to obtain a concatenated text of the user statements of each intention; The smart device performs text processing on the user utterance concatenation text of each intention based on a deep recurrent neural network to obtain a semantic latent representation of each intention.
3. The method according to claim 1, characterized in that: The smart device determines the weight of each of the intents according to the implicit semantic representation of each of the intents and the implicit semantic representation of the skill request words, including: The smart device calculates the similarity between the semantic implicit representation of each intent and the semantic implicit representation of the skill request word as the weight of each intent.
4. The method according to any one of claims 1 to 3, characterized in that: The smart device determines the matching degree between the skill request word and the user utterance set according to the skill request word and the target summary semantics, including: The smart device maps the semantic latent representation of the skill request word and the semantics of the target summary into the same semantic space to obtain a first semantic vector and a second semantic vector; The smart device calculates the similarity between the first semantic vector and the second semantic vector as the matching degree between the skill request word and the user utterance set.
5. A smart device, characterized in that: include: An acquisition module, comprising a skill request word and a user statement set for acquiring a target skill, wherein the user statement set includes at least one user statement for each intent in the target skill; A processing module, used to determine the semantic implicit representation and weight of each of the intentions according to the skill request words and the user utterance set; The processing module is used to determine the target summary semantics of the user utterance set according to the semantic implicit representation and weight of each intention; The processing module is used to determine the matching degree between the skill request word and the user utterance set according to the skill request word and the target summary semantics; The determining of the semantic implicit representation and weight of each intention according to the skill request word and the user utterance set respectively includes: Determine the semantic implicit representation of each of the intentions according to the user statement set; Performing text processing on the skill request words based on a deep recurrent neural network to obtain a semantic latent representation of the skill request words; The weight of each intent is determined according to the implicit semantic representation of each intent and the implicit semantic representation of the skill request word.
6. The smart device according to claim 5, characterized in that: The determining the semantic implicit representation of each of the intentions according to the user utterance set includes: Determine a user statement for each of the intents in the user statement set; Concatenate all user statements of each intent to obtain a concatenated text of user statements of each intent; Based on a deep recurrent neural network, text processing is performed on the user utterance concatenation text of each intent to obtain a semantic latent representation of each intent.
7. The smart device according to claim 5, characterized in that: The determining the weight of each intention according to the semantic implicit representation of each intention and the semantic implicit representation of the skill request word includes: The similarity between the semantic implicit representation of each of the intents and the semantic implicit representation of the skill request words is calculated as the weight of each of the intents.
8. The smart device according to any one of claims 5 to 7, characterized in that: The determining the matching degree between the skill request word and the user utterance set according to the skill request word and the target summary semantics includes: According to the semantic latent representation of the skill request word and the semantics of the target summary are mapped into the same semantic space, a first semantic vector and a second semantic vector are obtained; The similarity between the first semantic vector and the second semantic vector is calculated as the matching degree between the skill request word and the user utterance set.
9. A smart device, characterized in that: include: A processor, a memory and a transceiver, wherein the memory stores program codes, and the processor calls the program codes stored in the memory so that the smart device executes the method according to any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: The invention comprises a program which, when being run on a computer, causes the computer to execute the method according to any one of claims 1 to 4.
11. A computer program product, characterized in that One or more computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the processor performs the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Text implicit semantic meaning activation method and system
CN107577656A
Intention recognition method and device, electronic equipment and readable storage medium
CN110928997A