Work order text processing method and device
Through clustering algorithm and word frequency analysis technology, the complaint work ticket text is clustered and keyword extracted, and visual display is generated, which solves the problems of complex classification system and uneven effects in the existing technology, and realizes efficient complaint information mining and intuitiveness The results are displayed.
Patent Information
- Application Number
- CN202410322391.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-20
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-03-20
AI Technical Summary
The existing complaint work order text processing solutions have problems such as complex classification system, long-term model construction, unbalanced classification effects and unintuitive results, especially when dealing with unpopular work order texts.
Text clustering is used to use density-based clustering algorithm HDBSCAN and cluster-word frequency-inverse text frequency index C-TF-IDF algorithm to generate text clusters and combine semantic vector model BGE and dimensionality reduction algorithm UMAP with unified manifold approximation and projection to generate text clusters and Keyword extraction and subject word generation are carried out, and keywords and subject words are displayed through visual form.
It realizes the simple and efficient mining of important information in the complaint work order text, helps the hotline center to timely discover the appeal content and key information, and provides data support for subsequent processing and decision-making, reducing the time of model construction and improving classification effect.
Smart Images

Figure CN119128140A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for processing work order text. Background Art
[0002] In the existing technology, some large-scale public service hotlines handle thousands of complaints and feedback every day. These complaints often involve service quality, policy implementation, public safety and other aspects, which are of great significance to maintaining social stability and improving the image of the government. Faced with a large number of complaints and feedback, if they are simply handed over to manual review and processing one by one, it will undoubtedly consume a lot of manpower and material resources. In this case, it is particularly necessary to introduce automated and intelligent text analysis technology to mine text information for a large number of complaint tickets.
[0003] The existing solution for handling complaint ticket texts is to establish a hierarchical classification system for complaint ticket texts, that is, to use natural language processing (NLP) related technologies to establish a classification model and classify different complaint ticket texts. This method can better organize and manage a large number of complaint ticket texts, making it easier for professionals to better understand and handle complaints. However, the existing solution for handling public complaint texts also has the following shortcomings:
[0004] Firstly, the complaints cover a wide range of areas, so in order to cover as many areas as possible, it is necessary to establish a large and complex classification system, which is not an easy process.
[0005] Secondly, the number of work orders of different types has a serious long-tail distribution, that is, most of the work order texts are concentrated in a few popular categories, and the remaining work orders are scattered in other unpopular categories. This will increase the difficulty of building a classification model, especially for work order texts belonging to unpopular categories. The model classification effect may not be good; therefore, in order to make the model perform evenly in different categories, it is necessary to accumulate data for unpopular category work order data for a long time, which will result in a long time for the entire model construction.
[0006] Finally, the presented results are not intuitive enough and lack a visual information display process. Summary of the invention
[0007] One purpose of the present application is to provide a method and device for processing work order texts, which enables simple and efficient mining of important information in work order texts about complaints, and visually displays the keywords and subject terms of the text clusters formed by the work order texts. The entire process conveniently and intuitively helps hotline centers in actual application scenarios to promptly discover various appeal contents and key information of the corresponding work order texts in the work order texts, and provides data support for subsequent processing and decision-making.
[0008] According to one aspect of the present application, a method for processing a work order text is provided, wherein the method comprises:
[0009] Obtaining a preset number of work order texts regarding complaints, and performing data preprocessing on the preset number of work order texts to obtain the preset number of preprocessed work order texts, wherein the preset number includes at least two;
[0010] Performing text clustering on the preset number of pre-processed work order texts to obtain a comprehensive text cluster corresponding to each of the different demands, each of the comprehensive text clusters including at least one pre-processed work order text;
[0011] Perform keyword extraction and subject word generation operations on the comprehensive text cluster corresponding to each demand, and obtain keywords and subject words of the comprehensive text cluster corresponding to each demand;
[0012] The keywords and subject terms of the comprehensive text cluster corresponding to each demand are displayed in a visual form.
[0013] Furthermore, in the above method, the data preprocessing of the preset number of work order texts to obtain a preset number of preprocessed work order texts includes:
[0014] Obtain a preset general stop word thesaurus and a constructed professional stop word thesaurus; wherein the professional stop word thesaurus is obtained by sequentially performing word segmentation, word frequency statistics, and manual screening of historical work order texts related to complaints;
[0015] Based on the general stop word library and the professional stop word library, each work order text in the preset number of work order texts is respectively subjected to word segmentation processing, stop word screening processing and valid word retention processing in sequence to obtain a preset number of preprocessed work order texts.
[0016] Furthermore, in the above method, text clustering is performed on the preset number of pre-processed work order texts to obtain a comprehensive text cluster corresponding to each of the different demands, and each of the comprehensive text clusters includes at least one pre-processed work order text, including:
[0017] Using a density-based clustering algorithm HDBSCAN to perform initial clustering on the preset number of pre-processed work order texts to obtain at least two candidate text clusters, each of which includes at least one pre-processed work order text;
[0018] The cluster-term frequency-inverse text frequency index C-TF-IDF algorithm and the density-based clustering algorithm HDBSCAN are used to perform secondary clustering on the at least two candidate text clusters to obtain a clustered text cluster corresponding to each of the different demands, each of the clustered text clusters including at least one preprocessed work order text;
[0019] After the secondary clustering, it is determined whether there are discrete work order texts that are not clustered in the preset number of pre-processed work order texts.
[0020] If not, the clustered text cluster corresponding to each demand is determined as the comprehensive text cluster corresponding to each demand;
[0021] If so, the discrete work order texts are merged based on the clustered text clusters corresponding to each demand to obtain a comprehensive text cluster corresponding to each demand in the different demands, each of the comprehensive text clusters including at least one preprocessed work order text.
[0022] Furthermore, in the above method, the density-based clustering algorithm HDBSCAN is used to perform initial clustering on the preset number of pre-processed work order texts to obtain at least two candidate text clusters, including:
[0023] Using a semantic vector model BGE to obtain a sentence vector of each of the preprocessed work order texts in the preset number of preprocessed work order texts;
[0024] Using the unified manifold approximation and projection dimensionality reduction algorithm UMAP to perform vector dimensionality reduction on the sentence vector of each preprocessed work order text, so as to obtain the dimensionality reduced sentence vector corresponding to each preprocessed work order text;
[0025] The reduced-dimensional sentence vectors corresponding to each of the preprocessed work order texts are clustered using the density-based clustering algorithm HDBSCAN to obtain at least two candidate text clusters.
[0026] Furthermore, in the above method, the cluster-term frequency-inverse text frequency index C-TF-IDF algorithm and the density-based clustering algorithm HDBSCAN are used to perform secondary clustering on the at least two candidate text clusters to obtain a clustered text cluster corresponding to each demand in different demands, including:
[0027] A cluster-term frequency-inverse text frequency index C-TF-IDF algorithm is used to construct a vocabulary for the words in the preset number of preprocessed work order texts, and a C-TF-IDF value of each word in the vocabulary is calculated, wherein the number of words in the vocabulary is N, and N is a positive integer greater than or equal to 2;
[0028] Representing at least one preprocessed work order text in each of the at least two candidate text clusters by a set of words in the vocabulary to form an N-dimensional vector;
[0029] In each of the candidate text clusters, multiplying the C-TF-IDF value of each word included in each of the candidate text clusters by the N-dimensional vector to obtain a vector representation of each of the candidate text clusters;
[0030] Based on the vector representation of each of the candidate text clusters and the density-based clustering algorithm HDBSCAN, the at least two candidate text clusters are clustered again to obtain a clustered text cluster corresponding to each of the different demands.
[0031] Furthermore, in the above method, the discrete work order texts are merged based on the clustered text clusters corresponding to each demand to obtain a comprehensive text cluster corresponding to each demand in different demands, including:
[0032] The vector representation of the discrete work order text is calculated by using a cluster-term frequency-inverse text frequency index C-TF-IDF algorithm;
[0033] Performing cosine similarity calculation on the vector representation of the discrete work order text and the vector representation of each candidate text cluster, respectively, to obtain a first similarity between the discrete work order text and each candidate text cluster;
[0034] If there is a first similarity greater than a preset first similarity threshold, the candidate text cluster corresponding to the maximum first similarity is merged with the discrete work order text; if there is no first similarity greater than the first similarity threshold, the discrete work order text is discarded or a new text cluster is added and the discrete work order text is classified into the new text cluster to obtain a comprehensive text cluster corresponding to each of the different demands.
[0035] Furthermore, in the above method, the comprehensive text cluster corresponding to each demand is subjected to keyword extraction and subject word generation operations respectively, so as to obtain keywords and subject words of the comprehensive text cluster corresponding to each demand, including:
[0036] For each of the comprehensive text clusters, obtaining C-TF-IDF values of all words in at least one preprocessed work order text, and sorting all the words in reverse order according to the C-TF-IDF values, and using the first number of sorted words as keywords of the comprehensive text cluster;
[0037] Determine a large model for generating keywords; for each of the comprehensive text clusters, calculate the cosine similarity between the vector representation of each of the preprocessed work order texts in the comprehensive text cluster and the vector representation of the comprehensive text cluster to obtain a second similarity between the comprehensive text cluster and each of the preprocessed work order texts therein, and use the first second number of preprocessed work order texts with the highest second similarity as representative work order texts of the comprehensive text cluster; input the representative work order texts of each of the comprehensive text clusters into the large model respectively to generate keywords for each of the comprehensive text clusters.
[0038] Furthermore, in the above method, the keywords and subject terms of the comprehensive text cluster corresponding to each demand are displayed in a visual form, including:
[0039] The keywords and subject terms of the comprehensive text cluster corresponding to each demand are displayed in the form of a word cloud or a visual association diagram.
[0040] According to another aspect of the present application, a non-volatile storage medium is also provided, on which computer-readable instructions are stored. When the computer-readable instructions can be executed by a processor, the processor implements the method for processing the work order text as described above.
[0041] According to another aspect of the present application, a work order text processing device is also provided, wherein the device includes:
[0042] one or more processors;
[0043] A computer readable medium for storing one or more computer readable instructions,
[0044] When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the method for processing the work order text as described above.
[0045] Compared with the prior art, the present application obtains a preset number of work order texts about complaints, and performs data preprocessing on the preset number of work order texts to obtain the preset number of preprocessed work order texts, wherein the preset number includes at least two; performs text clustering on the preset number of preprocessed work order texts to obtain a comprehensive text cluster corresponding to each of the different demands, wherein each of the comprehensive text clusters includes at least one preprocessed work order text; performs keyword extraction operations and subject word generation operations on the comprehensive text cluster corresponding to each demand, respectively, to obtain keywords and subject words of the comprehensive text cluster corresponding to each demand; displays the keywords and subject words of the comprehensive text cluster corresponding to each demand in a visual form, thereby realizing a simple and efficient way to mine important information in the work order text about complaints, and displays the keywords and subject words of the text cluster formed by the work order text in a visual form. The whole process conveniently and intuitively helps hotline centers and the like in actual application scenarios to promptly discover various demand contents and key information of the corresponding work order texts, thereby providing data support for subsequent processing and decision-making. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Other features, objects and advantages of the present application will become more apparent by reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0047] Figure 1 A schematic diagram showing a flow chart of a method for processing a work order text according to one aspect of the present application;
[0048] Figure 2 A schematic diagram showing a processing flow of a method for processing a work order text according to one aspect of the present application in an actual application scenario;
[0049] Figure 3 A schematic diagram showing text clustering in a method for processing work order text according to one aspect of the present application;
[0050] Figure 4 A schematic diagram showing the acquisition of training corpus for training a large model in a method for processing work order text according to one aspect of the present application;
[0051] Figure 5 A schematic diagram showing the visualization of keywords and subject terms in a method for processing a work order text according to one aspect of the present application.
[0052] The same or similar reference numerals in the drawings represent the same or similar components. DETAILED DESCRIPTION
[0053] The present application is described in further detail below in conjunction with the accompanying drawings.
[0054] In a typical configuration of the present application, the terminal, the device of the service network and the trusted party all include one or more processors (CPU), input / output interfaces, network interfaces and memories.
[0055] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0056] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory media such as modulated data signals and carrier waves.
[0057] like Figure 1 As shown, Figure 1 A flowchart of a method for processing work order texts proposed in one aspect of the present application is provided. The method is applied to the processing of complaint or problem reflection centers or customer service centers that have work order texts, so as to realize data mining of large quantities of work order texts. The processing of work order texts includes: Figure 2 The data preprocessing, text clustering, keyword extraction and subject word generation and visualization display four modules are shown, wherein the method comprises: step S11, step S12, step S13 and step S14, specifically comprising the following steps:
[0058] Step S11, obtain a preset number of work order texts regarding complaints, and perform data preprocessing on the preset number of work order texts to obtain the preset number of preprocessed work order texts, wherein the preset number includes at least two; it should be noted that the preset number of work order texts regarding complaints are the original recorded work order texts without any data processing.
[0059] Since each work order text about a complaint records a specific demand, in the face of a large number of work order texts, in order to have a more detailed understanding of the types of demands contained therein, it is first necessary to cluster the work order texts. In step S12, text clustering is performed on the preset number of preprocessed work order texts to obtain a comprehensive text cluster corresponding to each demand in different demands, and each of the comprehensive text clusters includes at least one preprocessed work order text.
[0060] Step S13, performing keyword extraction operations and subject word generation operations on the comprehensive text cluster corresponding to each demand, and obtaining keywords and subject words of the comprehensive text cluster corresponding to each demand.
[0061] Step S14, the keywords and subject terms of the comprehensive text cluster corresponding to each demand are displayed in a visual form.
[0062] Through the above steps S11 to S15, it is possible to simply and efficiently mine the important information in the work order text about the complaint, and visualize the keywords and subject terms of the text cluster formed by the work order text. The whole process conveniently and intuitively helps the hotline center in the actual application scenario to promptly discover the various demands in the work order text and the key information of the corresponding work order text, and provide data support for subsequent processing and decision-making.
[0063] Following the above embodiment of the present application, the step S11 performs data preprocessing on the preset number of work order texts to obtain a preset number of preprocessed work order texts, specifically including:
[0064] Obtain a preset general stop word thesaurus and a constructed professional stop word thesaurus; wherein the professional stop word thesaurus is obtained by sequentially performing word segmentation, word frequency statistics, and manual screening of historical work order texts related to complaints;
[0065] Based on the general stop word library and the professional stop word library, each work order text in the preset number of work order texts is respectively subjected to word segmentation processing, stop word screening processing and valid word retention processing in sequence to obtain a preset number of preprocessed work order texts.
[0066] In this embodiment, step S11 needs to remove some words in the work order text that interfere with subsequent key steps such as clustering and keyword extraction. For example, if there are many phrases such as "citizen feedback" in the work order text about complaints, it will affect the effects of text clustering and keyword extraction in subsequent steps. Therefore, these meaningless words need to be removed in step S11. The specific approach is as follows: first, a preset professional stop word thesaurus is constructed. When constructing the professional stop word thesaurus, the historical work order texts about complaints are sequentially segmented and counted for word frequency, and some words with higher word frequency are selected as candidate words, and the available stop words are obtained through manual screening, thereby forming a professional stop word thesaurus. The historical work order texts here are explained based on the current time. Of course, if at some point in the future, the work order text corresponding to the current time can also be called a historical work order text; when constructing a professional stop word thesaurus, a general stop word thesaurus is also required to be preset to meet different actual application scenarios; then, the general stop word thesaurus and the professional stop word thesaurus are obtained; finally, each work order text in the preset number of work order texts is segmented by using the obtained general stop word thesaurus and the professional stop word thesaurus, and then the stop words in the segmentation are screened out, and the remaining retained words are merged to form a preprocessed work order text, thereby realizing data preprocessing of the original work order text and ensuring the accuracy of subsequent keyword extraction and subject word generation.
[0067] Following the above embodiment of the present application, the step S12 performs text clustering on the preset number of preprocessed work order texts to obtain a comprehensive text cluster corresponding to each of the different demands, each of which includes at least one preprocessed work order text, specifically including:
[0068] Using a density-based clustering algorithm HDBSCAN to perform initial clustering on the preset number of pre-processed work order texts to obtain at least two candidate text clusters, each of which includes at least one pre-processed work order text;
[0069] The cluster-term frequency-inverse text frequency index C-TF-IDF algorithm and the density-based clustering algorithm HDBSCAN are used to perform secondary clustering on the at least two candidate text clusters to obtain a clustered text cluster corresponding to each of the different demands, each of the clustered text clusters including at least one preprocessed work order text;
[0070] After the secondary clustering, it is determined whether there are discrete work order texts that are not clustered in the preset number of pre-processed work order texts.
[0071] If not, the clustered text cluster corresponding to each demand is determined as the comprehensive text cluster corresponding to each demand;
[0072] If so, the discrete work order texts are merged based on the clustered text clusters corresponding to each demand to obtain a comprehensive text cluster corresponding to each demand in the different demands, each of the comprehensive text clusters including at least one preprocessed work order text.
[0073] In step S12, a preset number of pre-processed work order texts are clustered, such as Figure 3 As shown, when clustering the preprocessed work order text, an unsupervised hierarchical clustering model can be used: the density-based clustering algorithm HDBSCAN clusters the work order text about the complaint. This hierarchical clustering model has the advantages of not needing to define categories in advance, being insensitive to outliers, and adapting to clustering of data of any shape, so it is very convenient to use. Since a single clustering may produce similar text clusters, a two-step clustering method is used to solve this problem when clustering the preprocessed work order text in this application. The specific steps of the two-step clustering method are as follows:
[0074] First, a density-based clustering algorithm HDBSCAN is used to perform initial clustering on the preset number of preprocessed work order texts to obtain at least two candidate text clusters, each of which includes at least one preprocessed work order text;
[0075] Then, since there are often many similar text clusters in the at least two candidate text clusters obtained after the initial clustering, it is necessary to merge these similar text clusters, and it is necessary to use the cluster-term frequency-inverse text frequency index C-TF-IDF algorithm and the density-based clustering algorithm HDBSCAN to perform secondary clustering on the at least two candidate text clusters to obtain clustered text clusters corresponding to each of the different demands, and each of the clustered text clusters includes at least one preprocessed work order text;
[0076] Finally, after the secondary clustering, since the result of clustering using the density-based clustering algorithm HDBSCAN may contain more discrete work order texts, that is, work order texts that do not appear in any clustering text cluster after the secondary clustering, it is necessary to determine whether to merge the discrete work order texts with the existing clustering text clusters, that is, to determine whether there are discrete work order texts that are not clustered in the preset number of preprocessed work order texts. If not, the clustering text cluster corresponding to each demand is determined as the comprehensive text cluster corresponding to each demand, and there is no need to merge the discrete work order texts. If so, in order to reduce the number of discrete work order texts, it is necessary to merge the discrete work order texts based on the clustering text cluster corresponding to each demand, so as to obtain a comprehensive text cluster corresponding to each demand in different demands, and each of the comprehensive text clusters includes at least one preprocessed work order text, thereby realizing the merging and clustering of discrete work order texts.
[0077] Following the above embodiment of the present application, the density-based clustering algorithm HDBSCAN in step S12 is used to perform initial clustering on the preset number of pre-processed work order texts to obtain at least two candidate text clusters, specifically including:
[0078] First, a semantic vector model BGE is used to obtain a sentence vector for each of the preset number of preprocessed work order texts; herein, in the process of obtaining a sentence vector for each of the preprocessed work order texts using the semantic vector model BGE, it can be loaded through the sentence-transformer library of python, and the semantic vector model BGE is a general BGE model obtained after domain incremental pre-training on work order text data.
[0079] Then, the unified manifold approximation and projection dimensionality reduction algorithm UMAP is used to perform vector dimensionality reduction on the sentence vector of each preprocessed work order text to extract the main feature components of the book, thereby obtaining the reduced dimensionality sentence vector corresponding to each preprocessed work order text.
[0080] Finally, the reduced-dimensional sentence vector corresponding to each of the preprocessed work order texts is clustered using the density-based clustering algorithm HDBSCAN to obtain at least two candidate text clusters, thereby achieving initial clustering of a preset number of preprocessed work order texts.
[0081] Following the above embodiment of the present application, the cluster-term frequency-inverse text frequency index C-TF-IDF algorithm and the density-based clustering algorithm HDBSCAN are used in step S12 to perform secondary clustering on the at least two candidate text clusters to obtain clustered text clusters corresponding to each of the different demands, specifically including:
[0082] First, the cluster-term frequency-inverse text frequency index C-TF-IDF algorithm is used to construct the vector representation of the text cluster. The cluster-term frequency-inverse text frequency index C-TF-IDF algorithm is an improved version of the term frequency-inverse text frequency index TF-IDF algorithm, which is suitable for representing the vector representation of text clusters. The specific calculation formula of the C-TF-IDF value of the cluster-term frequency-inverse text frequency index C-TF-IDF algorithm is as follows:
[0083] W t,c =tf t,c log(1+A / df t )
[0084] Among them, tf t,crepresents the frequency of word t in text cluster c, log(1+A / dft) is the inverse class frequency, A represents the average number of words in each cluster, df t Represents the number of times word t appears in all clusters.
[0085] Then, a cluster-term frequency-inverse text frequency index C-TF-IDF algorithm is used to construct a vocabulary for the words in the preset number of preprocessed work order texts, and the C-TF-IDF value of each word in the vocabulary is calculated, and the number of words in the vocabulary is N, where N is a positive integer greater than or equal to 2;
[0086] Next, at least one preprocessed work order text in each of the at least two candidate text clusters is represented by a group of words in the vocabulary to form an N-dimensional vector;
[0087] Secondly, in each of the candidate text clusters, the C-TF-IDF value of each word included in each of the candidate text clusters is multiplied by the N-dimensional vector to obtain a vector representation of each of the candidate text clusters;
[0088] Finally, based on the vector representation of each candidate text cluster and the density-based clustering algorithm HDBSCAN, the at least two candidate text clusters are clustered again to obtain a clustered text cluster corresponding to each demand in different demands. For example, assuming that the number of words in the vocabulary is N, and then calculating the C-TF-IDF values of these N words, when constructing the vector representation of the text cluster, for each candidate text cluster, which contains multiple work order texts, it can be represented by a group of words in the vocabulary, so the bags-of-word model can be used to represent it as an N-dimensional vector, and the N-dimensional vector is finally multiplied by the C-TF-IDF value weight of each word to obtain the text cluster vector, thereby determining the vector representation of each text cluster.
[0089] Following the above embodiment of the present application, the step S12 of merging the discrete work order texts based on the clustered text clusters corresponding to each demand to obtain a comprehensive text cluster corresponding to each demand in different demands specifically includes:
[0090] The vector representation of the discrete work order text is calculated by using a cluster-term frequency-inverse text frequency index C-TF-IDF algorithm;
[0091] Performing cosine similarity calculation on the vector representation of the discrete work order text and the vector representation of each candidate text cluster, respectively, to obtain a first similarity between the discrete work order text and each candidate text cluster;
[0092] If there is a first similarity greater than a preset first similarity threshold, the candidate text cluster corresponding to the maximum first similarity is merged with the discrete work order text; if there is no first similarity greater than the first similarity threshold, the discrete work order text is discarded or a new text cluster is added and the discrete work order text is classified into the new text cluster to obtain a comprehensive text cluster corresponding to each of the different demands.
[0093] For example, the cluster-term frequency-inverse text frequency index C-TF-IDF algorithm is first used to calculate the vector representation of each outlier work order text, and then the cosine similarity is calculated between the vector representation of each discrete work order text and the vector representation of all candidate text clusters, and a first similarity threshold is set. If there is a case where the first similarity is greater than the first similarity threshold, the candidate text cluster corresponding to the maximum first similarity is selected and merged with the outlier work order text. If there is no case where the first similarity is greater than the first similarity threshold, the text is not merged. There are two situations in which the text is not merged. Either the discrete work order text is discarded, or a text cluster is added to the discrete work order text, so as to obtain a comprehensive text cluster corresponding to each demand in different demands. This can greatly reduce the number of outlier work order texts.
[0094] Following the above embodiment of the present application, for each text cluster, the subject word is the extraction and summary of the demands expressed by the information carried by the preprocessed work order text in the text cluster. Traditional methods such as TF-IDF directly mine subject word information from the text, lacking the process of extraction and processing. In the embodiment of the present application, a large model is used to directly extract and summarize the work order text and generate subject words. That is, step S13 performs keyword extraction operations and subject word generation operations on the comprehensive text cluster corresponding to each demand, respectively, to obtain the keywords and subject words of the comprehensive text cluster corresponding to each demand, specifically including:
[0095] For each of the comprehensive text clusters, obtaining C-TF-IDF values of all words in at least one preprocessed work order text, and sorting all the words in reverse order according to the C-TF-IDF values, and using the first number of sorted words as keywords of the comprehensive text cluster, so as to extract keywords from each comprehensive text cluster;
[0096] Determine a large model for generating keywords; for each of the comprehensive text clusters, calculate the cosine similarity between the vector representation of each of the preprocessed work order texts in the comprehensive text cluster and the vector representation of the comprehensive text cluster to obtain the second similarity between the comprehensive text cluster and each of the preprocessed work order texts therein, and use the first second number of preprocessed work order texts with the highest second similarity as the representative work order texts of the comprehensive text cluster; input the representative work order texts of each of the comprehensive text clusters into the large model respectively to generate keywords for each of the comprehensive text clusters. Here, the second number can be a number of any value. In a preferred embodiment of the present application, the second number is preferably 10.
[0097] In this embodiment, when generating a keyword, the following five steps are required:
[0098] 1. Model selection. Taking into account data sensitivity and reasoning time constraints, in one embodiment of the present application, the open source large prediction model baichuan2-7B-Base is selected as the base model. On the one hand, baichuan2-7B-Base, as an open source model, can be deployed locally, solving the data sensitivity problem; on the other hand, the 7B-scale model can basically meet the enterprise's requirements for reasoning time after being optimized for reasoning speed.
[0099] 2. Selection of representative work order texts. It should be noted that since the large model has a limit on the length of the input text, and often a text cluster contains a large number of work order texts, all inputs easily exceed its length limit. Therefore, it is necessary to select representative work order texts as the input of the large model. The selection method is: first use the cluster-term frequency-inverse text frequency index C-TF-IDF algorithm to calculate the vector representation of each preprocessed work order text in the text cluster, and then calculate the cosine similarity between the vector representation of the candidate text cluster, and select the top 10 work order texts with the second highest similarity calculated as representative work order texts.
[0100] 3. Acquisition of training corpus for training the large model for generating topic words. Baichuan2-7B-Base needs to be fine-tuned before it can have the ability to generate topics. Regarding the acquisition of training corpus required for fine-tuning, such as Figure 4 First, a batch of historical work order texts are obtained, and after clustering, multiple text clusters are obtained, and representative work order texts are obtained. The representative work order texts in each text cluster are sent to the large model to generate keywords, and then manually screened to obtain the final training corpus. In a preferred embodiment of the present application, the Qwen-72B-Chat model is selected to generate a large model for keyword.
[0101] 4. Instruction fine-tuning: fine-tune the baichuan2-7B-Base on 4 A100s. In terms of parameter setting, select batch_size as 64, learning rate as 1e-4, epochs as 5, use warmup to preheat the learning rate within the first 0.1 proportional steps, and use cosine annealing to adjust the learning rate.
[0102] 5. Model reasoning: During the reasoning and prediction, the representative work order text in the text cluster is selected as input and input into the large model used to generate topic words, thereby generating topic words.
[0103] Following the above embodiment of the present application, the step S14 displays the keywords and subject words of the comprehensive text cluster corresponding to each demand in a visual form, specifically including:
[0104] The keywords and subject terms of the comprehensive text cluster corresponding to each demand are displayed in the form of a word cloud or a visual association diagram.
[0105] In this embodiment, in the visual display of step S14, the keywords and subject words obtained in step S13 are displayed in a visual form such as a word cloud or a correlation diagram. Figure 5 As shown, Figure 5 The left side of the figure is a word cloud diagram of the subject words, where the font size of the subject words measures the number of texts in the corresponding text cluster; Figure 5 The right picture in the figure is a correlation diagram between subject terms and keywords, in which the subject term is in the middle of the correlation diagram, and the keywords and other information are connected to it around it.
[0106] In an embodiment of the present application, the problems reflected in a large number of work order texts are classified by an unsupervised clustering method; keyword extraction and subject word generation are performed on the clustered text clusters, and the results are presented in a visual form such as word clouds and association diagrams, which can facilitate staff to quickly locate the main demands and understand the key information related to the main demands, thereby improving the efficiency of analyzing and processing work order texts.
[0107] According to another aspect of the present application, a non-volatile storage medium is provided, on which computer-readable instructions are stored. When the computer-readable instructions can be executed by a processor, the processor implements the method for processing the work order text as described above.
[0108] According to another aspect of the present application, a work order text processing device is also provided, wherein the device includes:
[0109] one or more processors;
[0110] A computer readable medium for storing one or more computer readable instructions,
[0111] When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the method for processing the work order text as described above.
[0112] Here, the detailed contents of each embodiment of the work order text processing device can be specifically referred to the corresponding part of the above-mentioned work order text processing method embodiment, which will not be repeated here.
[0113] In summary, the present application obtains a preset number of work order texts about complaints, and performs data preprocessing on the preset number of work order texts to obtain the preset number of preprocessed work order texts, wherein the preset number includes at least two; performs text clustering on the preset number of preprocessed work order texts to obtain a comprehensive text cluster corresponding to each of the different demands, wherein each of the comprehensive text clusters includes at least one preprocessed work order text; performs keyword extraction operations and subject word generation operations on the comprehensive text clusters corresponding to each demand, respectively, to obtain keywords and subject words of the comprehensive text cluster corresponding to each demand; displays the keywords and subject words of the comprehensive text cluster corresponding to each demand in a visual form, thereby achieving a simple and efficient way to mine important information in the work order text about complaints, and displays the keywords and subject words of the text clusters formed by the work order text in a visual form. The whole process conveniently and intuitively helps hotline centers and the like in actual application scenarios to promptly discover various demand contents and key information of the corresponding work order texts, thereby providing data support for subsequent processing and decision-making.
[0114] It should be noted that the present application can be implemented in software and / or a combination of software and hardware, for example, can be implemented using an application specific integrated circuit (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present application can be executed by a processor to implement the steps or functions described above. Similarly, the software program of the present application (including relevant data structures) can be stored in a computer-readable recording medium, for example, a RAM memory, a magnetic or optical drive or a floppy disk and similar devices. In addition, some steps or functions of the present application can be implemented using hardware, for example, as a circuit that cooperates with a processor to perform each step or function.
[0115] In addition, a part of the present application may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present application through the operation of the computer. The program instruction for calling the method of the present application may be stored in a fixed or removable recording medium, and / or transmitted through a data stream in a broadcast or other signal-bearing medium, and / or stored in a working memory of a computer device that runs according to the program instruction. Here, according to an embodiment of the present application, a device is included, the device including a memory for storing computer program instructions and a processor for executing program instructions, wherein, when the computer program instruction is executed by the processor, the device is triggered to run the method and / or technical solution based on the aforementioned multiple embodiments according to the present application.
[0116] It is obvious to those skilled in the art that the present application is not limited to the details of the above exemplary embodiments, and that the present application can be implemented in other specific forms without departing from the spirit or basic features of the present application. Therefore, from any point of view, the embodiments should be regarded as exemplary and non-restrictive, and the scope of the present application is limited by the attached claims rather than the above description, so it is intended to include all changes that fall within the meaning and scope of the equivalent elements of the claims in the present application. Any figure mark in the claims should not be regarded as limiting the claims involved. In addition, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the device claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
Claims
1. A method for processing work order text, in, The method includes: Obtaining a preset number of work order texts regarding complaints, and performing data preprocessing on the preset number of work order texts to obtain the preset number of preprocessed work order texts, wherein the preset number includes at least two; Performing text clustering on the preset number of pre-processed work order texts to obtain a comprehensive text cluster corresponding to each of the different demands, each of the comprehensive text clusters including at least one pre-processed work order text; Perform keyword extraction and subject word generation operations on the comprehensive text cluster corresponding to each demand, and obtain keywords and subject words of the comprehensive text cluster corresponding to each demand; The keywords and subject terms of the comprehensive text cluster corresponding to each demand are displayed in a visual form.
2. The method according to claim 1, in, The step of performing data preprocessing on the preset number of work order texts to obtain a preset number of preprocessed work order texts includes: Obtain a preset general stop word thesaurus and a constructed professional stop word thesaurus; wherein the professional stop word thesaurus is obtained by sequentially performing word segmentation, word frequency statistics, and manual screening of historical work order texts related to complaints; Based on the general stop word library and the professional stop word library, each work order text in the preset number of work order texts is respectively subjected to word segmentation processing, stop word screening processing and valid word retention processing in sequence to obtain a preset number of preprocessed work order texts.
3. The method according to claim 1, in, The text clustering is performed on the preset number of pre-processed work order texts to obtain a comprehensive text cluster corresponding to each of the different demands, each of the comprehensive text clusters including at least one pre-processed work order text, including: Using a density-based clustering algorithm HDBSCAN to perform initial clustering on the preset number of pre-processed work order texts to obtain at least two candidate text clusters, each of which includes at least one pre-processed work order text; The cluster-term frequency-inverse text frequency index C-TF-IDF algorithm and the density-based clustering algorithm HDBSCAN are used to perform secondary clustering on the at least two candidate text clusters to obtain a clustered text cluster corresponding to each of the different demands, each of the clustered text clusters including at least one preprocessed work order text; After the secondary clustering, it is determined whether there are discrete work order texts that are not clustered in the preset number of pre-processed work order texts. If not, the clustered text cluster corresponding to each demand is determined as the comprehensive text cluster corresponding to each demand; If so, the discrete work order texts are merged based on the clustered text clusters corresponding to each demand to obtain a comprehensive text cluster corresponding to each demand in the different demands, each of the comprehensive text clusters including at least one preprocessed work order text.
4. The method according to claim 3, in, The density-based clustering algorithm HDBSCAN is used to perform initial clustering on the preset number of pre-processed work order texts to obtain at least two candidate text clusters, including: Using a semantic vector model BGE to obtain a sentence vector of each of the preprocessed work order texts in the preset number of preprocessed work order texts; Using the unified manifold approximation and projection dimensionality reduction algorithm UMAP to perform vector dimensionality reduction on the sentence vector of each preprocessed work order text, so as to obtain the dimensionality reduced sentence vector corresponding to each preprocessed work order text; The reduced-dimensional sentence vectors corresponding to each of the preprocessed work order texts are clustered using the density-based clustering algorithm HDBSCAN to obtain at least two candidate text clusters.
5. The method according to claim 3, in, The cluster-term frequency-inverse text frequency index C-TF-IDF algorithm and the density-based clustering algorithm HDBSCAN are used to perform secondary clustering on the at least two candidate text clusters to obtain a clustered text cluster corresponding to each of the different demands, including: A cluster-term frequency-inverse text frequency index C-TF-IDF algorithm is used to construct a vocabulary for the words in the preset number of preprocessed work order texts, and a C-TF-IDF value of each word in the vocabulary is calculated, wherein the number of words in the vocabulary is N, and N is a positive integer greater than or equal to 2; Representing at least one preprocessed work order text in each of the at least two candidate text clusters by a set of words in the vocabulary to form an N-dimensional vector; In each of the candidate text clusters, multiplying the C-TF-IDF value of each word included in each of the candidate text clusters by the N-dimensional vector to obtain a vector representation of each of the candidate text clusters; Based on the vector representation of each of the candidate text clusters and the density-based clustering algorithm HDBSCAN, the at least two candidate text clusters are clustered again to obtain a clustered text cluster corresponding to each of the different demands.
6. The method according to claim 5, in, The discrete work order texts are merged based on the clustered text clusters corresponding to each demand to obtain a comprehensive text cluster corresponding to each demand in different demands, including: The vector representation of the discrete work order text is calculated by using a cluster-term frequency-inverse text frequency index C-TF-IDF algorithm; Performing cosine similarity calculation on the vector representation of the discrete work order text and the vector representation of each candidate text cluster, respectively, to obtain a first similarity between the discrete work order text and each candidate text cluster; If there is a first similarity greater than a preset first similarity threshold, the candidate text cluster corresponding to the maximum first similarity is merged with the discrete work order text; if there is no first similarity greater than the first similarity threshold, the discrete work order text is discarded or a new text cluster is added and the discrete work order text is classified into the new text cluster to obtain a comprehensive text cluster corresponding to each of the different demands.
7. The method according to claim 5, in, The comprehensive text cluster corresponding to each demand is subjected to keyword extraction and subject word generation operations respectively, to obtain keywords and subject words of the comprehensive text cluster corresponding to each demand, including: For each of the comprehensive text clusters, obtaining C-TF-IDF values of all words in at least one preprocessed work order text, and sorting all the words in reverse order according to the C-TF-IDF values, and using the first number of sorted words as keywords of the comprehensive text cluster; Determine a large model for generating keywords; for each of the comprehensive text clusters, calculate the cosine similarity between the vector representation of each of the preprocessed work order texts in the comprehensive text cluster and the vector representation of the comprehensive text cluster to obtain a second similarity between the comprehensive text cluster and each of the preprocessed work order texts therein, and use the first second number of preprocessed work order texts with the highest second similarity as representative work order texts of the comprehensive text cluster; input the representative work order texts of each of the comprehensive text clusters into the large model respectively to generate keywords for each of the comprehensive text clusters.
8. The method according to any one of claims 1 to 7, in, The keywords and subject terms of the comprehensive text cluster corresponding to each demand are displayed in a visual form, including: The keywords and subject terms of the comprehensive text cluster corresponding to each demand are displayed in the form of a word cloud or a visual association diagram.
9. A non-volatile storage medium having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executable by a processor, the processor is enabled to implement the method according to any one of claims 1 to 8.
10. A work order text processing device, in, The equipment includes: one or more processors; A computer readable medium for storing one or more computer readable instructions, When the one or more computer-readable instructions are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Classification processing method and device for consultation type work orders, storage medium and electronic equipment
CN117648438A
Text information clustering method and text information clustering system
US20180365218A1
Cited By
Building design short text-oriented topic extraction method and system, terminal and storage medium
CN120654705A
Civil aviation safety report theme modeling method based on large language model and semantic enhancement
CN122155555A
Civil aviation safety report topic modeling method based on large language model and semantic enhancement
CN122155555B
