Work order data clustering method, device, electronic device and storage medium

By using a hierarchical clustering model in work ticket data clustering, and multi-level classification and clustering are used for SimCSE sublayer and DEC clustering sublayer, the problem of slow speed and poor effect of work ticket clustering in the existing technology is solved. , more efficient clustering processing and more accurate clustering results are achieved.

CN114896392BActive Publication Date: 2025-02-11BEIJING BAOLANDE SOFTWARE CORP
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210392110.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-14
Publication Date
2025-02-11
Estimated Expiration
2042-04-14

AI Technical Summary

Technical Problem

The prior art has slow clustering speed and poor effect in work-single clustering scenarios, especially under large-scale data volumes, the performance of the clustering algorithm is degraded, time-consuming and the accuracy of the clustering results is low.

Method used

Using a hierarchical clustering model, including the classification layer, the first clustering layer and the second clustering layer, the SimCSE sublayer and the DEC clustering sublayer are used to classify and cluster the work ticket data at multiple levels to improve clustering efficiency and effects.

Benefits of technology

The clustering speed and effect of work ticket data are significantly improved through the hierarchical clustering model, and can process large-scale data more efficiently and improve the accuracy of clustering results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114896392B_ABST
    Figure CN114896392B_ABST
Patent Text Reader

Abstract

The present invention provides a clustering method, device, electronic device and storage medium for work order data, the method comprising: obtaining work order data; inputting the work order data into a hierarchical clustering model to obtain a clustering result of the work order data; wherein the hierarchical clustering model comprises a classification layer, a first clustering layer and a second clustering layer; the second clustering layer comprises a SimCSE sublayer and a DEC clustering sublayer, wherein the SimCSE sublayer is obtained by supervised training based on a work order sample and a text vector of the work order sample; the DEC clustering sublayer is obtained by training based on the text vector of the work order sample and the clustering result of the work order data corresponding to the text vector. The present invention improves the clustering speed and clustering effect of large amounts of work order data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of machine learning and natural language processing, and in particular to a clustering method, device, electronic device and storage medium for work order data. Background Art

[0002] The work order system collects a large number of various types of work orders from various cities every day, such as complaint work orders, fault work orders, etc. There are duplicates between a large number of work orders, and similar work orders need to be merged and classified. The introduction of machine learning capabilities can process work orders intelligently. The natural language processing algorithm can better understand the semantic information between work orders; the clustering algorithm can merge similar work orders, which can greatly reduce the workload of customer service staff and improve efficiency. The work orders processed by the machine learning algorithm can be deposited into the knowledge base, and the question-and-answer system of the operation and maintenance robot can be used to search for similar work orders and recommend solutions.

[0003] Existing technical solutions are not very suitable for work order clustering scenarios. When manually labeling and analyzing work order data, it is found that the work order data has the following characteristics:

[0004] 1. The text description methods of work order data belonging to the same category may vary greatly. Because the work orders come from customer service personnel in various cities, their language organization skills and methods sometimes vary greatly; the definition scope of some categories is wider than other categories, and naturally there are more description methods that can be accommodated.

[0005] 2. Multi-level category labeling. Work orders in the system have multiple levels of categories, and work orders belonging to the same large category can be divided into many small categories.

[0006] When facing large-scale data work orders, when the clusters are large, the performance of the clustering algorithm will be seriously degraded and time-consuming. The accuracy of the clustering results will also be affected by the text vectorization method and the performance of the traditional clustering algorithm itself, making it difficult to obtain excellent clustering results. When there are many co-occurring words between documents, the algorithm matches a higher similarity.

[0007] Therefore, how to improve the clustering speed and clustering effect of work orders is a technical problem that needs to be solved urgently in this project. Summary of the invention

[0008] The present invention provides a work order deep clustering method, device, electronic device and storage medium, which are used to solve the defects of slow clustering speed and poor effect in the prior art, and to improve the clustering speed and clustering effect of work orders.

[0009] The present invention provides a work order data clustering method, comprising:

[0010] Get work order data;

[0011] Inputting the work order data into a hierarchical clustering model to obtain a clustering result of the work order data;

[0012] Wherein, the hierarchical clustering model includes a classification layer, a first clustering layer and a second clustering layer;

[0013] The second clustering layer includes a SimCSE sublayer and a DEC clustering sublayer, wherein the SimCSE sublayer is obtained by supervised training based on work order samples and text vectors of the work order samples;

[0014] The DEC clustering sublayer is trained based on the text vector of the work order sample and the clustering result of the work order data corresponding to the text vector.

[0015] According to a work order data clustering method provided by the present invention, the work order data is input into a hierarchical clustering model to obtain a clustering result of the work order data, specifically comprising:

[0016] Inputting the work order data into a classification layer to obtain a classification result of the work order data;

[0017] Inputting the classification result into the first clustering layer to obtain a preliminary clustering result of the work order data;

[0018] The preliminary clustering result is input into the second clustering layer to obtain the final clustering result of the work order data.

[0019] According to a clustering method for work order data provided by the present invention, the step of inputting the preliminary clustering result into a second clustering layer to obtain a final clustering result of the work order data specifically includes:

[0020] Input the work order data corresponding to the preliminary clustering result into the trained SimCSE sublayer to obtain the text vector of the work order data;

[0021] The text vector is input into the trained DEC clustering sublayer to obtain the final clustering result of the work order data.

[0022] According to a clustering method for work order data provided by the present invention, before inputting the work order data into a classification layer, the method further includes:

[0023] Traversing the domain dictionary, obtaining keywords of the domain dictionary, and establishing statistical rules based on the keywords;

[0024] Based on the keywords and statistical rules, preset rules for classifying the work order data are obtained.

[0025] According to a clustering method for work order data provided by the present invention, the work order data is input into a classification layer to obtain a classification result of the work order data, specifically comprising:

[0026] Inputting the work order data into a classification layer, performing judgment based on the preset rules, and obtaining a classification result of the work order data based on the judgment result;

[0027] If the work order data satisfies a preset rule, classifying the work order data into a target category corresponding to the preset rule;

[0028] If the work order data does not meet the preset rules and does not contain keywords, the work order data is regarded as other categories.

[0029] According to a clustering method for work order data provided by the present invention, the classification result is input into a first clustering layer to obtain a preliminary clustering result of the work order data, specifically comprising:

[0030] Input the classification result into the first clustering layer, and convert the work order data corresponding to the classification result into a SimHash signature based on a hash function;

[0031] The Hamming distance between the SimHash signatures is obtained, and the SimHash signatures whose Hamming distances meet a preset threshold are clustered into a family to obtain a preliminary clustering result of the work order data.

[0032] According to a clustering method for work order data provided by the present invention, the training method of the SimCSE sublayer includes:

[0033] Get a sample of work orders;

[0034] Establish the SimCSE sublayer to be trained;

[0035] The work order sample is input into the SimCSE sublayer, and a first loss value between the text vector and the work order sample is obtained based on a loss function. The first loss value is used to repeatedly adjust parameters of the SimCSE sublayer until the first loss value is less than a first preset threshold, and training is stopped.

[0036] According to a clustering method for work order data provided by the present invention, the training method of the DEC clustering sublayer includes:

[0037] Establishing a DEC clustering sublayer to be trained, inputting the text vector of the work order sample into the DEC clustering sublayer, and obtaining a clustering result of the work order sample;

[0038] A second loss value between the clustering result and the text vector is obtained based on the loss function, and the second loss value is used to adjust parameters of the DEC clustering sublayer until the second loss value is less than a second preset threshold.

[0039] According to a clustering method for work order data provided by the present invention, the step of inputting the work order sample into the SimCSE sublayer to obtain the text vector of the work order sample specifically includes:

[0040] Fine-tune the work order sample to obtain a positive sample of the work order sample;

[0041] Based on the BM25 algorithm, the positive sample is used to generate a negative sample that semantically matches the positive sample;

[0042] The positive sample and the negative sample are input into the SimCSE sublayer to obtain the text vectors of the positive sample and the negative sample respectively.

[0043] According to a clustering method for work order data provided by the present invention, before inputting the positive sample and the negative sample into the SimCSE sublayer and respectively obtaining the text vectors of the positive sample and the negative sample, the method further includes:

[0044] Get the Chinese text STS dataset;

[0045] Inputting the Chinese text STS data set into the SimCSE sublayer for pre-training to obtain a SimCSE pre-training sublayer;

[0046] The step of inputting the positive sample and the negative sample into the SimCSE sublayer to obtain the text vectors of the positive sample and the negative sample respectively includes:

[0047] The positive sample and the negative sample are input into the SimCSE pre-training sublayer to obtain the text vectors of the positive sample and the negative sample respectively.

[0048] According to a clustering method for work order data provided by the present invention, before fine-tuning the work order samples and obtaining positive samples of the work order samples, the method further includes:

[0049] Replacing synonyms and adjusting word order of the work order sample to obtain a corpus enhancement sample;

[0050] The fine-tuning training of the work order sample to obtain a positive sample of the work order sample specifically includes:

[0051] The corpus enhancement samples are fine-tuned and trained to obtain positive samples of the corpus enhancement samples.

[0052] According to a clustering method for work order data provided by the present invention, the DEC clustering sublayer includes an automatic encoding layer and a clustering layer;

[0053] The step of inputting the text vector into the DEC clustering sublayer to obtain the clustering result of the work order sample specifically includes:

[0054] Inputting the text vector into an automatic encoding layer to obtain a feature vector of the text vector;

[0055] The feature vector is input into the clustering layer to obtain the clustering result of the work order sample corresponding to the feature vector.

[0056] A work order data clustering method provided according to the present invention further includes: setting a distance threshold, and adjusting the number of clusters based on the distance threshold; wherein the clustering result corresponds to the number of clusters.

[0057] The present invention also provides a work order data clustering device, comprising:

[0058] Acquisition module, used to obtain work order data;

[0059] A clustering module, used for inputting the work order data into a hierarchical clustering model to obtain a clustering result of the work order data;

[0060] Wherein, the hierarchical clustering model includes a classification layer, a first clustering layer and a second clustering layer;

[0061] The second clustering layer includes a SimCSE sublayer and a DEC clustering sublayer, wherein the SimCSE sublayer is obtained by supervised training based on work order samples and text vectors of the work order samples;

[0062] The DEC clustering sublayer is trained based on the text vector and the clustering results of the work order data corresponding to the text vector.

[0063] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the clustering method for work order data as described above are implemented.

[0064] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the work order data clustering method as described in any one of the above are implemented.

[0065] The work order deep clustering method, device, electronic device and storage medium provided by the present invention obtain the work order data to be clustered, input the work order data into the hierarchical clustering model, perform multi-layer classification and clustering on the work order data, and cluster the work order data based on the trained SimCSE sublayer and DEC clustering sublayer, thereby improving the clustering speed of large amounts of work order data. In addition, high-quality text vectors of the work order data can be obtained through the SimCSE sublayer, and then the clustering results of the work order data can be obtained through the DEC clustering sublayer, thereby improving the clustering effect of the work order data. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0067] Figure 1 This is one of the flow charts of the clustering method for work order data provided by the present invention;

[0068] Figure 2 This is the second flow chart of the clustering method for work order data provided by the present invention;

[0069] Figure 3 This is the third flow chart of the clustering method for work order data provided by the present invention;

[0070] Figure 4 This is the fourth flow chart of the clustering method for work order data provided by the present invention;

[0071] Figure 5 This is the fifth flow chart of the clustering method for work order data provided by the present invention;

[0072] Figure 6 This is the sixth flow chart of the clustering method for work order data provided by the present invention;

[0073] Figure 7 This is the seventh flow chart of the clustering method for work order data provided by the present invention;

[0074] Figure 8 This is the eighth flow chart of the clustering method for work order data provided by the present invention;

[0075] Fig. 9 This is a ninth flow chart of the clustering method for work order data provided by the present invention;

[0076] Fig.10This is a tenth flowchart of the clustering method for work order data provided by the present invention;

[0077] Fig.11 It is a structural schematic diagram of a clustering device for work order data provided by the present invention;

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

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

[0080] Combine the following Figure 1-Figure 10 The clustering method of work order data of the present invention is described.

[0081] Reference Figure 1 The present invention provides a clustering method for work order data, comprising the following steps:

[0082] Step 110: Obtain work order data.

[0083] Specifically, the work order data in this example is a large number of types of work orders summarized by the work order system from various channels, such as complaint work orders, fault work orders, etc.

[0084] Step 120: input the work order data into a hierarchical clustering model to obtain a clustering result of the work order data;

[0085] The hierarchical clustering model includes a classification layer, a first clustering layer and a second clustering layer.

[0086] It can be understood that in this embodiment, the work order data to be classified is input into the already constructed hierarchical clustering model, so as to obtain the clustering result of the work order data.

[0087] The hierarchical clustering model includes a multi-layer structure, and the input work order data can be classified and clustered multiple times through the classification layer, the first clustering layer and the second clustering layer.

[0088] The second clustering layer includes a SimCSE sublayer and a DEC clustering sublayer, wherein the SimCSE sublayer is obtained by supervised training based on work order samples and text vectors of the work order samples;

[0089] The DEC clustering sublayer is trained based on the text vector of the work order sample and the clustering result of the work order data corresponding to the text vector.

[0090] Specifically, this embodiment performs a second clustering on the work order data after clustering by the first clustering layer. The work order data after the first clustering is input into the second clustering layer, respectively undergoes vector conversion through the SimCSE sublayer, and then performs fine clustering on the work order data through the DEC clustering sublayer, thereby obtaining the final clustering result of the work order data.

[0091] The work order deep clustering method provided by the present invention obtains the work order data to be clustered, inputs the work order data into the hierarchical clustering model, performs multi-layer classification and clustering on the work order data, and clusters the work order data based on the trained SimCSE sublayer and DEC clustering sublayer, thereby improving the clustering speed of large amounts of work order data. In addition, high-quality text vectors of the work order data can be obtained through the SimCSE sublayer, and then the clustering results of the work order data are obtained through the DEC clustering sublayer, thereby improving the clustering effect of the work order data.

[0092] Based on the above embodiments, refer to Figure 2 , the work order data is input into a hierarchical clustering model to obtain a clustering result of the work order data, specifically comprising the following steps:

[0093] Step 210: input the work order data into a classification layer to obtain a classification result of the work order data;

[0094] Step 220: input the classification result to the first clustering layer to obtain a preliminary clustering result of the work order data;

[0095] Step 230: Input the preliminary clustering result to the second clustering layer to obtain the final clustering result of the work order data.

[0096] Specifically, the process of classifying and clustering work order data in this embodiment is as follows:

[0097] First, the work order data is passed through the classification layer and then divided into multiple categories, such as category a, category b, and category c. The first-level stratification is a rough stratification based on regular expressions and accumulated domain dictionaries.

[0098] Secondly, the output of the classification layer is input to the first clustering layer, and the word-based coarse clustering is quickly performed based on the SimHash method. The work order data is converted into SimHash signatures (fingerprints) through a certain hash function, and the data whose Hamming distance between SimHash signatures is less than N is a cluster. The empirical value N = 3, but in the face of real work order data, the hyperparameter N is generally selected to be a larger value to ensure that the data after the second layer will not be clustered into too many clusters.

[0099] Finally, the output results of the first clustering layer are input into the second clustering layer, and the work order data is subjected to text vector generation and fine clustering in succession, thereby obtaining the final clustering results of the work order data.

[0100] Based on the above embodiments, refer to Figure 3 , the preliminary clustering result is input into the second clustering layer to obtain the final clustering result of the work order data, specifically comprising the following steps:

[0101] Step 310: input the work order data corresponding to the preliminary clustering result into the trained SimCSE sublayer to obtain the text vector of the work order data;

[0102] Step 320: Input the text vector into the trained DEC clustering sublayer to obtain the final clustering result of the work order data.

[0103] In this embodiment, the second clustering layer can be divided into two layers, namely, the SimCSE sublayer and the DEC clustering sublayer, both of which are neural network models obtained by training a large number of sample sets. The text vector and clustering results of the work order data are obtained through the trained SimCSE model and DEC clustering model, thereby improving the accuracy and efficiency of clustering.

[0104] Based on the above embodiment, before the work order data is input into the classification layer, the method further includes:

[0105] Traversing the domain dictionary, obtaining keywords of the domain dictionary, and establishing statistical rules based on the keywords;

[0106] Based on the keywords and statistical rules, preset rules for classifying the work order data are obtained.

[0107] Specifically, before the first classification of the work order data, it is necessary to obtain the classification rules of the classification layer. The classification rules are obtained by obtaining the keywords of the domain dictionary and establishing statistical rules based on the keywords. It is necessary to set priorities for the keywords in these dictionaries to deal with some work orders containing more than one keyword. A statistical rule based on keywords is established. If more than N words of a certain category are included at the same time, it will be classified into that category.

[0108] Based on the above embodiment, the work order data is input into the classification layer to obtain the classification result of the work order data, specifically including:

[0109] Inputting the work order data into a classification layer, performing judgment based on the preset rules, and obtaining a classification result of the work order data based on the judgment result;

[0110] If the work order data satisfies a preset rule, classifying the work order data into a target category corresponding to the preset rule;

[0111] If the work order data does not meet the preset rules and does not contain keywords, the work order data is regarded as other categories.

[0112] Specifically, this embodiment further screens and classifies the work order data through preset rules, for example, it can be expressed as: setting up an "other category", the work orders in this category neither contain the keywords in the dictionary nor can be matched by the rules. That is, the first category is the category containing keywords, and the other categories are "other categories" that do not contain keywords and do not meet the preset rules.

[0113] Based on the above embodiment, the classification result is input into the first clustering layer to obtain the preliminary clustering result of the work order data, which specifically includes:

[0114] Input the classification result into the first clustering layer, and convert the work order data corresponding to the classification result into a SimHash signature based on a hash function;

[0115] The Hamming distance between the SimHash signatures is obtained, and the SimHash signatures whose Hamming distances meet a preset threshold are clustered into a family to obtain a preliminary clustering result of the work order data.

[0116] Specifically, this embodiment performs coarse clustering of work order data based on the SimHash algorithm. In this example, the classified work order data is deduplicated on a large scale through the SimHash algorithm, the work order data is converted into SimHash signatures (fingerprints) through a hash function, the Hamming distance between SimHash signatures is calculated, and the work order data with a Hamming distance less than a preset threshold N is taken as a family, where the preset threshold N can be set to different values ​​according to actual conditions. The empirical value N=3, but in the face of real work order data, the hyperparameter N generally selects a larger value to ensure that the work order data passing the second layer will not be clustered into too many clusters.

[0117] Based on the above embodiments, refer to Figure 4 , the training method of the SimCSE sublayer includes:

[0118] Step 410: Obtain a work order sample;

[0119] Step 420: Establish a SimCSE sublayer to be trained;

[0120] Step 430: input the work order sample into the SimCSE sublayer, obtain a first loss value between the text vector and the work order sample based on the loss function, and use the first loss value to repeatedly adjust the parameters of the SimCSE sublayer until the first loss value is less than a first preset threshold, and stop training.

[0121] Specifically, the work order samples in this embodiment are the training sample set of the SimCSE sub-layer model. A large number of work order samples are input into the established SimCSE sub-layer model for training, and the loss function is used to continuously adjust the parameters until the first loss value is less than the preset threshold, that is, the training is stopped when the model converges. The trained model will be used in the process of converting work order data into text vectors.

[0122] Based on the above embodiments, refer to Figure 5 , the training method of the DEC clustering sublayer comprises the following steps:

[0123] Step 510: Establish a DEC clustering sublayer to be trained, input the text vector of the work order sample into the DEC clustering sublayer, and obtain a clustering result of the work order sample;

[0124] Step 520: Obtain a second loss value between the clustering result and the text vector based on the loss function, and use the second loss value to adjust parameters of the DEC clustering sublayer until the second loss value is less than a second preset threshold.

[0125] Specifically, this embodiment is a training process of a DEC clustering sublayer model. A large number of text vectors are used as training sample sets and input into the established DEC clustering sublayer model, and the second loss value is continuously adjusted using the loss function until the second loss value is less than the second preset threshold, that is, the model converges and stops training.

[0126] Based on the above embodiment, the step of inputting the work order sample into the SimCSE sublayer to obtain the text vector of the work order sample specifically includes:

[0127] Fine-tune the work order sample to obtain a positive sample of the work order sample;

[0128] Based on the BM25 algorithm, the positive sample is used to generate a negative sample that semantically matches the positive sample;

[0129] The positive sample and the negative sample are input into the SimCSE sublayer to obtain the text vectors of the positive sample and the negative sample respectively.

[0130] Specifically, the SimCSE sublayer of this embodiment is implemented based on the twin network architecture. Figure 6 , the twin network structure has two input channels, left and right, and the two input channels share the same BERT model. The loss function can be cosine similarity or Euclidean distance L2, etc. In the figure, Sentence B and Sentence B are two related sentences, which are used as BERT inputs. They are converted into two text vectors U and V through the same BERT layer and pooling, and then output according to the loss function (cosine Similarity).

[0131] The training samples of this embodiment are divided into positive samples and negative samples, where the positive samples are selected from the same category of data sets, and the BM25 algorithm is used to screen out the work order data in different categories that are closest to the positive semantics as negative samples. The purpose of contrastive learning is to reduce the distance between the same category and increase the distance between different categories, thereby obtaining a better representation vector for a text. The negative samples are designed in this way to enhance the model's better vector representation of texts of similar but different categories.

[0132] Reference Figure 7 ,In the supervised SimCSE algorithm diagram, the solid arrows represent positive samples belonging to the same class, and the dotted arrows represent negative samples of different classes.

[0133] Specifically, the arrows represent positive samples of the same category, such as "Two dogs are running", "There are animals outdoors", "The pets are sitting on a couch". The dotted arrows represent negative samples of different categories, such as "A man surfing on the sea", "A kid is on a skateboard", "There is a man", "The man wears a business suit", "The man wears a businesssuit", "A kid is on a skateboart", "A kid is skateboarding", "A kit is inside the house".

[0134] Based on the above embodiment, before inputting the positive sample and the negative sample into the SimCSE sublayer and respectively obtaining the text vectors of the positive sample and the negative sample, the method further includes:

[0135] Get the Chinese text STS dataset;

[0136] Inputting the Chinese text STS data set into the SimCSE sublayer for pre-training to obtain a SimCSE pre-training sublayer;

[0137] The step of inputting the positive sample and the negative sample into the SimCSE sublayer to obtain the text vectors of the positive sample and the negative sample respectively includes:

[0138] The positive sample and the negative sample are input into the SimCSE pre-training sublayer to obtain the text vectors of the positive sample and the negative sample respectively.

[0139] Specifically, this embodiment first uses the open source large-scale Chinese text STS dataset to perform SimCSE model pre-training to obtain the SimCSE pre-training sub-layer model, so that the initial SimCSE model can learn the prior knowledge of Chinese text. It should be noted that the distance measurement method of the loss function DEC clustering sub-layer is consistent here.

[0140] Based on the above embodiment, before fine-tuning the work order sample and obtaining a positive sample of the work order sample, the method further includes:

[0141] Replacing synonyms and adjusting word order of the work order sample to obtain a corpus enhancement sample;

[0142] The fine-tuning training of the work order sample to obtain a positive sample of the work order sample specifically includes:

[0143] The corpus enhancement samples are fine-tuned and trained to obtain positive samples of the corpus enhancement samples.

[0144] Specifically, this embodiment uses synonym replacement and word order adjustment to enhance the corpus of the work order samples after word segmentation, and fine-tunes the enhanced corpus samples. In the process of training the SimCSE fine-tuning model, the initial layers of BERT are frozen in an attempt to retain the Chinese prior knowledge in the pre-training stage to the greatest extent.

[0145] Based on the above embodiment, the DEC clustering sublayer includes an automatic encoding layer and a clustering layer;

[0146] The step of inputting the text vector into the DEC clustering sublayer to obtain the clustering result of the work order sample specifically includes:

[0147] Inputting the text vector into an automatic encoding layer to obtain a feature vector of the text vector;

[0148] The feature vector is input into the clustering layer to obtain the clustering result of the work order sample corresponding to the feature vector.

[0149] Specifically, refer to Figure 8 The DEC clustering sublayer model of this embodiment is trained in two stages. In the first stage, AutoEncoder (AE) is trained as the initial feature representation, and the input uses the output text vector of the SimCSE sublayer model. The feature vector of the middle layer of the AE network structure is the input vector of the clustering algorithm required in the second stage, and the feature of the middle layer can also be processed and reconstructed by the decoder. The advantage of using the AE network algorithm is that the feature vector can have the function of dimensionality reduction and denoising compared to the input vector.

[0150] In the second stage, the trained Encoder model is used together with the cluster center assignment for training and fine-tuning, thereby optimizing both the encoder and the cluster center assignment, so that the two tasks can promote and learn from each other.

[0151] Based on the above embodiment, a distance threshold is set, and the number of clusters is adjusted based on the distance threshold; wherein the clustering result corresponds to the number of clusters.

[0152] Specifically, this embodiment is based on the hierarchical clustering algorithm AgglomerativeClustering, and controls the number of clusters by setting a distance threshold (distance_threshold) parameter, wherein the parameter distance_threshold is generally selected between 0.8 and 0.9. It should be noted that the method of calculating distance in this embodiment needs to be consistent with the SimCSE mentioned above.

[0153] Reference Fig. 9 The clustering method of work order data provided by the present invention comprises the following steps:

[0154] Step 910: construct the data required for clustering the labeled work orders, analyze the data and construct expert rules and domain dictionaries;

[0155] Step 920: preprocessing of work order data;

[0156] Step 930: Use the labeled work order data to train the SimCSE algorithm pipeline based on the twin network;

[0157] Step 940: input the obtained text vector into the deep clustering algorithm DEC to train the deep clustering model;

[0158] Step 950: Hierarchical work order clustering.

[0159] Reference Fig.10 , the clustering method of work order data provided by the present invention is fully described below.

[0160] The work order data clustering method provided by the present invention comprises as a whole: SimCSE model, DEC deep clustering and a three-layer work order clustering architecture.

[0161] First, the steps to obtain the SimCSE model are:

[0162] Input a large-scale Chinese STS dataset into the SimCSE model for pre-training to obtain a pre-trained model;

[0163] Enhance the corpus of the labeled work order data and design training samples;

[0164] The training samples are input into the pre-trained model and fine-tuned to output the fine-tuned model SimCSE model.

[0165] Secondly, the DEC deep clustering model is based on the automatic encoding model and encoding hierarchical clustering;

[0166] Finally, a three-layer work order clustering architecture is built, which includes the classification layer, the first clustering layer and the second clustering layer; the first classification layer is built and layered according to rules and dictionaries; the first clustering layer is built based on the SimHash algorithm; the second clustering layer is built by integrating the acquired SimCSE model and the DEC deep clustering model.

[0167] The specific process of hierarchical clustering of work order data is as follows:

[0168] The work orders are layered based on rules and dictionaries, and are divided into categories A, B, and C.

[0169] Class a is roughly clustered based on SimHash and divided into two levels, namely, class aa, class ab, and class ac;

[0170] Category aa is refined based on DEC and divided into three levels, namely category aaa, category aab and category aac.

[0171] The work order data clustering device provided by the present invention is described below. The work order data clustering device described below and the work order data clustering method described above can be referred to each other.

[0172] Reference Fig.11 The work order data clustering device provided by the present invention includes:

[0173] The acquisition module 111 is used to acquire work order data;

[0174] A clustering module 112, used for inputting the work order data into a hierarchical clustering model to obtain a clustering result of the work order data;

[0175] Wherein, the hierarchical clustering model includes a classification layer, a first clustering layer and a second clustering layer;

[0176] The second clustering layer includes a SimCSE sublayer and a DEC clustering sublayer, wherein the SimCSE sublayer is obtained by supervised training based on work order samples and text vectors of the work order samples;

[0177] The DEC clustering sublayer is trained based on the text vector and the clustering results of the work order data corresponding to the text vector.

[0178] Based on the above embodiments, the clustering module is specifically used for:

[0179] Inputting the work order data into a classification layer to obtain a classification result of the work order data;

[0180] Inputting the classification result into the first clustering layer to obtain a preliminary clustering result of the work order data;

[0181] The preliminary clustering result is input into the second clustering layer to obtain the final clustering result of the work order data.

[0182] Based on the above embodiments, the clustering module is specifically used for:

[0183] Input the work order data corresponding to the preliminary clustering result into the trained SimCSE sublayer to obtain the text vector of the work order data;

[0184] The text vector is input into the trained DEC clustering sublayer to obtain the final clustering result of the work order data.

[0185] Based on the above embodiment, it also includes:

[0186] A keyword and statistical rule acquisition module, used to traverse the domain dictionary, obtain keywords of the domain dictionary, and establish statistical rules based on the keywords;

[0187] The preset rule acquisition module is used to obtain the preset rules for classifying the work order data based on the keywords and statistical rules.

[0188] Based on the above embodiments, the clustering module is specifically used for:

[0189] Inputting the work order data into a classification layer, performing judgment based on the preset rules, and obtaining a classification result of the work order data based on the judgment result;

[0190] If the work order data satisfies a preset rule, classifying the work order data into a target category corresponding to the preset rule;

[0191] If the work order data does not meet the preset rules and does not contain keywords, the work order data is regarded as other categories.

[0192] Based on the above embodiments, the clustering module is specifically used for:

[0193] Input the classification result into the first clustering layer, and convert the work order data corresponding to the classification result into a SimHash signature based on a hash function;

[0194] The Hamming distance between the SimHash signatures is obtained, and the SimHash signatures whose Hamming distances meet a preset threshold are clustered into a family to obtain a preliminary clustering result of the work order data.

[0195] Based on the above embodiments, the clustering module is specifically used for:

[0196] Get a sample of work orders;

[0197] Establish the SimCSE sublayer to be trained;

[0198] The work order sample is input into the SimCSE sublayer, and a first loss value between the text vector and the work order sample is obtained based on a loss function. The first loss value is used to repeatedly adjust parameters of the SimCSE sublayer until the first loss value is less than a first preset threshold, and training is stopped.

[0199] Based on the above embodiments, the clustering module is specifically used for:

[0200] Establishing a DEC clustering sublayer to be trained, inputting the text vector of the work order sample into the DEC clustering sublayer, and obtaining a clustering result of the work order sample;

[0201] A second loss value between the clustering result and the text vector is obtained based on the loss function, and the second loss value is used to adjust parameters of the DEC clustering sublayer until the second loss value is less than a second preset threshold.

[0202] Based on the above embodiments, the clustering module is specifically used for:

[0203] Fine-tune the work order sample to obtain a positive sample of the work order sample;

[0204] Based on the BM25 algorithm, the positive sample is used to generate a negative sample that semantically matches the positive sample;

[0205] The positive sample and the negative sample are input into the SimCSE sublayer to obtain the text vectors of the positive sample and the negative sample respectively.

[0206] Based on the above embodiment, it also includes:

[0207] Chinese text STS data set acquisition module, used to acquire Chinese text STS data set;

[0208] A pre-training module, used for inputting the Chinese text STS data set into the SimCSE sub-layer for pre-training to obtain a SimCSE pre-training sub-layer;

[0209] The text vector acquisition module is used to input the positive sample and the negative sample into the SimCSE pre-training sublayer to obtain the text vectors of the positive sample and the negative sample respectively.

[0210] Based on the above embodiment, it also includes:

[0211] A corpus enhancement module is used to replace synonyms and adjust the word order of the work order sample to obtain a corpus enhancement sample;

[0212] The positive sample acquisition module is used to perform fine-tuning training on the corpus enhancement samples to obtain positive sample of the corpus enhancement samples.

[0213] Based on the above embodiment, the DEC clustering sublayer includes an automatic encoding layer and a clustering layer;

[0214] The clustering module is specifically used for:

[0215] Inputting the text vector into an automatic encoding layer to obtain a feature vector of the text vector;

[0216] The feature vector is input into the clustering layer to obtain the clustering result of the work order sample corresponding to the feature vector.

[0217] Based on the above embodiment, it also includes:

[0218] The distance setting module is used to set a distance threshold and adjust the number of clusters based on the distance threshold; wherein the clustering result corresponds to the number of clusters.

[0219] Fig.12 An example of a physical structure diagram of an electronic device is shown in FIG. Fig.12As shown, the electronic device may include: a processor 1210, a communication interface 1220, a memory 1230 and a communication bus 1240, wherein the processor 1210, the communication interface 1220, and the memory 1230 communicate with each other through the communication bus 1240. The processor 1210 may call the logic instructions in the memory 1230 to execute the clustering method of the work order data, and the method includes:

[0220] Get work order data;

[0221] Inputting the work order data into a hierarchical clustering model to obtain a clustering result of the work order data;

[0222] Wherein, the hierarchical clustering model includes a classification layer, a first clustering layer and a second clustering layer;

[0223] The second clustering layer includes a SimCSE sublayer and a DEC clustering sublayer, wherein the SimCSE sublayer is obtained by supervised training based on work order samples and text vectors of the work order samples;

[0224] The DEC clustering sublayer is trained based on the text vector of the work order sample and the clustering result of the work order data corresponding to the text vector.

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

[0226] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the clustering method of work order data provided by the above methods, the method comprising:

[0227] Get work order data;

[0228] Inputting the work order data into a hierarchical clustering model to obtain a clustering result of the work order data;

[0229] Wherein, the hierarchical clustering model includes a classification layer, a first clustering layer and a second clustering layer;

[0230] The second clustering layer includes a SimCSE sublayer and a DEC clustering sublayer, wherein the SimCSE sublayer is obtained by supervised training based on work order samples and text vectors of the work order samples;

[0231] The DEC clustering sublayer is trained based on the text vector of the work order sample and the clustering result of the work order data corresponding to the text vector.

[0232] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, which is implemented when the computer program is executed by a processor to perform the clustering method of work order data provided by the above methods, the method comprising:

[0233] Get work order data;

[0234] Inputting the work order data into a hierarchical clustering model to obtain a clustering result of the work order data;

[0235] Wherein, the hierarchical clustering model includes a classification layer, a first clustering layer and a second clustering layer;

[0236] The second clustering layer includes a SimCSE sublayer and a DEC clustering sublayer, wherein the SimCSE sublayer is obtained by supervised training based on work order samples and text vectors of the work order samples;

[0237] The DEC clustering sublayer is trained based on the text vector of the work order sample and the clustering result of the work order data corresponding to the text vector.

[0238] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0239] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0240] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A clustering method for work order data, characterized in that: include: Get work order data; Inputting the work order data into a hierarchical clustering model to obtain a clustering result of the work order data; Wherein, the hierarchical clustering model includes a classification layer, a first clustering layer and a second clustering layer; The second clustering layer includes a SimCSE sublayer and a DEC clustering sublayer, wherein the SimCSE sublayer is obtained by supervised training based on work order samples and text vectors of the work order samples; The DEC clustering sublayer is trained based on the text vector of the work order sample and the clustering result of the work order data corresponding to the text vector; The step of inputting the work order data into a hierarchical clustering model to obtain a clustering result of the work order data specifically includes: Inputting the work order data into a classification layer to obtain a classification result of the work order data; Inputting the classification result into the first clustering layer to obtain a preliminary clustering result of the work order data; Inputting the preliminary clustering result into the second clustering layer to obtain the final clustering result of the work order data; Inputting the preliminary clustering result into the second clustering layer to obtain the final clustering result of the work order data specifically includes: Input the work order data corresponding to the preliminary clustering result into the trained SimCSE sublayer to obtain the text vector of the work order data; The text vector is input into the trained DEC clustering sublayer to obtain the final clustering result of the work order data.

2. The clustering method of work order data according to claim 1, characterized in that: Before inputting the work order data into the classification layer, it also includes: Traversing the domain dictionary, obtaining keywords of the domain dictionary, and establishing statistical rules based on the keywords; Based on the keywords and statistical rules, preset rules for classifying the work order data are obtained.

3. The clustering method of work order data according to claim 2, characterized in that: Inputting the work order data into the classification layer to obtain the classification result of the work order data specifically includes: Inputting the work order data into a classification layer, performing judgment based on the preset rules, and obtaining a classification result of the work order data based on the judgment result; If the work order data satisfies a preset rule, classifying the work order data into a target category corresponding to the preset rule; If the work order data does not meet the preset rules and does not contain keywords, the work order data is regarded as other categories.

4. The clustering method of work order data according to claim 1, characterized in that: Inputting the classification result into the first clustering layer to obtain the preliminary clustering result of the work order data specifically includes: Input the classification result into the first clustering layer, and convert the work order data corresponding to the classification result into a SimHash signature based on a hash function; The Hamming distance between the SimHash signatures is obtained, and the SimHash signatures whose Hamming distances meet a preset threshold are clustered into a family to obtain a preliminary clustering result of the work order data.

5. The clustering method of work order data according to claim 1, characterized in that: The training method of the SimCSE sublayer includes: Get a sample of work orders; Establish the SimCSE sublayer to be trained; The work order sample is input into the SimCSE sublayer, and a first loss value between the text vector and the work order sample is obtained based on a loss function. The first loss value is used to repeatedly adjust parameters of the SimCSE sublayer until the first loss value is less than a first preset threshold, and training is stopped.

6. The clustering method of work order data according to claim 5, characterized in that: The training method of the DEC clustering sublayer includes: Establishing a DEC clustering sublayer to be trained, inputting the text vector of the work order sample into the DEC clustering sublayer, and obtaining a clustering result of the work order sample; A second loss value between the clustering result and the text vector is obtained based on the loss function, and the second loss value is used to adjust parameters of the DEC clustering sublayer until the second loss value is less than a second preset threshold.

7. The clustering method of work order data according to claim 5, characterized in that: Inputting the work order sample into the SimCSE sublayer to obtain the text vector of the work order sample specifically includes: Fine-tune the work order sample to obtain a positive sample of the work order sample; Based on the BM25 algorithm, the positive sample is used to generate a negative sample that semantically matches the positive sample; The positive sample and the negative sample are input into the SimCSE sublayer to obtain the text vectors of the positive sample and the negative sample respectively.

8. The clustering method of work order data according to claim 7, characterized in that: Before inputting the positive sample and the negative sample into the SimCSE sublayer and respectively obtaining the text vectors of the positive sample and the negative sample, the method further includes: Get the Chinese text STS dataset; Inputting the Chinese text STS data set into the SimCSE sublayer for pre-training to obtain a SimCSE pre-training sublayer; The step of inputting the positive sample and the negative sample into the SimCSE sublayer to obtain the text vectors of the positive sample and the negative sample respectively includes: The positive sample and the negative sample are input into the SimCSE pre-training sublayer to obtain the text vectors of the positive sample and the negative sample respectively.

9. The clustering method of work order data according to claim 7, characterized in that: Before fine-tuning the work order sample and obtaining a positive sample of the work order sample, the method further includes: Replacing synonyms and adjusting word order of the work order sample to obtain a corpus enhancement sample; The fine-tuning training of the work order sample to obtain a positive sample of the work order sample specifically includes: The corpus enhancement samples are fine-tuned and trained to obtain positive samples of the corpus enhancement samples.

10. The clustering method of work order data according to claim 6, characterized in that: The DEC clustering sublayer includes an auto-encoding layer and a clustering layer; The step of inputting the text vector into the DEC clustering sublayer to obtain the clustering result of the work order sample specifically includes: Inputting the text vector into an automatic encoding layer to obtain a feature vector of the text vector; The feature vector is input into the clustering layer to obtain the clustering result of the work order sample corresponding to the feature vector.

11. The method for clustering work order data according to claim 6, characterized in that: Also includes: Setting a distance threshold, and adjusting the number of clusters based on the distance threshold; The clustering result corresponds to the number of clusters.

12. A clustering device for work order data, characterized in that: include: Acquisition module, used to obtain work order data; A clustering module, used for inputting the work order data into a hierarchical clustering model to obtain a clustering result of the work order data; Wherein, the hierarchical clustering model includes a classification layer, a first clustering layer and a second clustering layer; The second clustering layer includes a SimCSE sublayer and a DEC clustering sublayer, wherein the SimCSE sublayer is obtained by supervised training based on work order samples and text vectors of the work order samples; The DEC clustering sublayer is obtained by training based on the clustering results of the text vector and the work order data corresponding to the text vector; The clustering module is further used for: Inputting the work order data into a classification layer to obtain a classification result of the work order data; Inputting the classification result into the first clustering layer to obtain a preliminary clustering result of the work order data; Inputting the preliminary clustering result into the second clustering layer to obtain the final clustering result of the work order data; The clustering module is further used for: Input the work order data corresponding to the preliminary clustering result into the trained SimCSE sublayer to obtain the text vector of the work order data; The text vector is input into the trained DEC clustering sublayer to obtain the final clustering result of the work order data.

13. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the work order data clustering method according to any one of claims 1 to 11 are implemented.

14. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the work order data clustering method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Text clustering method and device

    CN106909575A

  • Text classification method based on self-supervised comparative learning

    CN113139053A

  • Work order processing method and device, equipment and storage medium

    CN114218958A