Intention recognition method for control instruction, storage medium, and electronic device
Patent Information
- Application Number
- CN202310083554.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-30
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-01-30
AI Technical Summary
[0004]针对相关技术中,如何提高对用户意图识别结果的准确度的问题,尚未提出有效的解决方案
[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described control instruction intention recognition method at runtime.
Smart Images

Figure CN116090461B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart home technology, and more specifically, to a method for recognizing the intent of a control command, a storage medium, and an electronic device. Background Technology
[0002] Currently, in the field of smart home technology, as the intelligence level of smart home appliances continues to improve, more and more smart home appliances are able to provide corresponding services to users by recognizing their intentions. For example, classification models can be used to classify and analyze user voice data, and from multiple categories of intentions, the most likely user control intention for the device can be obtained. However, this method of recognizing user control intentions through classification models relies on the classification model itself to analyze user voice data, without combining the user's control habits to determine the user's control intentions. The recognition results of user intentions are not accurate enough, resulting in a lower user experience.
[0003] Therefore, in related technologies, there is a question of how to improve the accuracy of user intent recognition results.
[0004] Regarding the issue of how to improve the accuracy of user intent recognition results in related technologies, no effective solution has yet been proposed. Summary of the Invention
[0005] This application provides a method, storage medium, and electronic device for recognizing the intent of control commands, in order to at least solve the problem of how to improve the accuracy of user intent recognition results in related technologies.
[0006] According to one embodiment of this application, a method for identifying the intent of a control command is provided, comprising: acquiring a control command received by a smart device; determining entity data corresponding to the control command, and generating an intent expression of the control command based on the entity data; determining a target intent expression consistent with the intent expression from a preset intent set, and determining the control intent corresponding to the target intent expression as the intent identification result of the control command.
[0007] Determining the entity data corresponding to the control command and generating an intent expression for the control command based on the entity data includes: performing text recognition on the control command to obtain recognized text data; determining the entity data from the text data; and generating an intent expression for the control command based on a preset binary tree of the target object and the entity data.
[0008] In an exemplary embodiment, determining the entity data from the text data includes: inputting the text data into a word segmentation model; segmenting the text data using a first word segmentation sub-model in the word segmentation model to obtain a word segmentation result; performing part-of-speech tagging on multiple words in the word segmentation result using a second word segmentation sub-model in the word segmentation model to obtain multiple tagged words, wherein each of the multiple tagged words corresponds to a word tag, and the word tag represents the word category of each word; determining the target word among the multiple words as the entity data, wherein the word tag of the target word is an entity word.
[0009] In an exemplary embodiment, generating the intent expression of the control instruction based on a preset binary tree of the target object and the entity data includes: traversing the binary tree to obtain tree nodes of the binary tree and node expressions corresponding to the tree nodes; wherein the tree nodes represent the categories corresponding to the entities in the entity data; determining a target tree node from multiple tree nodes and obtaining a target node expression corresponding to the target tree node, wherein the target tree node is consistent with the category of the entity in the entity data; and sorting the multiple target node expressions according to the traversal order of the binary tree to generate the intent expression of the control instruction.
[0010] In one exemplary embodiment, determining a target intent expression consistent with the intent expression from a preset intent set includes: parsing non-standard words in the intent expression; obtaining standard words corresponding to the non-standard words from a preset dictionary; replacing the non-standard words in the intent expression with the standard words to obtain a standardized intent expression; and determining a target intent expression consistent with the standardized intent expression from the preset intent set.
[0011] In an exemplary embodiment, before determining the control intent corresponding to the target intent expression as the intent recognition result of the control instruction, the method further includes: obtaining the expression similarity between the target intent expression and a first preset intent expression; if the expression similarity is determined to be greater than a first preset threshold, obtaining the control intent preset by the first preset intent expression for the target object; and determining the preset control intent as the control intent corresponding to the target intent expression.
[0012] In an exemplary embodiment, after determining the control intent corresponding to the target intent expression as the intent recognition result of the control instruction, the method further includes: establishing a correspondence between the control instruction and the intent recognition result, and storing the correspondence; and when the smart device receives the control instruction again, directly determining the intent recognition result corresponding to the control instruction based on the correspondence.
[0013] In an exemplary embodiment, determining a target intent expression consistent with the intent expression from a preset intent set includes: determining a second preset intent expression within the preset intent set, and determining the difference between a first length of the intent expression and a second length of the second preset intent expression; if the difference is greater than a second preset threshold, determining a first content word that first appears in the intent expression and a second content word that first appears in the target intent expression; if the part of speech of the first content word is consistent with the part of speech of the second content word, determining the second preset intent expression as the target intent expression.
[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described control instruction intention recognition method at runtime.
[0015] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the aforementioned control instruction intention recognition method through the computer program.
[0016] In this embodiment, a control command received by a smart device is acquired; entity data corresponding to the control command is determined, and an intent expression of the control command is generated based on the entity data; a target intent expression consistent with the intent expression is determined from a preset intent set, and the control intent corresponding to the target intent expression is determined as the intent recognition result of the control command; by adopting the above technical solution, the problem of how to improve the accuracy of user intent recognition results is solved, thereby improving the accuracy of user intent recognition results. Attached Figure Description
[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0018] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of the hardware environment for a control instruction intent recognition method according to an embodiment of this application;
[0020] Figure 2 This is a flowchart of a control instruction intent recognition method according to an embodiment of this application;
[0021] Figure 3 This is a schematic diagram of an intent recognition method for control instructions according to an embodiment of this application;
[0022] Figure 4 This is a structural block diagram (a) of a control instruction intent recognition device according to an embodiment of this application;
[0023] Figure 5 This is a structural block diagram (II) of a control command intent recognition device according to an embodiment of this application. Detailed Implementation
[0024] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0025] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0026] According to one aspect of the embodiments of this application, a method for recognizing the intent of a control command is provided. This method for recognizing the intent of a control command is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-mentioned method for recognizing the intent of a control command can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.
[0027] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.
[0028] This embodiment provides a method for recognizing the intent of control commands, applied to the aforementioned computer terminal. Figure 2 This is a flowchart of a control command intent recognition method according to an embodiment of this application, the process including the following steps:
[0029] Step S202: Obtain the control command received by the smart device;
[0030] It should be noted that acquiring control commands received by a smart device may include: acquiring voice information received by the smart device, performing voice recognition on the voice information, and determining the control commands used to control the smart device.
[0031] Step S204: Determine the entity data corresponding to the control command, and generate the intent expression of the control command based on the entity data;
[0032] Step S206: Determine a target intent expression that matches the intent expression from a preset intent set, and determine the control intent corresponding to the target intent expression as the intent recognition result of the control command.
[0033] Through the above steps, control commands received by the smart device are obtained; entity data corresponding to the control commands is determined, and an intent expression of the control commands is generated based on the entity data; a target intent expression consistent with the intent expression is determined from a preset intent set, and the control intent corresponding to the target intent expression is determined as the intent recognition result of the control commands. This solves the problem of how to improve the accuracy of user intent recognition results in related technologies, thereby improving the accuracy of user intent recognition results.
[0034] Furthermore, in step S204 above, the process of determining the entity data corresponding to the control instruction and generating the intent expression of the control instruction based on the entity data may include: performing text recognition on the control instruction to obtain the recognized text data; determining the entity data from the text data; and generating the intent expression of the control instruction based on a preset binary tree of the target object and the entity data.
[0035] In an exemplary embodiment, to better understand the technical solution for determining the entity data from the text data in the above embodiments, the following technical solution is further proposed, with specific steps including: inputting the text data into a word segmentation model; using a first word segmentation sub-model in the word segmentation model to segment the text data into words, obtaining word segmentation results; using a second word segmentation sub-model in the word segmentation model to perform part-of-speech tagging on multiple words in the word segmentation results, obtaining multiple tagged words, wherein each of the multiple tagged words corresponds to a word tag, and the word tag represents the word category of each word; determining the target word among the multiple words as the entity data, wherein the word tag of the target word is an entity word.
[0036] It should be noted that the aforementioned word segmentation models can be, for example, word segmentation tools, including LTP (Language Technology Platform) word segmentation tools, Jieba word segmentation tools, and pkuseg word segmentation tools. Furthermore, for example, word segmentation can be performed using the pyltp module in Python, using the jieba module in Python, and using the pkuseg module in Python, but is not limited to these.
[0037] Optionally, in this embodiment, the learning rate of the first sub-model and the learning rate of the second sub-model can be set separately. For example, the learning rate of the first sub-model can be set to be greater than the learning rate of the second sub-model, or the learning rate of the second sub-model can be set to be greater than the learning rate of the first sub-model. This application does not limit this.
[0038] In an exemplary embodiment, to better understand the implementation process of generating the intent expression of the control instruction based on the preset binary tree of the target object and the entity data in the above embodiments, the following technical solution is proposed, specifically including: traversing the binary tree to obtain the tree nodes of the binary tree and the node expressions corresponding to the tree nodes; wherein, the tree nodes represent the category corresponding to the entity of the entity data; determining the target tree node from multiple tree nodes and obtaining the target node expression corresponding to the target tree node, wherein, the target tree node is consistent with the category of the entity of the entity data; sorting the multiple target node expressions according to the traversal order of the binary tree to generate the intent expression of the control instruction.
[0039] It should be noted that the node expression corresponding to the tree node mentioned above can be set to the entity category device to which the device name of the smart device belongs, or the entity category action to which the operation action of the smart device belongs, or the entity category attr to which the attribute of the smart device belongs, etc., but is not limited to these.
[0040] In an exemplary embodiment, to better illustrate the implementation process of determining the target intent expression consistent with the intent expression from a preset intent set in step S206 above, the following implementation steps are further proposed, specifically including: parsing the intent expression to obtain non-standard words in the intent expression; obtaining the standard words corresponding to the non-standard words from a preset dictionary; replacing the non-standard words in the intent expression with the standard words to obtain a standardized intent expression; and determining the target intent expression consistent with the standardized intent expression from the preset intent set.
[0041] In an exemplary embodiment, before determining the control intent corresponding to the target intent expression as the intent recognition result of the control instruction, the expression similarity between the target intent expression and the first preset intent expression can be obtained; if the expression similarity is determined to be greater than the first preset threshold, the control intent preset by the first preset intent expression for the target object is obtained; and the preset control intent is determined as the control intent corresponding to the target intent expression.
[0042] It should be noted that the similarity of the above expressions can be understood as the similarity of the word structure of different expressions.
[0043] In an exemplary embodiment, after determining the control intent corresponding to the target intent expression as the intent recognition result of the control instruction, the following execution steps are further proposed, specifically including: establishing a correspondence between the control instruction and the intent recognition result, and storing the correspondence; when the smart device receives the control instruction again, directly determining the intent recognition result corresponding to the control instruction based on the correspondence.
[0044] In an exemplary embodiment, the process of determining a target intent expression consistent with the intent expression from a preset intent set can also be implemented through other technical steps. Specific steps include: determining a second preset intent expression within the preset intent set, and determining the difference between a first length of the intent expression and a second length of the second preset intent expression; if the difference is greater than a second preset threshold, determining the first content word appearing for the first time in the intent expression and the second content word appearing for the first time in the target intent expression; if the part of speech of the first content word is consistent with the part of speech of the second content word, determining the second preset intent expression as the target intent expression.
[0045] In an optional embodiment, the process of determining a target intent expression that matches the intent expression from a preset intent set can be implemented, for example, using a thread. This involves generating a search thread to perform a full search of the preset intent set; grouping the intent expressions in the preset intent set into multiple groups of intent expressions; and using the search thread to search the multiple groups of intent expressions to determine the target intent expression that matches the intent expression from the preset intent set.
[0046] To better understand the process of the above-mentioned control instruction intent recognition method, the implementation flow of the above-mentioned control instruction intent recognition method will be described below in conjunction with optional embodiments, but it is not intended to limit the technical solution of the embodiments of this application.
[0047] In this embodiment, combined with Figure 3 A method for recognizing the intent of control commands is provided, comprising the following steps:
[0048] Step 1: Entity Extraction
[0049] For example, the BERT model can be used to extract entities from the text data corresponding to user control commands. The relationship between entity data and entity categories can be defined as follows:
[0050] device: The name of the target device, such as refrigerator or air conditioner.
[0051] attr: Sets the properties of the target device, such as temperature, mode, and volume.
[0052] attrValue: Sets the target device property value, such as setting the volume to "26".
[0053] location: The location of the target device, such as the living room, bathroom, or first floor.
[0054] Action: Target device action, such as setting, turning on, turning off, or adjusting.
[0055] The structural diagram of the BERT model can be shown as follows: Figure 3 As shown, Figure 3 This is a schematic diagram of the control instruction intent recognition method according to the embodiments of this application. Combining the logical structure of BERT (Chinese word segmentation) + CRF (part-of-speech tagging), the learning rate of the CRF layer can be set to be greater than that of the BERT layer during training. For example, the learning rate of the CRF layer can be set to 100 times that of the BERT layer.
[0056] In this embodiment, taking "setting the air conditioner temperature to 25 degrees" as an example, the entity extraction model can be used to obtain the following entity relationships:
[0057] device: air conditioner;
[0058] attr: temperature;
[0059] attrValue: 25;
[0060] action: to adjust.
[0061] Step 2: Obtain the generated intent expression:
[0062] In this step, the entity data extracted in step one can be formally expressed in the following way to obtain the generated intent expression: traversing the preset binary tree of the target object can obtain the tree nodes of the binary tree and the node expressions corresponding to the tree nodes; then, from the multiple tree nodes, the target tree node that matches the category of the entity in the entity data is determined, the target node expression corresponding to the target tree node is obtained, and the multiple target node expressions are sorted according to the traversal order of the binary tree to generate the intent expression of the control instruction.
[0063] Optionally, taking "raising the living room air conditioner temperature by 2 degrees" as an example, the following intent expression can be obtained:
[0064] Increase the temperature by 2 degrees (dest_attr(location(air conditioner, living room)), temperature).
[0065] Step 3: Inferring the Intent of the Expression:
[0066] Specifically, step three includes the following steps:
[0067] Step 1: Obtain a predefined set of intents.
[0068] For example, taking AirConditionerIncrTemp and AirConditionerDecrTemp as the codes for raising and lowering the temperature of an air conditioner, we define a set of intents including the following mapping relationships. It should be noted that when defining the mapping relationships, all possible expressions should be enumerated as much as possible.
[0069] Taking AirConditionerIncrTemp as a preset intent set as an example, the intent expressions included in AirConditionerIncrTemp are as follows:
[0070] AirConditionerIncrTemp:[
[0071] "increase(dest_attr(location(air conditioning, room), temperature), \\d+degrees)",
[0072] "increase(dest_attr(air conditioner, temperature), \\d+degrees)",
[0073] "increase(dest_attr(~, temperature), \\d+degrees)",
[0074] "increase (air conditioning, \\d+degree)"
[0075] "increase(~,\\d+degree)"
[0076] ].
[0077] Taking AirConditionerDecrTemp as a preset intent set as an example, the intent expressions included in AirConditionerIncrTemp are as follows:
[0078] AirConditionerDecrTemp:[
[0079] "decrease(dest_attr(location(air conditioning, room), temperature), \\d+degrees)",
[0080] "decrease(dest_attr(air conditioner, temperature), \\d+degrees)"
[0081] "decrease(dest_attr(~, temperature), \\d+degrees)",
[0082] "decrease (air conditioning, \\d+degree)"
[0083] "decrease(~,\\d+degree)"
[0084] ].
[0085] Step 2: Retrieve the target intent expression that matches the intent expression generated in Step 2 from the preset intent set:
[0086] Step 2 includes:
[0087] Step 2.1: Standardize the intent expression generated in Step 2 according to the preset dictionary. An example of the dictionary content is as follows:
[0088] increase: raise; increase
[0089] decrease: lower; reduce
[0090] room: living room | kitchen.
[0091] Therefore, the intent expression "increase(dest_attr(location(air conditioner, living room), temperature), 2 degrees)" can be standardized as: "increase(dest_attr(location(air conditioner, room), temperature), 2 degrees)".
[0092] Step 2.2: Iterate through each intent expression in the intent set and match each element of each intent expression. The pseudocode for this matching is as follows:
[0093] 1var intents / / Collection of intent semantics
[0094] 2var queryFormula / / Formal representation of user input
[0095] 3var intentResults / / Hit intent
[0096] 4def intentInfer(var queryFormula):
[0097] 5. For intent in intents:
[0098] 6for formula in intents.formulas:
[0099] 7if match(formula,queryFormula):
[0100] 8. intentResults.add(intent).
[0101] The above embodiments can accurately identify user intent. Compared with existing classification models for identifying intent, the maintenance cost is low and the identification efficiency is higher.
[0102] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0103] Figure 4 This is a structural block diagram (a) of a control command intent recognition device according to an embodiment of this application; as shown... Figure 4 As shown, it includes:
[0104] Acquisition module 42 is used to acquire control commands received by the smart device;
[0105] The first determining module 44 is used to determine the entity data corresponding to the control command and generate the intent expression of the control command based on the entity data;
[0106] The second determining module 46 is used to determine a target intent expression that is consistent with the intent expression from a preset intent set, and to determine the control intent corresponding to the target intent expression as the intent recognition result of the control instruction.
[0107] The above-described device acquires control commands received by a smart device; determines the entity data corresponding to the control command, and generates an intent expression for the control command based on the entity data; determines a target intent expression consistent with the intent expression from a preset intent set, and identifies the control intent corresponding to the target intent expression as the intent recognition result of the control command. This solves the problem of how to improve the accuracy of user intent recognition results in related technologies, thereby improving the accuracy of user intent recognition results.
[0108] Furthermore, the first determining module 44 is also used to: perform text recognition on the control command to obtain the recognized text data; determine the entity data from the text data; and generate an intent expression for the control command based on a preset binary tree of the target object and the entity data.
[0109] In an exemplary embodiment, the first determining module 44 is further configured to: input the text data into a word segmentation model; segment the text data using a first word segmentation sub-model in the word segmentation model to obtain a word segmentation result; perform part-of-speech tagging on multiple words in the word segmentation result using a second word segmentation sub-model in the word segmentation model to obtain multiple tagged words, wherein each of the multiple tagged words corresponds to a word tag, and the word tag represents the word category of each word segment; determine the target word among the multiple words as the entity data, wherein the word tag of the target word is an entity word.
[0110] It should be noted that the aforementioned word segmentation models can be, for example, word segmentation tools, including LTP (Language Technology Platform) word segmentation tools, Jieba word segmentation tools, and pkuseg word segmentation tools. Furthermore, for example, word segmentation can be performed using the pyltp module in Python, using the jieba module in Python, and using the pkuseg module in Python, but is not limited to these.
[0111] Optionally, in this embodiment, the learning rate of the first sub-model and the learning rate of the second sub-model can be set separately. For example, the learning rate of the first sub-model can be set to be greater than the learning rate of the second sub-model, or the learning rate of the second sub-model can be set to be greater than the learning rate of the first sub-model. This application does not limit this.
[0112] In an exemplary embodiment, the first determining module 44 is further configured to: traverse the binary tree to obtain tree nodes of the binary tree and node expressions corresponding to the tree nodes; wherein the tree nodes represent the categories corresponding to the entities of the entity data; determine a target tree node from multiple tree nodes and obtain a target node expression corresponding to the target tree node, wherein the target tree node is consistent with the category of the entity of the entity data; and sort the multiple target node expressions according to the traversal order of the binary tree to generate the intent expression of the control instruction.
[0113] It should be noted that the node expression corresponding to the tree node mentioned above can be set to the entity category device to which the device name of the smart device belongs, or the entity category action to which the operation action of the smart device belongs, or the entity category attr to which the attribute of the smart device belongs, etc., but is not limited to these.
[0114] In an exemplary embodiment, the second determining module 46 is further configured to: parse non-standard words from the intent expression to obtain non-standard words in the intent expression; obtain standard words corresponding to the non-standard words from a preset dictionary; replace the non-standard words in the intent expression with the standard words to obtain a standardized intent expression; and determine a target intent expression consistent with the standardized intent expression from a preset intent set.
[0115] In an exemplary embodiment, the second determining module 46 is further configured to: obtain the expression similarity between the target intent expression and the first preset intent expression; if the expression similarity is determined to be greater than the first preset threshold, obtain the control intent preset by the first preset intent expression for the target object; and determine the preset control intent as the control intent corresponding to the target intent expression.
[0116] It should be noted that the similarity of the above expressions can be understood as the similarity of the word structure of different expressions.
[0117] In an exemplary embodiment, the second determining module 46 is further configured to: determine a second preset intent expression within the preset intent set, and determine the difference between the first length of the intent expression and the second length of the second preset intent expression; if the difference is determined to be greater than a second preset threshold, determine the first content word appearing for the first time in the intent expression and the second content word appearing for the first time in the target intent expression; if the part of speech of the first content word is determined to be consistent with the part of speech of the second content word, determine the second preset intent expression as the target intent expression.
[0118] In an optional embodiment, the process of determining a target intent expression that matches the intent expression from a preset intent set can be implemented, for example, using a thread. This involves generating a search thread to perform a full search of the preset intent set; grouping the intent expressions in the preset intent set into multiple groups of intent expressions; and using the search thread to search the multiple groups of intent expressions to determine the target intent expression that matches the intent expression from the preset intent set.
[0119] Figure 5 This is a structural block diagram (II) of a control command intent recognition device according to an embodiment of this application; as shown Figure 5 As shown, in an exemplary embodiment, the above-mentioned control instruction intent recognition device, in addition to the acquisition module 42, the first determination module 44, and the second determination module 46, further includes: a storage module 52, which, after determining the control intent corresponding to the target intent expression as the intent recognition result of the control instruction, further proposes the following execution steps, specifically including: establishing a correspondence between the control instruction and the intent recognition result, and storing the correspondence; and, when the smart device receives the control instruction again, directly determining the intent recognition result corresponding to the control instruction based on the correspondence.
[0120] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.
[0121] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:
[0122] S1, acquire the control commands received by the smart device;
[0123] S2, determine the entity data corresponding to the control command, and generate the intent expression of the control command based on the entity data;
[0124] S3, determine the target intent expression that matches the intent expression from the preset intent set, and determine the control intent corresponding to the target intent expression as the intent recognition result of the control instruction.
[0125] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0126] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0127] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0128] S1, acquire the control commands received by the smart device;
[0129] S2, determine the entity data corresponding to the control command, and generate the intent expression of the control command based on the entity data;
[0130] S3, determine the target intent expression that matches the intent expression from the preset intent set, and determine the control intent corresponding to the target intent expression as the intent recognition result of the control instruction.
[0131] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0132] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0133] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0134] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for recognizing the intent of a control command, characterized in that, include: Acquire control commands received by smart devices; The entity data corresponding to the control command is determined, and the binary tree is traversed to obtain the tree nodes of the binary tree and the node expressions corresponding to the tree nodes; wherein, the tree node represents the category corresponding to the entity of the entity data; a target tree node is determined from multiple tree nodes, and the target node expression corresponding to the target tree node is obtained, wherein the target tree node is consistent with the category of the entity of the entity data; the multiple target node expressions are sorted according to the traversal order of the binary tree to generate the intent expression of the control command; A target intent expression that matches the intent expression is determined from a preset intent set, and the control intent corresponding to the target intent expression is determined as the intent recognition result of the control command; The step of determining the target intent expression that matches the intent expression from the preset intent set includes: generating a search thread for performing a full search on the preset intent set; grouping the intent expressions in the preset intent set into multiple groups of intent expressions; and using the search thread to search the multiple groups of intent expressions to determine the target intent expression that matches the intent expression from the preset intent set.
2. The method for recognizing the intent of a control command according to claim 1, characterized in that, Determining the entity data corresponding to the control command includes: The control commands are subjected to text recognition to obtain the recognized text data; The entity data is determined from the text data.
3. The method for recognizing the intent of a control command according to claim 2, characterized in that, Determining the entity data from the text data includes: The text data is input into the word segmentation model; The first sub-model of the word segmentation model is used to segment the text data to obtain the word segmentation result. The second sub-model of the word segmentation model is used to perform part-of-speech tagging on multiple words in the word segmentation result to obtain multiple tagged words. Each of the multiple tagged words corresponds to a word tag, and the word tag represents the word category of each word. The target word among the multiple word segments is determined as the entity data, wherein the word tag of the target word is an entity word.
4. The method for recognizing the intent of a control command according to claim 1, characterized in that, Determining a target intent expression that matches the intent expression from a preset intent set includes: Non-standard words in the intent expression are obtained from the intent expression parsing; Obtain the standard words corresponding to the non-standard words from the preset dictionary; The non-standard words in the intent expression are replaced with the standard words to obtain the standardized intent expression; Determine a target intent expression that is consistent with the standardized intent expression from a preset intent set.
5. The method for recognizing the intent of a control command according to claim 1, characterized in that, Before determining the control intent corresponding to the target intent expression as the intent recognition result of the control command, the method further includes: Obtain the expression similarity between the target intent expression and the first preset intent expression; If the similarity of the expression is determined to be greater than a first preset threshold, the target object is obtained as the control intent preset by the first preset intent expression; The preset control intent is determined as the control intent corresponding to the target intent expression.
6. The method for recognizing the intent of a control command according to claim 1, characterized in that, After determining the control intent corresponding to the target intent expression as the intent recognition result of the control command, the method further includes: Establish a correspondence between the control commands and the intent recognition results, and store the correspondence; When the smart device receives the control command again, the intent recognition result corresponding to the control command is determined directly based on the correspondence.
7. The method for recognizing the intent of a control command according to claim 1, characterized in that, Determining a target intent expression that matches the intent expression from a preset intent set includes: Determine a second preset intent expression within the preset intent set, and determine the difference between the first length of the intent expression and the second length of the second preset intent expression; If the difference is determined to be greater than the second preset threshold, the first content word appearing for the first time in the intent expression and the second content word appearing for the first time in the target intent expression are determined; If it is determined that the part of speech of the first content word is consistent with the part of speech of the second content word, the second preset intent expression is determined as the target intent expression.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 7.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 7 through the computer program.
Citation Information
Patent Citations
Method and apparatus for identifying user intention, terminal, and computer-readable storage medium
CN109376847A
Named entity normalization method, system and related device
CN111783465A
Control instruction generation method, storage medium and electronic device
CN116224815A