Data mining method and device, electronic equipment and storage medium
By using the temporal order and cosine similarity of dialogue data to filter data to be clustered in data mining, and performing cluster mining, the problem that fixed dialogue flow cannot adapt to different business scenarios is solved, and responses that are closer to user intent are achieved, improving service efficiency and user experience.
Patent Information
- Application Number
- CN202511298609.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-11
- Publication Date
- 2025-11-28
AI Technical Summary
In existing data mining methods, fixed script flowcharts cannot adapt to the differences in user intent across different business scenarios, resulting in a poor user experience.
By acquiring the time sequence of dialogue data, question-and-answer rounds and nodes are established. Cosine similarity is used to filter the data to be clustered, and cluster mining is performed to obtain response scripts that are closer to the user's intent.
This improved service efficiency and user experience, ensuring that responses were closer to the user's true intentions.
Smart Images

Figure CN121029795A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and more specifically, to a data mining method, apparatus, electronic device, and storage medium. Background Technology
[0002] Existing dialogue mining methods rely on mining a fixed dialogue flow chart for each business scenario. This chart contains multiple intent nodes, each with a corresponding response dialogue. However, different business scenarios may have different intents, and a fixed response dialogue can easily lead to misunderstandings of the other party's true intentions, resulting in a poor user experience. Summary of the Invention
[0003] In view of this, this application proposes a data mining method, apparatus, electronic device, and storage medium to improve the above-mentioned problems.
[0004] According to one aspect of the embodiments of this application, a data mining method is provided, comprising: acquiring dialogue data, the dialogue data including multiple question-answer pairs; establishing question-answer rounds and question-answer nodes according to the time order of the question-answer pairs; acquiring the question-answer rounds and question-answer nodes selected by the user, and determining a search range according to the question-answer rounds; acquiring, within the search range, dialogue data to be clustered that has a cosine similarity of reaching a first preset value with the question-answer nodes selected by the user; and performing cluster mining on the dialogue data to be clustered to obtain cluster mining results.
[0005] According to one aspect of the embodiments of this application, a data mining apparatus is provided, comprising: a dialogue data acquisition module for acquiring dialogue data, the dialogue data including multiple question-answer pairs; an establishment module for establishing question-answer rounds and question-answer nodes according to the time sequence of the question-answer pairs; a search scope determination module for acquiring the question-answer rounds and question-answer nodes selected by a user, and determining a search scope based on the question-answer rounds; a dialogue data to be clustered module for acquiring, within the search scope, dialogue data to be clustered whose cosine similarity to the question-answer nodes selected by the user reaches a first preset value; and a mining result acquisition module for performing clustering mining on the dialogue data to be clustered, and acquiring clustering mining results.
[0006] According to one aspect of the embodiments of this application, an electronic device is provided, including: a processor; a memory storing computer-readable instructions, which, when executed by the processor, implement the data mining method described above.
[0007] According to one aspect of the embodiments of this application, a computer-readable storage medium is provided, on which computer-readable instructions are stored, which, when executed by a processor, implement the data mining method described above.
[0008] In this application's solution, question-and-answer rounds are established based on the chronological order of question-and-answer pairs in the acquired dialogue data. This clarifies the other party's actual intent. Furthermore, by acquiring clustering data with a cosine similarity of at least one preset value to the question-and-answer nodes, the clustering data becomes more similar to the question-and-answer nodes selected by the user. The clustering mining results obtained after performing clustering mining on the clustering dialogue data are closer to the other party's true intent. By using the clustering mining results as subsequent question-and-answer data, the wording of the responses during the dialogue becomes closer to the other party's true intent, which not only improves service efficiency but also enhances user experience. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 A structural block diagram of an electronic device suitable for implementing embodiments of this application is shown.
[0011] Figure 2 A flowchart of a data mining method provided in an embodiment of this application is shown.
[0012] Figure 3 It shows Figure 2 A flowchart of one embodiment of step S240.
[0013] Figure 4 It shows Figure 2 A flowchart of one embodiment of step S250.
[0014] Figure 5 A data mining flowchart of one embodiment of this application is shown.
[0015] Figure 6 It shows Figure 4 A flowchart of one implementation of step S255.
[0016] Figure 7 A flowchart illustrating the preprocessing of dialogue data in an embodiment of this application is shown.
[0017] Figure 8 It shows Figure 7 A flowchart of one embodiment of step S320.
[0018] Figure 9 A flowchart illustrating the vectorization process of initial dialogue data in an embodiment of this application is shown.
[0019] Figure 10 A block diagram of a data mining apparatus provided in one embodiment of this application is shown. Detailed Implementation
[0020] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0021] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0022] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0023] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0024] It should be noted that "multiple" in this article refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0025] Existing data mining techniques typically involve mining data from fixed business scenarios and historical data to obtain a set of communication flowcharts, which are then used to serve customers. However, different customers may have different needs and intentions regarding the same business scenario. Therefore, fixed communication flowcharts can sometimes be too rigid, leading to low communication efficiency and a reduced user experience. The inventors have identified the following main drawbacks in existing data mining techniques: 1. Determining user intent through intent classification models is time-consuming and resource-intensive, and intents may vary in different scenarios. 2. The order of rounds was ignored. In a dialogue, similar content may have different meanings in different rounds. Therefore, the inventors proposed a data mining method, apparatus, electronic device, and storage medium. By establishing question-and-answer rounds based on the chronological order of question-and-answer pairs in the acquired dialogue data, the actual intent of the user can be more clearly identified. Furthermore, by acquiring clustering data with a cosine similarity of up to a first preset value with the question-and-answer nodes, the clustering data can be made more similar to the question-and-answer nodes selected by the user. The clustering mining results obtained after clustering the dialogue data are closer to the user's true intent. When using the clustering mining results as subsequent question-and-answer data, the wording of the replies during the dialogue is closer to the user's true intent, which not only improves service efficiency but also enhances user experience.
[0026] Please see Figure 1 , Figure 1 A structural block diagram of an electronic device suitable for implementing embodiments of this application is shown. Figure 1 The electronic devices shown may include terminal devices or servers. Terminals may be smartphones, tablets, laptops, desktop computers, etc. Servers may be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0027] exist Figure 1In the illustrated electronic device, the memory 1005, serving as a storage medium, may include an operating system, a data storage module, a network communication module, a user interface module, and electronic programs. The network interface 1004 is primarily used for data communication with a network server; the user interface 1003 is primarily used for data interaction with a user; the communication bus 1002 is primarily used for communication and interaction between the memory 1005, network interface 1004, user interface 1003, and the server. The processor 1001 and memory 1005 in the electronic device of this invention can be disposed within the electronic device. The electronic device uses the processor 1001 to call the data prediction device stored in the memory 1005 and executes the data prediction method provided in the embodiments of this application.
[0028] Processor 1001 may include one or more processing cores. Processor 1001 connects to various parts within the electronic device using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in memory 1005, and by calling data stored in memory 1005. Optionally, processor 1001 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 1001 may integrate one or more of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 1001 and may be implemented separately using a communication chip.
[0029] The memory 1005 may include random access memory (RAM) or read-only memory (ROM). The memory 1005 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 1005 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, alarm functionality, etc.), instructions for implementing the various method embodiments described below, etc. The data storage area may also store data created during the use of the electronic device (such as spoofed response commands, acquired process states, etc.).
[0030] Those skilled in the art will understand that Figure 1 The structure shown does not constitute a limitation on the electronic device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0031] Figure 2 This is a flowchart illustrating a data mining method according to an embodiment of this application. The method can be executed by the aforementioned electronic device, and is not specifically limited herein. (Refer to...) Figure 2 As shown, the method includes at least steps S210 to S250, which are described in detail below: Step S210: Obtain dialogue data, which includes multiple question-answer pairs.
[0032] Dialogue data refers to data generated through interactions between two parties, including conversations between friends and between customer service representatives and customers. Taking a customer service representative and customer conversation as an example, the question-and-answer format can be either customer service representative-customer or customer-customer service, with the specific format determined by the actual user's instructions.
[0033] Step S220: Establish question-and-answer rounds and question-and-answer nodes according to the time sequence of the question-and-answer pairs.
[0034] Dialogue data is a time-series dataset that uses time to establish question-and-answer turns and question-and-answer nodes. A question-and-answer turn contains multiple question-and-answer nodes, and each question-and-answer node contains multiple question-and-answer pairs. Dialogue data can be represented as... Where d represents the dialogue ID of the original dialogue in which the current question-and-answer pair resides, q represents the question, a represents the answer, and r represents the turn number of the current question-and-answer pair in the original dialogue, where r≥1. This represents the total number of question-answer pairs contained in the current task.
[0035] Step S230: Obtain the question-and-answer rounds and question-and-answer nodes selected by the user, and determine the search scope based on the question-and-answer rounds.
[0036] Users can select the question-and-answer rounds and question-and-answer nodes in the client, or they can input the selection of question-and-answer rounds and question-and-answer nodes. The specific selection method is not limited here.
[0037] The search scope starts with the selected question-and-answer rounds and ends with a preset number of rounds after the selected rounds. The preset number of rounds is entered by the user on the client. For example, if the preset number of question-and-answer rounds selected by the user is R, then the search scope is R ≤ r ≤ R + 3, where the minimum value of R is 1.
[0038] Step S240: Within the search range, acquire the dialogue data to be clustered that has a cosine similarity to the question-and-answer node selected by the user that reaches a first preset value.
[0039] Cosine similarity measures the similarity between two vectors using the cosine of the angle between them. The cosine similarity value ranges from -1 to 1. A cosine similarity of 1 indicates a 0° angle between the two vectors (meaning they point in the same direction), while a cosine similarity of -1 indicates a 180° angle (meaning they point in opposite directions). A higher cosine similarity indicates greater similarity between the two vectors. To ensure a certain level of similarity, the first preset value is set between 0.5 and 1, preferably 0.75.
[0040] Before performing cosine similarity comparison, first determine whether the question-and-answer round selected by the user is the last round, and then process according to steps S242 and S244.
[0041] Step S242: If the selected question-and-answer round is not the last round, obtain the dialogue data to be clustered with the selected question-and-answer node whose cosine similarity reaches a first preset value.
[0042] When the user selects a question-and-answer round that is not the last round, the search scope is determined within the dataset to be mined. Data mining is then performed. The dialogue data to be clustered, whose cosine similarity to the selected question-and-answer nodes reaches a first preset value, is merged with the data from the original question-and-answer rounds and integrated into a parent node set. Dialogue data that did not reach the first preset value were merged with previously unsuccessful dialogue data to form the mined dataset. The question-and-answer rounds and nodes selected by the user come from the data of the parent node set, i.e., the dataset to be mined. ,but Parent node set With the dataset to be mined The sum of these represents the entire dialogue data.
[0043] Step S244: If the selected question-and-answer round is the last round, then no cosine similarity comparison is performed on the selected question-and-answer round.
[0044] During the dialogue, the last round of question and answer is basically the end of the dialogue data, and there are no subsequent rounds of question and answer that can be compared with the previous round in terms of similarity. Therefore, when the selected round of question and answer is the last round, no cosine similarity comparison is performed on that round of question and answer.
[0045] Step S250: Perform cluster mining on the dialogue data to be clustered to obtain the cluster mining results.
[0046] Clustering is the process of dividing a collection of physical or abstract objects into multiple classes composed of similar objects. A cluster generated by clustering is a set of data objects that are similar to objects in the same cluster and different from objects in other clusters.
[0047] Cluster mining of dialogue data refers to using clustering methods to identify data similar to the dialogue data to be mined. The output and saved cluster mining results vary depending on the question-and-answer rounds and nodes selected by the user.
[0048] Users can manually modify the mining results according to their actual business needs, such as adjusting the question-answer rounds or changing the question-answer pair data in the question-answer nodes.
[0049] In one implementation, cluster mining is performed on the dialogue data to be clustered to obtain cluster mining results. The specific cluster mining method can be as follows: Figure 4 The process shown yields: Step S251: Obtain the target number of clusters.
[0050] The target number of clusters can be defined at the initial stage of clustering or input based on the user's specific needs. For example, if the initial target number of clusters is set to 5, then there will be 5 question-and-answer nodes in the clustering results; or, if the user inputs a target number of 10, then there will be 10 question-and-answer nodes in the clustering results; or, if the initial target number of clusters is set to 8, and the user inputs a target number of 12, then the user-input target number will be used, and the clustering results will have 12 question-and-answer nodes.
[0051] Step S252: Input the dialogue data to be clustered into the clustering model to obtain multiple clustering nodes. Each clustering node includes multiple clustering question-answer pairs. The number of multiple clustering nodes is the same as the target number of clusters.
[0052] The clustering model is built based on the clustering algorithm and trained on large-scale dialogue data. Common clustering models include K-means clustering algorithm, hierarchical clustering algorithm, and DBSCAN algorithm. In this application, the clustering algorithm in the K-means++ model is selected. The selection of cluster centers in the K-means clustering algorithm has been optimized to a certain extent, which solves the shortcomings of the K-means algorithm in sometimes finding weak clustering.
[0053] For example, see Figure 5 , Figure 5 The diagram illustrates a data mining flowchart from one embodiment of this application. When the user selects question-and-answer round 1 and question-and-answer nodes 0, the user inputs a target cluster number of 10. This indicates that the first mining operation is being performed on new dialogue data. Nodes matching the target cluster number are generated, resulting in 10 question-and-answer nodes, thus obtaining the clustering mining result. This result is named and saved according to the question-and-answer round and the question-and-answer nodes; the clustering mining result file name is 1. The file name is stored in a database. The nodes in the file and the question-and-answer pairs contained within each node are stored in a fixed storage path, which is also stored in the database. The storage path can be a Minio path, which can be used as cloud storage to store massive amounts of images, videos, and documents.
[0054] When the user selects question-answer round 1, question-answer node 2, and target cluster number 5, then cluster mining is performed on the question-answer pairs in question-answer round 1 and question-answer node 2, generating 5 question-answer nodes. The cluster mining results are then named and saved according to the question-answer round and question-answer nodes, i.e., the cluster mining result file name is 1_2. The file name is also stored in the database.
[0055] When the user selects question-answer round 1_2 and question-answer node 3, the target number of clusters is set to 3. When the user inputs a target number of clusters of 4, cluster mining is performed on the question-answer pairs in question-answer round 1_2 and question-answer node 3, generating 4 question-answer nodes. The cluster mining results are named and saved according to the question-answer round and question-answer nodes, i.e., the data mining result file name is 1_2_3. The file name is also stored in the database.
[0056] Step S253: Obtain the cluster center vector of each cluster node.
[0057] The cluster center vector represents the specific intent of the customer represented by the cluster node. For example, if the customer's intent is to complain, the cluster center vector mainly reflects the intent to complain.
[0058] Step S254: In each clustering node, obtain clustering question-answer pairs whose cosine similarity with the cluster center vector reaches a second preset value to obtain similar cluster data.
[0059] The higher the cosine similarity between the question-answer pair and the cluster center vector, the higher the similarity between the information contained in the cluster center vector and the information contained in the cluster center vector. To ensure the similarity between the selected question-answer pairs and the cluster center vector, the second preset value is [0.5-1]. The second preset value can be 0.75, 0.8, or 0.9, and should be determined according to the user's specific business.
[0060] All question-answer pairs in the original cluster whose cosine similarity to the cluster center vector is lower than the second preset value are extracted, integrated into a new cluster, and saved as dissimilar data. The new cluster data will not be mined in the next data mining.
[0061] Step S255: Sort the similar cluster data to obtain the clustering mining results for each cluster node.
[0062] The cluster data are sorted by similarity to obtain the final clustering mining results.
[0063] Specifically, the similar cluster data is sorted to obtain the clustering mining results. The specific sorting method can be according to... Figure 6 The process shown yields: Step S2552: Based on the number of question-answer pairs in the similar cluster data, sort the similar cluster data by the number of pairs to obtain the first sorted question-answer pairs.
[0064] The more question-answer pairs there are, the more information they contain. By prioritizing data clusters with more information, users can better understand the customer's intent.
[0065] Step S2554: Based on the cosine similarity between the similar cluster data and the cluster center vector, sort the first sorted question-and-answer pairs by similarity to obtain the second sorted question-and-answer pairs.
[0066] The cluster center vector is the core content of the similar cluster data. The higher the cosine similarity of the data with the cluster center vector, the more similar it is to the content that the cluster center vector wants to express. The first sorted question and answer pairs are sorted by similarity, and the data that comes earlier is more important.
[0067] Step S2556: Based on the length of the first sorted question-answer pair, sort the second sorted question-answer pair by length to obtain the clustering mining result.
[0068] The second-order question-and-answer pairs are sorted by length because longer sentences contain more information, and ranking them earlier is more helpful to users.
[0069] In this embodiment, a question-and-answer round is established based on the time sequence of question-and-answer pairs in the user's dialogue data. This helps to clarify the user's actual intent. Furthermore, by acquiring clustering data with a cosine similarity of at least one preset value to the question-and-answer nodes, the clustering data becomes more similar to the question-and-answer nodes selected by the user. The clustering mining results obtained after performing clustering mining on the dialogue data are closer to the user's true intent. When using the clustering mining results to serve users, the wording of the replies is closer to the user's true intent, which not only improves service efficiency but also enhances the user experience.
[0070] Please refer to Figure 7 In this embodiment of the application, the dialogue data can be preprocessed before acquisition. Specific methods may include: Step S310: Perform stop word removal processing on the original dialogue data to obtain stop-removed data.
[0071] Stop words are words that are not essential to a sentence; removing them has no impact on understanding the meaning of the entire sentence. Data often contains a large number of function words, pronouns, or verbs and nouns without specific meanings; these words offer no help in data analysis.
[0072] Stop word removal involves comparing the data with a stop word list to remove stop words from the data, thus obtaining stop-word-free data.
[0073] Step S320: Perform data splicing on the stop removal data to obtain spliced data.
[0074] Some question-answer pairs become empty data after the stop operation, or they can be better represented by concatenating them with the previous question-answer pair. Therefore, using data concatenation to merge the stop data not only saves storage space but also better reflects the customer's intent. The specific concatenation method is question-question, answer-answer.
[0075] Specifically, the stop data is concatenated to obtain concatenated data. The concatenated data can be obtained according to the following steps: Figure 8 The steps described above are used to obtain the information, such as... Figure 8 As shown, it includes: Step S322: Obtain the question-and-answer rounds in the stop data where the number of Chinese characters is 0, and obtain empty question-and-answer round data.
[0076] In some question-and-answer pairs, the data may only contain a modal particle or other words recorded in the stop word list. During the stop removal process, the entire question data, answer data, or the entire question-and-answer pair data will be processed to remove the stop words. At this time, the question data, answer data, or the entire question-and-answer pair data will be empty question-and-answer pair round data.
[0077] Step S324: Merge the empty question-and-answer round data into the previous question-and-answer round to obtain the spliced data.
[0078] Empty Q&A rounds do not reflect the customer's intent. To save data storage space, empty Q&A rounds are merged into the previous Q&A round, thus increasing or decreasing the amount of data in the previous Q&A round.
[0079] Step S330: De-identify the spliced data to obtain the dialogue data.
[0080] In some scenarios, both parties need to provide sensitive information, including personal information such as ID card number, mobile phone number, card number, and customer number. This information does not provide any indication of intent in the dialogue data. Moreover, in order to protect user privacy, the data needs to be anonymized.
[0081] Data anonymization is a method of creating structurally similar but not identical data from the original data, enabling its use in non-production environments such as development, testing, training, and analysis. In data anonymization, only the data values are changed, but the data format remains consistent with the original. It is crucial that the original data cannot be detected or reconstructed from the original data. Data anonymization will be widely used to comply with policies and regulations, prevent data leaks, and prevent accidental access to data.
[0082] Data anonymization tools help organizations achieve legal and compliant sharing of production data by transforming and processing real sensitive data according to data anonymization rules to remove sensitive information. Data anonymization can be achieved through various methods, but all methods must adhere to the principles of preventing reverse engineering, representing the original data, ensuring the integrity of references, preventing data inference, and automation.
[0083] Specific de-identification algorithms include obfuscation, replacement, emptying, and encryption: Obfuscation algorithms: Disrupt the positions of existing data so that the data no longer represents its original meaning.
[0084] The Java Collection class can be used to shuffle the order of data in an ArrayList. However, in practice, the results are not very good, as it cannot guarantee that the order of the data items will be completely different from the original order.
[0085] Arbitrary replacement: Replaces sensitive data to make it appear similar to the original data, but the two are actually unrelated. Commonly used for name replacement, numerical replacement, date replacement, and card number replacement.
[0086] Nulling algorithm: Delete sensitive data and set it to null.
[0087] Data encryption: Sensitive data is encrypted, and the encrypted data differs significantly from the original data.
[0088] Data anonymization algorithms that can be used include: MD5 encryption, AES symmetric encryption, and FPE format retention encryption.
[0089] The specific de-identification algorithm needs to be chosen based on the actual user's selection.
[0090] Reference Figure 9 In this embodiment of the application, dialogue data can be obtained through methods such as... Figure 8 The steps described include: Step S410: Obtain initial dialogue data including multiple question-answer pairs.
[0091] Step S420: Obtain the vector representation type of the user input.
[0092] The type of input vector representation depends on the user's specific needs.
[0093] Step S430: According to the vector representation type, the multiple question-answer pairs in the initial dialogue data are vectorized to obtain the dialogue data.
[0094] The vector representation types include question representation, answer representation, and question-answer pair representation. Initial dialogue data is input into the pre-trained model, and then, based on the user's choice of vector representation type, the initial dialogue data is converted into a vector representation type corresponding to the user's choice before output. The pre-trained model is trained using large-scale dialogue data. For example, the pre-trained model could be a Simbert model, a tool model based on BERT predicts sentence vectors for semantic similarity retrieval. The Simbert model can achieve batch searching of the N most similar data points in a dataset, improving search efficiency.
[0095] Vector representation types include question representation, answer representation, and question-answer pair representation. Question representation refers to using only the vector calculated from the question through a pre-trained model as the vector representation of the question-answer pair; answer representation refers to using only the vector calculated from the answer through a pre-trained model as the vector representation of the question-answer pair; question-answer pair representation refers to concatenating the question and answer, and using the vector calculated from the concatenated text through a pre-trained model as the vector representation of the question-answer pair.
[0096] In summary, the data mining method provided in this application embodiment can perform data clustering mining based on real-time dialogue data. By mining similar response scripts from the dialogue data in the user's selected question-and-answer rounds and question-and-answer nodes, the user's intent can be determined more accurately, thereby improving the customer experience.
[0097] Figure 10 This is a block diagram of a data mining apparatus according to an embodiment of this application, such as... Figure 10 As shown, the data mining device 50 includes: The dialogue data acquisition module 510 is used to acquire dialogue data, which includes multiple question-answer pairs. Module 520 is used to establish question-and-answer rounds and question-and-answer nodes according to the time sequence of the question-and-answer pairs; The search scope determination module 530 is used to obtain the question-and-answer rounds and question-and-answer nodes selected by the user, and determine the search scope based on the question-and-answer rounds; The module 540 for acquiring dialogue data to be clustered is used to acquire, within the search range, dialogue data to be clustered whose cosine similarity to the question-and-answer node selected by the user reaches a first preset value. The module 550 for obtaining mining results is used to perform clustering mining on the dialogue data to be clustered and obtain clustering mining results.
[0098] In some embodiments of this application, the mining result acquisition module 550 includes: a target cluster number acquisition module for acquiring a target cluster number; a cluster node acquisition module for inputting the dialogue data to be clustered into a clustering model to obtain cluster node data with the same target cluster number, wherein the cluster node data includes multiple cluster question-answer pairs; a cluster center vector acquisition module for acquiring the cluster center vectors of the cluster node data; a similar cluster data acquisition module for acquiring cluster question-answer pairs whose cosine similarity to the cluster center vectors reaches a second preset value to obtain similar cluster data; and a sorting module for sorting the similar cluster data to obtain the cluster mining result.
[0099] In some embodiments of this application, the sorting module includes a similarity sorting module, used to sort the similar cluster data by similarity based on the cosine similarity between the similar cluster data and the cluster center vector, to obtain a first sorted question-answer pair; and a length sorting module, used to sort the first sorted question-answer pair by length based on the length of the first sorted question-answer pair, to obtain the clustering mining result.
[0100] In some embodiments of this application, the data mining device 50 further includes a stop removal module for processing the original dialogue data to remove stop words, thereby obtaining stop-removed data; a splicing module for splicing the stop-removed data to obtain spliced data; and a desensitization module for desensitizing the spliced data to obtain the dialogue data.
[0101] In some embodiments of this application, the splicing module includes: an empty question-and-answer round data acquisition module, used to acquire question-and-answer rounds in the stop-and-go data where the number of Chinese characters is 0, to obtain empty question-and-answer round data; and a merging module, used to merge the empty question-and-answer round data into the previous question-and-answer round, to obtain the spliced data.
[0102] In some embodiments of this application, the module 540 for obtaining dialogue data to be clustered includes a sub-module for obtaining dialogue data to be clustered, which is used to obtain dialogue data to be clustered with a cosine similarity of a selected question-and-answer node reaching a first preset value if the selected question-and-answer round is not the last round; and a non-comparison module, which is used to not perform cosine similarity comparison on the selected question-and-answer round if the selected question-and-answer round is the last round.
[0103] In some embodiments of this application, the data mining apparatus 50 further includes an initial dialogue data acquisition module for acquiring initial dialogue data including multiple question-answer pairs; a vector representation type acquisition module for acquiring a vector representation type input by the user; and a vectorization processing module for vectorizing the multiple question-answer pairs in the initial dialogue data according to the vector representation type to obtain the dialogue data. In this embodiment, the vector representation type includes question representation, answer representation, and question-answer pair representation.
[0104] It should be noted that each module in the data mining device in this embodiment corresponds one-to-one with each step in the data mining method in the aforementioned embodiment. Therefore, the specific implementation of this embodiment can refer to the implementation of the aforementioned data mining method, and will not be repeated here.
[0105] It should be understood that the above are merely illustrative examples and do not constitute any limitation on the technical solution of this application. Those skilled in the art can make settings as needed in practical applications, and no restrictions are imposed here.
[0106] This application also provides a computer-readable storage medium storing computer-readable instructions thereon, which, when executed by a processor, implement the method in any of the above method embodiments.
[0107] Computer-readable storage media can be electronic storage devices such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, computer-readable storage media includes non-transitory computer-readable storage medium. The computer-readable storage medium has storage space for computer-readable instructions that perform any of the method steps described above. These computer-readable instructions can be read from or written to one or more computer program products. The computer-readable instructions can be compressed, for example, in a suitable form.
[0108] According to one aspect of the embodiments of this application, a computer program product or computer program is provided, the computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, causing the computer device to perform the methods of any of the above embodiments.
[0109] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0110] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the methods according to the embodiments of this application.
[0111] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0112] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A data mining method, characterized in that, The methods include: Acquire dialogue data, which includes multiple question-answer pairs; Based on the time sequence of the question-and-answer pairs, establish question-and-answer rounds and question-and-answer nodes; Obtain the question-and-answer rounds and question-and-answer nodes selected by the user, and determine the search scope based on the question-and-answer rounds; Within the retrieval range, acquire the dialogue data to be clustered that has a cosine similarity to the question-and-answer node selected by the user that reaches a first preset value; Clustering mining is performed on the dialogue data to be clustered to obtain the clustering mining results.
2. The method according to claim 1, characterized in that, The step of performing clustering mining on the dialogue data to be clustered and obtaining the clustering mining results includes: Obtain the target number of clusters; The dialogue data to be clustered is input into the clustering model to obtain multiple clustering nodes. Each clustering node includes multiple clustered question-answer pairs, and the number of multiple clustering nodes is the same as the target number of clusters. Obtain the cluster center vector for each of the clustering nodes; In each clustering node, clustering question-answer pairs with a cosine similarity to the cluster center vector that reaches a second preset value are obtained to obtain similar cluster data; The similar cluster data are sorted to obtain the clustering mining results for each cluster node.
3. The method according to claim 2, characterized in that, The process of sorting the similar cluster data to obtain the clustering mining results includes: Based on the number of question-answer pairs in the similar cluster data, the similar cluster data is sorted by the number of pairs to obtain the first sorted question-answer pairs. Based on the cosine similarity between the similar cluster data and the cluster center vector, the similar cluster data are sorted by similarity to obtain the first sorted question-answer pairs; Based on the length of the first ranked question-answer pair, the first ranked question-answer pair is sorted by length to obtain the clustering mining result.
4. The method according to claim 1, characterized in that, Before acquiring the dialogue data, the process also includes: The original dialogue data is processed to remove stop words, resulting in stop-removed data. The stopped data is concatenated to obtain concatenated data; The spliced data is anonymized to obtain the dialogue data.
5. The method according to claim 4, characterized in that, The step of concatenating the stop data to obtain concatenated data includes: Obtain the question-and-answer rounds in the data where the number of Chinese characters is 0, and obtain the empty question-and-answer round data; The empty question-and-answer round data is merged into the previous question-and-answer round to obtain the spliced data.
6. The method according to claim 1, characterized in that, The step of obtaining the dialogue data to be clustered based on the search range, where the cosine similarity with the selected question-and-answer nodes reaches a first preset value, includes: If the selected question-and-answer round is not the last round, obtain the dialogue data to be clustered with the cosine similarity of the selected question-and-answer node reaching a first preset value; If the selected question-and-answer round is the last round, then no cosine similarity comparison will be performed on the selected question-and-answer round.
7. The method according to any one of claims 1 to 6, characterized in that, The acquisition of dialogue data includes: Obtain initial dialogue data including multiple question-answer pairs; Obtain the vector representation type of the user input; Based on the vector representation type, multiple question-answer pairs in the initial dialogue data are vectorized to obtain the dialogue data.
8. A data mining device, characterized in that, include: A dialogue data acquisition module is used to acquire dialogue data, which includes multiple question-answer pairs; A module is established to create question-and-answer rounds and question-and-answer nodes based on the time sequence of the question-and-answer pairs. The search scope determination module is used to obtain the question-and-answer rounds and question-and-answer nodes selected by the user, and determine the search scope based on the question-and-answer rounds; The module for acquiring dialogue data to be clustered is used to acquire, within the search range, dialogue data to be clustered whose cosine similarity to the question-and-answer node selected by the user reaches a first preset value; The module for obtaining mining results is used to perform clustering mining on the dialogue data to be clustered and obtain the clustering mining results.
9. An electronic device, characterized in that, include: processor; A memory storing computer-readable instructions that, when executed by the processor, implement the method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1-7.