Method, electronic device, medium and program product for generating intent tags

Through clustering algorithms and eigenvalue calculations to generate intention labels in intelligent dialogue systems, the problem of time-consuming and subjective factors in the prior art is solved, and the accuracy and generation efficiency of intention labels are improved.

CN113961709BActive Publication Date: 2024-12-10KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111368238.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-18
Publication Date
2024-12-10
Estimated Expiration
2041-11-18

AI Technical Summary

Technical Problem

Intent tags in existing intelligent dialogue systems are usually pre-written by developers, resulting in the expansion of intent tag dimensions or refinement of granularity when business volume and dialogue data increase. It takes a long time and is prone to subjective factors, affecting the accuracy of intent recognition.

Method used

By obtaining the original text set with unidentified intentions, a clustering algorithm is used to determine the text subset, calculating word feature values ​​and word embeddings, generating feature vectors, and selecting target keywords as intent tags to avoid subjective intervention by developers and improve generation efficiency .

Benefits of technology

It improves the efficiency of generation of intention tags, reduces the subjective influence of developers, and enhances the accuracy of intention tags and the responsiveness of intelligent dialogue systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113961709B_ABST
    Figure CN113961709B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose a method, electronic device, medium and program product for generating an intent label, wherein the method comprises: obtaining an original text set; determining at least one text subset from the original text set, each text subset including at least one original text; based on the original text set, determining a first feature value of each word contained in the original text corresponding to the original text; for each text subset, determining a second feature value of each word based on the first feature value corresponding to each original text in the text subset; based on the second feature value, selecting a first preset number of keywords from the text subset, and generating a word embedding for each keyword; based on the second feature value and the word embedding of each keyword, determining a feature vector of the text subset; based on the similarity between the word embedding of each keyword and the feature vector, determining a target keyword, and determining the target keyword as the intent label of the text subset.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to a method, electronic device, medium and computer program product for generating intent tags. Background Art

[0002] In an intelligent dialogue system, it is usually necessary to identify the user's intention based on the user's dialogue content, and then select the response corpus with the highest matching degree from the corpus based on the user's intention. It can be seen that the accuracy of intention recognition is directly related to the accuracy and pertinence of intelligent dialogue.

[0003] In the related art, the intent labels of the corpus are usually written by the developer in advance according to the dialogue scenario. When a new intent label needs to be added, the following two methods are usually adopted: one is that the developer manually writes the new intent label according to specific needs; the other is that the developer analyzes the corpus where the intent recognition fails and determines the new intent label from it. Summary of the invention

[0004] The embodiments of the present disclosure provide a method, electronic device, medium, and computer program product for generating intent labels to improve the efficiency of generating intent labels.

[0005] According to one aspect of an embodiment of the present disclosure, a method for generating an intent label is provided, comprising: obtaining an original text set, the original text set including at least one original text whose intent is not recognized; based on a preset clustering algorithm, determining at least one text subset from the original text set, each text subset including at least one original text; based on the original text set, determining a first feature value of each word contained in the original text corresponding to the original text; for each text subset, determining a second feature value of each word corresponding to the text subset based on the first feature value corresponding to each original text in the text subset; based on the second feature value, selecting a first preset number of keywords from the text subset, and generating a word embedding for each keyword; based on the second feature value of each keyword and the respective word embedding, determining a feature vector for the text subset; based on the similarity between the word embedding of each keyword and the feature vector, determining a target keyword from each keyword, and determining the target keyword as the intent label for the text subset.

[0006] In some embodiments, the first feature value is determined through the following steps: segmenting the original text to obtain the individual words included in the original text; determining the word frequency and inverse text frequency index of each word included in the original text in the original text set; based on the word frequency and inverse text frequency index, determining the first feature value of each word included in the original text.

[0007] In some embodiments, based on the first feature value corresponding to each word and each original text in the text subset, the second feature value of the word corresponding to the text subset is determined, including: the sum of the first feature values ​​corresponding to each word and each original text in the text subset is determined as the second feature value of the word corresponding to the text subset.

[0008] In some embodiments, determining the feature vector of the text subset based on the second feature value of each keyword and the respective word embedding includes: summing the products of the second feature value of each keyword and the respective word embedding to determine the feature vector of the text subset.

[0009] In some embodiments, obtaining the original text set includes: obtaining historical conversation logs of the intelligent conversation system and classification results of a preset intent classifier for the historical conversation logs; based on the classification results, extracting historical conversation texts without recognized intent tags from the historical conversation logs as original texts to obtain the original text set.

[0010] In some embodiments, the method further includes: for each text subset, based on the sum of the products of the similarities corresponding to the keywords contained in each original text and the first feature value of the keyword, selecting a second preset number of target texts from the text subset to obtain a target text set; and determining the target text set as a text set that matches the intention label of the text subset.

[0011] In some embodiments, the method further includes: constructing a sample set based on sample texts marked with intent labels, wherein the sample texts include target texts, and the intent labels of the target texts are the intent labels of the text subsets to which the target texts belong; inputting the sample texts in the sample set into a pre-constructed initial intent classification model, taking the intent labels marked with the sample texts as expected outputs, training the initial intent classification model, and obtaining a trained intent classification model.

[0012] In some embodiments, the method further includes: in response to a user's conversational statement, inputting the conversational statement into an intent classification model to obtain a target intent label for the conversational statement; in response to the target intent label being an intent label of the first type, determining a target reply statement with the highest degree of match with the target intent label from a preset corpus, and sending the target reply statement; in response to the target intent label being an intent label of the second type, storing the conversational statement in an original text set.

[0013] According to another aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a memory for storing a computer program; a processor for executing the computer program stored in the memory, and when the computer program is executed, the method for generating an intent tag in any of the above embodiments is implemented.

[0014] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for generating an intent tag in any of the above embodiments is implemented.

[0015] According to another aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program / instruction, which implements the method for generating an intent tag in any of the above embodiments when executed by a processor.

[0016] The method for generating an intent label provided by the embodiment of the present disclosure first obtains an original text set, wherein the original text in the original text set is the original text whose intent is not recognized, and at least one text subset is determined from the original text set by using a clustering algorithm; then, the first feature value of each word contained in the original text corresponding to the original text is determined; then, for each text subset, based on the first feature value corresponding to each word and each original text in the text subset, the second feature value of the word corresponding to the text subset is determined, and based on the second feature value, a first preset number of keywords are selected from the text subset, and a word embedding of each keyword is generated at the same time; then, based on the second feature value and the word embedding of each keyword, a feature vector of the text subset is determined; finally, based on the similarity between the word embedding of each keyword and the feature vector, a target keyword is determined from each keyword, and the target keyword is determined as the intent label of the text subset. Intent labels can be generated based on text sets that fail to recognize intent, which can improve the efficiency of generating intent labels and avoid the adverse effects of subjective factors of developers on the accuracy of intent labels.

[0017] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0019] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:

[0020] FIG. 1( a ) and FIG. 1( b ) are schematic diagrams of an application scenario of the method for generating intent labels disclosed herein;

[0021] Figure 2 A flowchart of an embodiment of a method for generating an intent tag according to the present disclosure;

[0022] Figure 3 A flowchart of another embodiment of the method for generating an intent tag according to the present disclosure;

[0023] Figure 4 A flowchart of another embodiment of the method for generating an intent tag disclosed in the present invention;

[0024] Figure 5 A flowchart of another embodiment of the method for generating an intent tag disclosed in the present invention;

[0025] Figure 6 A flowchart of another embodiment of the method for generating an intent tag according to the present disclosure;

[0026] Figure 7 A schematic diagram of the structure of an embodiment of a device for generating an intent tag according to the present disclosure;

[0027] Figure 8 The figure is a schematic diagram of the structure of an application embodiment of the electronic device disclosed in the present invention. DETAILED DESCRIPTION

[0028] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.

[0029] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.

[0030] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.

[0031] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0032] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.

[0033] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0034] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.

[0035] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0036] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.

[0037] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0038] The disclosed embodiments can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.

[0039] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.

[0040] SUMMARY OF THE DISCLOSURE

[0041] In the process of implementing the present disclosure, the inventors found that in the related art, the intent labels of the intelligent dialogue system are usually written by developers in advance according to the dialogue scenario. With the increase of business volume and dialogue data, it is often necessary to expand the dimension of intent labels or refine the granularity of intent labels. New intent labels are usually generated in the following two ways: one is for developers to manually write new intent labels according to specific needs; the other is for developers to analyze the corpus where intent recognition fails and determine new intent labels from it.

[0042] The above two methods require high professional literacy of developers. Developers need to process a large amount of data to extract new intent labels, which is time-consuming and the generated new intent labels will inevitably carry subjective factors of developers.

[0043] Exemplary Overview

[0044] FIG. 1( a ) and FIG. 1( b ) are schematic diagrams showing an application scenario for generating intent tags according to the present disclosure.

[0045] First, refer to FIG. 1(a). In the dialogue scenario shown in FIG. 1(a), the mobile terminal 101 may be a smart phone, or a terminal computer, a laptop computer, a tablet computer, etc., on which a client of the intelligent dialogue system is installed. The mobile terminal 101 and the server 109 may be connected via a network. The user may exchange information with the server 109 through the intelligent dialogue system. For example, the user may input "Do you have a two-bedroom apartment?" in the interactive interface of the client of the intelligent dialogue system, and the client of the intelligent dialogue system may send the information to the server 109. The server 109 may input the received user session information 102 into the intent classifier 103. When there is an intent tag matching the user session information 102 in the intent classifier 103, the intent tag 104 of the user session information 102 may be output, for example, it may be "Ask about the apartment type". Afterwards, the server 105 can retrieve the reply corpus 105 based on the intent tag 104, filter out the reply sentence 106 that has the highest degree of match with the intent tag, send the reply sentence 106 to the mobile terminal 101, and present the reply sentence to the user through the client of the intelligent conversation system, thereby completing a round of intelligent dialogue.

[0046] When there is no intent label matching the user session information in the intent classifier 103, the intent label 104 of the user session information may be output, indicating that the intent label of the user session information cannot be identified. At this time, the user session information may be used as the "original text" in the method for generating intent labels disclosed in the present invention.

[0047] Next, referring to FIG. 1(b), in the scenario shown in FIG. 1(b), the electronic device 110 on which the method for generating an intent tag of the present disclosure runs can be a terminal device or a server. The execution subject 110 can extract historical session information without recognized intent tags from the session log of the mobile terminal 101 as the original text to construct the original text set 110. Afterwards, the execution subject can determine at least one text subset from the original text set 110, such as 112 and 113 shown in FIG. 1(b). Then, two groups of keywords 114 and 115 are determined from the text subsets 112 and 113, respectively, and the most representative target keywords 116 and 117 are selected therefrom. Finally, the target keyword 116 is determined as the intent tag 118 of the text subset 112, and the target keyword 117 is determined as the intent tag 119 of the text subset 113, thereby realizing the extraction of new intent tags from text data without recognized intent tags.

[0048] Exemplary Methods

[0049] Figure 2 A flowchart of an embodiment of the present disclosure for generating an intent tag is shown in FIG. Figure 2 As shown, the process includes the following steps:

[0050] Step 210: Obtain the original text set.

[0051] The original text set includes at least one original text whose intent is not recognized.

[0052] In this embodiment, the original texts in the original text set table are all text data that are not marked with intent labels, for example, they may be texts that have not been recognized for intent, or they may be texts that have not been recognized for intent labels after intent recognition.

[0053] In a specific example, the execution entity (such as the electronic device 110 in Figure 1) can extract user conversation texts that are not marked with intent tags or have intent tags of "other" or "recognition failed" from the conversation log of the intelligent conversation system as original texts to construct an original text set.

[0054] Step 220: Determine at least one text subset from the original text set based on a preset clustering algorithm.

[0055] Each text subset includes at least one original text.

[0056] In this embodiment, the text subset represents a set of original texts with common features determined from the original text set, and each text subset may represent a set of original texts of a category.

[0057] As an example, the execution subject performs unsupervised free clustering (for example, K-means clustering or Gaussian mixture clustering) on ​​the original text set to obtain at least one text subset, each of which represents a set of original texts of a category.

[0058] Step 230: Based on the original text set, determine the first feature value of each word contained in the original text corresponding to the original text.

[0059] In this embodiment, the first feature value represents the importance of the word in the original text set.

[0060] As an example, the first eigenvalue may be positively correlated with the number of times a word appears in the original text set. The executor may first segment the original text, then count the number of times each word appears in the original text set, and then normalize the number of occurrences. The resulting value may be used as the first eigenvalue of the word. The greater the number of occurrences, the greater the first eigenvalue.

[0061] Thereafter, steps 240 to 270 are performed on each text subset determined in step 220 .

[0062] Step 240: Based on the first feature value corresponding to each word and each original text in the text subset, determine the second feature value of the word corresponding to the text subset.

[0063] In this embodiment, the second feature value represents the importance of the word in the text subset. As an example, the second feature value may be positively correlated with the number of occurrences of the word in the text subset.

[0064] In a specific example, the execution entity may first determine the number of occurrences of a word in a text subset, then normalize the number of occurrences of the word in the text subset to obtain a normalized number of occurrences, and then determine the weighted sum of the normalized number of occurrences and the first eigenvalue as the second eigenvalue of the word.

[0065] Step 250: Based on the second feature value, select a first preset number of keywords from the text subset, and generate a word embedding for each keyword.

[0066] In this embodiment, keywords can represent representative words in a text subset, and different keywords can represent the characteristics of a text subset in different dimensions. Word embedding is a vector representation of a word.

[0067] As an example, the execution entity may sort the words in the text subset in descending order of the second eigenvalue, and then extract a first preset number of keywords in the sorted order, and then use a One-hot algorithm to generate a word embedding for each keyword.

[0068] Step 260: Determine a feature vector of the text subset based on the second feature value and word embedding of each keyword.

[0069] In this embodiment, the feature vector of the text subset can represent the commonality of each original text in the text subset.

[0070] As an example, the execution entity may perform weighted averaging based on the second feature value of each word in the text subset and the word embedding, and determine the obtained vector as the feature vector of the text subset.

[0071] Step 270: Based on the similarity between the word embedding of each keyword and the feature vector, a target keyword is determined from each keyword, and the target keyword is determined as the intent label of the text subset.

[0072] In this embodiment, the similarity between the word embedding and the feature vector of the text subset is used to characterize the similarity between the word and the commonality of the original texts in the text subset. The higher the similarity, the more accurate the word is in describing the commonality of the original texts in the text subset.

[0073] As an example, the execution entity can use Hamming distance or cosine distance to represent the similarity between word embedding and feature vector, so as to determine the similarity value of each keyword respectively, and then determine the keyword with the highest similarity value as the target keyword, and determine the target keyword as the intent label of the text subset.

[0074] The method for generating an intent label provided by the embodiment of the present disclosure first obtains an original text set, wherein the original text in the original text set is the original text whose intent is not recognized, and at least one text subset is determined from the original text set by using a clustering algorithm; then, the first feature value of each word contained in the original text corresponding to the original text is determined; then, for each text subset, based on the first feature value corresponding to each word and each original text in the text subset, the second feature value of the word corresponding to the text subset is determined, and based on the second feature value, a first preset number of keywords are selected from the text subset, and a word embedding of each keyword is generated at the same time; then, based on the second feature value and the word embedding of each keyword, a feature vector of the text subset is determined; finally, based on the similarity between the word embedding of each keyword and the feature vector, a target keyword is determined from each keyword, and the target keyword is determined as the intent label of the text subset. Intent labels can be generated based on text sets that fail to recognize intent, which can improve the efficiency of generating intent labels and avoid the adverse effects of subjective factors of developers on the accuracy of intent labels.

[0075] In some optional implementations of this embodiment, the first feature value is determined through the following steps: segmenting the original text to obtain each word included in the original text; determining the word frequency and inverse text frequency index of each word included in the original text in the original text set; based on the word frequency and inverse text frequency index, determining the first feature value of each word included in the original text.

[0076] In this implementation, the word frequency represents the frequency of the word appearing in the entire original text set. The inverse text frequency index represents the frequency of the word appearing in other original texts. The higher the inverse text frequency, the greater the difference between the original text in which the word is located and other original texts, and the higher the degree to which the word describes the characteristics of the original text. The first eigenvalue can be the product of the word frequency and the inverse text frequency index. In this way, the higher the frequency of the word in the original text in the original text set and the lower the frequency of its appearance in other original texts, the larger the first eigenvalue of the word, representing the higher the importance of the word in the original text within the original text set.

[0077] As an example, if the word "A" appears m times in the original text, and the original text includes n words in total, then the word frequency of "A" is m / n; if the number of original texts containing "A" in the original text set is x, and the original text set includes y original texts in total, then the inverse text frequency index of "A" is "y / (x+1)", then the first eigenvalue of "A" can be the product of the word frequency and the inverse text frequency index.

[0078] In this implementation, the first eigenvalue determined based on the word frequency and inverse text frequency index can simultaneously reflect the number of times the word appears in the entire original text set and the difference between the original text in which the word is located and other original texts. Therefore, it can more accurately characterize the importance of the word in the original text set.

[0079] In some optional implementations of this embodiment, based on the first feature value corresponding to each word and each original text in the text subset, the second feature value of the word corresponding to the text subset is determined, including: determining the sum of the first feature values ​​corresponding to each word and each original text in the text subset as the second feature value of the word corresponding to the text subset.

[0080] As an example, the text subset includes original texts 1, 2, 3, and 4. These four original texts include words "B", "C", and "D", where the first eigenvalues ​​of "B" in each original text are 0.1, 0.3, 0.3, and 0.4, respectively, and the second eigenvalue of B is 1.1; the first eigenvalues ​​of "C" in each original text are 0.1, 0.1, 0.1, and 0.1, respectively, and the second eigenvalue of "C" is 0.4.

[0081] In this implementation, the second feature value can more accurately represent the importance of each word in the text subset relative to the text subset.

[0082] In some optional implementations of this embodiment, the feature vector of the text subset is determined based on the second feature value of each keyword and the respective word embedding, including: summing the products of the second feature value of each keyword and the respective word embedding to determine the feature vector of the text subset.

[0083] As an example, the second eigenvalues ​​of keywords "E" and "F" are 0.5 and 0.8 respectively. The word embedding of "E" is a vector (a, b, c, d), and the word embedding of "F" is a vector (e, f, g, h). Then the feature vector of the text subset is (0.5a+0.8e, 0.5b+0.8f, 0.5c+0.8g, 0.5d+0.8h).

[0084] In this implementation, different keywords can represent the characteristics of text subsets in different dimensions, and the sum of the products of the second eigenvalue of each keyword and their respective word embeddings is determined as the feature vector of the text itself, so that the feature vector can represent the characteristics of the text subset from multiple different dimensions.

[0085] Next reference Figure 3 ,like Figure 3 As shown, in some optional implementations of this embodiment, step 210 may further include:

[0086] Step 310: Obtain the historical conversation logs of the intelligent conversation system and the classification results of the preset intent classifier for the historical conversation logs.

[0087] As an example, the execution entity can obtain historical data of the intelligent conversation system from the cloud or the client, and then extract the historical conversation logs and the classification results of the historical conversation logs by the intent classifier.

[0088] Step 320: Based on the classification result, extract the historical conversation text without recognized intent tags from the historical conversation log as the original text to obtain the original text set.

[0089] In this implementation, the original text is real data obtained from the historical data of the intelligent conversation system, so the original text has a higher degree of match with the real conversation scene, and the intent label generated thereby can more accurately represent the user's intent in the real conversation scene.

[0090] Next reference Figure 4 ,like Figure 4 As shown, in some optional implementations of this embodiment, Figure 2 Based on the process shown, the method may further include:

[0091] Step 410: For each text subset, based on the product of the similarity corresponding to the keyword contained in each original text and the first feature value of the keyword, select a second preset number of target texts from the text subset to obtain a target text set.

[0092] In this implementation, the first eigenvalue of a keyword can represent the importance of the keyword in the original text set, and the similarity corresponding to the keyword can represent the similarity between the keyword and the commonality of each original text in the text subset. The product of the two can simultaneously represent the importance of the keyword in the original text set and the similarity between the keyword and the commonality of each original text in the text subset. Furthermore, the product of the similarity of each keyword in the original text and the first eigenvalue of the keyword can simultaneously represent the importance of the original text in the original text set and the similarity between the original text and the commonality of each original text in the text subset.

[0093] As an example, the execution subject may sort the original texts in the text subset in descending order of the product sum value, and then select a second preset number of original texts from the text subset in the sorted order as target texts, thereby obtaining a target text set. The target text set obtained in this way may represent a collection of the most representative original texts in the text subset.

[0094] For another example, the execution subject may also determine the original texts whose product sum values ​​are greater than a preset threshold as target texts, and construct the target text sets in sequence.

[0095] Step 420: Determine the target text set as a text set that matches the intention label of the text subset.

[0096] In this implementation, the target text set represents the collection of the most representative original texts in the text subset, and the intent label represents the commonality of each original text in the text subset, thereby ensuring the matching degree between the target text set and the intent label. Using the target text set and the intent label as training data for the intent classification model can expand the sample dimension of the intent classification model and help improve the accuracy of the intent classification model.

[0097] Further, Figure 4 The target text set and its intent labels obtained in the embodiment shown can be used to construct sample data to train the intent classification model. Figure 5 For example, Figure 5 A flowchart of another embodiment of a method for generating an intent tag according to the present disclosure is shown, and the process includes:

[0098] Step 510: construct a sample set based on the sample texts marked with intent labels.

[0099] The sample text includes Figure 4 The target text in the illustrated embodiment, and the intention tag of the target text is the intention tag of the text subset to which the target text belongs.

[0100] In a specific example, the execution subject (which can be a terminal device or a server) can first obtain the historical conversation log of the intelligent conversation system to obtain the classification result of the historical conversation log by the intent classifier, and then extract the historical text marked with the old intent label and the historical text without the recognized intent label from it, wherein the historical text marked with the old intent label can be directly used as the sample text in this embodiment, and then the historical text without the recognized intent label is executed. Figure 4 According to the process shown, at least one target text set and its new intention label are obtained, and then each historical text in the target text set is labeled with a new intention label, and the labeled historical text is used as the sample text in this embodiment. In this way, the sample set can include historical texts labeled with the old intention label and historical texts labeled with the new intention label.

[0101] Step 520: Input the sample text in the sample set into the pre-built initial intent classification model, use the intent label marked by the sample text as the expected output, train the initial intent classification model, and obtain a trained intent classification model.

[0102] In this embodiment, the target text set and its intent labels are text data extracted from texts whose intent labels have not been identified, which can expand the dimension of the sample set. The classification granularity of the intent classification model trained thereby is finer and the accuracy is higher.

[0103] Furthermore, Figure 5 The intent classification model obtained by training the process shown can be applied to the intelligent conversation system. Figure 6 As shown, Figure 6 A flowchart of another embodiment of a method for generating an intent tag according to the present disclosure is shown, and the flowchart includes:

[0104] Step 610: In response to the user's conversation sentence, the conversation sentence is input into the intent classification model to obtain a target intent label of the conversation sentence.

[0105] In this embodiment, the intent classification model is Figure 5 The process shown is trained to identify the intent label of the conversation sentence based on the input conversation sentence.

[0106] Step 620: In response to the target intent tag being an intent tag of the first type, determine a target reply sentence that has the highest degree of match with the target intent tag from a preset corpus, and send the target reply sentence.

[0107] In this embodiment, the first type of intent label is the intent label output by the intent classification model when the conversation sentence is successfully recognized, which can represent the user's conversation intent.

[0108] Step 630: In response to the target intent tag being an intent tag of the second type, store the conversation sentence into the original text set.

[0109] In this embodiment, the second type of intent label represents the intent label output when the intent classification model fails to recognize the conversation intent of the conversation sentence, for example, it can be an intent label such as "other" or "recognition failed".

[0110] Continuing with the exemplary description in conjunction with FIG. 1( a ), the intelligent conversation system generally includes an interaction unit, an intent classifier, a corpus screening unit, and a corpus, wherein the interaction unit can receive a user's conversation sentence and present a target reply sentence to the user; the intent classifier is an intent classification model in this embodiment, which can identify the intent tag of the conversation sentence; the corpus screening unit can retrieve the target reply sentence from the corpus based on the intent tag of the conversation sentence.

[0111] It should be noted that the intelligent conversation system in this embodiment can be installed on a mobile terminal, can be installed on a server, or can adopt a distributed architecture and be set on both the mobile terminal and the server.

[0112] The interactive unit of the intelligent conversation system can be set in a mobile terminal, so that it can receive the conversation sentences generated by the user by operating the mobile terminal and present the target reply sentence to the user. The conversation sentence and the target reply sentence can be text messages or voice messages. The intention classifier, corpus screening unit and corpus can be set in the server. After the server receives the conversation sentence sent by the interactive unit, the intention classifier can identify the intention label of the conversation sentence.

[0113] When the intent classifier successfully identifies the intent label of the conversation sentence, it outputs the first type of intent label. The corpus screening unit searches the corpus according to the target intent label, determines the target reply sentence with the highest degree of match with the target intent label, and sends the target reply sentence to the interaction unit, thereby completing an intelligent conversation.

[0114] When the intent classifier cannot identify the conversation intent of the conversation sentence, the second type of intent label is output, and the conversation sentence can be stored in the original text set. Afterwards, the processes in the aforementioned embodiments can be performed on the expanded original text set to extract new intent labels from the original text set, construct new sample data based on the new intent labels, expand the training set of the intent classification model based on the new sample data, train the intent classification model based on the new training set, and apply the trained intent classification model to the intelligent conversation system.

[0115] The intent classification model in this embodiment is based on Figure 5 The method for training the intent classification model shown has higher accuracy and finer intent classification granularity, and can be applied to intelligent conversation systems. On the one hand, it can enable the intelligent conversation system to more accurately identify the user's conversation intention and make more targeted responses, which helps to improve the quality of the conversation; on the other hand, the conversation sentences for which the intent labels cannot be identified can be stored in the original text set, and through the processes in the aforementioned embodiments, the accuracy of intent classification can be further improved.

[0116] Exemplary Devices

[0117] Figure 7 Schematic diagram of the structure of the device for generating intent labels disclosed in the present invention, such as Figure 7 As shown, the device includes: an original text acquisition unit 710, configured to acquire an original text set, the original text set includes at least one original text whose intent is not recognized; an original text classification unit 720, configured to determine at least one text subset from the original text set based on a preset clustering algorithm, each text subset includes at least one original text; a first feature calculation unit 730, configured to determine, based on the original text set, a first feature value of each word contained in the original text corresponding to the original text; an intent label generation unit 740, configured to determine, for each text subset, a second feature value of each word corresponding to the text subset based on the first feature value corresponding to each original text in the text subset; based on the second feature value, select a first preset number of keywords from the text subset, and generate a word embedding for each keyword; based on the second feature value of each keyword and the respective word embedding, determine a feature vector of the text subset; based on the similarity between the word embedding of each keyword and the feature vector, determine a target keyword from each keyword, and determine the target keyword as the intent label of the text subset.

[0118] In this embodiment, the first feature calculation unit 730 further includes: a word segmentation module, configured to perform word segmentation on the original text to obtain each word included in the original text; a calculation module, configured to determine the word frequency and inverse text frequency index of each word included in the original text in the original text set; a determination module, configured to determine the first feature value of each word included in the original text based on the word frequency and inverse text frequency index.

[0119] In this embodiment, the intention label generation unit 740 includes: a second feature value calculation module, configured to determine the sum of the first feature values ​​corresponding to each word and each original text in the text subset as the second feature value of the word corresponding to the text subset.

[0120] In this embodiment, the intention tag generation unit 740 includes: a feature vector determination module configured to determine the feature vector of the text subset by summing the product of the second feature value of each keyword and the respective word embedding.

[0121] In this embodiment, the original text acquisition unit 710 further includes: a data acquisition module, configured to acquire the historical conversation logs of the intelligent conversation system and the classification results of the preset intent classifier for the historical conversation logs; a text extraction module, configured to extract the historical conversation text without recognized intent tags from the historical conversation logs based on the classification results as the original text, to obtain the original text set.

[0122] In this embodiment, the device also includes: a text set construction unit, configured to select a second preset number of target texts from each text subset based on the product of the similarity corresponding to the keyword contained in each original text and the first feature value of the keyword, to obtain a target text set; a text set determination unit, configured to determine the target text set as a text set that matches the intention label of the text subset.

[0123] In this embodiment, the device also includes: a text set construction unit, configured to select a second preset number of target texts from each text subset based on the product of the similarity corresponding to the keyword contained in each original text and the first feature value of the keyword, to obtain a target text set; a text set determination unit, configured to determine the target text set as a text set that matches the intention label of the text subset.

[0124] In this embodiment, the device also includes: a sample construction unit, configured to construct a sample set based on sample texts marked with intent labels, wherein the sample texts include target texts, and the intent labels of the target texts are the intent labels of the text subsets to which the target texts belong; a model training unit, configured to input the sample texts in the sample set into a pre-constructed initial intent classification model, use the intent labels marked with the sample texts as expected outputs, train the initial intent classification model, and obtain a trained intent classification model.

[0125] In this embodiment, the device also includes: a receiving unit, configured to input the conversation sentence into the intent classification model in response to the user's conversation sentence, and obtain a target intent label for the conversation sentence; a reply unit, configured to determine, in response to the target intent label being an intent label of the first type, a target reply sentence with the highest degree of match with the target intent label from a preset corpus, and send the target reply sentence; a storage unit, configured to store the conversation sentence in the original text set in response to the target intent label being an intent label of the second type.

[0126] In addition, an embodiment of the present disclosure further provides an electronic device, comprising: a memory for storing a computer program; a processor for executing the computer program stored in the memory, and when the computer program is executed, the method for generating an intent tag described in any of the above embodiments of the present disclosure is implemented.

[0127] Figure 8 This is a schematic diagram of the structure of an application embodiment of the electronic device disclosed in the present invention. Figure 8 The electronic device according to the embodiment of the present disclosure is described. The electronic device may be any one or both of the first device and the second device, or a stand-alone device independent of them, and the stand-alone device may communicate with the first device and the second device to receive the collected input signals from them.

[0128] like Figure 8 As shown, the electronic device includes one or more processors and memory.

[0129] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.

[0130] The memory may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor may execute the program instructions to implement the method for generating intent tags and / or other desired functions of the various embodiments of the present disclosure described above.

[0131] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).

[0132] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.

[0133] The output device can output various information to the outside, including the determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.

[0134] Of course, to simplify, Figure 8 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.

[0135] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps in the method for generating intent tags according to various embodiments of the present disclosure described in the above part of this specification.

[0136] The computer program product may be written in any combination of one or more programming languages ​​to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0137] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, cause the processor to execute the steps of the method for generating intent tags according to various embodiments of the present disclosure described in the above part of this specification.

[0138] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0139] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various media that can store program codes.

[0140] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.

[0141] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0142] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.

[0143] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.

[0144] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.

[0145] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

[0146] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.

Claims

1. A method for generating an intent label, characterized in that: include: Acquire an original text set, wherein the original text set includes at least one original text, and the original text is a text whose intent is not recognized; Based on a preset clustering algorithm, at least one text subset is determined from the original text set, each of the text subsets includes at least one of the original texts; Based on the original text set, determining a first feature value of each word contained in the original text corresponding to the original text; For each of the text subsets, based on the first feature values ​​corresponding to each word and each of the original texts in the text subset, determining the second feature value of the word corresponding to the text subset; Based on the second feature value, selecting a first preset number of keywords from the words in the text subset, and generating a word embedding for each of the keywords; Based on the second feature value and word embedding of each of the keywords, a feature vector of the text subset is determined; based on the similarity between the word embedding of each of the keywords and the feature vector, a target keyword is determined from each of the keywords, and the target keyword is determined as the intent label of the text subset.

2. The method according to claim 1, characterized in that: The step of determining that each word contained in the original text corresponds to a first feature value of the original text includes: Segmenting the original text to obtain each word included in the original text; Determine the word frequency and inverse text frequency index of each word included in the original text in the original text set; Based on the word frequency and the inverse text frequency index, a first feature value of each word included in the original text is determined.

3. The method according to claim 1, characterized in that Determining a second feature value of each word corresponding to the text subset based on the first feature value of each word corresponding to each of the original texts in the text subset includes: The sum of the first feature values ​​corresponding to each word and each of the original texts in the text subset is determined as the second feature value of the word corresponding to the text subset.

4. The method according to claim 1, characterized in that: Determining a feature vector of the text subset based on the second feature value and word embedding of each of the keywords includes: The product of the second feature value of each keyword and the respective word embedding is summed to determine the feature vector of the text subset.

5. The method according to claim 1, characterized in that Get the original text set, including: Obtaining historical conversation logs of the intelligent conversation system and classification results of a preset intent classifier for the historical conversation logs; Based on the classification result, historical conversation texts without recognized intent labels are extracted from the historical conversation logs as original texts to obtain the original text set.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: For each of the text subsets, based on the sum of the products of the word embedding of the keyword contained in each of the original texts and the feature vector and the first feature value of the keyword, a second preset number of target texts are selected from the text subset to obtain a target text set; The target text set is determined as a text set that matches the intention label of the text subset.

7. The method according to claim 6, characterized in that The method further comprises: Building a sample set based on sample texts marked with intent labels, wherein the sample texts include the target text, and the intent label of the target text is the intent label of the text subset to which the target text belongs; The sample texts in the sample set are input into a pre-built initial intent classification model, the intent labels marked by the sample texts are used as expected outputs, the initial intent classification model is trained, and a trained intent classification model is obtained.

8. The method according to claim 7, characterized in that The method further comprises: In response to a conversation sentence of a user, inputting the conversation sentence into the intent classification model to obtain a target intent label of the conversation sentence; In response to the target intent tag being an intent tag of the first type, determining a target reply sentence with the highest matching degree with the target intent tag from a preset corpus, and sending the target reply sentence; In response to the target intent tag being an intent tag of the second type, storing the conversation sentence in the original text set.

9. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program stored in the memory, and when the computer program is executed, the method for generating an intent tag described in any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for generating an intent tag as described in any one of claims 1 to 8 is implemented.

11. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the method for generating an intent tag as described in any one of claims 1 to 8 is implemented.