Method and device for identifying intention of statement, electronic equipment and program product

By selecting an appropriate sentence pattern based on the number of intents of the sentences to be identified for sentence processing, the problem of low accuracy in intention recognition in the prior art is solved, and more efficient sentence intention recognition is achieved.

CN119830892AActive Publication Date: 2025-04-15NIO TECH ANHUI CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411902656.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-04-15
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

Existing statement intention recognition techniques are poor in processing statements containing multiple intentions, resulting in a low accuracy of intention recognition.

Method used

By obtaining the number of intents of the statement to be identified, selecting the corresponding sentence model for sentence processing, and then obtaining the sub-statement and then performing intent recognition. Specifically, when the number of intentions is greater than or equal to a certain threshold, the first sentence model is used; otherwise, the second sentence model is used.

Benefits of technology

By selecting the appropriate sentence pattern to process the sentence to be identified, the effect of sentence processing is improved, thereby improving the accuracy of sentence intention recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830892A_ABST
    Figure CN119830892A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of artificial intelligence, and provides a statement intention recognition method and device, electronic equipment and a program product. The method comprises the steps of obtaining a to-be-recognized statement; determining the intention number of the to-be-recognized statement; according to the intention number of the to-be-recognized statement, performing sentence segmentation processing on the to-be-recognized statement by adopting a sentence segmentation model corresponding to the intention number to obtain one or more to-be-recognized sub-statements corresponding to the to-be-recognized statement; and determining a first intention recognition result of the to-be-recognized statement according to the sub-intention recognition result of each to-be-recognized sub-statement in the one or more to-be-recognized sub-statements. Through the method, the proper sentence segmentation model can be selected according to the intention number of the to-be-recognized statement to perform sentence segmentation processing on the to-be-recognized statement, the sentence segmentation processing effect is improved, and then the intention recognition accuracy of the statement is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence technology, and in particular, relates to a method, device, electronic device and program product for identifying the intent of a sentence. Background Art

[0002] In the field of voice artificial intelligence, electronic devices usually need to first segment the sentence to be recognized input by the user through a sentence segmentation model to obtain several sub-sentences to be recognized, and then execute the intentions included in each sub-sentence to be recognized separately.

[0003] Current sentence segmentation models are usually only good at sentence segmentation for sentences to be recognized that include a specific number of intents. For example, some models are good at sentence segmentation for sentences to be recognized that include only one intent, but are poor at sentence segmentation for sentences to be recognized that include multiple intents; other models are poor at sentence segmentation for sentences to be recognized that include only one intent, but are good at sentence segmentation for sentences to be recognized that include multiple intents.

[0004] However, current electronic devices usually only use one sentence segmentation model to segment sentences to be recognized. When the sentence segmentation model performs sentence segmentation on sentences to be recognized that it is not good at, the sentence segmentation effect will be poor, which ultimately leads to a low accuracy rate in sentence intent recognition. Summary of the invention

[0005] In view of this, the embodiments of the present application provide a method, device, electronic device and program product for identifying the intent of a sentence to solve the technical problem of low accuracy in existing sentence intent identification.

[0006] In a first aspect, an embodiment of the present application provides a method for identifying the intent of a sentence, including:

[0007] Get the sentence to be recognized;

[0008] Determining the number of intents of the sentence to be identified;

[0009] According to the number of intentions of the sentence to be recognized, using a sentence model corresponding to the number of intentions to perform sentence processing on the sentence to be recognized, so as to obtain one or more sub-sentences to be recognized corresponding to the sentence to be recognized;

[0010] Determine a first intent recognition result of the sentence to be recognized based on a sub-intention recognition result of each of the sub-sentences to be recognized in one or more of the sub-sentences to be recognized.

[0011] Optionally, according to the number of intentions of the sentence to be recognized, a sentence model corresponding to the number of intentions is used to perform sentence processing on the sentence to be recognized to obtain one or more sub-sentences to be recognized corresponding to the sentence to be recognized, including:

[0012] If the number of intentions is greater than or equal to a first intention number threshold, the sentence to be recognized is processed by a first sentence model to obtain a plurality of sub-sentences to be recognized corresponding to the sentence to be recognized;

[0013] If the number of intentions is less than the first intention number threshold, the sentence to be recognized is segmented by the second sentence model to obtain multiple sub-sentences to be recognized corresponding to the sentence to be recognized; the difference between the first sentence model and the second sentence model is that: when the number of intentions is greater than or equal to the first intention number threshold, the first parameter value of the first evaluation parameter of the first sentence model is higher than the second parameter value of the first evaluation parameter of the second sentence model; when the number of intentions is less than the first intention number threshold, the first parameter value is lower than the second parameter value.

[0014] Optionally, the first intention quantity threshold is determined by:

[0015] Get one or more test statements;

[0016] determining one or more different second intent quantity thresholds;

[0017] For each of the second intention quantity thresholds, determine a third parameter value of the second evaluation parameter corresponding to the second intention quantity threshold, and a fourth parameter value of the second evaluation parameter, wherein the third parameter value is determined by performing sentence processing on each of the test sentences using the second intention quantity threshold by the first sentence model, and the fourth parameter value is determined by performing sentence processing on each of the test sentences using the second intention quantity threshold by the second sentence model;

[0018] The first intention quantity threshold is determined according to the third parameter value and the fourth parameter value corresponding to each of the second intention quantity thresholds.

[0019] Optionally, determining the number of intents of the sentence to be identified includes:

[0020] Determining keyword information of the sentence to be recognized;

[0021] The number of intentions is determined through a second sentence model according to the sentence to be identified and the keyword information.

[0022] Optionally, determining the first intention recognition result of the sentence to be recognized according to the sub-intention recognition result of each of the sub-sentences to be recognized in the plurality of sub-sentences to be recognized includes:

[0023] Performing splicing processing on each of the sub-intention recognition results to obtain an intention splicing result;

[0024] The intent splicing result is post-processed to obtain the first intent recognition result; the post-processing method includes at least one or more of the following: preset intent deletion processing, slot inheritance processing, intent deduplication processing and intent quantity correction processing.

[0025] Optionally, after determining the first intention recognition result of the sentence to be recognized according to the sub-intention recognition result of each of the sub-sentences to be recognized in the plurality of sub-sentences to be recognized, the method further includes:

[0026] Performing intent recognition processing on the sentence to be recognized through a target recognition model to obtain a second intent recognition result of the sentence to be recognized; the target recognition model is a recognition model used to determine the sub-intent recognition result of each sub-sentence to be recognized;

[0027] A target intent recognition result of the sentence to be recognized is determined according to the first intent recognition result and the second intent recognition result.

[0028] Optionally, determining a target intent recognition result of the sentence to be recognized according to the first intent recognition result and the second intent recognition result includes:

[0029] Determining a first weight and a first confidence level of the first intention recognition result;

[0030] Determining a second weight and a second confidence level of the second intent recognition result;

[0031] The target intent recognition result is determined according to the first intent recognition result, the second intent recognition result, the first weight, the first confidence, the second weight and the second confidence.

[0032] In a second aspect, an embodiment of the present application provides a sentence intention recognition device, comprising:

[0033] A sentence acquisition unit, used for acquiring a sentence to be recognized;

[0034] An intention quantity determination unit, used to determine the intention quantity of the sentence to be recognized;

[0035] A sentence segmentation unit, configured to perform sentence segmentation processing on the sentence to be identified according to the number of intentions of the sentence to be identified, using a sentence segmentation model corresponding to the number of intentions, to obtain one or more sub-sentences to be identified corresponding to the sentence to be identified;

[0036] The first intention recognition unit is used to determine the first intention recognition result of the sentence to be recognized based on the sub-intention recognition result of each of the sub-sentences to be recognized in one or more sub-sentences to be recognized.

[0037] In a third aspect, an embodiment of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the processor implements each step in the method for identifying the intent of a statement as described in any one of the first aspects above.

[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, each step in the method for identifying the intent of a statement as described in any one of the first aspects above is implemented.

[0039] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes each step in the method for identifying the intent of a sentence as described in any one of the first aspects above.

[0040] The sentence intention recognition method, device, electronic device and program product provided by the embodiments of the present application have the following beneficial effects:

[0041] In the sentence intention recognition method provided in the embodiment of the present application, the sentence to be recognized is first obtained, and then the number of intentions of the sentence to be recognized is determined. Then, according to the number of intentions of the sentence to be recognized, a sentence model corresponding to the number of intentions is used to perform sentence processing on the sentence to be recognized, and one or more sub-sentences to be recognized corresponding to the sentence to be recognized are obtained. Finally, the first intention recognition result of the sentence to be recognized is determined based on the sub-intention recognition result of each sub-sentence to be recognized in the one or more sub-sentences to be recognized. Through this method, a suitable sentence model can be selected according to the number of intentions of the sentence to be recognized to perform sentence processing on the sentence to be recognized, thereby improving the effect of sentence processing and thereby improving the accuracy of sentence intention recognition. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0043] Figure 1 A flowchart of a method for identifying the intent of a sentence provided in an embodiment of the present application;

[0044] Figure 2 A schematic diagram of evaluation parameters corresponding to different model thresholds provided in an embodiment of the present application;

[0045] Figure 3 A schematic diagram of training a sentence model provided in an embodiment of the present application;

[0046] Figure 4 A flowchart of a method for identifying the intent of a sentence provided in an embodiment of the present application;

[0047] Figure 5 A schematic diagram of the structure of a device for identifying the intent of a sentence provided in an embodiment of the present application;

[0048] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0049] It should be noted that the terms used in the embodiments of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application. In the description of the embodiments of the present application, unless otherwise specified, "multiple" refers to two or more than two, and "at least one", "one or more" refers to one, two or more. The terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, it is defined that the "first" and "second" features can explicitly or implicitly include one or more of the features.

[0050] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0051] The executor of the sentence intention recognition method provided in the embodiment of the present application can be an electronic device, wherein the electronic device can include but is not limited to a sentence intention recognition device, a mobile phone, a tablet computer, a laptop computer, a desktop computer, a vehicle-mounted control device and other devices.

[0052] The sentence intention recognition method provided in the embodiment of the present application can be applied to any application scenario that requires sentence intention recognition. Exemplarily, the sentence intention recognition method provided in the embodiment of the present application can be applied to the application scenario of the smart cockpit of a vehicle, and the user can make the vehicle control device execute the various steps of the sentence intention recognition method provided in the embodiment of the present application, thereby improving the accuracy of the intention recognition of the vehicle user's sentence to be recognized.

[0053] Some sentences to be recognized include multiple intentions, for example, the sentence to be recognized "open the sunroof and heat the steering wheel" includes the two intentions of "open the sunroof" and "heat the steering wheel". Some sentences to be recognized include only one intention, for example, the sentence to be recognized "please open the passenger window" includes only the intention of "open the passenger window".

[0054] Current sentence segmentation models are usually only good at sentence segmentation for sentences to be recognized that include a specific number of intents. For example, the BERT (Bidirectional Encoder Representations from Transformers) sentence segmentation model has a good effect on sentence segmentation for sentences to be recognized that include only one intent, but a poor effect on sentence segmentation for sentences to be recognized that include multiple intents; for example, the Large Language Model (LLM) has a poor effect on sentence segmentation for sentences to be recognized that include only one intent, but a good effect on sentence segmentation for sentences to be recognized that include multiple intents. The effect of sentence segmentation can be determined based on any one or more of the following parameters: efficiency of sentence segmentation, accuracy of intent recognition after sentence segmentation, recall rate of intent recognition after sentence segmentation, etc.

[0055] Since current electronic devices usually only use one sentence segmentation model to segment sentences to be recognized, when the sentence segmentation model is not good at segmenting sentences to be recognized, the sentence segmentation effect will be poor, which will eventually lead to low accuracy of sentence intent recognition. For example, the sentence segmentation effect of the sentence "open the sunroof and heat the steering wheel" to be recognized using the BERT sentence model is poor.

[0056] Based on this, the present application embodiment provides a method for identifying the intent of a sentence. Figure 1 , Figure 1The present invention provides a flowchart of a method for identifying the intent of a sentence in an embodiment of the present invention. The method for identifying the intent of a sentence may include S101 to S104, which are described in detail as follows:

[0057] In S101, a sentence to be recognized is obtained.

[0058] In an embodiment of the present application, the electronic device may first obtain a sentence to be recognized that needs to be recognized. For example, the user may input the sentence to be recognized so that the electronic device may obtain the sentence to be recognized output by the user.

[0059] In S102 , the number of intentions of the sentence to be recognized is determined.

[0060] In an embodiment of the present application, after acquiring the sentence to be recognized, the electronic device may first determine the number of intentions of the sentence to be recognized.

[0061] In one possible implementation, the electronic device may first determine the keyword information (prompt) of the sentence to be recognized, and then may determine the number of intentions of the sentence to be recognized based on the sentence to be recognized and the keyword information through the second sentence segmentation model provided in the embodiment of the present application.

[0062] It should be noted that the sentence model provided in the embodiment of the present application may include a first sentence model and a second sentence model. The difference between the first sentence model and the second sentence model is that: when the number of intentions of the sentence to be identified is greater than or equal to the first intention number threshold, the first parameter value of the first evaluation parameter of the first sentence model is higher than the second parameter value of the first evaluation parameter of the second sentence model; when the number of intentions is less than the first intention number threshold, the first parameter value of the first evaluation parameter of the first sentence model is lower than the second parameter value of the first evaluation parameter of the second sentence model.

[0063] Among them, the first parameter value of the first evaluation parameter of the first sentence model can be: a first accuracy rate and a first recall rate of intent recognition of the sub-sentence to be recognized obtained after sentence processing by the first sentence model.

[0064] Among them, the second parameter value of the first evaluation parameter of the second sentence model can be: the second accuracy rate and the second recall rate of intent recognition of the sub-sentences to be recognized obtained after sentence processing by the second sentence model.

[0065] Exemplarily, the first sentence model provided in the embodiment of the present application may be an LLM model, and the second sentence model provided in the embodiment of the present application may be a BERT model.

[0066] In a possible implementation, the accuracy of the second sentence model in determining the number of intents of the sentence to be identified can also be improved by adjusting the model threshold of the second sentence model.

[0067] Specifically, different model thresholds can be determined first, and then the single-intent accuracy, single-intent recall, multi-intent accuracy and multi-intent recall corresponding to each different model threshold can be determined respectively. Finally, the target model threshold can be determined according to the single-intent accuracy, single-intent recall, multi-intent accuracy and multi-intent recall corresponding to each different model threshold.

[0068] See also Figure 2 , Figure 2 A schematic diagram of evaluation parameters corresponding to different model thresholds provided in the embodiment of the present application. Figure 2 As shown, the lower the model threshold of the second sentence model, the higher the multi-intent recall rate. Based on this, the model threshold of the second sentence model can be set to a smaller number to improve the accuracy of the second sentence model in determining the number of intents of the sentence to be recognized, thereby improving the accuracy of sentence intent recognition.

[0069] It should be noted that in some optional implementations, the number of intentions of the sentence to be recognized can be determined by other models besides the second sentence model. However, since this method also requires the use of an additional model for determining the number of intentions of the sentence to be recognized, the cost is increased.

[0070] In this implementation, the method of determining the number of intents of a sentence to be recognized through the second sentence model does not require the use of an additional model for determining the number of intents of a sentence to be recognized, thereby reducing the cost of sentence intent recognition.

[0071] In S103, according to the number of intentions of the sentence to be recognized, a sentence model corresponding to the number of intentions is used to perform sentence processing on the sentence to be recognized, so as to obtain one or more sub-sentences to be recognized corresponding to the sentence to be recognized.

[0072] In an embodiment of the present application, after determining the number of intentions of the sentence to be recognized, the electronic device can perform sentence processing on the sentence to be recognized based on the number of intentions of the sentence to be recognized using a sentence segmentation model corresponding to the number of intentions to obtain one or more sub-sentences to be recognized corresponding to the sentence to be recognized.

[0073] In one possible implementation, the electronic device may first determine the relationship between the number of intentions of the sentence to be recognized and a first intention number threshold, and then select a sentence segmentation model to perform sentence segmentation on the sentence to be recognized based on the relationship between the number of intentions of the sentence to be recognized and the first intention number threshold.

[0074] Exemplarily, if the electronic device determines that the number of intentions of the sentence to be recognized is greater than or equal to a first intention number threshold, the sentence to be recognized is processed by a first sentence segmentation model to obtain a plurality of sub-sentences to be recognized corresponding to the sentence to be recognized; correspondingly, if the electronic device determines that the number of intentions of the sentence to be recognized is less than the first intention number threshold, the sentence to be recognized is processed by a second sentence model to obtain a plurality of sub-sentences to be recognized corresponding to the sentence to be recognized.

[0075] Among them, examples and differences between the first sentence model and the second sentence model can be found in the embodiment corresponding to S102, and will not be repeated here.

[0076] In this implementation, the electronic device may first obtain one or more test statements, and first determine one or more different second intent quantity thresholds. The number of test statements may be as large as possible, and the number of intents in the test statements may not be completely the same. The second intent quantity threshold may include but is not limited to 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 6.5, etc.

[0077] After obtaining the test statement and one or more different second intention quantity thresholds, the electronic device can determine, for each second intention quantity threshold, a third parameter value of the second evaluation parameter corresponding to the second intention quantity threshold and a fourth parameter value of the second evaluation parameter, wherein the third parameter value is determined by using the first sentence model to perform sentence processing on each test statement using the second intention quantity threshold, and the fourth parameter value is determined by using the second sentence model to perform sentence processing on each test statement using the second intention quantity threshold.

[0078] Among them, the third parameter value of the second evaluation parameter corresponding to any second intention quantity threshold can be determined in the following way: first, the first sentence segmentation model is used to use the second intention quantity threshold to segment each test sentence to obtain a corresponding number of sub-sentences to be identified, and then intent recognition is performed on these sub-sentence pairs to be identified, and then the third accuracy and third recall of intent recognition are determined based on the intention recognition results.

[0079] Among them, the fourth parameter value of the second evaluation parameter corresponding to any second intention quantity threshold can be determined in the following way: first, the second sentence segmentation model is used to use the second intention quantity threshold to segment each test sentence to obtain a corresponding number of sub-sentences to be identified, and then intent recognition is performed on these sub-sentence pairs to be identified, and then the fourth accuracy and fourth recall of intent recognition are determined based on the intention recognition results.

[0080] The third parameter value and the fourth parameter value of the second evaluation parameter corresponding to each second intention quantity threshold can be determined in the above manner, and then the electronic device can determine the first intention quantity threshold according to the third parameter value and the fourth parameter value corresponding to each second intention quantity threshold. The specific method of determining the first intention quantity threshold according to the third parameter value and the fourth parameter value corresponding to each second intention quantity threshold can be set according to actual needs and is not limited here.

[0081] It should be noted that, in other possible implementation methods, the electronic device can also determine the sentence model to be adopted in the following way: if the number of intentions of the sentence to be recognized is less than the intention number threshold 1, sentence model 1 is adopted; if the number of intentions of the sentence to be recognized is greater than or equal to the intention number threshold 1 and less than the intention number threshold 2, sentence model 2 is adopted; if the number of intentions of the sentence to be recognized is greater than or equal to the intention number threshold 2 and less than the intention number threshold 3, sentence model 3 is adopted.

[0082] Based on this, it can be understood that the intention quantity threshold used in this application can be several, and the sentence models used in different intention intervals can also be set according to actual needs. Any scheme corresponding to the idea of ​​selecting different sentence models according to different intention intervals is within the protection scope of this application.

[0083] In S104, a first intent recognition result of a sentence to be recognized is determined according to a sub-intention recognition result of each sub-sentence to be recognized in one or more sub-sentences to be recognized.

[0084] In an embodiment of the present application, after obtaining one or more sub-sentences to be identified corresponding to the sentence to be identified, the electronic device can first determine the sub-intention recognition result of each sub-sentence to be identified, and then determine the first intention recognition result of the sentence to be identified based on the sub-intention recognition result of each sub-sentence to be identified.

[0085] In one possible implementation, after obtaining one or more sub-sentences to be identified corresponding to the sentence to be identified, the electronic device can input each sub-sentence to be identified into the target recognition model respectively to instruct the target recognition model to generate and output the sub-intention recognition results corresponding to each sub-sentence to be identified respectively according to each sub-sentence to be identified, and the electronic device can obtain the sub-intention recognition results corresponding to each sub-sentence to be identified output by the target recognition model.

[0086] In practical applications, the electronic device can input each sub-sentence to be recognized into the target recognition model in parallel to improve the efficiency of obtaining the sub-intention recognition results corresponding to each sub-sentence to be recognized, thereby improving the efficiency of sentence intent recognition.

[0087] The target recognition model can be used to generate and output the intent recognition result corresponding to the input sentence according to the input sentence. Exemplarily, the target recognition model can be a (domain-intent-slot) model.

[0088] After obtaining the sub-intention recognition results corresponding to each sub-sentence to be recognized, the electronic device can splice each sub-intention recognition result to obtain an intention splicing result. After obtaining the intention splicing result, the electronic device can post-process the intention splicing result to obtain a first intention recognition result.

[0089] Among them, the post-processing method includes at least one or more of the following: preset intent deletion processing, slot inheritance processing, intent deduplication processing and intent quantity correction processing.

[0090] The preset intention deletion process may be to delete the blacklist intention and the ignore list intention existing in the intention splicing result, wherein the blacklist intention is the intention existing in the preset blacklist, and the ignore list intention is the intention existing in the preset ignore list. For example, the blacklist intention may be the intention that may cause driving safety.

[0091] Slot inheritance processing can be an inheritance processing between multiple adjacent intents. For example, if the first intent is "turn on the air conditioner to 30 degrees" and the second intent is "adjust to 20 degrees", then these two intentions can be slot inherited so that the second intention can be adjusted to "adjust the air conditioner temperature to 20 degrees."

[0092] Intent deduplication can be used to remove duplicate intents.

[0093] The intention quantity correction processing can be used to increase or decrease the number of intentions to meet preset requirements. For example, if the number of intentions is 7 and the intention threshold is 6, the intention quantity correction processing can be performed to reduce the number of intentions to 6.

[0094] From the above, it can be seen that in the sentence intention recognition method provided in the embodiment of the present application, the sentence to be recognized is first obtained, and then the number of intentions of the sentence to be recognized is determined. Then, according to the number of intentions of the sentence to be recognized, a sentence model corresponding to the number of intentions is used to perform sentence processing on the sentence to be recognized, and one or more sub-sentences to be recognized corresponding to the sentence to be recognized are obtained. Finally, the first intention recognition result of the sentence to be recognized is determined based on the sub-intention recognition result of each sub-sentence to be recognized in the one or more sub-sentences to be recognized. Through this method, a suitable sentence model can be selected according to the number of intentions of the sentence to be recognized to perform sentence processing on the sentence to be recognized, which improves the effect of sentence processing and thereby improves the accuracy of sentence intention recognition.

[0095] The above embodiment describes a process of segmenting a sentence to be recognized to obtain one or more sub-sentences to be recognized, and determining a first intent recognition result of the sentence to be recognized based on a sub-intention recognition result of each sub-sentence to be recognized.

[0096] In a possible implementation, the electronic device can directly perform intent recognition processing on the sentence to be recognized through the target recognition model (without sentence segmentation) to obtain the second intent recognition result of the sentence to be recognized. The target recognition model is the recognition model mentioned above for determining the sub-intent recognition result of each sub-sentence to be recognized.

[0097] Based on this, after the electronic device obtains the first intention recognition result obtained through the sentence processing step and obtains the second intention recognition result obtained without the sentence processing step, the electronic device can also determine the target intention recognition result of the sentence to be recognized based on the first intention recognition result and the second intention recognition result.

[0098] Specifically, the electronic device can determine the first weight and first confidence of the first intention recognition result, and determine the second weight and second confidence of the second intention recognition result, and then determine the target intention recognition result based on the first intention recognition result, the second intention recognition result, the first weight, the first confidence, the second weight and the second confidence.

[0099] The method of obtaining two different intent recognition results through two different methods and then obtaining a target intent recognition result based on the two different intent recognition results can further improve the accuracy of sentence intent recognition.

[0100] In a possible implementation, before executing the sentence intention recognition method provided in the embodiment of the present application, the first sentence model and the second sentence model may be trained. Exemplarily, the second sentence model may be trained by unsupervised data, and the first sentence model may be trained by supervised data, and the first sentence model and the second sentence model may be fine-tuned by annotated supervised data.

[0101] See also Figure 3 , Figure 3 A schematic diagram of training a sentence model provided in an embodiment of the present application. Figure 3 As shown in the figure, unsupervised training samples can be obtained through NLU single-round training data, and then the BERT model (second sentence model) can be trained through unsupervised training samples. Supervised data can be obtained through multi-task annotation-specific data, and the LLM model (first sentence model) and BERT model (second sentence model) can be fine-tuned through supervised data.

[0102] Based on the sentence intention recognition method provided in the embodiment of the present application, the following continues to provide a flow chart of the sentence intention recognition method. Figure 4 , Figure 4 A flowchart of a method for identifying the intent of a sentence provided in an embodiment of the present application.

[0103] like Figure 4 As shown, the electronic device can obtain the user's audio input and convert the voice signal of the audio input into text information. Afterwards, the electronic device can search in the keyword information (Prompt) database according to the text information to determine the keyword information of the text information.

[0104] Afterwards, the electronic device can input the keyword information and text information of the text information into the BERT model (i.e., the second sentence model in the embodiment of the present application) to instruct the second sentence model to determine the number of intentions based on the keyword information and the text information. If the number of intentions is less than 2 (i.e., the first intention number threshold in the embodiment of the present application), the BERT model can perform sentence processing on the text information to obtain one or more sub-sentences to be recognized. If the number of intentions is greater than or equal to 2 (i.e., the first intention number threshold in the embodiment of the present application), the LLM model (i.e., the first sentence model in the embodiment of the present application) can perform sentence processing on the text information to obtain one or more sub-sentences to be recognized.

[0105] After obtaining the sub-sentences to be recognized, the electronic device can input each sub-sentence to be recognized into the domain-intent-slot model (i.e., the target recognition model in the embodiment of the present application) in parallel to instruct the domain-intent-slot model to output the intent recognition results corresponding to each sub-sentence to be recognized.

[0106] After obtaining the intention recognition result corresponding to each sub-sentence to be recognized, the electronic device can post-process the intention recognition result corresponding to each sub-sentence to be recognized, so as to obtain the first intention recognition result.

[0107] In addition, after obtaining the text information, the electronic device can also input the text information that has not been sentence-processed into the domain-intent-slot model) to instruct the domain-intent-slot model to output the second intent recognition result corresponding to the text information that has not been sentence-processed, so that the electronic device can obtain the second intent recognition result.

[0108] After obtaining the first intent recognition result and the second intent recognition result, the electronic device can perform multi-result fusion arbitration based on the first intent recognition result and the second intent recognition result to obtain the target intent recognition result.

[0109] The method provided in the embodiment of the present application can also be implemented by a smart cockpit. The smart cockpit can be implemented by an independent server or a server cluster composed of multiple servers. The smart cockpit system refers to an automotive electronic system equipped with intelligent and networked vehicle-mounted equipment and services, such as an in-vehicle infotainment system, an instrument panel, a head-up display (HUD), a streaming media rearview mirror, a voice interaction system, etc.

[0110] The electronic system of the smart cockpit can be a complete system consisting of a central control platform, full LCD instrument, central control display, entertainment system, smart speaker, car networking module, streaming media rearview mirror, telematics system, etc. The smart cockpit system can be centered on the cockpit area controller, realize the functions of the above smart cockpit electronic system on a unified software and hardware platform, and integrate the system of intelligent interaction, intelligent scene, and personalized service.

[0111] The smart cockpit system can form the basis for human-vehicle interaction and the interconnection between the vehicle and the outside world. The usage scenarios of the smart cockpit system can generally cover all scenarios in which users use the vehicle. Specifically, it can include time scenarios before the user uses the vehicle, during the user's use of the vehicle, and after the user uses the vehicle. It can also report spatial scenes including the driver, co-pilot, rear passengers, and related people or objects outside the car. Compared with the past command interaction, the human-computer interaction of the smart cockpit can be combined with the usage scenarios of the vehicle and the user, based on image recognition, voice recognition, environmental perception and other foundations. Achieve an intelligent effect that is more in line with user needs (such as the need to change voice when making calls, etc.). In other words, the smart cockpit refers to an intelligent and networked vehicle-mounted equipment and services, such as vehicle-mounted infotainment systems, instrument panels, head-up displays (HUDs), streaming media rearview mirrors, voice interaction systems and other automotive electronic systems. The vehicle-mounted cockpit in this embodiment refers to the smart cockpit.

[0112] Based on the sentence intention recognition method provided in the above embodiment, the present application embodiment further provides a sentence intention recognition device for implementing the above method embodiment, please refer to Figure 5 , Figure 5 A schematic diagram of the structure of a sentence intention recognition device provided in an embodiment of the present application. Figure 5 As shown, the sentence intention recognition device 50 may include: a sentence acquisition unit 51, an intention quantity determination unit 52, a sentence division unit 53 and a first intention recognition unit 54. Among them:

[0113] The sentence acquisition unit 51 is used to acquire sentences to be recognized.

[0114] The intention quantity determination unit 52 is used to determine the intention quantity of the sentence to be recognized.

[0115] The sentence segmentation unit 53 is used to perform sentence segmentation processing on the sentence to be recognized according to the number of intentions of the sentence to be recognized, using a sentence segmentation model corresponding to the number of intentions, to obtain one or more sub-sentences to be recognized corresponding to the sentence to be recognized.

[0116] The first intention recognition unit 54 is used to determine a first intention recognition result of a sentence to be recognized based on a sub-intention recognition result of each sub-sentence to be recognized in one or more sub-sentences to be recognized.

[0117] Optionally, the sentence unit 53 is specifically used for:

[0118] If the number of intentions is greater than or equal to the first intention number threshold, the sentence to be recognized is processed by the first sentence segmentation model to obtain a plurality of sub-sentences to be recognized corresponding to the sentence to be recognized;

[0119] If the number of intentions is less than the first intention number threshold, the sentence to be recognized is segmented by the second sentence model to obtain multiple sub-sentences to be recognized corresponding to the sentence to be recognized; the difference between the first sentence model and the second sentence model is that: when the number of intentions is greater than or equal to the first intention number threshold, the first parameter value of the first evaluation parameter of the first sentence model is higher than the second parameter value of the first evaluation parameter of the second sentence model; when the number of intentions is less than the first intention number threshold, the first parameter value is lower than the second parameter value.

[0120] Optionally, the sentence intention recognition device 50 may further include an intention quantity threshold determination unit, wherein:

[0121] The intention quantity threshold determination unit is specifically used for:

[0122] Get one or more test statements;

[0123] determining one or more different second intent quantity thresholds;

[0124] For each second intention quantity threshold, determine a third parameter value of the second evaluation parameter corresponding to the second intention quantity threshold and a fourth parameter value of the second evaluation parameter, wherein the third parameter value is determined by using the first sentence segmentation model to perform sentence segmentation processing on each test sentence using the second intention quantity threshold, and the fourth parameter value is determined by using the second sentence segmentation model to perform sentence segmentation processing on each test sentence using the second intention quantity threshold;

[0125] The first intention quantity threshold is determined according to the third parameter value and the fourth parameter value corresponding to each second intention quantity threshold.

[0126] Optionally, the intended quantity determination unit 52 is specifically configured to:

[0127] Determine keyword information of the sentence to be recognized;

[0128] The second sentence segmentation model is used to determine the number of intents based on the sentences to be identified and keyword information.

[0129] Optionally, the first intention recognition unit 54 is specifically used for:

[0130] The recognition results of each sub-intent are spliced ​​to obtain the intent splicing result;

[0131] The intent splicing result is post-processed to obtain a first intent recognition result; the post-processing method includes at least one or more of the following: preset intent deletion processing, slot inheritance processing, intent deduplication processing and intent quantity correction processing.

[0132] Optionally, the sentence intention recognition device 50 may further include a second intention recognition unit.

[0133] The second intention recognition unit is specifically used for:

[0134] The target recognition model is used to perform intent recognition processing on the sentence to be recognized, and obtain a second intent recognition result of the sentence to be recognized; the target recognition model is a recognition model used to determine the sub-intent recognition result of each sub-sentence to be recognized;

[0135] A target intent recognition result of the sentence to be recognized is determined according to the first intent recognition result and the second intent recognition result.

[0136] Optionally, the second intention recognition unit is specifically used for:

[0137] Determining a first weight and a first confidence level of a first intent recognition result;

[0138] Determining a second weight and a second confidence level of a second intent recognition result;

[0139] A target intent recognition result is determined according to the first intent recognition result, the second intent recognition result, the first weight, the first confidence, the second weight, and the second confidence.

[0140] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown, the electronic device 6 provided in this embodiment may include: a processor 60, a memory 61, and a computer program 62 stored in the memory 61 and executable on the processor 60, such as a program corresponding to the method for recognizing the intention of a sentence. When the processor 60 executes the computer program 62, the steps in the embodiment of the method for recognizing the intention of a sentence are implemented, such as Figure 1 Alternatively, when the processor 60 executes the computer program 62, the functions of each module / unit in the embodiment of the intention recognition device of the above statement are realized, for example Figure 5 The functions of the units 51 to 54 are shown.

[0141] Exemplarily, the computer program 62 may be divided into one or more modules / units, one or more modules / units are stored in the memory 61 and executed by the processor 60 to complete the present application. The one or more modules / units may be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program 62 in the electronic device 6. For example, the computer program 62 may be divided into a sentence acquisition unit 51, an intention quantity determination unit 52, a sentence division unit 53, and a first intention recognition unit 54. For the specific functions of each unit, please refer to Figure 5 The relevant descriptions in the corresponding embodiments are not repeated here.

[0142] Those skilled in the art will understand that Figure 6 The electronic device 6 is merely an example and does not limit the electronic device 6 , and may include more or less components than those shown in the figure, or may combine certain components, or may include different components.

[0143] The processor 60 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0144] The memory 61 may be an internal storage unit of the electronic device 6, such as a hard disk or memory of the electronic device 6. The memory 61 may also be an external storage device of the electronic device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, or a flash card, etc., equipped on the electronic device 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the electronic device 6. The memory 61 is used to store computer programs and other programs and data required by the electronic device. The memory 61 may also be used to temporarily store data that has been output or is to be output.

[0145] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units is used as an example for illustration. In actual applications, the above-mentioned functions can be assigned to different functional units as needed, that is, the internal structure of the sentence intention recognition device can be divided into different functional units to complete all or part of the functions described above. The functional units in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0146] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0147] An embodiment of the present application provides a computer program product. When the computer program product is executed on a terminal device, the terminal device implements the steps in the above-mentioned various method embodiments.

[0148] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0149] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0150] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

[0151] The relevant user personal information that may be involved in each embodiment of this application is strictly in accordance with the requirements of laws and regulations, following the principles of legality, legitimacy and necessity, based on the reasonable purpose of the business scenario, to process the personal information that the user actively provides during the use of the product / service or generated by the use of the product / service, as well as the personal information obtained with the user's authorization. The user personal information processed by the applicant will vary depending on the specific product / service scenario and must be based on the specific scenario in which the user uses the product / service, and may involve the user's account information, device information, driving information, vehicle information or other relevant information. The applicant will treat the user's personal information and its processing with a high degree of diligence. The applicant attaches great importance to the security of user personal information, and has taken reasonable and feasible security protection measures that meet industry standards to protect user information and prevent personal information from being unauthorized access, public disclosure, use, modification, damage or loss.

Claims

1. A method for identifying the intention of a sentence, characterized in that: include: Get the sentence to be recognized; Determining the number of intents of the sentence to be identified; According to the number of intentions of the sentence to be recognized, using a sentence model corresponding to the number of intentions to perform sentence processing on the sentence to be recognized, so as to obtain one or more sub-sentences to be recognized corresponding to the sentence to be recognized; Determine a first intent recognition result of the sentence to be recognized based on a sub-intention recognition result of each of the sub-sentences to be recognized in one or more of the sub-sentences to be recognized.

2. The method according to claim 1, characterized in that: According to the number of intentions of the sentence to be recognized, the sentence to be recognized is processed by using a sentence model corresponding to the number of intentions to obtain one or more sub-sentences to be recognized corresponding to the sentence to be recognized, including: If the number of intentions is greater than or equal to a first intention number threshold, the sentence to be recognized is processed by a first sentence model to obtain a plurality of sub-sentences to be recognized corresponding to the sentence to be recognized; If the number of intentions is less than the first intention number threshold, the sentence to be recognized is segmented by the second sentence model to obtain multiple sub-sentences to be recognized corresponding to the sentence to be recognized; the difference between the first sentence model and the second sentence model is that: when the number of intentions is greater than or equal to the first intention number threshold, the first parameter value of the first evaluation parameter of the first sentence model is higher than the second parameter value of the first evaluation parameter of the second sentence model; when the number of intentions is less than the first intention number threshold, the first parameter value is lower than the second parameter value.

3. The method according to claim 2, characterized in that The first intention quantity threshold is determined by: Get one or more test statements; determining one or more different second intent quantity thresholds; For each of the second intention quantity thresholds, determine a third parameter value of the second evaluation parameter corresponding to the second intention quantity threshold, and a fourth parameter value of the second evaluation parameter, wherein the third parameter value is determined by performing sentence processing on each of the test sentences using the second intention quantity threshold by the first sentence model, and the fourth parameter value is determined by performing sentence processing on each of the test sentences using the second intention quantity threshold by the second sentence model; The first intention quantity threshold is determined according to the third parameter value and the fourth parameter value corresponding to each of the second intention quantity thresholds.

4. The method according to claim 1, characterized in that: The determining the number of intentions of the sentence to be recognized includes: Determining keyword information of the sentence to be recognized; The number of intentions is determined through a second sentence model according to the sentence to be identified and the keyword information.

5. The method according to any one of claims 1 to 4, characterized in that: The determining the first intention recognition result of the sentence to be recognized according to the sub-intention recognition result of each of the sub-sentences to be recognized in the plurality of sub-sentences to be recognized comprises: Performing splicing processing on each of the sub-intention recognition results to obtain an intention splicing result; The intent splicing result is post-processed to obtain the first intent recognition result; the post-processing method includes at least one or more of the following: preset intent deletion processing, slot inheritance processing, intent deduplication processing and intent quantity correction processing.

6. The method according to any one of claims 1 to 4, characterized in that: After determining the first intention recognition result of the sentence to be recognized according to the sub-intention recognition result of each of the sub-sentences to be recognized in the plurality of sub-sentences to be recognized, the method further includes: Performing intent recognition processing on the sentence to be recognized through a target recognition model to obtain a second intent recognition result of the sentence to be recognized; the target recognition model is a recognition model used to determine the sub-intent recognition result of each sub-sentence to be recognized; A target intent recognition result of the sentence to be recognized is determined according to the first intent recognition result and the second intent recognition result.

7. The method according to claim 6, characterized in that The determining, according to the first intent recognition result and the second intent recognition result, a target intent recognition result of the sentence to be recognized includes: Determining a first weight and a first confidence level of the first intention recognition result; Determining a second weight and a second confidence level of the second intent recognition result; The target intent recognition result is determined according to the first intent recognition result, the second intent recognition result, the first weight, the first confidence, the second weight and the second confidence.

8. A device for identifying the intention of a sentence, characterized in that: include: A sentence acquisition unit, used for acquiring a sentence to be recognized; An intention quantity determination unit, used to determine the intention quantity of the sentence to be recognized; A sentence segmentation unit, configured to perform sentence segmentation processing on the sentence to be identified according to the number of intentions of the sentence to be identified, using a sentence segmentation model corresponding to the number of intentions, to obtain one or more sub-sentences to be identified corresponding to the sentence to be identified; The first intention recognition unit is used to determine the first intention recognition result of the sentence to be recognized based on the sub-intention recognition result of each of the sub-sentences to be recognized in one or more sub-sentences to be recognized.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, each step in the method for identifying the intention of a sentence as described in any one of claims 1 to 7 is implemented.

10. A computer program product, characterized in that When the computer program product is executed by a processor, each step in the method for identifying the intention of a statement as described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • User multi-intention identification method and device, storage medium and vehicle

    CN111400438A

  • Statement intention recognition method and electronic equipment

    CN114860938A

  • Semantic understanding method, electronic equipment and storage medium

    CN117034952A

  • Semantic understanding method and device

    CN117034957A

  • Prompt word generation processing method and device, equipment and medium

    CN119129605A