Method, apparatus, device, medium and program product for generating intent labels

By clustering data sets in the intelligent dialogue system and generating new intention labels, the problem of low efficiency and difficulty in guaranteeing the generation of unlabeled intention labels in the prior art is solved, and more efficient and accurate intention label generation is achieved.

CN114722180BActive Publication Date: 2025-04-18KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210455213.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-24
Publication Date
2025-04-18
Estimated Expiration
2042-04-24

AI Technical Summary

Technical Problem

In intelligent dialogue systems, it is difficult for the prior art to effectively generate unlabeled intention tags, which usually rely on manual tags, which are inefficient and difficult to guarantee accuracy.

Method used

New intent tags are generated by clustering datasets containing tagged historical intent tags and unlabeled intent tags. The specific steps include determining the data feature vectors in the data set, clustering to form a first cluster with the same historical intent tags and a second cluster composed of unlabeled data, and generating a new intent tag based on the second cluster.

Benefits of technology

On the basis of maintaining the original intention label, the generation efficiency and accuracy of unlabeled intention labels are improved, the conflict between clustering results and historical intention labels is avoided, and the potential association between historical intention labels and unlabeled data is utilized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114722180B_ABST
    Figure CN114722180B_ABST
Patent Text Reader

Abstract

The disclosed embodiments disclose a method, device, electronic device, storage medium and computer program product for generating intent labels, wherein the method comprises: obtaining a data set to be processed, wherein the data in the data set comprises first data with a historical intent label and second data without an intent label; clustering the data set to obtain at least one first cluster and at least one second cluster, wherein the first data included in each first cluster has the same historical intent label, and each second cluster is composed of second data; and generating a new intent label based on the second cluster. New intent labels can be generated based on data without an intent label in the data set while maintaining the historical intent labels, which helps to improve the efficiency and accuracy of generating intent labels.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In the human-computer dialogue scenario, the intelligent dialogue system first needs to identify the intent label of the user's message, and then select the best matching response message from multiple response templates corresponding to the intent label stored in the system, where the intent label can be used to represent the user's intention in the dialogue. In practice, manual labeling or machine learning algorithms (such as unsupervised clustering algorithms) are usually used to label text data.

[0003] In the related art, when a data set contains both labeled data and unlabeled data and a new intent label needs to be generated based on the unlabeled data, manual labeling is usually used to label the unlabeled data. Summary of the invention

[0004] Embodiments of the present disclosure provide a method, apparatus, electronic device, storage medium, and computer program product for generating an intent tag.

[0005] One aspect of an embodiment of the present disclosure provides a method for generating intent labels, including: obtaining a data set to be processed, the data in the data set including first data marked with historical intent labels and second data not marked with intent labels; clustering the data set to obtain at least one first cluster and at least one second cluster, wherein the first data included in each first cluster has the same historical intent label, and each second cluster consists of second data; and generating a new intent label based on the second cluster.

[0006] In some embodiments, clustering a data set includes: determining a feature vector of data in the data set; determining a target number of clusters to be clustered based on the number of historical intent labels and the number of new intent labels to be generated; selecting a target number of data from the data set as initial cluster centers; clustering the data in the data set into a target number of clusters based on the distance between the data in the data set and each initial cluster center, the distance being determined based on a feature vector of the data in the data set and a feature vector of the data serving as the initial cluster center; determining a new cluster center for each cluster based on the feature vector of the data included in each cluster, and updating the cluster based on the new cluster center to obtain an updated cluster; repeating the steps of determining a new cluster center for each cluster and updating the cluster until A preset termination condition is met to obtain at least one first cluster and at least one second cluster; wherein, a new cluster center of each cluster is determined according to the feature vector of the data included in each cluster, including: if the cluster includes only the first data or the second data, the new cluster center of the cluster is determined based on the mean of the feature vector of the first data or the second data included in the cluster; if the cluster includes the first data and the second data, a penalty term is determined based on the feature vector of the second data included in the cluster, and a new cluster center of the cluster is determined based on the feature vector of the first data included in the cluster and the penalty term; based on the new cluster center, the cluster is updated to obtain an updated cluster, including: based on the distance between the data in the data set and each new cluster center, the cluster to which the data in the data set belongs is updated.

[0007] In some embodiments, determining the penalty term based on the feature vector of the second data contained in the cluster includes: determining the sum of the feature vectors of the second data contained in the cluster; and determining the product of the sum of the feature vectors of the second data contained in the cluster and a preset penalty term coefficient as the penalty term.

[0008] In some embodiments, based on the characteristic vector of the first data contained in the cluster and the penalty term, determining a new cluster center of the cluster includes: determining the sum of the characteristic vectors of the first data contained in the cluster; determining the difference between the sum of the characteristic vectors of the first data contained in the cluster and the penalty term; based on the number of data contained in the cluster and the difference, determining the new cluster center of the cluster, the characteristic vector of the new cluster center is negatively correlated with the number of data contained in the cluster, and positively correlated with the difference.

[0009] In some embodiments, the method further includes: obtaining a conversation log of the intelligent dialogue system; extracting a conversation text from the conversation log; performing intent recognition on the conversation text using a pre-trained intent recognition model, and if there is a historical intent label that matches the conversation text, marking the historical intent label as the intent label of the conversation text and determining the conversation text as the first data; if there is no historical intent label that matches the conversation text, determining the conversation text as the second data; and constructing a text set based on the first data and the second data.

[0010] Another aspect of the embodiments of the present disclosure provides an apparatus for generating intent labels, comprising: a data acquisition unit, configured to acquire a data set to be processed, the data in the data set comprising first data marked with historical intent labels and second data not marked with intent labels; a data clustering unit, configured to cluster the data set to obtain at least one first cluster and at least one second cluster, wherein the first data included in each first cluster has the same historical intent label, and each second cluster consists of second data; and a label generation unit, configured to generate a new intent label based on the second cluster.

[0011] In some embodiments, the device also includes: a log acquisition unit, configured to acquire a conversation log of an intelligent dialogue system; a text extraction unit, configured to extract conversation text from the conversation log; an intention recognition unit, configured to perform intention recognition on the conversation text using a pre-trained intention recognition model, and if there is a historical intention label that matches the conversation text, mark the historical intention label as the intention label of the conversation text and determine the conversation text as the first data; if there is no historical intention label that matches the conversation text, determine the conversation text as the second data; and a data set construction unit, configured to construct the text set based on the first data and the second data.

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

[0013] Another aspect of the embodiments of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for generating an intent tag in any of the above embodiments.

[0014] Another aspect of the embodiments of the present disclosure provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the method for generating an intent tag in any of the above embodiments.

[0015] The method for generating intent labels provided by the embodiments of the present disclosure is for the case where the data set to be processed includes first data marked with historical intent labels and second texts without intent labels. By clustering the data set, the first data with the same historical intent labels are clustered into a first cluster, and the second data with the same category are clustered into a second cluster, and then new intent labels are generated based on the second cluster. New intent labels can be generated based on data without intent labels in the data set while maintaining the original intent labels, which helps to improve the efficiency and accuracy of generating intent labels.

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

[0017] 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.

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

[0019] Figure 1 A flowchart of an embodiment of a method for generating an intent tag disclosed in the present invention;

[0020] Figure 2 A schematic diagram of an application scenario of the method for generating intent tags disclosed in the present invention;

[0021] Figure 3 A schematic diagram of a clustering process in another embodiment of the method for generating intent labels disclosed herein;

[0022] Figure 4 for Figure 3 A schematic diagram of the effect of determining a new cluster center in the embodiment shown;

[0023] Figure 5 A schematic diagram of a process for determining a new cluster center in one embodiment of a method for generating an intent label disclosed herein;

[0024] Figure 6 A schematic diagram of the structure of an embodiment of a device for generating an intent tag disclosed in the present invention;

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

[0026] 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.

[0027] 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.

[0028] 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.

[0029] 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.

[0030] 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.

[0031] 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.

[0032] 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.

[0033] 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.

[0034] 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.

[0035] 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.

[0036] The embodiments of the present disclosure 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.

[0037] 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.

[0038] SUMMARY OF THE DISCLOSURE

[0039] Unsupervised clustering algorithms in related technologies usually include the following two processing methods when facing mixed data sets that include both labeled data and unlabeled data: directly clustering the mixed data set, or first separating the unlabeled data from the mixed data set and then clustering the unlabeled data separately. The former cannot effectively distinguish between labeled data and unlabeled data, resulting in some clusters including both labeled data and unlabeled data. When the intent labels of the data in the cluster are subsequently determined based on the cluster category, the new intent labels will conflict with the existing intent labels. Although the latter can avoid conflicts between clustering results and existing intent labels, it severs the potential association between the new intent labels and the existing intent labels and ignores the contribution of the existing intent labels.

[0040] In practice, experts usually determine new intent labels, and then use manual labeling to label the unlabeled data in the mixed data set. This results in low efficiency of data labeling, which is affected by subjective factors of the staff and difficult to guarantee accuracy.

[0041] Exemplary Methods

[0042] Combine the following Figure 1 The method for generating an intent label disclosed in the present invention is exemplified. Figure 1 A flowchart of an embodiment of a method for generating an intent tag of the present disclosure is shown, and the process includes the following steps:

[0043] Step 110: Obtain a data set to be processed.

[0044] The text in the data set includes first data marked with historical intent labels and second data not marked with intent labels.

[0045] In this embodiment, the historical intent label refers to an existing old intent label. The data set is a mixed data set including first data with labels and second data without labels.

[0046] As an example, the data in the dataset to be processed may be behavioral data, such as a user's purchasing behavior, browsing behavior, etc., or may be attribute data representing parameters of an object, such as the object's physical attributes, social attributes, etc.

[0047] In a specific example, the data set to be processed may be a text set. In order to accumulate data to improve the performance of the intelligent dialogue system, the intelligent dialogue system stores the dialogue logs generated during the dialogue process and their intent recognition results. Among them, the intent recognition results include the following two types: one is the dialogue text with a matching intent tag; the other is the dialogue text without a matching intent tag, and this type of dialogue text is marked as "recognition failure" or "other". The execution subject in this embodiment (for example, a terminal device or a server) can, for example, extract the dialogue text corresponding to the historical intent tag and the dialogue text with failed recognition or no intent tag from the dialogue log of the intelligent dialogue system according to the historical intent tag, as the first data and the second data, respectively, to obtain a data set.

[0048] Step 120: cluster the data set to obtain at least one first cluster and at least one second cluster.

[0049] The first data included in the first cluster have the same historical intent label, and the second cluster consists of the second data.

[0050] In this embodiment, the execution entity clusters the data set through a preset clustering algorithm, maintains the correspondence between the first data and the historical intent label in the data set, and clusters the first data with the same historical intent label into a first cluster; at the same time, clusters the second data with the same category into a second cluster.

[0051] As an example, the execution entity can use the K-means clustering algorithm to cluster the data set. During the iteration process, for clusters where the first data and the second data coexist, the execution entity can determine the cluster center of the cluster based on the difference between the feature vector of the first data and the feature vector of the second data, so that the cluster center is biased toward the first data or the second data, and thus away from the second data or the first data. In this way, the distance between the first data and the second data can be increased, thereby achieving the separation of the first data and the second data, and finally obtaining a first cluster composed of the first data and a second cluster composed of the second data.

[0052] Step 130: Generate a new intent label based on the second cluster.

[0053] In this embodiment, each cluster may include one or more category labels, wherein the category label of the second cluster may represent the characteristic attributes common to the second data contained in the second cluster, and the execution entity may generate a new intent label based on the category label of the second cluster.

[0054] As an example, the execution subject can also determine the keywords of each cluster through clustering, and then select the keyword with the highest priority as the new intent label of the cluster.

[0055] In an optional implementation of this embodiment, after the new intent label of the second cluster is determined, the second data included in the second cluster may be marked based on the new intent label.

[0056] Next reference Figure 2 , Figure 2 A scenario embodiment of the method for generating intent tags disclosed in the present invention is shown. Figure 2 In the scenario shown, the data to be processed is text data, and the server 200 may be a server of an intelligent dialogue system, on which the dialogue log of the intelligent dialogue system and its intention labels are stored, wherein the dialogue text for which the recognition fails or there is no matching intention label is marked as "other". The terminal device 210 may extract the dialogue text corresponding to the historical intention label and the dialogue text in "other" from the server 200 through the network, thereby obtaining a data set 220 to be processed, in which "△" and "○" represent data points corresponding to two types of first data, and "▲" and "●" represent data points corresponding to two types of second data. Then, the terminal device may perform clustering processing on the data set 220 to obtain two first clusters 230, 240 and two second clusters 250, 260, and then generate new intention labels according to the category labels of the second clusters 250 and 260, respectively. Afterwards, the second data in the second clusters 250 and 260 may also be marked, respectively.

[0057] The method for generating intent labels provided in this embodiment is for the case where the text set to be processed includes first data marked with historical intent labels and second data without intent labels. By clustering the data set, the first data with the same historical intent labels are clustered into at least one first cluster, and the second data with the same category are clustered into at least one second cluster, and then new intent labels are generated based on the second clusters. New intent labels can be generated based on data without intent labels in the data set while maintaining the original intent labels, which helps to improve the efficiency and accuracy of generating intent labels.

[0058] Next reference Figure 3 , Figure 3 A flow chart of clustering in another embodiment of the method for generating intent labels of the present disclosure is shown as follows: Figure 3 As shown, the process includes the following steps:

[0059] Step 310: Determine the feature vector of the data in the data set.

[0060] As an example, the data set may be a text set. In this case, the execution subject may convert the data in the data set into a feature vector through the word2vec or Bert algorithm, thereby mapping the data in the data set into a data point represented by the feature vector.

[0061] Step 320: Determine the target number of clusters to be clustered based on the number of historical intent labels and the number of new intent labels to be generated.

[0062] In this embodiment, the target number of words to be clustered represents a hyperparameter of the clustering algorithm, that is, the parameter K in the K-means algorithm.

[0063] Combined with the specific application scenario, the data set to be processed already has historical intent labels: T0~T n-1 , it is necessary to generate a new intent label based on the second data in the dataset: T n ~T n+m , then the target number can be determined to be n+m.

[0064] Step 330: Select a target number of data from the data set as initial cluster centers.

[0065] Continuing to explain with reference to the example in step 320 , the execution entity may randomly select n+m data from the data set as initial cluster centers.

[0066] Step 340: Cluster the data in the data set into a target number of clusters based on the distance between the data in the data set and each initial cluster center.

[0067] The distance between the data and the initial cluster center is determined based on the feature vector of the data in the data set and the feature vector of the data serving as the initial cluster center.

[0068] In this embodiment, the similarity between two data can be represented by the distance between the feature vectors. For example, the distance between the data and the initial cluster center can be determined by using Euclidean distance, cosine distance or Manhattan distance.

[0069] In a specific example, the execution subject calculates the distance between the data and the initial cluster center respectively, and then divides the data into the cluster represented by the initial cluster center with the smallest distance. The calculation process can be represented by formula (1).

[0070]

[0071] In the formula, t represents the number of iterations, represents the i-th cluster in the t-th iteration; x p Represents the feature vector corresponding to the p-th data in the i-th cluster; The feature vector representing the jth cluster center in the tth iteration; represents the feature vector of the i-th cluster center in the i-th iteration; k represents the number of targets.

[0072] Step 350: Determine a new cluster center of each cluster according to the feature vector of the data included in each cluster, and update the cluster based on the new cluster center to obtain an updated cluster.

[0073] Wherein, according to the characteristic vector of the data included in each cluster, the new cluster center of each cluster is determined, including: if the cluster includes only the first data or the second data, based on the mean of the characteristic vector of the first data or the second data contained in the cluster, the new cluster center of the cluster is determined; if the cluster includes the first data and the second data, based on the characteristic vector of the second data contained in the cluster, the penalty term is determined, and based on the characteristic vector of the first data contained in the cluster and the penalty term, the new cluster center of the cluster is determined.

[0074] For example, when the cluster includes only the first data or the second data, the execution entity may determine a new cluster center by using the following formula (2).

[0075]

[0076] In the formula, represents the cluster center of the i-th cluster in the t+1th iteration; represents the i-th cluster in the t-th iteration; express The number of Chinese characters; x j represents the feature vector corresponding to the jth data in the i-th cluster. It should be noted that in this step, Include only the second data or the first data.

[0077] In the field of machine learning, penalty terms are often used to modify the loss function in order to constrain the iterative process.

[0078] In this embodiment, the penalty term is a vector determined based on the feature vector of the second data. The execution entity can determine the feature vector of the new cluster center based on the feature vector of the first data and the penalty term, so as to constrain the relative distance of the new cluster center from the first data and the second data.

[0079] As an example, the execution subject can determine the mean of the feature vector of the second data and the mean of the feature vector of the first data contained in the cluster, and then use the mean of the feature vector of the second data as a penalty term, and use the difference between the mean of the feature vector of the first data and the penalty term as the feature vector of the new cluster center. In this way, if the number of first data contained in the cluster is more, the average distance between the new cluster center and the first data in the cluster is smaller, and the average distance between the new cluster center and the second data in the cluster is larger; conversely, if the number of second data contained in the cluster is more, the average distance between the new cluster center and the first data in the cluster is larger, and the average distance between the new cluster center and the second data in the cluster is smaller.

[0080] In some optional implementations of this embodiment, the penalty term may be determined in the following manner: determining the sum of the feature vectors of the second data included in the cluster; and determining the product of the sum of the feature vectors of the second data included in the cluster and a preset penalty term coefficient as the penalty term.

[0081] In this implementation, the penalty item coefficient can be predetermined based on experience, and the penalty item coefficient can be used to correct the penalty item, and the degree of constraint of the penalty item on the iteration process can be adjusted in turn, which helps to improve the iteration efficiency.

[0082] Combine the following Figure 4 The effect of the new cluster center is illustrated as follows: Figure 4 The effect of the present disclosure in determining new cluster centers is shown. Figure 4 In , "○" represents the data point corresponding to the first data, and "▲" and "●" represent the data point corresponding to the second data; point 410 is the first cluster center point determined based on the mean of the feature vectors of each text in the cluster, and point 420 is the second cluster center point determined based on step 360. It can be seen from the figure that point 410 is close to the first data and the second data; point 420 is farther from the first data and closer to the second data.

[0083] In this embodiment, updating the cluster based on the new cluster center to obtain the updated cluster includes: updating the cluster to which the data in the data set belongs based on the distance between the data in the data set and the new cluster center to obtain the updated cluster.

[0084] As an example, after determining the new cluster centers, the execution entity may calculate the distance between each data and each new cluster center, and then re-divide the data into clusters with the closest distances to obtain updated clusters.

[0085] Step 360, repeating the steps of determining new cluster centers and updating clusters until a preset termination condition is met, thereby obtaining at least one first cluster and at least one second cluster.

[0086] As an example, the termination condition may be that the number of iterations reaches a preset iteration number threshold, or that the distance between the new cluster center and the cluster center in the previous iteration is less than a preset distance threshold.

[0087] from Figure 3 It can be seen that Figure 3 The clustering process shown embodies that: during the iteration process, when the cluster contains both the first data and the second data, the penalty term is determined based on the feature vector of the second data contained in the cluster, and then the new cluster center is determined based on the feature vector of the first data contained in the cluster and the penalty term. By constraining the relative distance between the new cluster center and the first data and the second data with the penalty term, the first data and the second data are separated through multiple iterations, thereby obtaining a first cluster composed of the first data and a second cluster composed of the second data. The clustering result obtained in this way not only retains the corresponding relationship between the historical intent label and the first data, avoiding the conflict between the clustering result and the historical intent label, but also can utilize the potential connection and difference between the clusters formed by the historical intent label and the second data, which can improve the accuracy of the clustering result.

[0088] exist Figure 3 The illustrated embodiment is based on reference Figure 5 , Figure 5 The process of determining a new cluster center in one embodiment of the method for generating intent labels disclosed in the present invention is shown as follows: Figure 5 As shown, the process may include the following steps:

[0089] Step 510: Determine the sum of the feature vectors of the second data contained in the cluster.

[0090] Step 520: Determine the product of the sum of the feature vectors of the second data contained in the cluster and the preset penalty item coefficient as the penalty item.

[0091] Step 530: Determine the sum of the feature vectors of the first data contained in the cluster.

[0092] Step 540: Determine the difference between the sum of the feature vectors of the first data contained in the cluster and the penalty term.

[0093] Step 550: Determine a new cluster center of the cluster based on the number and difference of data contained in the cluster.

[0094] Among them, the eigenvector of the new cluster center is negatively correlated with the number of data contained in the cluster and positively correlated with the difference.

[0095] In this embodiment, the above steps 510 to 550 can be expressed by the following formula (3).

[0096]

[0097] In the formula, The cluster center of the lth cluster in the t+1th iteration; express The number of Chinese characters; TAG represents a subset of the first data, express The qth data in S TAG ; express The rth data in S, and the data does not belong to S TAG ; α represents the penalty coefficient.

[0098] Figure 5 The illustrated implementation embodies a step of determining a new cluster center based on the difference between the mean of the feature vector of the first data contained in the cluster and the penalty term and the number of data in the cluster, which helps to improve the calculation accuracy of the new cluster center.

[0099] In some optional implementations of the above embodiments, the data set to be processed can be obtained in the following manner: obtain the conversation log of the intelligent dialogue system; extract the conversation text from the conversation log; use a pre-trained intention recognition model to perform intent recognition on the conversation text, and if there is a historical intention label that matches the conversation text, mark the historical intention label as the intention label of the conversation text and determine the conversation text as the first data; if there is no historical intention label that matches the conversation text, determine the conversation text as the second data; and construct a text set based on the first data and the second data.

[0100] In this embodiment, the execution subject can extract the dialogue text from the log of the intelligent dialogue system, and then use the pre-trained intention recognition model to perform intent recognition on the dialogue text. If there is a historical intention label matching the dialogue text, the dialogue text is determined as the first data; if there is no historical intention label matching the dialogue text, the dialogue text is determined as the second data, and then the first data and the second data are merged to obtain the data set to be processed. After that, the data set can be processed. Figure 2 or Figure 3 The process shown generates a new intent label for the second data, which helps to improve the pertinence of data in the intelligent dialogue system.

[0101] Exemplary Devices

[0102] Reference below Figure 6 , Figure 6 A schematic diagram of the structure of an embodiment of the device for generating intent labels disclosed in the present invention is shown as follows: Figure 6As shown, the device includes: a data acquisition unit 610, configured to acquire a data set to be processed, the data in the data set including first data marked with a historical intent label and second data without a marked intent label; a data clustering unit 620, configured to cluster the data set to obtain at least one first cluster and at least one second cluster, wherein the first data included in each first cluster has the same historical intent label, and the second cluster consists of the second data; a label generation unit 630, configured to generate a new intent label based on the second cluster.

[0103] In one embodiment, the data clustering unit 620 further includes: a vector generation module, configured to determine the feature vector of the data in the data set; a parameter determination module, configured to determine the target number of clusters to be clustered based on the number of historical intent labels and the number of new intent labels to be generated; an initialization module, configured to select a target number of data from the data set as initial cluster centers; an initial clustering module, configured to cluster the data in the data set into a target number of clusters based on the distance between the data in the data set and each initial cluster center, wherein the distance is determined based on the feature vector of the data in the data set and the feature vector as the initial cluster center; an update module, configured to determine a new cluster center for each cluster based on the feature vector of the data included in each cluster, and update the cluster based on the new cluster center to obtain an updated cluster; an iteration module, configured to repeatedly determine the new cluster center for each cluster. The method comprises the steps of determining a new cluster center of each cluster and updating the cluster until a preset termination condition is met, thereby obtaining at least one first cluster and at least one second cluster; wherein the updating module further comprises a first center submodule, a second center submodule and a data updating submodule, wherein the first center submodule is configured to: if the cluster includes only the first data or the second data, determine the new cluster center of the cluster based on the mean of the feature vector of the first data or the second data contained in the cluster; the second center module is configured to: if the cluster includes the first data and the second data, determine the penalty term based on the feature vector of the second data contained in the cluster, and determine the new cluster center of the cluster based on the feature vector of the first data contained in the cluster and the penalty term; the data updating submodule is configured to: based on the distance between the data in the data set and each new cluster center, update the cluster to which the data in the data set belongs to obtain an updated cluster.

[0104] In one embodiment, the second center module further includes a penalty item submodule, which is configured to: determine the sum of the feature vectors of the second data contained in the cluster; and determine the product of the sum of the feature vectors of the second data contained in the cluster and a preset penalty item coefficient as the penalty item.

[0105] In one embodiment, the second center module also includes a center determination submodule, which is configured to: determine the sum of the characteristic vectors of the first data contained in the cluster; determine the difference between the sum of the characteristic vectors of the first data contained in the cluster and the penalty term; based on the number of data contained in the cluster and the difference, determine a new cluster center of the cluster, the characteristic vector of the new cluster center is negatively correlated with the number of data contained in the cluster, and positively correlated with the difference.

[0106] In one of the embodiments, the device also includes: a log acquisition unit, configured to acquire a conversation log of an intelligent dialogue system; a text extraction unit, configured to extract conversation text from the conversation log; an intention recognition unit, configured to perform intention recognition on the conversation text using a pre-trained intention recognition model, and if there is a historical intention label that matches the conversation text, mark the historical intention label as the intention label of the conversation text and determine the conversation text as the first data; if there is no historical intention label that matches the conversation text, determine the conversation text as the second data; and a data set construction unit, configured to construct the data set based on the first data and the second data.

[0107] In addition, an embodiment of the present disclosure further provides an electronic device, including:

[0108] A memory for storing a computer program product;

[0109] The processor is used to execute the computer program product stored in the memory, and when the computer program is executed, the method for generating an intent label in any of the above embodiments of the present disclosure is implemented.

[0110] Below, reference Figure 7 An electronic device according to an embodiment of the present disclosure is described.

[0111] Figure 7 A block diagram of an electronic device according to an embodiment of the present disclosure is illustrated.

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

[0113] 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.

[0114] The memory may include storing one or more computer program products, and the memory 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 computer 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.

[0115] 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).

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

[0117] The output device can output various information to the outside, including 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.

[0118] Of course, to simplify, Figure 7 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.

[0119] 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 of generating intent tags according to various embodiments of the present disclosure described in the above part of this specification.

[0120] 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.

[0121] 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.

[0122] 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.

[0123] 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.

[0124] 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.

[0125] 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.

[0126] 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.

[0127] 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.

[0128] 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.

[0129] 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 a data set to be processed, where data in the data set is extracted from a dialogue log of an intelligent dialogue system, and the data in the data set includes first data marked with a historical intent label and second data not marked with an intent label; Clustering the data set to obtain at least one first cluster and at least one second cluster, wherein the first data included in each of the first clusters have the same historical intent label, and each of the second clusters consists of second data with the same category; Based on the second cluster, generating a new intent label; The clustering of the data set includes: Determining a feature vector of data in the data set; Determining a target number of clusters to be clustered based on the number of the historical intent labels and the number of new intent labels to be generated; Selecting a target number of data from the data set as initial clustering centers; Clustering the data in the data set into a target number of clusters based on a distance between the data in the data set and each of the initial cluster centers, wherein the distance is determined based on a feature vector of the data in the data set and a feature vector of the data serving as the initial cluster center; Determine a new cluster center of each cluster according to the feature vector of the data included in each cluster, and update the cluster based on the new cluster center to obtain an updated cluster; The steps of determining a new cluster center of each cluster and updating the cluster are repeated until a preset termination condition is met, thereby obtaining the at least one first cluster and the at least one second cluster.

2. The method according to claim 1, characterized in that The determining of the new cluster center of each cluster according to the feature vector of the data included in each cluster includes: if the cluster includes only the first data or the second data, determining the new cluster center of the cluster based on the mean of the feature vector of the first data or the second data included in the cluster; if the cluster includes the first data and the second data, determining a penalty term based on the feature vector of the second data included in the cluster, and determining the new cluster center of the cluster based on the feature vector of the first data included in the cluster and the penalty term; The updating of the cluster based on the new cluster center to obtain an updated cluster includes: updating the cluster to which the data in the data set belongs based on the distance between the data in the data set and each of the new cluster centers to obtain an updated cluster.

3. The method according to claim 2, characterized in that Determining a penalty item based on a feature vector of the second data contained in the cluster includes: determining a sum of feature vectors of the second data contained in the cluster; The penalty item is determined as the product of the sum of the feature vectors of the second data contained in the cluster and a preset penalty item coefficient.

4. The method according to claim 3, characterized in that Determining a new cluster center of the cluster based on the feature vector of the first data contained in the cluster and the penalty item includes: Determine a sum of feature vectors of the first data contained in the cluster; Determine a difference between a sum of feature vectors of the first data contained in the cluster and the penalty term; Based on the amount of data included in the cluster and the difference, a new cluster center of the cluster is determined, and a feature vector of the new cluster center is negatively correlated with the amount of data included in the cluster and positively correlated with the difference.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Get the conversation log of the intelligent dialogue system; extracting a conversation text from the conversation log; Performing intent recognition on the dialogue text using a pre-trained intent recognition model, and if there is a historical intent label matching the dialogue text, marking the historical intent label as the intent label of the dialogue text and determining the dialogue text as the first data; if there is no historical intent label matching the dialogue text, determining the dialogue text as the second data; The data set is constructed based on the first data and the second data.

6. A device for generating an intent tag, characterized in that: include: a data acquisition unit configured to acquire a data set to be processed, wherein the data in the data set is extracted from a dialogue log of the intelligent dialogue system, and the data in the data set includes first data marked with a historical intent label and second data not marked with an intent label; a data clustering unit configured to cluster the data set to obtain at least one first cluster and at least one second cluster, wherein the first data included in each of the first clusters have the same historical intent label, and each of the second clusters consists of second data with the same category; a label generation unit, configured to generate a new intent label based on the second cluster; Wherein, the data clustering unit includes: A vector generation module, configured to determine a feature vector of the data in the data set; a parameter determination module configured to determine a target number of clusters to be clustered based on the number of the historical intent labels and the number of new intent labels to be generated; An initialization module is configured to select a target number of data from the data set as initial clustering centers; an initial clustering module, configured to cluster the data in the data set into a target number of clusters based on a distance between the data in the data set and each of the initial cluster centers, wherein the distance is determined based on a feature vector of the data in the data set and a feature vector of the data serving as the initial cluster center; An updating module is configured to determine a new cluster center of each cluster according to a feature vector of the data included in each cluster, and update the cluster based on the new cluster center to obtain an updated cluster; The iteration module is configured to repeat the steps of determining a new cluster center of each cluster and updating the cluster until a preset termination condition is met, thereby obtaining the at least one first cluster and the at least one second cluster.

7. The device according to claim 6, characterized in that The device also includes: A log acquisition unit, configured to acquire a dialogue log of the intelligent dialogue system; A text extraction unit, configured to extract a conversation text from the conversation log; an intention recognition unit configured to perform intention recognition on the dialogue text using a pre-trained intention recognition model, and if there is a historical intention label matching the dialogue text, mark the historical intention label as the intention label of the dialogue text and determine the dialogue text as the first data; if there is no historical intention label matching the dialogue text, determine the dialogue text as the second data; The data set construction unit is configured to construct the data set based on the first data and the second data.

8. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute a computer program stored in the memory, and when the computer program is executed, implement the method described in any one of claims 1 to 5.

9. 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 described in any one of claims 1 to 5 is implemented.

10. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Target recognition method and target recognition device

    CN105095905A

  • Identification method and device for high occurrence place of livelihood problem and electronic equipment

    CN112131382A

  • Method for generating intention tag, electronic equipment, a medium and program product

    CN113961709A