Dialogue data clustering method and device, electronic equipment and storage medium

By encoding the intent and speaker information of each round of dialogue text in the dialogue data, a sequence of representation vectors is generated, and the similarity is calculated based on the similarity matrix. This solves the problem of loss of contextual information and logical relationships in traditional clustering methods and achieves efficient clustering of dialogue data.

CN121808430APending Publication Date: 2026-04-07BEIJING ZHONGKE JINDEZHU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-10
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Traditional clustering methods lose contextual information and logical relationships between rounds when processing multi-round, lengthy dialogue data, resulting in poor clustering performance.

Method used

By encoding the intent and speaker information of each round of dialogue text, a sequence of representation vectors is generated. The similarity between dialogue data is calculated by combining the similarity matrix, and an appropriate clustering algorithm is used for clustering.

Benefits of technology

It effectively preserves the contextual information of the dialogue data and the logical relationships between rounds, significantly improving the clustering effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121808430A_ABST
    Figure CN121808430A_ABST
Patent Text Reader

Abstract

The invention discloses a dialogue data clustering method and device, electronic equipment and a storage medium. The dialogue data clustering method comprises the steps of obtaining multiple pieces of dialogue data and an intention of each round of dialogue text in the dialogue data, wherein the dialogue data comprises multiple rounds of dialogue texts among different speakers; each piece of dialogue data is encoded, a representation vector sequence of each piece of dialogue data is obtained, the representation vector sequence comprises representation vectors of at least one round of dialogue text in the dialogue data, and the representation vectors are obtained by encoding intentions and speaker information of the dialogue text; based on the representation vector sequence of each piece of dialogue data, determining a first similarity among the plurality of pieces of dialogue data; and clustering the multiple pieces of dialogue data based on the first similarity among the multiple pieces of dialogue data to obtain a clustering result. Therefore, the context information, the intention sequence and the semantic diversity of the dialogue data can be effectively captured, and the clustering effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence and natural language processing, and particularly relates to a dialogue data clustering method and device, an electronic device and a storage medium. BACKGROUND

[0002] In many business scenarios, a large amount of dialogue data is often generated. Effective analysis of the massive dialogue data can provide stronger support for business processing. In order to achieve efficient and accurate analysis of the massive data, clustering is a common and key step.

[0003] However, most of the traditional clustering methods are suitable for single sentences or short texts. If the clustering method is directly applied to multi-turn dialogue data with a long length, the context information and the logical relationship between turns of the dialogue will be lost, resulting in poor clustering effect and further affecting the subsequent data analysis effect. SUMMARY

[0004] The embodiments of the present application provide a dialogue data clustering method and device, an electronic device and a storage medium, to solve the problem of loss of context information and logical relationship between turns based on the traditional clustering method for dialogue data clustering.

[0005] In order to achieve the above-mentioned purpose, the embodiments of the present application adopt the following technical solutions: In a first aspect, the embodiments of the present application provide a dialogue data clustering method, comprising: obtaining a plurality of dialogue data and an intent of each turn of dialogue text in the dialogue data, wherein the dialogue data comprises multi-turn dialogue text between different speakers; encoding each dialogue data to obtain a representation vector sequence of each dialogue data, wherein the representation vector sequence comprises a representation vector of at least one turn of dialogue text in the dialogue data, and the representation vector is obtained by encoding the intent and speaker information of the dialogue text; determining a first similarity between the plurality of dialogue data based on the representation vector sequence of each dialogue data; clustering the plurality of dialogue data based on the first similarity between the plurality of dialogue data to obtain a clustering result.

[0006] In a second aspect, the embodiments of the present application provide a dialogue data clustering device, comprising: an obtaining module configured to obtain a plurality of dialogue data and an intent of each turn of dialogue text in the dialogue data, wherein the dialogue data comprises multi-turn dialogue text between different speakers; An encoding module is used to encode each of the dialogue data to obtain a representation vector sequence for each of the dialogue data. The representation vector sequence includes the representation vector of at least one round of dialogue text in the corresponding dialogue data. The representation vector is obtained by encoding the intent and speaker information of the corresponding dialogue text. A determining module is configured to determine a first similarity between the plurality of dialogue data based on a representation vector sequence for each of the dialogue data; The clustering module is used to cluster the multiple dialogue data based on a first similarity between the multiple dialogue data to obtain clustering results.

[0007] Thirdly, embodiments of this application provide an electronic device, including: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the dialogue data clustering method provided in the first aspect.

[0008] Fourthly, embodiments of this application provide a computer-readable storage medium that, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to perform the dialogue data clustering method provided in the first aspect.

[0009] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects: For each dialogue data set, the intent and speaker information of each round of dialogue text are encoded to obtain a representation vector for each round of dialogue text. This not only reduces the impact of different expressions with the same intent on the actual encoding and solves the semantic diversity problem, but also enriches the semantic information of the representation vectors of each round of dialogue text by introducing speaker information. Based on this, a representation vector sequence of dialogue data is obtained based on the representation vectors of each round of dialogue text in the dialogue data set, effectively preserving the contextual information and logical relationships between rounds of dialogue data. Furthermore, based on the representation vector sequence of each dialogue data set, the similarity between all dialogue data sets to be clustered is determined, fully preserving the impact of contextual information, semantic diversity, and sequence features on the similarity between dialogue data sets. Finally, clustering all dialogue data sets based on the similarity between all dialogue data sets can significantly improve the clustering effect. Attached Figure Description

[0010] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1This is a schematic diagram of an example environment in which embodiments of this application can be implemented; Figure 2 A flowchart illustrating a dialogue data clustering method provided in an embodiment of this application; Figure 3 A schematic diagram of the structure of a dialogue data clustering device provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0011] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0012] The term "comprising" and its variations as used in this document are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the following description. The term "in response to" indicates that the performed operation depends on a condition or state. When the dependent condition or state is met, one or more operations may be performed in real time or with a set delay. Unless otherwise specified, there is no restriction on the order in which multiple operations are performed.

[0013] It should be noted that the concepts of "first" and "second" mentioned in this document are used only to distinguish different devices, modules or units, and are not used to restrict the order of functions performed by these devices, modules or units or their interdependencies.

[0014] It should be noted that the terms "one" and "more" used in this document are illustrative rather than restrictive, and those skilled in the art should understand that, unless explicitly stated otherwise in the context, they should be understood as "one or more".

[0015] The names of messages or information exchanged between multiple devices in the embodiments of this document are for illustrative purposes only and are not intended to limit the scope of these messages or information.

[0016] As mentioned earlier, traditional clustering methods are mostly applicable to single sentences or short texts. If the clustering method is directly applied to dialogue data with multiple rounds and long passages, the contextual information of the dialogue and the logical relationship between rounds will be lost, resulting in poor clustering results and affecting the subsequent data analysis results.

[0017] Through extensive research, the inventors discovered that clustering massive amounts of multi-turn, lengthy dialogue data presents the following main challenges: First, context dependency. In multi-turn dialogues, the meaning of each turn's text often depends on the preceding context, and simple single-sentence encoding cannot capture this dependency.

[0018] Second, semantic diversity. The same intention can be expressed in many different ways, and traditional encoding methods struggle to map these diverse expressions to similar vector spaces.

[0019] Third, sequence features. Dialogue is a time series, and the order and combination of each round contains important information. The encoding method based on the traditional bag-of-words model will completely lose the sequence information, while the encoding method based on whole sentence embedding retains the semantics of a single sentence, but does not show the relationship between the rounds, resulting in the encoding result not retaining the sequence features.

[0020] In view of this, embodiments of this application provide a dialogue data clustering method that can effectively capture the contextual information, intent sequence, and semantic diversity of multi-turn dialogue data, thereby improving the clustering effect. Specifically, for each dialogue data, the intent and speaker information of each turn of dialogue text in the dialogue data are encoded to obtain the representation vector of each turn of dialogue text. This not only reduces the impact of different expressions with the same intent on the actual encoding and solves the semantic diversity problem, but also enriches the semantic information of the representation vectors of each turn of dialogue text through speaker information. On this basis, a representation vector sequence of dialogue data is obtained based on the representation vectors of each turn of dialogue text in the dialogue data, effectively preserving the contextual information and logical relationships between turns of the dialogue data. Furthermore, based on the representation vector sequence of each dialogue data, the similarity between all dialogue data to be clustered is determined, fully preserving the influence of the contextual information, semantic diversity, and sequence features of the dialogue data on the similarity between dialogue data. Finally, clustering all dialogue data based on the similarity between all dialogue data can significantly improve the clustering effect.

[0021] The dialogue data clustering method provided in this application can be applied to various business scenarios with clustering requirements, such as including but not limited to dialogue data analysis, user profile construction, and product promotion strategy optimization.

[0022] The dialogue data clustering method provided in this application embodiment can be executed by an electronic device. The electronic device referred to herein may include terminal devices, such as, but not limited to, mobile phones, tablets, laptops, desktop computers, smart voice interaction devices, smart home appliances, smart wearable devices, vehicle terminals, aircraft, etc.; or, the electronic device may also include a server, such as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0023] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0024] Figure 1 A schematic diagram of an example environment in which embodiments of this application can be implemented is shown. This example environment includes a terminal device 100 and a server 200.

[0025] The terminal device 100 and the server 200 establish a communication connection, which may include, but is not limited to, at least one of the following: wired connection and wireless connection.

[0026] Terminal device 100 includes, but is not limited to, smartphones, tablets, laptops, desktop computers, smart voice interaction devices, smart home appliances, smartwatches, vehicle terminals, and aircraft. Server 200 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0027] Terminal device 100 can provide a dialog interface through which users can engage in human-computer interaction. Terminal device 100 can receive relevant parameters input by the user and send these parameters to server 200. Server 200 can obtain a processing result based on the received parameters and return the processing result to terminal device 100.

[0028] It should be understood that in some embodiments, the terminal device 100 may obtain the processing result itself based on the relevant parameters input by the user, without needing to interact with the server 200. This application embodiment does not limit this.

[0029] Based on the example environment described above, this application provides a method for clustering dialogue data. Please refer to... Figure 2 This is a flowchart illustrating a dialogue data clustering method provided in an embodiment of this application. The method includes the following steps: S202, Obtain multiple dialogue data and the intent of each round of dialogue text in the dialogue data.

[0030] Dialogue data includes multi-turn dialogue texts between different speakers. These multiple dialogue data points can originate from the same business scenario. The speakers may differ across different business scenarios. A single turn of dialogue text can include the dialogue text corresponding to one interaction between different speakers.

[0031] For example, in a product promotion scenario, dialogue data can include multi-turn dialogue text between the promoter and the customer. Within this dialogue data, a single turn of dialogue text can include the dialogue text corresponding to one interaction between the promoter and the customer.

[0032] For example, in a customer service scenario, dialogue data can include multi-turn conversation text between customer service representatives and customers. Within this dialogue data, a single turn of conversation text can include the text corresponding to one interaction between the customer service representative and the customer.

[0033] In practice, the aforementioned dialogue data can be obtained in various ways. In some implementations, the original dialogue audio between different speakers is acquired, and then converted into text using Automatic Speech Recognition (ASR) technology. This text is then cleaned (e.g., noise removal, correction of domain-specific errors), and segmented into independent multi-turn dialogue texts according to the speaker, thus obtaining the dialogue data. In other implementations, the original dialogue data between different speakers is acquired, cleaned, and then segmented into independent multi-turn dialogue texts according to the speaker, thus obtaining the dialogue data.

[0034] For each dialogue data set, intent recognition is performed on each round of dialogue text within that data set to obtain the intent of each round of dialogue text. In this embodiment, various intent recognition technologies can be employed to perform intent recognition on each round of dialogue text.

[0035] In some implementations, for each round of dialogue text in the dialogue data, a first model can be used to perform intent recognition on the dialogue text of that round to obtain the intent of the dialogue text. The first model here can include various models with natural language understanding and generation capabilities, such as large language models (LLMs), etc., which are not limited in this application embodiment.

[0036] Specifically, for each round of dialogue text, a first prompt word can be generated based on that round of dialogue text. The first prompt word is used to indicate the intent recognition of that round of dialogue text. The first prompt word is input into the first model to utilize the natural language understanding and processing capabilities of the first model to identify the intent of that round of dialogue text.

[0037] The first cue word may include the dialogue text for that round.

[0038] Considering that some speakers' responses are usually quite concise, such as "okay," "yes," "no need," or "um," these ambiguous responses may convey different meanings at different stages. Therefore, the first cue words can also include one or more previous rounds of historical dialogue text, using these historical dialogue texts as context to help the first model more accurately identify the intent of the current round of dialogue text.

[0039] For example, one first prompt word might be, "Please analyze the intent of the customer's statement in the dialogue segment. The preceding text is, 'Customer Service: Which phone are you interested in?' The current statement is, 'Customer: Hmm.' Please provide a specific intent label." Based on this first prompt word, the first model outputs the intent "Hesitation - Difficulty in making a choice."

[0040] Optionally, the first prompt may also include output requirements, such as labeling simple and similar intents for diverse dialogue texts, such as "welcome," "hello," and "opening remarks" being similar intents.

[0041] S204, encode each dialogue data to obtain a sequence of representation vectors for each dialogue data.

[0042] The representation vector sequence includes the representation vectors of at least one round of dialogue text in the corresponding dialogue data. The representation vectors are obtained by encoding the intent and speaker information of the corresponding dialogue text.

[0043] Specifically, the representation vector of each dialogue data can be obtained as follows: for each round of dialogue text in the dialogue data, the speaker information and the intent of the dialogue text in that round are concatenated and encoded to obtain the representation vector of that round of dialogue text; the representation vectors of each round of dialogue text in the dialogue data are arranged according to the dialogue rounds to obtain the representation vector sequence of the dialogue data.

[0044] The speaker information may include one or more attribute features used to characterize the speaker's identity, specifically including but not limited to at least one of the following speaker roles (such as customer service / customer / system) or unique identifiers (such as user ID, device number, etc.).

[0045] For example, speaker information includes the speaker's role, which can be represented by special tags (such as [AGENT], [CUSTOMER]). For each round of dialogue text, the speaker's role tag and the intent of that round of dialogue text are concatenated and input into an encoding model (such as a sentence embedding model) for encoding, thus obtaining the representation vector of that round of dialogue text. Assume the encoding model has a dimension of... The representation vector of the dialogue text in this round is denoted as . Arrange the representation vectors of all dialogue text turns in the dialogue data according to the dialogue turn to form a sequence of representation vectors for the dialogue data. ,in, Let represent the representation vector of the i-th round of dialogue text. This indicates the number of dialogue rounds included in the dialogue data.

[0046] As can be seen, using the above encoding method, the same sentence spoken by different speakers will generate different representation vectors due to the differences in the speakers. For example, the sentence "How much is this price?" may imply "confirming the customer's intention" when spoken by a customer service representative, but "questioning the reasonableness of the price" when spoken by a customer. By incorporating speaker information into the encoding process to distinguish dialogue behaviors, it helps to capture the differences in dialogue behaviors of different speakers (such as asking questions, confirming, and refuting) during the encoding process. This ensures that the resulting representation vector contains both semantic and speaker information, which is crucial. This can prevent dissimilar dialogue texts from being misclassified as similar during subsequent clustering, further improving the aggregation accuracy.

[0047] S206, Based on the representation vector sequence of each dialogue data, determine the first similarity between multiple dialogue data.

[0048] The first similarity score reflects the overall similarity between two dialogue data sets, taking into account their similarity in terms of contextual information, semantic diversity, and sequence features.

[0049] In S206 above, the first similarity between any two dialogue data can be determined in various ways.

[0050] In one implementation, the edit distance between the representation vectors of any two dialogue data can be determined, and then the first similarity between the two dialogue data can be determined based on this edit distance. This approach can take into account the sequence order, length differences, and the similarity of the representation vectors in the sequence.

[0051] Specifically, the representation vector sequence of any two dialogue data is denoted as... and The edit distance between them is determined by the editing cost (such as insertion, deletion, replacement, etc.) required to transform the representation vector sequence A into the representation vector sequence B, where the editing cost is as follows: The cost of insertion or deletion operations is a fixed constant (e.g., 1); The cost of the replacement operation is If two representation vectors are very similar, the cost of the replacement operation is small; if the two representation vectors are not similar, the cost of the replacement operation is large.

[0052] Using a dynamic programming algorithm, the edit distance between representation vector sequence A and representation vector sequence B is calculated based on the edit cost described above.

[0053] Considering that dialogue texts from different speakers cannot be replaced, and that adding or deleting speakers' representation vectors must maintain an alternation within the representation vector sequence, and that similarity calculation methods based on edit distance cannot distinguish between speakers, leading to inaccurate calculation results and affecting subsequent clustering performance, an alternative implementation can include the following steps in S206: S2062 generates a similarity matrix based on the representation vector sequences of any two dialogue data.

[0054] The similarity matrix includes the second similarity between each pair of dialogue texts in each round of any two dialogue data sets.

[0055] Specifically, the similarity matrix can be a single matrix. In this case, the similarity matrix contains the second similarity between all pairs of dialogue texts from all rounds in any two dialogue datasets. Assuming the two dialogue datasets include a first dialogue dataset and a second dialogue dataset, then the element in the i-th row and j-th column of the similarity matrix represents the second similarity between the i-th round dialogue text in the first dialogue dataset and the j-th round dialogue text in the second dialogue dataset. This second similarity can be determined based on the similarity (such as cosine similarity) between the representation vectors of the i-th round dialogue text and the j-th round dialogue text.

[0056] The similarity matrix may also include a first similarity matrix and a second similarity matrix. In this case, the first similarity matrix may include the second similarity between pairwise dialogue texts from any two dialogue data sets that follow a preset dialogue flow. The second similarity matrix may include the second similarity between pairwise dialogue texts from any two dialogue data sets that do not follow a preset dialogue flow.

[0057] In most business scenarios, to better achieve business goals through dialogue, a pre-defined dialogue flow is typically established. A pre-defined dialogue flow can be understood as the dialogue sequence within the business scenario to which the aforementioned dialogue data pertains. The leading speaker usually follows this flow to ensure efficient information delivery. For example, in a product promotion scenario, the promoter typically follows a pre-defined promotional dialogue flow: "greeting opening -> needs assessment -> product recommendation -> price explanation -> closing the deal" to communicate with customers and promote the product more effectively. Of course, other speakers may introduce content outside the pre-defined flow, causing the dialogue to deviate from it. For example, raising objections to competitor discounts during the price explanation phase. This type of dialogue text outside the pre-defined flow is considered a dialogue text that does not follow the pre-defined flow.

[0058] The first and second similarity matrices can be obtained through steps A1~A3: Step A1: Based on the preset dialogue flow, identify the first dialogue text and the second dialogue text from the first dialogue data, and identify the third dialogue text and the fourth dialogue text from the second dialogue data.

[0059] The first and third dialogue texts each include at least one round of dialogue text conducted according to a preset dialogue flow. The second and fourth dialogue texts each include at least one round of dialogue text that did not follow the preset dialogue flow.

[0060] As examples, each process node in the preset dialogue flow has a corresponding reference intent. For each round of dialogue text in the first dialogue flow, the intent of that round of dialogue text can be matched with the reference intent of each process node; in response to the existence of a process node with a matching intent in the preset dialogue flow, it is determined that the round of dialogue text follows the preset dialogue flow; in response to the existence of a process node with a matching intent in the preset dialogue flow, it is determined that the round of dialogue text does not follow the preset dialogue flow.

[0061] As other examples, a second prompt word can be generated, which may include a preset dialogue flow and first dialogue data. The second prompt word is used to indicate whether the dialogue text in each round of the first dialogue data follows the preset dialogue flow. The second prompt word is input into a second model to utilize the natural language understanding and generation capabilities of the second model to identify the first dialogue text and the second dialogue text.

[0062] Similarly, a third prompt word can be generated, which may include a preset dialogue flow and second dialogue data. The third prompt word is used to indicate whether the dialogue text in each round of the second dialogue data follows the preset dialogue flow. The third prompt word is input into the second model to utilize the natural language understanding and generation capabilities of the second model to identify the third dialogue text and the fourth dialogue text.

[0063] The second model may include various models with natural language understanding and generation capabilities, such as LLM, etc., and this application embodiment does not limit this.

[0064] Step A2: Based on the representation vectors of the first dialogue text and the third dialogue text, calculate the similarity between the first dialogue text and the third dialogue text to obtain the first similarity matrix.

[0065] In the first similarity matrix, the element in the i-th row and j-th column represents the second similarity between the i-th round dialogue text in the first dialogue text and the j-th round dialogue text in the third dialogue text. This second similarity can be determined based on the similarity (such as cosine similarity) between the representation vectors of the i-th round dialogue text and the representation vectors of the j-th round dialogue text.

[0066] Step A3: Based on the representation vectors of the second dialogue text and the fourth dialogue text, calculate the similarity between the second dialogue text and the fourth dialogue text to obtain the second similarity matrix.

[0067] In the second similarity matrix, the element in the i-th row and j-th column represents the second similarity between the i-th round dialogue text in the second dialogue text and the j-th round dialogue text in the fourth dialogue text. This second similarity can be determined based on the similarity (such as cosine similarity) between the representation vectors of the i-th round dialogue text and the j-th round dialogue text.

[0068] S2064, based on the similarity matrix, determines the first similarity between any two dialogue data.

[0069] As a first example, when there is only one similarity matrix, the smallest second similarity in the similarity matrix can be determined as the first similarity between any two dialogue data.

[0070] As a second example, when there is only one similarity matrix, the above S2064 may include the following steps: Step B1, perform at least one round of first operation based on the similarity matrix until the representation vector sequence of any two dialogue data is empty; Step B2, in response to the fact that the representation vector sequence of any two dialogue data is empty, determine the first similarity between any two dialogue data based on the second similarity taken in at least one round of first operation.

[0071] In step B1 above, the first operation includes: extracting the second similarity with the smallest value in the similarity matrix, deleting the row and column containing the extracted second similarity from the similarity matrix, and deleting the representation vector of the dialogue text corresponding to the extracted second similarity from the representation vector sequence of any two dialogue data.

[0072] In step B2 above, the mean of the extracted second similarity can be determined as the first similarity between any two dialogue data.

[0073] Alternatively, a non-empty first representation vector sequence can be obtained from the representation vector sequences of any two dialogue data; a first operation can be performed on the second similarity extracted in at least one round of the first operation and the length of the first representation vector sequence to obtain a first value; the maximum number of dialogue rounds between any two dialogue data can be determined; a second operation can be performed on the first value and the maximum number of dialogue rounds to obtain the first similarity between any two dialogue data.

[0074] The first and second operations can be set according to actual needs, and this application embodiment does not limit them. For example, the first operation can be a summation operation, and the second operation can be a division operation. Therefore, the first similarity between any two dialogue data is calculated as (the second similarity extracted in each round of the first operation + the length of the first representation vector sequence) / the maximum number of dialogue rounds.

[0075] For example, let's consider the first and second dialogue data sets, respectively. The first dialogue data set includes three rounds of dialogue text, whose corresponding representation vector sequence is denoted as {A, B, C}; the second dialogue data set includes two rounds of dialogue text, whose corresponding representation vector sequence is denoted as {a, b}. The maximum number of dialogue rounds between these two sets is 3. The similarity matrix is ​​as follows:

[0076] In the first round of the first operation, after taking out the smallest second similarity of 0.2 in the current similarity matrix, the row and column containing the second similarity are deleted from the similarity matrix, resulting in the following new similarity matrix, and B is deleted from the representation vector sequence {A,B,C} (the representation vector sequence after deletion is {A,C}), and a is deleted from the representation vector sequence {a,b} (the representation vector sequence after deletion is {b}).

[0077]

[0078] In the second round of the first operation, after extracting the smallest second similarity of 0.4 from the current similarity matrix, the row and column containing this second similarity are deleted from the similarity matrix, resulting in an empty similarity matrix. A is then deleted from the representation vector sequence {A,C} obtained in the previous round of the first operation (the resulting representation vector sequence is {C}), and b is deleted from the representation vector sequence {b} obtained in the previous round of the first operation. Since this representation vector sequence is empty after deletion, the process stops. At this point, the first representation vector sequence is {C}, with a length of 1.

[0079] Furthermore, the first similarity between the first dialogue data and the second dialogue data is (0.2+0.4+1) / 3=0.53.

[0080] As can be seen, in the process of calculating the first similarity between any two dialogue data in the above manner, a greedy matching strategy is adopted, that is, the dialogue text with the least similarity between the two dialogue data is eliminated first, reducing the risk of high similarity rounds being mismatched; the length of the first representation vector sequence is the remaining rounds that have not been eliminated. The first representation vector sequence can compensate for the rounds that have not been eliminated, avoiding the long sequence from having a low similarity score due to the exhaustion of the short sequence; finally, normalization is performed by combining the maximum dialogue rounds, which can ensure that the first similarity is within the range of [0,1], and can more accurately reflect the true similarity between the two dialogue data.

[0081] As a third example, based on the first similarity matrix, the third similarity between any two dialogue data in the preset dialogue flow is determined; based on the second similarity matrix, the fourth similarity between any two dialogue data outside the preset dialogue flow is determined; the third similarity and the fourth similarity are weighted and summed to obtain the first similarity between any two dialogue data.

[0082] In practice, the smallest second similarity in the first similarity matrix can be determined as the third similarity between any two dialogue data in the preset dialogue flow; and the smallest second similarity in the second similarity matrix can be determined as the fourth similarity between any two dialogue data outside the preset dialogue flow.

[0083] Alternatively, to improve the accuracy of the third and fourth similarities, a method similar to the second example above can be used to determine the third and fourth similarities.

[0084] For example, at least one round of second operations is performed based on the first similarity matrix until the representation vector of either the first or third dialogue text is empty; in response to the empty representation vector of either the first or second dialogue text, the similarity between the first and third dialogue texts is determined based on the second similarity extracted in the at least one round of second operations, and this similarity is determined as the third similarity. The second operations include: extracting the smallest second similarity in the first similarity matrix, deleting the row and column containing the extracted second similarity from the first similarity matrix, and deleting the representation vector of the dialogue text corresponding to the extracted second similarity from the representation vectors of both the first and third dialogue texts.

[0085] At least one round of third operations is performed based on the second similarity matrix until the representation vector of either the second or fourth dialogue text is empty. In response to the empty representation vector of either the second or fourth dialogue text, the similarity between the second and fourth dialogue texts is determined based on the second similarity extracted in the at least one round of third operations, and this similarity is designated as the fourth similarity. The third operation includes: extracting the smallest second similarity from the second similarity matrix; deleting the row and column containing the extracted second similarity from the second similarity matrix; and deleting the representation vector of the dialogue text corresponding to the extracted second similarity from the representation vectors of both the second and fourth dialogue texts.

[0086] Furthermore, the first similarity between any two dialogue data points is calculated as α × the third similarity between these two dialogue data points + β × the fourth similarity between these two dialogue data points. Here, α and β represent weights, which can be set according to actual needs, such as α << β, etc., and this embodiment does not limit this.

[0087] Understandably, the third similarity reflects the similarity of the topic portions between the two dialogue data sets, while the fourth similarity reflects the similarity of the deviations from the topic portions, the latter often being key to distinguishing different dialogue data sets. Weighted summation of these two similarity scores determines the first similarity between the two dialogue data sets, making the assessment of similarity between any two dialogue data sets more accurate. This ensures that the main basis for clustering covers the most dynamic and discriminative parts of the dialogue data, thereby significantly improving clustering accuracy.

[0088] The foregoing illustrates a partial implementation of S206. It should be understood that S206 can also be implemented in other ways, and this application embodiment does not limit this.

[0089] S208, cluster multiple dialogue data based on the first similarity between multiple dialogue data to obtain clustering results.

[0090] By clustering multiple dialogue data sets, similar dialogue data can be grouped into the same cluster. Therefore, the clustering result can include at least one cluster and the dialogue data contained in each cluster.

[0091] Specifically, clustering algorithms such as K-means, Density-Based Spatial Clustering of Applications with Noise (DBSCAN), and Label Propagation Algorithm (LPA) can be used to cluster multiple dialogue data.

[0092] The dialogue data clustering method provided in this application encodes the intent and speaker information of each round of dialogue text for each dialogue data, obtaining a representation vector for each round of dialogue text. This not only reduces the impact of different expressions with the same intent on the actual encoding and solves the semantic diversity problem, but also enriches the semantic information of the representation vectors of each round of dialogue text through speaker information. Based on this, a representation vector sequence of dialogue data is obtained based on the representation vectors of each round of dialogue text in the dialogue data, effectively preserving the contextual information and logical relationships between rounds of dialogue data. Furthermore, based on the representation vector sequence of each dialogue data, the similarity between all dialogue data to be clustered is determined, fully preserving the influence of contextual information, semantic diversity, and sequence features of dialogue data on the similarity between dialogue data. Finally, clustering all dialogue data based on the similarity between all dialogue data can significantly improve the clustering effect.

[0093] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0094] Based on the same inventive concept, embodiments of this application also provide a dialogue data clustering device. Please refer to... Figure 3 This is a schematic diagram of the structure of a dialogue data clustering device 300 provided in an embodiment of this application. The device 300 may include: an acquisition module 310, an encoding module 320, a determination module 330, and a clustering module 340.

[0095] The acquisition module 310 is used to acquire multiple dialogue data and the intent of each round of dialogue text in the dialogue data, wherein the dialogue data includes multi-round dialogue text between different speakers.

[0096] The encoding module 320 is used to encode each of the dialogue data to obtain a representation vector sequence for each of the dialogue data. The representation vector sequence includes the representation vector of at least one round of dialogue text in the corresponding dialogue data. The representation vector is obtained by encoding the intent and speaker information of the corresponding dialogue text.

[0097] The determining module 330 is used to determine a first similarity between the plurality of dialogue data based on the representation vector sequence of each of the dialogue data.

[0098] The clustering module 340 is used to cluster the multiple dialogue data based on a first similarity between the multiple dialogue data to obtain a clustering result.

[0099] Obviously, the dialogue data retrieval device provided in the embodiments of this application can be used as the above-mentioned... Figure 2 The execution entity of the dialogue data retrieval method shown is therefore capable of enabling the dialogue data retrieval device to perform... Figure 2 The functions implemented are the same, so they will not be described in detail here.

[0100] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Please refer to it. Figure 4 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.

[0101] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0102] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0103] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a dialog data clustering device at the logical level. The processor executes the program stored in memory and specifically performs the following operations: Acquire multiple dialogue data and the intent of each round of dialogue text in the dialogue data, wherein the dialogue data includes at least one round of dialogue text between different speakers; For each dialogue data, the dialogue data is encoded to obtain a representation vector sequence of the dialogue data. The representation vector sequence includes the representation vector of at least one round of dialogue text in the dialogue data. The representation vector of each round of dialogue text is obtained by encoding the intent and speaker information of each round of dialogue. Based on the representation vector sequence of each of the dialogue data, a first similarity is determined among the plurality of dialogue data; The multiple dialogue data are clustered based on the first similarity among them to obtain the clustering result.

[0104] The above is as stated in this application. Figure 2 The method executed by the dialogue data clustering device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0105] The electronic device can also perform Figure 2 The method, and the implementation of the dialogue data clustering device in Figure 2 The functions of the embodiments shown are not described in detail here.

[0106] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0107] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform... Figure 2 The method of the illustrated embodiment is specifically used to perform the following operations: Acquire multiple dialogue data and the intent of each round of dialogue text in the dialogue data, wherein the dialogue data includes at least one round of dialogue text between different speakers; For each dialogue data, the dialogue data is encoded to obtain a representation vector sequence of the dialogue data. The representation vector sequence includes the representation vector of at least one round of dialogue text in the dialogue data. The representation vector of each round of dialogue text is obtained by encoding the intent and speaker information of each round of dialogue. Based on the representation vector sequence of each of the dialogue data, a first similarity is determined among the plurality of dialogue data; The multiple dialogue data are clustered based on the first similarity among them to obtain the clustering result.

[0108] In summary, the above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

[0109] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0110] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0111] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0112] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

Claims

1. A method for clustering dialogue data, characterized in that, include: Acquire multiple dialogue data and the intent of each round of dialogue text in the dialogue data, wherein the dialogue data includes multi-round dialogue text between different speakers; Each dialogue data is encoded to obtain a representation vector sequence for each dialogue data. The representation vector sequence includes the representation vector of at least one round of dialogue text in the corresponding dialogue data. The representation vector is obtained by encoding the intent and speaker information of the corresponding dialogue text. Based on the representation vector sequence of each of the dialogue data, a first similarity is determined among the plurality of dialogue data; The multiple dialogue data are clustered based on the first similarity among them to obtain the clustering result.

2. The method according to claim 1, characterized in that, The first similarity between any two dialogue data points in the plurality of dialogue data is determined in the following manner: Based on the representation vector sequence of any two dialogue data, a similarity matrix is ​​generated, the similarity matrix including: the second similarity between each pair of dialogue texts in each round of the any two dialogue data; Based on the similarity matrix, the first similarity between any two dialogue data is determined.

3. The method according to claim 2, characterized in that, Determining the first similarity between any two dialogue data based on the similarity matrix includes: Perform at least one round of first operation based on the similarity matrix until the representation vector sequence of any two dialogue data is empty; the first operation includes: taking out the smallest second similarity in the similarity matrix, deleting the row and column where the taken second similarity is located from the similarity matrix, and deleting the representation vector of the dialogue text corresponding to the taken second similarity from the representation vectors of any two dialogue data; In response to the fact that the representation vector sequence of either of the two dialogue data is empty, a first similarity between the two dialogue data is determined based on the second similarity extracted in the first operation of at least one round.

4. The method according to claim 3, characterized in that, Determining the first similarity between any two dialogue data based on the second similarity extracted in the at least one round of the first operation includes: Obtain a non-empty first representation vector sequence from the representation vector sequences of any two dialogue data; A first operation is performed on the second similarity extracted in the at least one round of the first operation and the length of the first representation vector sequence to obtain a first value; Determine the maximum number of dialogue rounds between any two sets of dialogue data; A second operation is performed on the first value and the maximum number of dialogue rounds to obtain the first similarity between any two dialogue data.

5. The method according to claim 2, characterized in that, The similarity matrix includes a first similarity matrix and a second similarity matrix; The first similarity matrix includes: the second similarity between any two dialogue texts that follow a preset dialogue flow; the second similarity matrix includes: the second similarity between any two dialogue texts that do not follow the preset dialogue flow. Determining the first similarity between any two dialogue data based on the similarity matrix includes: Based on the first similarity matrix, determine the third similarity between any two dialogue data in the preset dialogue flow; Based on the second similarity matrix, a fourth similarity is determined between any two dialogue data outside the preset dialogue flow; The first similarity between any two dialogue data is obtained by weighted summation of the third similarity and the fourth similarity.

6. The method according to claim 5, characterized in that, The arbitrary two dialogue data include first dialogue data and second dialogue data; the first similarity matrix and the second similarity matrix are obtained in the following way: Based on the preset dialogue flow, the first dialogue text and the second dialogue text are identified from the first dialogue data, and the third dialogue text and the fourth dialogue text are identified from the second dialogue data. The first dialogue text and the third dialogue text both include at least one round of dialogue text performed according to the preset dialogue process, and the second dialogue text and the fourth dialogue text both include at least one round of dialogue text not performed according to the preset dialogue process; Based on the representation vector of the first dialogue text and the representation vector of the third dialogue text, the similarity between the first dialogue text and the third dialogue text is calculated to obtain the first similarity matrix. Based on the representation vectors of the second dialogue text and the fourth dialogue text, a similarity calculation is performed on the second dialogue text and the fourth dialogue text to obtain the second similarity matrix.

7. The method according to claim 1, characterized in that, The representation vector sequence for each of the dialogue data is obtained in the following way: For each round of dialogue text in the dialogue data, the speaker information and the intent of the dialogue text are concatenated and encoded to obtain the representation vector of the dialogue text; The representation vectors of each round of dialogue text in the dialogue data are arranged according to the dialogue round to obtain the representation vector sequence of the dialogue data.

8. A dialogue data clustering device, characterized in that, include: The acquisition module is used to acquire multiple dialogue data and the intent of each round of dialogue text in the dialogue data, wherein the dialogue data includes multi-round dialogue text between different speakers; An encoding module is used to encode each of the dialogue data to obtain a representation vector sequence for each of the dialogue data. The representation vector sequence includes the representation vector of at least one round of dialogue text in the corresponding dialogue data. The representation vector is obtained by encoding the intent and speaker information of the corresponding dialogue text. A determining module is configured to determine a first similarity between the plurality of dialogue data based on a representation vector sequence for each of the dialogue data; The clustering module is used to cluster the multiple dialogue data based on a first similarity between the multiple dialogue data to obtain clustering results.

9. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the dialogue data clustering method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the dialogue data clustering method as described in any one of claims 1 to 7.