Intention recognition method and device, equipment and storage medium

By using a multi-intention grammar network in the central processor CPU to match and recognize multi-intention texts, the problem of excessive processing burden on GPUs in the prior art is solved, processing efficiency is improved, and the accuracy and sequence of intent recognition are ensured.

CN119760119APending Publication Date: 2025-04-04CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411617259.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2025-04-04

AI Technical Summary

Technical Problem

The prior art requires the use of GPU when using machine learning models to identify multi-intention text, which increases the processing burden of the GPU and reduces the processing efficiency.

Method used

By matching multi-intention texts using a multi-intention grammar network, a sequence of matching successful match rules is obtained, and the control intent sequence is determined and executed in the central processor CPU to avoid using the GPU.

Benefits of technology

There is no need to use the GPU when obtaining control intentions, which reduces the processing burden of the GPU, indirectly improves the processing efficiency of the GPU, and ensures the accuracy and sequence of intention recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119760119A_ABST
    Figure CN119760119A_ABST
Patent Text Reader

Abstract

The invention relates to an intention recognition method and device, equipment and a storage medium. The method comprises the steps of obtaining a to-be-recognized multi-intention text; matching characters in the text by using a multi-intention grammar network to obtain a successfully matched matching rule sequence, the multi-intention grammar network comprising a plurality of matching rules; determining a control intention sequence corresponding to the matching rule sequence according to the matching rule sequence; according to the sequence of each control intention in the control intention sequence, operation corresponding to each control intention is executed in sequence. According to the method, the GPU does not need to be used when the control intention is obtained, the processing burden of the GPU is reduced, and the processing efficiency of the GPU is indirectly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an intent recognition method, apparatus, device and storage medium. Background Art

[0002] With the development of science and technology, intention recognition is widely used in daily life. For example, by collecting the voice of users in the vehicle, the user's intention can be identified and the vehicle can be controlled according to the intention.

[0003] In the related art, most methods are used to recognize single-intent text. When it is necessary to recognize multi-intent text, it is necessary to use the trained machine learning model to recognize the multi-intent text and obtain multiple intents.

[0004] When using machine learning models to recognize text, the image processing unit (GPU) is needed to run the machine learning model, and then use the machine learning model to calculate and process the text. In practice, the processing power of the GPU is limited, and using machine learning models to recognize text will increase the processing burden of the GPU and reduce the processing efficiency of the GPU. Summary of the invention

[0005] The present application provides an intent recognition method, apparatus, device and storage medium. The method does not need to use a GPU when obtaining a control intent, thereby reducing the processing burden of the GPU and indirectly improving the processing efficiency of the GPU.

[0006] In a first aspect, the present application provides an intention recognition method, the method comprising:

[0007] Get the multi-intent text to be recognized;

[0008] Using a multi-intention grammar network, matching the characters in the text to obtain a matching rule sequence that successfully matches, the multi-intention grammar network including multiple matching rules;

[0009] According to the matching rule sequence, determining a control intention sequence corresponding to the matching rule sequence;

[0010] According to the order of each control intention in the control intention sequence, the operation corresponding to each control intention is executed in sequence.

[0011] Optionally, the multi-intention grammar network includes at least one network unit, each network unit is connected in series, and the multi-intention grammar network is used to match the characters in the text to obtain a matching rule sequence that successfully matches, including:

[0012] Inputting the text into a first network unit in a multi-intention grammar network, so as to use the first network unit as a current network unit to perform matching processing on the text;

[0013] When the last successfully matched node is the root node of the current network unit, jump out of the multi-intention grammar network, obtain the successfully matched target matching rules and the sequence identifier corresponding to each target matching rule in the matching process, sort the target matching rules according to the sequence identifier corresponding to each target matching rule, and obtain a successfully matched matching rule sequence;

[0014] When the last successfully matched node is not the root node of the current network unit, inputting the text into the next network unit of the current network unit, so as to continue matching the text with the next network unit as the current network unit;

[0015] The root node is a node in the last layer of the network unit.

[0016] Optionally, each network unit includes a multi-layer structure, each layer of the structure includes at least one node, each node is loaded with a matching rule or other rules, the other rules are used to identify conjunctions or auxiliary words, and the inputting the text into the first network unit in the multi-intention grammar network to match the text using the current network unit includes:

[0017] Input the text into the first layer of the current network unit, so as to perform matching processing on the text by taking the first layer as the current layer;

[0018] When there is a successfully matched node in the current layer, and the rule corresponding to the node is a matching rule, the matching rule is determined as a target matching rule, and a sequence identifier is marked for the target matching rule, and a corresponding operation is performed according to whether the node is a root node;

[0019] When there is a successfully matched node in the current layer, and the rule corresponding to the node is not a matching rule, performing a corresponding operation according to whether the node is a root node;

[0020] When there is no successfully matched node in the current layer, it is determined that the last successfully matched node is not the root node of the current network unit.

[0021] Optionally, performing a corresponding operation according to whether the node is a root node includes:

[0022] When the node is a root node, determining the last successfully matched node as the root node of the current network unit;

[0023] When the node is not a root node, detection is performed based on nodes of a next layer of the current layer.

[0024] Optionally, the detecting based on the node of the next layer of the current layer includes:

[0025] Obtain the vocabulary used when the node is successfully matched;

[0026] In the text, determining a reference text following the vocabulary;

[0027] Using all nodes of the next layer, the reference text is matched.

[0028] Optionally, the matching rule is an extended Backus-Naur Form (ABNF) rule, the ABNF rule includes an action sub-rule and an entity sub-rule, and the method further includes:

[0029] Obtain a preset abnf rule and at least one multi-intent recognition sentence pattern;

[0030] For each multi-intent recognition sentence pattern, determine an abnf rule statement corresponding to the multi-intent recognition sentence pattern according to the multi-intent recognition sentence pattern, the action sub-rule, and the entity sub-rule;

[0031] Use the preset abnf tool to process each abnf rule statement to obtain the network unit corresponding to each abnf rule statement;

[0032] According to the preset order, the network units corresponding to each abnf rule statement are connected in series to obtain a multi-intention grammar network.

[0033] Optionally, determining, according to the matching rule sequence, a control intention sequence corresponding to the matching rule sequence includes:

[0034] Determine the name of each matching rule in the matching rule sequence;

[0035] According to each name and the correspondence between the preset name and the control intent, determine the control intent corresponding to each name;

[0036] According to the order of the matching rules corresponding to each name in the matching rule sequence, the control intentions corresponding to each name are sorted to obtain a control intention sequence corresponding to the matching rule sequence.

[0037] In a second aspect, the present application provides an intention recognition device, the device comprising:

[0038] An acquisition unit, used for acquiring a multi-intent text to be recognized;

[0039] A matching unit, used to match the characters in the text using a multi-intention grammar network to obtain a matching rule sequence of successful matches, wherein the multi-intention grammar network includes a plurality of matching rules;

[0040] A determination unit, configured to determine, according to the matching rule sequence, a control intention sequence corresponding to the matching rule sequence;

[0041] The execution unit is used to execute the operation corresponding to each control intention in sequence according to the order of each control intention in the control intention sequence.

[0042] Optionally, the multi-intention grammar network includes at least one network unit, each network unit is connected in series, and the matching unit is used to:

[0043] Inputting the text into a first network unit in a multi-intention grammar network, so as to use the first network unit as a current network unit to perform matching processing on the text;

[0044] When the last successfully matched node is the root node of the current network unit, jump out of the multi-intention grammar network, obtain the successfully matched target matching rules and the sequence identifier corresponding to each target matching rule in the matching process, sort the target matching rules according to the sequence identifier corresponding to each target matching rule, and obtain a successfully matched matching rule sequence;

[0045] When the last successfully matched node is not the root node of the current network unit, inputting the text into the next network unit of the current network unit, so as to continue matching the text with the next network unit as the current network unit;

[0046] The root node is a node in the last layer of the network unit.

[0047] Optionally, each network unit includes a multi-layer structure, each layer of the structure includes at least one node, each node is loaded with a matching rule or other rules, the other rules are used to identify conjunctions or auxiliary words, and the matching unit is used to:

[0048] Input the text into the first layer of the current network unit, so as to perform matching processing on the text by taking the first layer as the current layer;

[0049] When there is a successfully matched node in the current layer, and the rule corresponding to the node is a matching rule, the matching rule is determined as a target matching rule, and a sequence identifier is marked for the target matching rule, and a corresponding operation is performed according to whether the node is a root node;

[0050] When there is a successfully matched node in the current layer, and the rule corresponding to the node is not a matching rule, performing a corresponding operation according to whether the node is a root node;

[0051] When there is no successfully matched node in the current layer, it is determined that the last successfully matched node is not the root node of the current network unit.

[0052] Optionally, the matching unit is used to:

[0053] When the node is a root node, determining the last successfully matched node as the root node of the current network unit;

[0054] When the node is not a root node, detection is performed based on nodes of a next layer of the current layer.

[0055] Optionally, the matching unit is used to:

[0056] Obtain the vocabulary used when the node is successfully matched;

[0057] In the text, determining a reference text following the vocabulary;

[0058] Using all nodes of the next layer, the reference text is matched.

[0059] Optionally, the matching rule is an extended Backus-Naur form (ABNF) rule, the ABNF rule includes an action sub-rule and an entity sub-rule, and the device further includes a network generation unit, the network generation unit is used to:

[0060] Obtain a preset abnf rule and at least one multi-intent recognition sentence pattern;

[0061] For each multi-intent recognition sentence pattern, determine an abnf rule statement corresponding to the multi-intent recognition sentence pattern according to the multi-intent recognition sentence pattern, the action sub-rule, and the entity sub-rule;

[0062] Use the preset abnf tool to process each abnf rule statement to obtain the network unit corresponding to each abnf rule statement;

[0063] According to the preset order, the network units corresponding to each abnf rule statement are connected in series to obtain a multi-intention grammar network.

[0064] Optionally, the determining unit is used to:

[0065] Determine the name of each matching rule in the matching rule sequence;

[0066] According to each name and the correspondence between the preset name and the control intent, determine the control intent corresponding to each name;

[0067] According to the order of the matching rules corresponding to each name in the matching rule sequence, the control intentions corresponding to each name are sorted to obtain a control intention sequence corresponding to the matching rule sequence.

[0068] In a third aspect, the present application provides an intent recognition device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; at least one memory connected to the at least one bus, wherein the processor is configured to:

[0069] Get the multi-intent text to be recognized;

[0070] Using a multi-intention grammar network, matching the characters in the text to obtain a matching rule sequence that successfully matches, the multi-intention grammar network including multiple matching rules;

[0071] According to the matching rule sequence, determining a control intention sequence corresponding to the matching rule sequence;

[0072] According to the order of each control intention in the control intention sequence, the operation corresponding to each control intention is executed in sequence.

[0073] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and the computer program implements the above-mentioned intent recognition method when executed by a processor.

[0074] The above technical solution provided by the embodiment of the present application has the following advantages over the prior art: In the embodiment of the present application, a multi-intention text to be identified is obtained; a multi-intention grammar network is used to match the text to obtain a matching rule sequence that successfully matches, and the multi-intention grammar network includes multiple matching rules; according to the matching rule sequence, a control intention sequence corresponding to the matching rule sequence is determined; according to the order of each control intention in the control intention sequence, the operation corresponding to each control intention is executed in sequence. Since the present application only needs to match the text, and the matching process is performed in the central processing unit CPU, the present application does not need to use the GPU when obtaining the control intention, which reduces the processing burden of the GPU and indirectly improves the processing efficiency of the GPU. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0076] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0077] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0078] Figure 1 A flowchart of an intent recognition method provided in an embodiment of the present application;

[0079] Figure 2 A schematic diagram of the structure of a multi-intention grammar network provided in an embodiment of the present application;

[0080] Figure 3 A flowchart of a matching rule sequence determination method provided in an embodiment of the present application;

[0081] Figure 4 A flowchart of another network unit processing method provided in an embodiment of the present application;

[0082] Figure 5 A schematic diagram of the structure of another multi-intention grammar network provided in an embodiment of the present application;

[0083] Figure 6 A flowchart of a method for generating a multi-intention grammar network provided in an embodiment of the present application;

[0084] Figure 7 A flowchart of another control intention sequence determination method provided in an embodiment of the present application;

[0085] Figure 8 A schematic diagram of a flow chart of an intention recognition device provided in an embodiment of the present application;

[0086] Fig. 9 A schematic diagram of an intent recognition device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0087] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0088] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0089] In practice, machine learning models are often used to identify multi-intent texts. When using a machine learning model to identify text, an image processing unit (GPU) is required to run the machine learning model, and then use the machine learning model to perform computational processing on the text. In practice, however, the processing power of a GPU is limited, and using a machine learning model to identify text will increase the processing burden of the GPU and reduce the processing efficiency of the GPU. Therefore, an embodiment of the present application provides an intent recognition method that does not require the use of a GPU when obtaining a control intent, thereby reducing the processing burden of the GPU and indirectly improving the processing efficiency of the GPU. Figure 1 As shown, the specific steps include:

[0090] Step 101: Obtain multi-intent text to be recognized.

[0091] Before executing this step, the application scenario of the present application is briefly introduced: a sound collection device is set in the vehicle, and the device will collect the sound in the vehicle. When the sound collection device collects the sound, the sound collection device can send the collected sound to the vehicle control system, and the vehicle control system can convert the sound into text, and then identify the intention in the text, and perform corresponding operations based on the intention. The text involved in the above process can include only one intention or multiple intentions. Of course, the embodiments of the present application can also be applied to other scenarios that require the identification of multiple intentions, which is not limited here.

[0092] Afterwards, when multi-intent text needs to be recognized, the multi-intent text to be recognized is obtained.

[0093] Step 102, using a multi-intention grammar network, matches the characters in the text to obtain a matching rule sequence that successfully matches.

[0094] Among them, the multi-intention grammar network includes multiple matching rules.

[0095] In this step, the characters in the text are input into the multi-intention grammar network to obtain a sequence of matching rules that are successfully matched.

[0096] Step 103: Determine a control intention sequence corresponding to the matching rule sequence according to the matching rule sequence.

[0097] In this step, according to each matching rule in the matching rule sequence, the control intention corresponding to each matching rule is determined, and according to the order of the corresponding matching rules in the matching rule sequence, the control intentions are sorted to obtain a control intention sequence.

[0098] For example, the matching rule sequence is [matching rule A, matching rule B, matching rule C], where the control intention corresponding to matching rule A is control intention A, the control intention corresponding to matching rule B is control intention B, and the control intention corresponding to matching rule C is control intention C. According to the order of the matching rules in the matching rule sequence, the corresponding control intentions are sorted, and the obtained control intention sequence is [control intention A, control intention B, control intention C].

[0099] Step 104 , executing the operation corresponding to each control intention in sequence according to the order of each control intention in the control intention sequence.

[0100] For example, the control intention sequence is [control intention A, control intention B, control intention C]. The operation corresponding to control intention A is executed first, then the operation corresponding to control intention B is executed, and finally the operation corresponding to control intention C is executed.

[0101] In an embodiment of the present application, a multi-intent text to be identified is obtained; a multi-intent grammar network is used to match the text to obtain a matching rule sequence that successfully matches, and the multi-intent grammar network includes multiple matching rules; according to the matching rule sequence, a control intent sequence corresponding to the matching rule sequence is determined; according to the order of each control intent in the control intent sequence, the operation corresponding to each control intent is executed in sequence. Since the present application only needs to match the text, and the matching process is performed in the central processing unit CPU, the present application does not need to use the GPU when obtaining the control intent, which reduces the processing burden of the GPU and indirectly improves the processing efficiency of the GPU.

[0102] At the same time, since the application ultimately obtains a control intention sequence, which includes the order in which each control intention appears, the application can execute the operations corresponding to each control intention in the order in which each control intention appears, avoiding the problem of executing erroneous operations due to lack of intention order, and improving the accuracy of executing operations.

[0103] In the embodiments of the present application, Figure 2 , the multi-intention grammar network includes at least one network unit, each network unit is connected in series, and then based on the multi-intention grammar network of the structure, the text in the text is matched to obtain a matching rule sequence that successfully matches. Therefore, the embodiment of the present application provides a matching rule sequence determination method, which is a further limitation of step 102, such as Figure 3 As shown, the specific steps are:

[0104] Step 301: input the text into the first network unit of the multi-intention grammar network, so as to use the first network unit as the current network unit to perform matching processing on the text.

[0105] The network unit is a node graph including multiple nodes and these nodes are connected according to a certain structure. The structure of each network unit is different.

[0106] In this step, after the text is input into the multi-intention grammar network, the text is first input into the first network unit in the multi-intention grammar network, and the network unit is used as the current network unit to perform matching processing on the text.

[0107] Step 302, when the last successfully matched node is the root node of the current network unit, jump out of the multi-intention grammar network, obtain the target matching rules that successfully match the current network unit and the sequence identifier corresponding to each target matching rule, sort the target matching rules according to the sequence identifier corresponding to each target matching rule, and obtain a successfully matched matching rule sequence.

[0108] The root node is the node in the last layer of the network unit.

[0109] In this step, when the root node of the network unit is successfully matched, it means that the text to be recognized is successfully matched with the network unit. At this time, the multi-intention grammar network is jumped out to stop using the multi-intention grammar network to match the text. When the current network unit is used to match the text, the target matching rules that successfully match the current network unit and the sequence identifier corresponding to each target matching rule are also stored. According to the sequence identifier corresponding to each target matching rule, the target matching rules are sorted to obtain a matching rule sequence that successfully matches.

[0110] For example, the target matching rules that successfully match the current network unit are matching rule A, matching rule B, and matching rule C. The sequence identifiers corresponding to each target matching rule are matching rule A as 1, matching rule B as 2, and matching rule C as 3. Therefore, the matching rule sequence is [matching rule A, matching rule B, matching rule C].

[0111] Step 303: When the last successfully matched node is not the root node of the current network unit, the text is input into the next network unit of the current network unit, so as to continue matching the text with the next network unit as the current network unit.

[0112] In this step, when the last successfully matched node is not the root node of the current network unit, it means that the text has not been successfully matched with the current network unit, and the next network needs to be used to continue matching. Therefore, the text is input into the next network unit of the current network unit to continue matching the text with the next network unit as the current network unit until the multi-intention grammar network is jumped out.

[0113] In the embodiment of the present application, the multi-intention grammar network includes at least one network unit, each network unit includes a multi-layer structure, each layer structure includes at least one node, each node is loaded with matching rules or other rules, and other rules are used to identify conjunctions or auxiliary words. Based on such a network unit, the text is matched. Therefore, the embodiment of the present application provides a network unit processing method, such as Figure 4 As shown, including:

[0114] Step 401, input text into the first layer of the current network unit, so as to use the first layer as the current layer to perform matching processing on the text.

[0115] In this step, the text is input into the first layer of the current network unit, and the text is matched based on each node of the first layer. If there is a node that successfully matches the text and the current node is not the root node, the text is continued to be matched based on each node of the second layer. Otherwise, the matching process is stopped.

[0116] Step 402, when there is a successfully matched node in the current layer, and the rule corresponding to the node is a matching rule, the matching rule is determined as a target matching rule, and a sequence identifier is marked for the target matching rule, and a corresponding operation is performed according to whether the node is a root node.

[0117] In this step, when there is a successfully matched node in the current layer and the rule corresponding to the node is a matching rule, the matching rule needs to be recorded. For easy distinction, the matching rule can be determined as a target matching rule and a sequence identifier can be marked for the target matching rule.

[0118] Afterwards, when the node is a root node, it indicates that the execution reaches the root node of a certain network unit, therefore, the last successfully matched node is determined to be the root node of the current network unit, so as to execute step 302. When the node is not a root node, the nodes of the next layer of the node are obtained, and the matching process is continued using these nodes. The specific steps are: when the node is a root node, the last successfully matched node is determined to be the root node of the current network unit; when the node is not a root node, detection is performed based on the nodes of the next layer of the current layer.

[0119] Furthermore, in the process of detecting the nodes of the next layer based on the current layer, the text is not detected from the beginning, but starting from the text that has been successfully matched, and continuing to detect the remaining part to detect whether there are other intentions in the remaining part. The specific steps are: obtain the vocabulary used when the node is successfully matched; in the text, determine the reference text after the vocabulary, and use all the nodes of the next layer to match the reference text.

[0120] Step 403: When there is a successfully matched node in the current layer, and the rule corresponding to the node is not a matching rule, a corresponding operation is performed according to whether the node is a root node.

[0121] In this step, when there is a successfully matched node in the current layer and the rule corresponding to the node is not a matching rule, it is determined whether the node is a root node. When the node is a root node, the last successfully matched node is determined to be the root node of the current network unit, so as to execute step 302; when the node is not a root node, the vocabulary used when the node is successfully matched is obtained, and in the text, the reference text after the vocabulary is determined, and all nodes in the next layer are used to match the reference text.

[0122] Step 404: When there is no successfully matched node in the current layer, it is determined that the last successfully matched node is not the root node of the current network unit.

[0123] Assume that the text to be recognized is "I want to turn on the air conditioner and windows". Figure 5The multi-intention grammar network shown in the figure inputs the text into the first layer of network unit A. The nodes of the first layer are ac_open node, ac_close node, ac_set node, ac_add node and ac_sub node. The rules corresponding to these nodes are used to match the text. In the process of using the nodes of the first layer to match the text, if "open" matches the ac_open node, the rules corresponding to the ac_open node are stored and a sequence identifier is assigned to it. Since this node is not the root node, the device node is continued to be used to match the text "air conditioning and windows" until it successfully matches the last device node, that is, it successfully matches the root node, and then jumps out of the multi-intention grammar network. If "open" does not match the ac_open node, jump out of network unit A and input the text "I want to open the air conditioning and windows" into network unit B for matching.

[0124] Furthermore, when the match is successful, all the successfully matched texts can be obtained, and the number of words in these texts can be counted, and the difference between the number of words and the total number of words in the text can be calculated. When the difference is less than the preset value, the match is determined to be successful, and when the difference is greater than the preset value, the match is determined to have failed.

[0125] The preset value is set based on the experience of the technicians, and is usually between 1 and 5. The larger the preset value, the higher the matching flexibility, but the accuracy will be relatively weaker, because in actual situations, the user input may contain some auxiliary words or intonations, which are not helpful for semantic understanding and can be appropriately excluded from matching.

[0126] The matching rule in the embodiment of the present application is an extended Backus-Naur form abnf rule, which includes an action sub-rule and an entity sub-rule corresponding to each action intent, so as to generate a multi-intent grammar network based on the abnf rule, wherein the action sub-rule is used to identify the action in the text, and the entity sub-rule is used to identify the entity in the text. Therefore, the embodiment of the present application provides a method for generating a multi-intent grammar network, such as Figure 6 As shown, including:

[0127] Step 601, obtaining a preset abnf rule and at least one multi-intent recognition sentence pattern.

[0128] Among them, the multi-intent recognition sentence pattern includes at least action elements and entity elements. The action elements are used to indicate the actions to be performed, and the entity elements are used to indicate the entities that perform the corresponding actions, for example, the air conditioner that performs the opening operation and the car window that performs the opening operation. The extended Backus-Nauer Form (ABNF) is a metalanguage based on the Backus-Nauer Form (BNF), but it has its own grammar and derivation rules. The primitive principle of ABNF is a formal system that describes a language as a two-way communication protocol. The ABNF rules involved in this application include action sub-rules corresponding to each action intent. Taking vehicle control as an example, this application divides the action intent into five categories: open, close, set, add, and sub, and writes corresponding sub-rules for each category. For example: the sub-rule corresponding to the open class is ac_open = @^(?<!((don't|don't|leave(want|can)?)hit?))(activate|activate|exit to|jump to|open|check|check|show|look|open|open|look|start|click|use|enter|enable|call out|adjust to|select|jump to|move to|adjust to|change to|open|back|use|look)|(^((don't|don't?)turn(close|off)?))@. Use ac_list to represent the action sub-rule corresponding to each action intent, specifically ac_list = ac_open|ac_close|ac_set|ac_add|ac_sub. The entity sub-rules involved in this application are used to identify various entities. Taking vehicle control as an example, the entity sub-rule device = (air conditioning|seat|window|music).

[0129] In this step, the technician writes ABNF rules that cover most action words and entity words as much as possible and multi-intent recognition sentences that cover most sentences based on real life, so that this application can recognize all multi-intent texts. When this step needs to be performed, obtain the pre-written ABNF rules and at least one multi-intent recognition sentence.

[0130] For example, the following basic sentence patterns are usually included in the summary of multi-intent statements in real life: action entity1 (and|and) entity2, entity1 (and|and) entity2action, and action1 entity1 (again|at the same time) action2 entity2 action3entity3. Among them, action, action1, action2 and action3 represent action elements, and entity1, entity2 and entity3 represent entity elements. The above basic sentence patterns can be directly determined as multi-intent recognition sentence patterns, or auxiliary words can be added to these basic sentence patterns to obtain multi-intent recognition sentence patterns, for example, assistant_worddaction entity1 (and|and) entity2. Among them, assistant represents an auxiliary word element.

[0131] Step 602: For each multi-intent recognition sentence pattern, determine the abnf rule statement corresponding to the multi-intent recognition sentence pattern according to the multi-intent recognition sentence pattern, the action sub-rule and the entity sub-rule.

[0132] In this step, for each multi-intent recognition sentence pattern, the action sub-rule in the abnf rule replaces the action element in the multi-intent recognition sentence pattern, and the entity sub-rule replaces the entity element in the multi-intent recognition sentence pattern. When there is no auxiliary word element in the multi-intent sentence pattern, the abnf rule statement corresponding to the multi-intent recognition sentence pattern can be directly obtained. When there is an auxiliary word element in the multi-intent sentence pattern, the preset auxiliary word recognition rule is used to replace the auxiliary word element to obtain the abnf rule statement corresponding to the multi-intent recognition sentence pattern.

[0133] For example, the multi-intent recognition sentence is action entity1 (and | and) entity2, and the abnf rule statement corresponding to the intent recognition sentence is generated as follows

[0134] rule_multiple_intent_1 = ac_list device (and | and) device. The multi-intent recognition sentence is entity1 (and | and) entity2 action, and the corresponding abnf rule statement generated for the intent recognition sentence is rule_multiple_intent_2 = device (and | and) device ac_list. The multi-intent recognition sentence is action1entity1 (again | at the same time) action2 entity2 action3 entity3, and the corresponding abnf rule statement generated for the intent recognition sentence is rule_multiple_intent_3 = ac_list device (again | at the same time) ac_list device ac_list device.

[0135] Among them, rule_multiple_intent_3 represents the abnf rule statement, ac_list represents the action sub-rule corresponding to each action intent, and device represents the entity sub-rule.

[0136] Step 603: Use a preset abnf tool to process each abnf rule statement to obtain a network unit corresponding to each abnf rule statement.

[0137] The abnf tool is a tool in the prior art for generating data structures based on abnf rule statements.

[0138] In this step, a preset abnf tool is used to process each abnf rule statement to obtain a data structure corresponding to each abnf rule statement, which is determined as a network unit corresponding to each abnf rule statement.

[0139] Step 604: connect the network units corresponding to each abnf rule statement in series according to a preset order to obtain a multi-intention grammar network.

[0140] Assume that Figure 5 As shown, rule_multiple_intent_1 = ac_list device (and|and) device, rule_multiple_intent_2 = device (and|and) device ac_list, rule_multiple_intent_3 = ac_list device (and|and) ac_list device ac_list device, where,

[0141] ac_list=ac_open|ac_close|ac_set|ac_add|ac_sub.

[0142] rule_multiple_intent_1 corresponds to network element A, rule_multiple_intent_2 corresponds to network element B, and

[0143] rule_multiple_intent_3 corresponds to network unit C. The preset order is network unit A, network unit B, network unit C. Therefore, network unit A, network unit B and network unit C are connected in series in sequence to obtain a multi-intent grammar network.

[0144] It should be noted that, since the usage frequency of each sentence pattern is different, the usage frequency of the network unit of the sentence pattern is also different. Therefore, the network unit with a higher usage frequency can be set at the front position, and the network unit with a lower usage frequency can be set at the back position. In summary, the steps of obtaining the preset order in this step are: counting the usage frequency of each sentence pattern in real life, and setting the network unit corresponding to each sentence pattern according to the usage frequency of each sentence pattern to obtain the preset order.

[0145] The embodiment of the present application further defines the control intention sequence corresponding to the matching rule sequence according to the matching rule sequence. Therefore, the embodiment of the present application provides a control intention sequence determination method. Figure 7 As shown, including:

[0146] Step 701, determining the name of each matching rule in the matching rule sequence.

[0147] In this step, the matching rule also has its corresponding name. Therefore, for each matching rule in the matching rule sequence, the name of each matching rule is obtained.

[0148] Step 702: Determine the control intent corresponding to each name according to each name and the preset correspondence between the name and the control intent.

[0149] In this step, the correspondence between the name of the matching rule and the control intent is preset, as shown in Table 1. Therefore, when each name is obtained, the control intent corresponding to each name is determined according to each name and the preset correspondence between the name and the control intent.

[0150] Table 1

[0151] Rule Name intention ac_open open ac_close close ac_set set ac_add add ac_sub sub

[0152] Step 703 , sorting the control intentions corresponding to each name according to the order of the matching rules corresponding to each name in the matching rule sequence, to obtain a control intention sequence corresponding to the matching rule sequence.

[0153] For example, the matching rule sequence is [matching rule A, matching rule B, matching rule C], where the name of matching rule A is name A, the name of matching rule B is name B, the name of matching rule C is name C, name A corresponds to control intention A, name B corresponds to control intention B, and name C corresponds to control intention C. According to the order of the matching rules corresponding to each name in the matching rule sequence, the control intention corresponding to each name is sorted, and the control intention sequence corresponding to the matching rule sequence is obtained as [control intention A, control intention B, control intention C].

[0154] like Figure 8 As shown, an embodiment of the present application provides an intention recognition device, which corresponds to the method embodiment and specifically includes:

[0155] An acquisition unit 801 is used to acquire a multi-intent text to be identified;

[0156] A matching unit 802 is used to match the characters in the text using a multi-intention grammar network to obtain a matching rule sequence that is successfully matched, wherein the multi-intention grammar network includes multiple matching rules;

[0157] A determination unit 803, configured to determine, according to the matching rule sequence, a control intention sequence corresponding to the matching rule sequence;

[0158] The execution unit 804 is used to execute the operation corresponding to each control intention in sequence according to the order of each control intention in the control intention sequence.

[0159] Optionally, the multi-intention grammar network includes at least one network unit, each network unit is connected in series, and the matching unit 802 is used to:

[0160] Inputting the text into a first network unit in a multi-intention grammar network, so as to use the first network unit as a current network unit to perform matching processing on the text;

[0161] When the last successfully matched node is the root node of the current network unit, jump out of the multi-intention grammar network, obtain the successfully matched target matching rules and the sequence identifier corresponding to each target matching rule in the matching process, sort the target matching rules according to the sequence identifier corresponding to each target matching rule, and obtain a successfully matched matching rule sequence;

[0162] When the last successfully matched node is not the root node of the current network unit, inputting the text into the next network unit of the current network unit, so as to continue matching the text with the next network unit as the current network unit;

[0163] The root node is a node in the last layer of the network unit.

[0164] Optionally, each network unit includes a multi-layer structure, each layer of the structure includes at least one node, each node is loaded with a matching rule or other rules, the other rules are used to identify conjunctions or auxiliary words, and the matching unit 802 is used to:

[0165] Input the text into the first layer of the current network unit, so as to perform matching processing on the text by taking the first layer as the current layer;

[0166] When there is a successfully matched node in the current layer, and the rule corresponding to the node is a matching rule, the matching rule is determined as a target matching rule, and a sequence identifier is marked for the target matching rule, and a corresponding operation is performed according to whether the node is a root node;

[0167] When there is a successfully matched node in the current layer, and the rule corresponding to the node is not a matching rule, performing a corresponding operation according to whether the node is a root node;

[0168] When there is no successfully matched node in the current layer, it is determined that the last successfully matched node is not the root node of the current network unit.

[0169] Optionally, the matching unit 802 is configured to:

[0170] When the node is a root node, determining the last successfully matched node as the root node of the current network unit;

[0171] When the node is not a root node, detection is performed based on nodes of a next layer of the current layer.

[0172] Optionally, the matching unit 802 is configured to:

[0173] Obtain the vocabulary used when the node is successfully matched;

[0174] In the text, determining a reference text following the vocabulary;

[0175] Using all nodes of the next layer, the reference text is matched.

[0176] Optionally, the matching rule is an extended Backus-Naur form (ABNF) rule, the ABNF rule includes an action sub-rule and an entity sub-rule, and the apparatus further includes a network generation unit 805, the network generation unit 805 is used to:

[0177] Obtain a preset abnf rule and at least one multi-intent recognition sentence pattern;

[0178] For each multi-intent recognition sentence pattern, determine an abnf rule statement corresponding to the multi-intent recognition sentence pattern according to the multi-intent recognition sentence pattern, the action sub-rule, and the entity sub-rule;

[0179] Use the preset abnf tool to process each abnf rule statement to obtain the network unit corresponding to each abnf rule statement;

[0180] According to the preset order, the network units corresponding to each abnf rule statement are connected in series to obtain a multi-intention grammar network.

[0181] Optionally, the determining unit 803 is configured to:

[0182] Determine the name of each matching rule in the matching rule sequence;

[0183] According to each name and the correspondence between the preset name and the control intent, determine the control intent corresponding to each name;

[0184] According to the order of the matching rules corresponding to each name in the matching rule sequence, the control intentions corresponding to each name are sorted to obtain a control intention sequence corresponding to the matching rule sequence.

[0185] like Fig. 9 As shown, the embodiment of the present application provides an intention recognition device, including a processor 901, a communication interface 902, a memory 903 and a communication bus 904, wherein the processor 901, the communication interface 902, and the memory 903 communicate with each other through the communication bus 904.

[0186] Memory 903, used for storing computer programs;

[0187] In one embodiment of the present application, the processor 901 is configured to implement the intention recognition method provided by any one of the aforementioned method embodiments when executing the program stored in the memory 903, including:

[0188] Get the multi-intent text to be recognized;

[0189] Using a multi-intention grammar network, matching the characters in the text to obtain a matching rule sequence that successfully matches, the multi-intention grammar network including multiple matching rules;

[0190] According to the matching rule sequence, determining a control intention sequence corresponding to the matching rule sequence;

[0191] According to the order of each control intention in the control intention sequence, the operation corresponding to each control intention is executed in sequence.

[0192] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps performed by the intent recognition method provided in any of the aforementioned method embodiments are implemented.

[0193] The device embodiments described above are merely illustrative, wherein 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 modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0194] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0195] It should be understood that the terms used herein are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used herein may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0196] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A method for intention recognition, characterized in that: The method comprises: Get the multi-intent text to be recognized; Using a multi-intention grammar network, matching the characters in the text to obtain a matching rule sequence that successfully matches, the multi-intention grammar network including a plurality of matching rules; According to the matching rule sequence, determining a control intention sequence corresponding to the matching rule sequence; According to the order of each control intention in the control intention sequence, the operation corresponding to each control intention is executed in sequence.

2. The method according to claim 1, characterized in that: The multi-intention grammar network includes at least one network unit, each network unit is connected in series, and the multi-intention grammar network is used to match the characters in the text to obtain a matching rule sequence that successfully matches, including: Inputting the text into a first network unit in a multi-intention grammar network, so as to use the first network unit as a current network unit to perform matching processing on the text; When the last successfully matched node is the root node of the current network unit, jump out of the multi-intention grammar network, obtain the successfully matched target matching rules and the sequence identifier corresponding to each target matching rule in the matching process, sort the target matching rules according to the sequence identifier corresponding to each target matching rule, and obtain a successfully matched matching rule sequence; When the last successfully matched node is not the root node of the current network unit, inputting the text into the next network unit of the current network unit, so as to continue matching the text with the next network unit as the current network unit; The root node is a node in the last layer of the network unit.

3. The method according to claim 2, characterized in that: Each network unit includes a multi-layer structure, each layer of the structure includes at least one node, each node is loaded with a matching rule or other rules, the other rules are used to identify conjunctions or auxiliary words, and the text is input into the first network unit in the multi-intention grammar network to match the text using the current network unit, including: Input the text into the first layer of the current network unit, so as to perform matching processing on the text by taking the first layer as the current layer; When there is a successfully matched node in the current layer, and the rule corresponding to the node is a matching rule, the matching rule is determined as a target matching rule, and a sequence identifier is marked for the target matching rule, and a corresponding operation is performed according to whether the node is a root node; When there is a successfully matched node in the current layer, and the rule corresponding to the node is not a matching rule, performing a corresponding operation according to whether the node is a root node; When there is no successfully matched node in the current layer, it is determined that the last successfully matched node is not the root node of the current network unit.

4. The method according to claim 3, characterized in that: The performing corresponding operations according to whether the node is a root node includes: When the node is a root node, determining the last successfully matched node as the root node of the current network unit; When the node is not a root node, detection is performed based on nodes of a next layer of the current layer.

5. The method according to claim 3, characterized in that: The detecting of the node of the next layer based on the current layer includes: Obtain the vocabulary used when the node is successfully matched; In the text, determining a reference text following the vocabulary; Using all nodes of the next layer, the reference text is matched.

6. The method according to claim 2, characterized in that: The matching rule is an extended Backus-Naur form (ABNF) rule, wherein the ABNF rule includes an action sub-rule and an entity sub-rule. The method further includes: Obtain a preset abnf rule and at least one multi-intent recognition sentence pattern; For each multi-intent recognition sentence pattern, determine an abnf rule statement corresponding to the multi-intent recognition sentence pattern according to the multi-intent recognition sentence pattern, the action sub-rule, and the entity sub-rule; Use the preset abnf tool to process each abnf rule statement to obtain the network unit corresponding to each abnf rule statement; According to the preset order, the network units corresponding to each abnf rule statement are connected in series to obtain a multi-intention grammar network.

7. The method according to claim 1, characterized in that: The determining, according to the matching rule sequence, a control intention sequence corresponding to the matching rule sequence includes: Determine the name of each matching rule in the matching rule sequence; According to each name and the correspondence between the preset name and the control intent, determine the control intent corresponding to each name; According to the order of the matching rules corresponding to each name in the matching rule sequence, the control intentions corresponding to each name are sorted to obtain a control intention sequence corresponding to the matching rule sequence.

8. An intention recognition device, characterized in that: The device comprises: An acquisition unit, used for acquiring a multi-intent text to be recognized; A matching unit, configured to match characters in the text using a multi-intention grammar network to obtain a matching rule sequence that successfully matches, wherein the multi-intention grammar network includes a plurality of matching rules; A determination unit, configured to determine, according to the matching rule sequence, a control intention sequence corresponding to the matching rule sequence; The execution unit is used to execute the operation corresponding to each control intention in sequence according to the order of each control intention in the control intention sequence.

9. An intention recognition device, characterized in that: include: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; at least one memory connected to the at least one bus, wherein the processor is configured to: Get the multi-intent text to be recognized; Using a multi-intention grammar network, matching the characters in the text to obtain a matching rule sequence that successfully matches, the multi-intention grammar network including multiple matching rules; According to the matching rule sequence, determining a control intention sequence corresponding to the matching rule sequence; According to the order of each control intention in the control intention sequence, the operation corresponding to each control intention is executed in sequence.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the intention recognition method described in any one of claims 1 to 7 is implemented.