Intent recognition method, device, electronic device and storage medium

By detecting the added text string in the clipboard and automatically determining the intent recognition results using the content relevance, the problems of inefficiency and accuracy of manual labeling in the prior art are solved, and the training efficiency and accuracy of the intent recognition model are improved.

CN114254647BActive Publication Date: 2025-06-06IFLYTEK CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111481354.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2025-06-06
Estimated Expiration
2041-12-06

AI Technical Summary

Technical Problem

The reliance on manual acquisition of sample text tags in the prior art leads to inefficiency and affects the accuracy of the intent identification model.

Method used

By detecting the new text string in the clipboard, inputting it into the intent recognition model, and automatically determining the sample intent recognition result using the content correlation between the sample text string and the template text string.

Benefits of technology

It improves the training efficiency of the intent recognition model, accurately obtains sample intent recognition results, and avoids the influence of manual labeling errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114254647B_ABST
    Figure CN114254647B_ABST
Patent Text Reader

Abstract

The present invention provides an intent recognition method, device, electronic device and storage medium, the method comprising: if a newly added text string is detected in a clipboard, the newly added text string is input into an intent recognition model to obtain an intent recognition result output by the intent recognition model; based on the intent recognition result, link jump is performed; wherein the intent recognition model is trained based on a sample text string and its corresponding sample intent recognition result; the sample intent recognition result is determined based on the content relevance between the sample text string and a template text string under each intent category. The present invention can quickly and accurately determine the sample intent recognition result based on the content relevance between the sample text string and the template text string, avoiding the problem of easily obtaining erroneous sample intent recognition results in the traditional method that relies on manual annotation of the sample text string.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of mobile Internet, smart phones have become an indispensable device in people's lives, and input methods have become an important application for human-computer interaction between people and smart devices. When using input methods, users often copy text content to the clipboard, so that the user's next action can be inferred by recognizing the text content and giving appropriate jump actions.

[0003] At present, the intent recognition results are mostly obtained by inputting the text to be recognized into the intent recognition model. However, the intent recognition model is trained based on a large number of sample texts and their corresponding sample text labels, and the sample text labels are manually labeled, which is not only inefficient, but also causes incorrect labeling due to human errors, which in turn affects the accuracy of the intent recognition model. Summary of the invention

[0004] The present invention provides an intent recognition method, device, electronic device and storage medium, which are used to solve the defects of the prior art that rely on manual acquisition of sample text labels, resulting in low efficiency and affecting the accuracy of the intent recognition model.

[0005] The present invention provides an intention recognition method, comprising:

[0006] If it is detected that there is a newly added text string in the clipboard, the newly added text string is input into the intent recognition model to obtain the intent recognition result output by the intent recognition model;

[0007] Based on the intention recognition result, link jump is performed;

[0008] Among them, the intent recognition model is trained based on a sample text string and its sample intent recognition result; the sample intent recognition result is determined based on the content relevance between the sample text string and the template text string under each intent category.

[0009] According to an intent recognition method provided by the present invention, the sample intent recognition result is determined based on the following steps:

[0010] Determining a sample text feature of the sample text string based on the word segmentation semantics of each target word segment in the sample text string and the text semantics of the sample text string;

[0011] Determining the template text features of each template text string based on the word segmentation semantics of each target word segment in each template text string and the text semantics of each template text string;

[0012] Determining the content relevance between the sample text string and each template text string based on the sample text feature and each template text feature;

[0013] The sample intent recognition result is determined based on the content relevance between the sample text string and each template text string.

[0014] According to an intention recognition method provided by the present invention, the determining of the sample text features of the sample text string based on the word segmentation semantics of each target word segment in the sample text string and the text semantics of the sample text string includes:

[0015] Determining the importance of each target segmentation in the sample text string based on the segmentation semantics of each target segmentation in the sample text string and the text semantics of the sample text string;

[0016] The importance of each target word segment in the sample text string is used as the sample word segment weight, and the features of each target word segment in the sample text string are weighted and fused to obtain the sample text feature.

[0017] According to an intention recognition method provided by the present invention, the template text features of each template text string are determined based on the word segmentation semantics of each target word segmentation in each template text string and the text semantics of each template text string, including:

[0018] Determine the importance of each target word in each template text string based on the word semantics of each target word in each template text string and the text semantics of each template text string;

[0019] The importance of each target word in each template text string is used as the template word weight, and the features of each target word in each template text string are weighted and fused to obtain the template text features.

[0020] According to an intention recognition method provided by the present invention, the target segmentation of the sample text string is determined based on the part of speech of each segmentation in the sample text string;

[0021] And / or, the target word segmentation of each template text string is determined based on the part of speech of each word segmentation in each template text string.

[0022] According to an intention recognition method provided by the present invention, the determining of the sample intention recognition result based on the content relevance between the sample text string and each template text string includes:

[0023] Determining the probability that the sample text string belongs to each intent category based on the content similarity between the sample text string and the template text string under each intent category;

[0024] The sample intent recognition result is determined based on the probability that the sample text string belongs to each intent category.

[0025] According to an intention recognition method provided by the present invention, link jumping based on the intention recognition result includes:

[0026] Sending the newly added text string and the intention recognition result to the test terminal, so that when the test terminal calls the newly added text string, the link corresponding to the intention recognition result is displayed, so as to count the actual click rate corresponding to the link when the link jumps and return it;

[0027] When the actual click-through rate is less than or equal to a threshold, a correction result corresponding to the intent recognition result is obtained, and the intent recognition model is updated based on the correction result and the newly added text string, and the threshold is determined based on a preset click-through rate and is less than the preset click-through rate.

[0028] According to an intention recognition method provided by the present invention, the sending of the newly added text string and the intention recognition result to a test terminal further includes:

[0029] When the actual click rate is greater than the threshold and less than the preset click rate, the preset click rate is adjusted according to a preset amplitude until the preset click rate is the same as the actual click rate.

[0030] The present invention also provides an intention recognition device, comprising:

[0031] A recognition unit, configured to input a newly added text string into an intention recognition model if a newly added text string is detected in the clipboard, and obtain an intention recognition result output by the intention recognition model;

[0032] A jump unit, used for performing link jump based on the intention recognition result;

[0033] Among them, the intent recognition model is trained based on a sample text string and its sample intent recognition result; the sample intent recognition result is determined based on the content relevance between the sample text string and the template text string under each intent category.

[0034] The present invention also 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 program, the steps of any of the above-described intention recognition methods are implemented.

[0035] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the above-described intent recognition methods.

[0036] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the steps of any one of the above-mentioned intention recognition methods are implemented.

[0037] The intent recognition method, device, electronic device, and storage medium provided by the present invention automatically determine the sample intent recognition result based on the content relevance between the sample text string and the template text string, and are highly efficient, so that a large number of training samples can be quickly obtained, thereby improving the training efficiency of the intent recognition model. In addition, based on the content relevance, the content association degree between the sample text string and each template text string can be accurately determined, thereby accurately obtaining the sample intent recognition result, avoiding the problem of relying on manual annotation of the sample text string in the traditional method to easily obtain erroneous sample intent recognition results. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0039] Figure 1 It is a flowchart of the intention recognition method provided by the present invention;

[0040] Figure 2 It is a flowchart of a method for determining sample intent recognition results provided by the present invention;

[0041] Figure 3 is a flowchart of an implementation of step 210 of the method for determining the sample intention recognition result provided by the present invention;

[0042] Figure 4 is a flowchart of an implementation of step 220 of the method for determining the sample intention recognition result provided by the present invention;

[0043] Figure 5 is a flowchart of an implementation of step 240 of the method for determining the sample intention recognition result provided by the present invention;

[0044] Figure 6 is a flowchart of an implementation of step 120 of the intention recognition method provided by the present invention;

[0045] Figure 7 It is a structural schematic diagram of the intention recognition model provided by the present invention;

[0046] Figure 8 is a schematic diagram of the structure of the intention recognition device provided by the present invention;

[0047] Fig. 9 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

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

[0049] At present, the intent recognition results are mostly obtained by inputting the text to be recognized into the intent recognition model. However, the intent recognition model is trained based on a large number of sample texts and their corresponding sample text labels, and the sample text labels rely on manual annotation, which is inefficient and affects the training efficiency of the intent recognition model.

[0050] In addition, when the sample text is more complex, such as when the sample text is a text string similar to a Taobao password or MD5 (Message-Digest Algorithm), it is difficult to accurately identify the corresponding intent category by manual labor alone, which leads to incorrect labeling and affects the accuracy of the intent recognition model.

[0051] To this end, the present invention provides an intention recognition method. Figure 1 is a flow chart of the intention recognition method provided by the present invention, such as Figure 1 As shown, the method comprises the following steps:

[0052] Step 110: If it is detected that a new text string exists in the clipboard, the new text string is input into the intent recognition model to obtain an intent recognition result output by the intent recognition model;

[0053] Among them, the intent recognition model is trained based on the sample text string and its sample intent recognition results; the sample intent recognition results are determined based on the content relevance between the sample text string and the template text string under each intent category.

[0054] Specifically, when a new text string is detected in the clipboard, it indicates that a corresponding link needs to be identified based on the new text string, so that the user can enter the corresponding application through the link, that is, the process of identifying the link corresponding to the new text string is the process of intent recognition. Optionally, the content in the clipboard can be read at a preset time interval, and when a new text string is detected in the clipboard, the new text string is input into the intent recognition model.

[0055] Among them, the newly added text string is the text string that needs to be identified for intent. The newly added text string can be a text string that satisfies the regular expression. For example, the newly added text string can be a text string similar to Taobao password or MD5. Compared with other types of text strings, this type of text string has certain regular rules, so that the user's intent category can be more accurately inferred.

[0056] It is understandable that the newly added text string can be directly input by the user, or obtained by transcribing the collected audio, or obtained by collecting images through image acquisition devices such as scanners, mobile phones, cameras, and performing OCR (Optical Character Recognition) on the images. The embodiments of the present invention do not specifically limit this.

[0057] The content relevance between the sample text string and the template text string under each intent category is used to characterize the degree of content association between the sample text string and each template text string. For example, the sample text string and the template text string are two different plots of the same TV series. Although the two plots are not about the same thing, the two plots belong to the same theme, that is, the same TV series. Therefore, it can be considered that the content association between the sample text string and the template text string is high, that is, the content relevance is high. Template text strings refer to text strings with known intent categories. The same intent category can include multiple template text strings. For example, if the template text string is "play music", its corresponding intent category is "open QQ music"; for another example, if the template text string is "play Zhang's song", its corresponding intent category is also "open QQ music".

[0058] The higher the content relevance between the sample text string and the template text string under each intent category, the higher the probability that the sample text string belongs to the corresponding intent category; the lower the content relevance between the sample text string and the template text string under each intent category, the lower the probability that the sample text string belongs to the corresponding intent category. The sample intent recognition result can be the probability that the sample text string belongs to each intent category, or it can be the intent category corresponding to the sample text string (such as taking the intent category corresponding to the maximum probability as the intent category of the sample text string), which is not specifically limited in the embodiments of the present invention.

[0059] It can be seen that the embodiment of the present invention automatically determines the sample intent recognition result based on the content relevance between the sample text string and the template text string, which is highly efficient and can improve the training efficiency of the intent recognition model. In addition, based on the content relevance, the content association degree between the sample text string and each template text string can be accurately determined, and the sample intent recognition result can be accurately obtained, avoiding the problem of traditional methods that rely on manual annotation of sample text strings and easily obtain erroneous sample intent recognition results.

[0060] After determining the sample text string and its corresponding sample intent recognition result, the initial model can be trained based on the two to obtain the intent recognition model, so that the intent recognition result can be accurately obtained based on the intent recognition model.

[0061] Optionally, the intent recognition model can perform semantic understanding on the newly added text string, determine the intent of the newly added text string, and determine the slot value of the newly added text string based on the intent of the newly added text string, and then determine the intent recognition result according to the intent of the newly added text string and the slot value of the newly added text string. For example, for the newly added text string "buy a plane ticket from Beijing to Shanghai tomorrow", after semantic understanding, its corresponding intent can be obtained as "buy a ticket", and then according to the intent, the corresponding slot can be determined as the departure place, destination and time, and then the slot is filled according to the semantics of each word segment of the newly added text string to obtain the corresponding slot value, so as to obtain the corresponding intent recognition result according to the intent and slot value.

[0062] Step 120: Based on the intent recognition result, link jump is performed.

[0063] Specifically, the intent recognition result can be the probability that the newly added text string belongs to each intent category, or it can be the intent category corresponding to the maximum probability. When the intent recognition result is the probability that the newly added text string belongs to each intent category, the links corresponding to each intent category can be displayed for the user to click to confirm the final link and jump. When the intent recognition result is the intent category corresponding to the maximum probability, the link corresponding to the intent category can be displayed, and the user can jump after clicking the link, or the link can be directly jumped.

[0064] In addition, when performing link jumping, the link jumping can be performed in the local terminal, or the intent recognition result and the newly added text string can be sent to other terminals (such as a test terminal) for link jumping, and the embodiment of the present invention does not specifically limit this.

[0065] The intent recognition method provided by the embodiment of the present invention automatically determines the sample intent recognition result based on the content relevance between the sample text string and the template text string, and has high efficiency, so that a large number of training samples can be quickly obtained, thereby improving the training efficiency of the intent recognition model. In addition, based on the content relevance, the content association degree between the sample text string and each template text string can be accurately determined, thereby accurately obtaining the sample intent recognition result, avoiding the problem of relying on manual annotation of the sample text string in the traditional method to easily obtain erroneous sample intent recognition results.

[0066] Based on the above embodiments, Figure 2 is a flow chart of the method for determining the sample intention recognition result provided by the present invention, such as Figure 2 As shown, the sample intent recognition result is determined based on the following steps:

[0067] Step 210: Determine the sample text features of the sample text string based on the word segmentation semantics of each target word segment in the sample text string and the text semantics of the sample text string;

[0068] Step 220: Determine the template text features of each template text string based on the word segmentation semantics of each target word segment in each template text string and the text semantics of each template text string;

[0069] Step 230: Determine the content relevance between the sample text string and each template text string based on the sample text feature and each template text feature;

[0070] Step 240: Determine the sample intent recognition result based on the content relevance between the sample text string and each template text string.

[0071] Specifically, the target segmented words in the sample text string can be all the segmented words in the sample text string, or can be segmented words with high importance in the sample text string. The segmented word semantics of each target segmented word in the sample text string is used to characterize the semantic information of each target segmented word, and the text semantics of the sample text string is used to characterize the semantic information of the entire text of the sample text string. The segmented word semantics of each target segmented word in the sample text string and the text semantics of the sample text string are combined to obtain the sample text feature, which includes not only the text semantic information of the sample text string, but also the semantic association information between each target segmented word in the sample text string and the sample text string.

[0072] Similarly, the target word segmentation in the template text string can be all the word segmentations in the template text string, or can be the word segmentations with higher importance in the template text string. The word segmentation semantics of each target word segmentation in the template text string is used to characterize the semantic information of each target word segmentation, and the text semantics of the template text string is used to characterize the semantic information of the entire text of the template text string. The word segmentation semantics of each target word segmentation in the template text string and the text semantics of the template text string are combined to obtain the template text feature, which contains not only the text semantic information of the template text string, but also the semantic association information between each target word segmentation in the template text string and the template text string.

[0073] Therefore, based on the sample text features and the template text features, the degree of content association between the sample text string and the template text string can be determined from the semantic information of the entire text and the semantic association information between each target word segment and the entire text, that is, the content relevance between the sample text string and each template text string can be obtained.

[0074] The higher the content relevance between the sample text string and the template text string under each intent category, the higher the probability that the sample text string belongs to the corresponding intent category; the lower the content relevance between the sample text string and the template text string under each intent category, the lower the probability that the sample text string belongs to the corresponding intent category. Optionally, the probability that the sample text string belongs to each intent category can be determined based on the content relevance between the sample text string and each template text string, and the probability that the sample text string belongs to each intent category can be used as the sample intent recognition result; the intent category corresponding to the maximum content relevance can also be used as the sample intent recognition result.

[0075] It can be seen that the embodiment of the present invention can accurately determine the content relevance between the sample text string and each template text string based on the sample text features and the template text features from the entire text semantic information and the semantic association information between each target word segment and the entire text, and then accurately obtain the sample intent recognition result based on the content relevance.

[0076] Based on any of the above embodiments, Figure 3 is a flowchart of an implementation of step 210 of the method for determining the sample intention recognition result provided by the present invention, such as Figure 3 As shown, step 210 includes:

[0077] Step 211: Determine the importance of each target word in the sample text string based on the word semantics of each target word in the sample text string and the text semantics of the sample text string;

[0078] Step 212: Taking the importance of each target word in the sample text string as the sample word weight, weighted fusion is performed on the features of each target word in the sample text string to obtain the sample text features.

[0079] Specifically, since different target segmentations in the sample text string express different semantics, different target segmentations have different importance in the sample text string. The segmentation semantics of each target segmentation in the sample text string carries the semantic information of the corresponding target segmentation, and the text semantics of the sample text string carries the semantic information of the entire text of the sample text string. Based on the semantic information of both, the semantic similarity between each target segmentation and the sample text string can be determined. The higher the semantic similarity, the higher the importance of the target segmentation in the sample text string.

[0080] Therefore, after determining the importance of each target segmentation in the sample text string, the importance of each target segmentation in the sample text string is used as the sample segmentation weight, and the features of each target segmentation in the sample text string are weighted and fused, so that the sample text features containing the semantic association information between each target segmentation in the sample text string and the sample text string can be obtained.

[0081] It can be seen that the embodiment of the present invention can accurately determine the importance of each target segmentation in the sample text string based on the segmentation semantics of each target segmentation in the sample text string and the text semantics of the sample text string. Therefore, combined with the importance of each target segmentation, it is possible to obtain sample text features for characterizing the semantic association information between each target segmentation in the sample text string and the sample text string, and further accurately determine the content relevance between the sample text string and each template text string.

[0082] Based on any of the above embodiments, Figure 4 2 is a flow chart of an implementation of step 220 of the method for determining the sample intention recognition result provided by the present invention. Figure 4 As shown, step 220 includes:

[0083] Step 221: Determine the importance of each target word in each template text string based on the word semantics of each target word in each template text string and the text semantics of each template text string;

[0084] Step 222: Taking the importance of each target word in each template text string as the template word weight, weighted fusion is performed on the features of each target word in each template text string to obtain the template text feature.

[0085] Specifically, since different target segmentations in the template text string express different semantics, different target segmentations have different importance in the template text string. The segmentation semantics of each target segmentation in the template text string carries the semantic information of the corresponding target segmentation, and the text semantics of the template text string carries the semantic information of the entire text of the template text string. Based on the semantic information of both, the semantic similarity between each target segmentation and the template text string can be determined. The higher the semantic similarity, the higher the importance of the target segmentation in the template text string.

[0086] Therefore, after determining the importance of each target word in the template text string, the importance of each target word in the template text string is used as the sample word weight, and the features of each target word in the template text string are weighted and fused, so that the template text features containing the semantic association information between each target word in the template text string and the template text string can be obtained.

[0087] It can be seen that the embodiment of the present invention can accurately determine the importance of each target segmentation in the template text string based on the segmentation semantics of each target segmentation in the template text string and the text semantics of the template text string. Therefore, combined with the importance of each target segmentation, it is possible to obtain template text features for characterizing the semantic association information between each target segmentation in the template text string and the template text string, and further accurately determine the content relevance between the sample text string and each template text string.

[0088] Based on any of the above embodiments, the content relevance between the sample text string and each template text string is determined based on the following steps:

[0089] The sample text string D1 is segmented to obtain each segment of the sample text string. Then, based on the segmentation semantics of each segment in the sample text string and the text semantics of the sample text string, the importance of each segment in the sample text string is determined. The importance is used as a weight to perform weighted fusion on the features of each segment of the sample text string to obtain the sample text feature of the sample text string D1.

[0090] The template text string D2 is segmented to obtain each segment of the template text string. Then, based on the segmentation semantics of each segment in the template text string and the text semantics of the template text string, the importance of each segment in the template text string is determined. The importance is used as a weight to perform weighted fusion on each segmentation feature of the template text string to obtain the template text feature of the template text string D2.

[0091] Then, based on the sample text features With template literal features The cosine value of the angle between them represents the content relevance sim(D1, D2) between the sample text string and each template text string. The specific calculation formula is as follows:

[0092]

[0093] It can be seen that the embodiment of the present invention can accurately determine the importance of each target segmentation in the template text string based on the segmentation semantics of each target segmentation in the template text string and the text semantics of the template text string. Therefore, combined with the importance of each target segmentation, it is possible to obtain template text features for characterizing the semantic association information between each target segmentation in the template text string and the template text string, and further accurately determine the content relevance between the sample text string and each template text string.

[0094] Based on any of the above embodiments, the target word segmentation of the sample text string is determined based on the part of speech of each word segmentation in the sample text string;

[0095] And / or, the target word segmentation of each template text string is determined based on the part of speech of each word segmentation in each template text string.

[0096] Specifically, the parts of speech of each segmented word in the sample text string include nouns, verbs, adverbs, pronouns, interjections, etc. The segmented words corresponding to different parts of speech have different importance in the sample text string. For example, the segmented words corresponding to nouns and verbs have higher importance in the sample text string, while the segmented words corresponding to adverbs, pronouns, interjections, etc. have lower importance in the sample text string. Even the segmented words corresponding to some parts of speech have an importance close to 0 in the sample text string, such as interjections.

[0097] Therefore, the embodiment of the present invention can filter out the less important words in the sample text string based on the part of speech of each word in the sample text string to obtain the target word with higher importance, so that the sample text features can be determined based on the target word with higher importance, thereby avoiding the interference of the less important words on the sample text features.

[0098] Similarly, the embodiments of the present invention can filter out the less important words in the template text string based on the part of speech of each word in the template text string to obtain the target word with higher importance, so that the template text features can be determined based on the target word with higher importance, thereby avoiding the interference of the less important words on the template text features.

[0099] Based on any of the above embodiments, Figure 5 is a flow chart of an implementation of step 240 of the method for determining the sample intention recognition result provided by the present invention, such as Figure 5 As shown, step 240 includes:

[0100] Step 241: Determine the probability that the sample text string belongs to each intent category based on the content similarity between the sample text string and the template text string under each intent category;

[0101] Step 242: Determine the sample intent recognition result based on the probability that the sample text string belongs to each intent category.

[0102] Specifically, there may be multiple template text strings corresponding to the same intent category, and then the content similarity between each template text string and the sample text string under the same intent category can be counted, and then based on the content similarity between the sample text string and the template text string under the same intent category, the probability that the sample text string belongs to each intent category can be determined. For example, the average value of the content similarity between the sample text string and the template text strings under each intent category can be used as the probability that the sample text string belongs to the corresponding intent category.

[0103] After obtaining the probability that the sample text string belongs to each intent category, the probability of belonging to each intent category can be used as the sample intent recognition result, or the intent category corresponding to the maximum probability can be used as the sample intent recognition result. The embodiment of the present invention does not make specific limitations on this.

[0104] It can be seen that the embodiment of the present invention can accurately determine the probability that the sample text string belongs to each intent category based on the content similarity between the sample text string and the template text string under each intent category, and further can accurately obtain the sample intent recognition result based on the probability that the sample text string belongs to each intent category.

[0105] Based on any of the above embodiments, Figure 6is a flowchart of an implementation of step 120 of the intention recognition method provided by the present invention, such as Figure 6 As shown, the method can be applied to recognize the text string in the clipboard and provide a jump link for the user, which specifically includes the following steps:

[0106] Step 121: Send the newly added text string and the intent recognition result to the test terminal, so that when the test terminal calls the newly added text string, it displays the link corresponding to the intent recognition result, so as to count the actual click rate of the link when the link jumps and return it;

[0107] Step 122: When the actual click rate is less than or equal to the threshold, obtain the correction result corresponding to the intent recognition result, and update the intent recognition model based on the correction result and the newly added text string. The threshold is determined based on the preset click rate and the threshold is less than the preset click rate.

[0108] Specifically, after obtaining the intent recognition result, if it is necessary to verify the training effect of the intent recognition model, the newly added text string and the intent recognition result can be sent to the test terminal, so that when the test terminal calls the newly added text string, such as when the test terminal copies the newly added text string in the clipboard, the link corresponding to the intent recognition result is displayed, so that when the user clicks the link to jump, the actual click rate of the link can be counted and returned.

[0109] After receiving the actual click rate returned by the test terminal, the actual click rate is compared with the threshold. If the actual click rate is less than or equal to the threshold, it indicates that there is a large deviation between the intent recognition result and the actual intent result corresponding to the newly added text string. If the intent recognition model is updated based on the intent recognition result and the newly added text string, the accuracy of the intent recognition model will be reduced, so that the intent recognition result can be regarded as negative feedback. At this time, in order to ensure the accuracy of the intent recognition model, the correction result corresponding to the intent recognition can be obtained, and then the intent recognition model can be updated based on the correction result and the newly added text string. Among them, the threshold is determined based on the preset click rate, which can be half of the preset click rate. The correction result can be the result of correcting the intent recognition result based on expert knowledge, or it can be the intention category corresponding to the link deleted from the intent recognition result. The embodiment of the present invention does not specifically limit this.

[0110] It can be seen that when the actual click-through rate is less than or equal to the threshold, the embodiment of the present invention obtains the correction result corresponding to the intent recognition result, and updates the intent recognition model based on the correction result and the newly added text string, thereby improving the training effect of the model and further ensuring the accuracy of the intent recognition result.

[0111] Based on any of the above embodiments, the newly added text string and the intention recognition result are sent to the test terminal, and then the following steps are further included:

[0112] When the actual click rate is greater than the threshold and less than the preset click rate, the preset click rate is adjusted according to a preset range until the preset click rate is the same as the actual click rate.

[0113] Specifically, if the actual click rate is greater than the threshold and less than the preset click rate, it indicates that the corresponding intent recognition result is more accurate, that is, the intent recognition result has a smaller deviation from the actual intent result corresponding to the newly added text string, so the intent recognition result can be regarded as positive feedback. At this time, it can be considered that the threshold setting is too large, and since the threshold is determined based on the preset click rate, it indicates that the preset click rate is too large. At this time, the preset click rate can be adjusted according to the preset range until the preset click rate is the same as the actual click rate.

[0114] Based on any of the above embodiments, the present invention further provides an intention recognition method, which can be applied to recognize a text string in a clipboard and provide a jump link for a user, specifically comprising:

[0115] Input the newly added text string in the clipboard into the intent recognition model, obtain the intent recognition result output by the intent recognition model, and display the jump link corresponding to the newly added text string according to the intent recognition result, so that the user can quickly enter the application interface corresponding to the newly added text string by clicking the jump link. Among them, the intent recognition model is trained based on the sample text string and its corresponding sample intent recognition result, and its specific training process is as follows:

[0116] The initial text string is matched with the preset regular expression. If the match is successful, the initial text string is used as the sample text string. Then, the sample text string is segmented to obtain each segment of the sample text string. Then, based on the segmentation semantics of each segment in the sample text string and the text semantics of the sample text string, the importance of each segment in the sample text string is determined, and the importance is used as a weight to perform weighted fusion on each segment feature of the sample text string to obtain the sample text feature of the sample text string.

[0117] At the same time, the template text string under each intent category is segmented to obtain each segment of the template text string, and then the importance of each segment in the template text string is determined based on the segmentation semantics of each segment in the template text string and the text semantics of the template text string, and the importance is used as the weight to perform weighted fusion on each segment feature of the template text string to obtain the template text feature of the template text string. Then, the cosine value of the angle between the sample text feature and the template text feature is used to represent the content relevance between the sample text string and each template text string, and the sample intent recognition result corresponding to the sample text string is determined based on the content relevance.

[0118] Then, the initial model is trained with the sample text string and the sample intent recognition results to obtain the intent recognition model, so that the intent recognition model can be applied to intent recognition.

[0119] In addition, after obtaining the intention recognition result of the newly added text string, the newly added text string and the intention recognition result can also be sent to the test terminal, so that when the test terminal copies the newly added text string, the link corresponding to the intention recognition result is displayed, and the actual click rate of the link is counted and returned; when the actual click rate is less than or equal to half of the preset click rate, the correction result corresponding to the intention recognition result is obtained, and the intention recognition model is updated based on the correction result and the newly added text string. When the actual click rate is greater than the threshold and less than the preset click rate, the preset click rate is adjusted according to the preset amplitude until the preset click rate is the same as the actual click rate.

[0120] Optionally, Figure 7 is a schematic diagram of the structure of the intent recognition model provided by the present invention, such as Figure 7 The intent recognition model can be a joint model (RecNN+Viterbi) that uses a semantic analysis tree to construct path features for slot and intent recognition. The part of speech on each node is used as a weight vector. According to the path of each word in the semantic analysis tree, the word vectors corresponding to the base points on the path are weighted and fused to obtain the path features of each word. Then, based on the path features of each word and the intent determined by the semantic information of the newly added text string, the slots are filled to obtain the corresponding slot values, thereby obtaining the corresponding intent recognition results based on the intent and slot values. For example, for the word in, the path in the semantic analysis tree is IN-PP-NP, and each output vector of the path is weighted to obtain the path feature.

[0121] The intention recognition device provided by the present invention is described below. The intention recognition device described below and the intention recognition method described above can be referenced to each other.

[0122] Based on any of the above embodiments, Figure 8 is a schematic diagram of the structure of the intention recognition device provided by the present invention, such as Figure 8 As shown, the device comprises:

[0123] The recognition unit 810 is used to input the newly added text string into the intention recognition model if it is detected that there is a newly added text string in the clipboard, and obtain the intention recognition result output by the intention recognition model;

[0124] A jump unit 820, configured to perform link jump based on the intention recognition result;

[0125] Among them, the intent recognition model is trained based on a sample text string and its corresponding sample intent recognition result; the sample intent recognition result is determined based on the content relevance between the sample text string and the template text string under each intent category.

[0126] Based on any of the above embodiments, the device further includes:

[0127] A sample feature determination unit, configured to determine a sample text feature of the sample text string based on the word segmentation semantics of each target word segment in the sample text string and the text semantics of the sample text string;

[0128] A template feature determination unit, configured to determine a template text feature of each template text string based on the word segmentation semantics of each target word segment in each template text string and the text semantics of each template text string;

[0129] A relevance determination unit, configured to determine the content relevance between the sample text string and each template text string based on the sample text feature and each template text feature;

[0130] The result determination unit is used to determine the sample intention recognition result based on the content relevance between the sample text string and each template text string.

[0131] Based on any of the above embodiments, the sample feature determination unit includes:

[0132] A sample importance determination unit, configured to determine the importance of each target word in the sample text string based on the word semantics of each target word in the sample text string and the text semantics of the sample text string;

[0133] The sample segmentation fusion unit is used to use the importance of each target segmentation in the sample text string as the sample segmentation weight, perform weighted fusion on the features of each target segmentation in the sample text string, and obtain the sample text feature.

[0134] Based on any of the above embodiments, the template feature determination unit includes:

[0135] A template importance determination unit, used to determine the importance of each target word in each template text string based on the word semantics of each target word in each template text string and the text semantics of each template text string;

[0136] The template word segmentation fusion unit is used to use the importance of each target word segmentation in each template text string as the template word segmentation weight, and perform weighted fusion on the features of each target word segmentation in each template text string to obtain the template text feature.

[0137] Based on any of the above embodiments, the target segmentation of the sample text string is determined based on the part of speech of each segmentation in the sample text string;

[0138] And / or, the target word segmentation of each template text string is determined based on the part of speech of each word segmentation in each template text string.

[0139] Based on any of the above embodiments, the result determination unit includes:

[0140] A similarity determination unit, configured to determine the probability that the sample text string belongs to each intent category based on the content similarity between the sample text string and the template text string under each intent category;

[0141] The sample intention determination unit is used to determine the sample intention recognition result based on the probability that the sample text string belongs to each intention category.

[0142] Based on any of the above embodiments, the jump unit 120 includes:

[0143] A sending unit, used to send the newly added text string and the intention recognition result to the test terminal, so that when the test terminal calls the newly added text string, the link corresponding to the intention recognition result is displayed to count the actual click rate corresponding to the link when the link jumps and returns;

[0144] A negative feedback unit is used to obtain a correction result corresponding to the intention recognition result when the actual click-through rate is less than or equal to a threshold, and to update the intention recognition model based on the correction result and the newly added text string, wherein the threshold is determined based on a preset click-through rate and the threshold is less than the preset click-through rate.

[0145] Based on any of the above embodiments, the device further includes:

[0146] A positive feedback unit is used to adjust the preset click rate according to a preset amplitude after sending the newly added text string and the intention recognition result to the test terminal when the actual click rate is greater than the threshold and less than the preset click rate, until the preset click rate is the same as the actual click rate.

[0147] Fig. 9 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Fig. 9As shown, the electronic device may include: a processor 910, a memory 920, a communication interface 930 and a communication bus 940, wherein the processor 910, the memory 920 and the communication interface 930 communicate with each other through the communication bus 940. The processor 910 may call the logic instructions in the memory 920 to execute the intention recognition method, which includes: if it is detected that there is a newly added text string in the clipboard, the newly added text string is input into the intention recognition model to obtain the intention recognition result output by the intention recognition model; based on the intention recognition result, link jump is performed; wherein the intention recognition model is trained based on the sample text string and its sample intention recognition result; the sample intention recognition result is determined based on the content relevance between the sample text string and the template text string under each intention category.

[0148] In addition, the logic instructions in the above-mentioned memory 920 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0149] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the intent recognition method provided by the above-mentioned methods, and the method includes: if a new text string is detected in the clipboard, the new text string is input into an intent recognition model to obtain an intent recognition result output by the intent recognition model; based on the intent recognition result, a link jump is performed; wherein the intent recognition model is trained based on a sample text string and its sample intent recognition result; the sample intent recognition result is determined based on the content relevance between the sample text string and the template text string under each intent category.

[0150] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned intent recognition methods, the method comprising: if a newly added text string is detected in the clipboard, the newly added text string is input into an intent recognition model to obtain an intent recognition result output by the intent recognition model; based on the intent recognition result, a link jump is performed; wherein the intent recognition model is trained based on a sample text string and its sample intent recognition result; the sample intent recognition result is determined based on the content relevance between the sample text string and the template text string under each intent category.

[0151] 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 displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0152] 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 necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art 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.

[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these 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 invention.

Claims

1. A method for identifying intent, It is characterized in that include: If it is detected that there is a newly added text string in the clipboard, the newly added text string is input into the intent recognition model to obtain the intent recognition result output by the intent recognition model; Based on the intention recognition result, link jump is performed; The intention recognition model is trained based on a sample text string and its sample intention recognition result; the sample intention recognition result is determined based on the content relevance between the sample text string and the template text string under each intention category; The sample intent recognition result is determined based on the following steps: Determining a sample text feature of the sample text string based on the word segmentation semantics of each target word segment in the sample text string and the text semantics of the sample text string; Determine the template text features of each template text string based on the word segmentation semantics of each target word in each template text string and the text semantics of each template text string; Determining the content relevance between the sample text string and each template text string based on the sample text feature and each template text feature; Determining the sample intent recognition result based on the content relevance between the sample text string and each template text string; The target word segment of the sample text string is determined based on the part of speech of each word segment in the sample text string; And / or, the target word segmentation of each template text string is determined based on the part of speech of each word segmentation in each template text string.

2. The method for identifying intention according to claim 1, It is characterized in that The determining of the sample text features of the sample text string based on the word segmentation semantics of each target word segment in the sample text string and the text semantics of the sample text string includes: Determining the importance of each target segmentation in the sample text string based on the segmentation semantics of each target segmentation in the sample text string and the text semantics of the sample text string; The importance of each target word segment in the sample text string is used as the sample word segment weight, and the features of each target word segment in the sample text string are weighted and fused to obtain the sample text feature.

3. The method for identifying intention according to claim 1, It is characterized in that The determining of the template text features of each template text string based on the word segmentation semantics of each target word segment in each template text string and the text semantics of each template text string includes: Determine the importance of each target word in each template text string based on the word semantics of each target word in each template text string and the text semantics of each template text string; The importance of each target word in each template text string is used as the template word weight, and the features of each target word in each template text string are weighted and fused to obtain the template text features.

4. The method for identifying intention according to claim 1, It is characterized in that The determining the sample intention recognition result based on the content relevance between the sample text string and each template text string includes: Determining the probability that the sample text string belongs to each intent category based on the content similarity between the sample text string and the template text string under each intent category; The sample intent recognition result is determined based on the probability that the sample text string belongs to each intent category.

5. The method for identifying intention according to any one of claims 1 to 4, It is characterized in that The link jump based on the intention recognition result includes: Sending the newly added text string and the intention recognition result to the test terminal, so that when the test terminal calls the newly added text string, the link corresponding to the intention recognition result is displayed, so as to count the actual click rate corresponding to the link when the link jumps and return it; When the actual click-through rate is less than or equal to a threshold, a correction result corresponding to the intent recognition result is obtained, and the intent recognition model is updated based on the correction result and the newly added text string, and the threshold is determined based on a preset click-through rate and is less than the preset click-through rate.

6. The method for identifying intention according to claim 5, It is characterized in that The sending of the newly added text string and the intention recognition result to the test terminal further includes: When the actual click rate is greater than the threshold and less than the preset click rate, the preset click rate is adjusted according to a preset amplitude until the preset click rate is the same as the actual click rate.

7. An intention recognition device, It is characterized in that include: A recognition unit, configured to input a newly added text string into an intention recognition model if a newly added text string is detected in the clipboard, and obtain an intention recognition result output by the intention recognition model; A jump unit, used for performing link jump based on the intention recognition result; The intention recognition model is trained based on a sample text string and its sample intention recognition result; the sample intention recognition result is determined based on the content relevance between the sample text string and the template text string under each intention category; The sample intent recognition result is determined based on the following steps: Determining a sample text feature of the sample text string based on the word segmentation semantics of each target word segment in the sample text string and the text semantics of the sample text string; Determine the template text features of each template text string based on the word segmentation semantics of each target word in each template text string and the text semantics of each template text string; Determining the content relevance between the sample text string and each template text string based on the sample text feature and each template text feature; Determining the sample intent recognition result based on the content relevance between the sample text string and each template text string; The target word segment of the sample text string is determined based on the part of speech of each word segment in the sample text string; And / or, the target word segmentation of each template text string is determined based on the part of speech of each word segmentation in each template text string.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the steps of the intention recognition method according to any one of claims 1 to 6 are implemented.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the intention recognition method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Statement recognition method, statement recognition device and intelligent equipment

    CN111046667A

  • Information recommendation method and device for input method, and electronic equipment

    CN112068711A