Text clustering method and device, storage medium and product

Through the supervised text clustering method, the text clustering quality evaluation model is used to separate clustering results that meet and do not meet the quality conditions, and iteratively optimize it, which solves the problems of semantic deviation and low quality in the traditional method, achieving high efficiency and low quality Cost text clustering.

CN119226511APending Publication Date: 2024-12-31WEBANK (CHINA)
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411285833.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-13
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The traditional unsupervised text clustering method loses information when the text data is converted into vectors, resulting in semantic deviations in the clustering results and low quality.

Method used

A supervised text clustering method is proposed. Through a pre-trained text clustering quality evaluation model, clustering texts according to different clustering parameters, and divided into two categories that meet and do not meet quality conditions, and iteratively optimize until it is Meet preset conditions and generate target clustering results.

Benefits of technology

It improves the quality of text clustering results, reduces calculation costs, and the generated clustering results are more in line with normal semantics, and are suitable for enterprises with limited computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226511A_ABST
    Figure CN119226511A_ABST
Patent Text Reader

Abstract

The invention discloses a text clustering method and device, a storage medium and a product, and relates to the technical field of natural language processing, and the text clustering method comprises the following steps: obtaining a to-be-clustered text; performing text clustering on the to-be-clustered text according to a plurality of preset clustering parameters to obtain text clustering results corresponding to the plurality of preset clustering parameters; inputting the text clustering results corresponding to the plurality of preset clustering parameters into a pre-trained text clustering quality evaluation model to obtain quality evaluation results corresponding to the plurality of preset clustering parameters; and determining a target text clustering result according to the quality evaluation index values corresponding to the plurality of preset clustering parameters. According to the scheme, iterative optimization of the text clustering result can be realized, so that the quality of the text clustering result is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to a text clustering method, device, storage medium and product. Background Art

[0002] With the advent of the digital age, text data has shown explosive growth. How to extract useful information from massive text data and achieve effective management and analysis of text has become a problem faced by enterprise development.

[0003] To solve the above problems, currently, unsupervised text clustering algorithms are usually used to represent text data as vectors and measure similarity. However, traditional unsupervised text clustering methods lose information when converting text data into vectors, and the quantitative indicators required for iterative calculations can only reflect the mathematical relationship between vectors, which leads to semantic deviations in the text clustering results of text clustering methods and low quality.

[0004] Therefore, how to improve the quality of text clustering results is a problem that needs to be solved urgently. Summary of the invention

[0005] The main purpose of this application is to provide a text clustering method, device, storage medium and product, aiming to solve the technical problem of low quality of text clustering results.

[0006] To achieve the above purpose, the present application proposes a text clustering method, which includes:

[0007] Get the text to be clustered;

[0008] Performing text clustering on the text to be clustered according to a plurality of preset clustering parameters to obtain text clustering results corresponding to each of the plurality of preset clustering parameters;

[0009] Inputting the text clustering results corresponding to the plurality of preset clustering parameters into a pre-trained text clustering quality evaluation model to obtain quality evaluation results corresponding to the plurality of preset clustering parameters, wherein the quality evaluation results include a first cluster and a second cluster and a quality evaluation index value, the first cluster being a cluster in the text clustering results determined by the text clustering quality evaluation model that meets a preset text clustering quality condition, and the second cluster being a cluster in the text clustering results determined by the text clustering quality evaluation model that does not meet the text clustering quality condition;

[0010] Determine the target clustering parameter and the target quality evaluation result corresponding to the target clustering parameter according to the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters;

[0011] Inputting the first cluster in the target quality evaluation result into a preset text buffer area, and using the text constituting the second cluster in the target quality evaluation result as a new text to be clustered;

[0012] Return to the step of performing text clustering on the text to be clustered according to a plurality of preset clustering parameters to obtain text clustering results corresponding to each of the plurality of preset clustering parameters, until a preset iteration end condition is met, and then determine the target text clustering result according to the target quality evaluation result.

[0013] In one embodiment, before the step of inputting the text clustering results corresponding to the plurality of preset clustering parameters into a pre-trained text clustering quality evaluation model to obtain the quality evaluation results corresponding to the plurality of preset clustering parameters, the step includes:

[0014] Construct a clustering quality evaluation dataset;

[0015] Model training is performed according to the clustering quality evaluation data set to obtain the trained text clustering quality evaluation model.

[0016] In one embodiment, the step of constructing a clustering quality evaluation data set includes:

[0017] Set text clustering quality conditions;

[0018] Obtaining an original text, and annotating each cluster in the original text with a binary classification label according to the text clustering quality condition to obtain a first annotated text and a second annotated text, wherein the first annotated text meets the text clustering quality condition, and the second annotated text does not meet the text clustering quality condition;

[0019] The clustering quality evaluation data set is constructed according to the first annotated text and the second annotated text.

[0020] In one embodiment, the step of performing model training according to the clustering quality evaluation data set to obtain the trained text clustering quality evaluation model includes:

[0021] Obtaining an original large language model, and fine-tuning the original large language model to obtain an original text clustering quality evaluation model;

[0022] The original text clustering quality evaluation model is trained according to the clustering quality evaluation data set to obtain the trained text clustering quality evaluation model.

[0023] In one embodiment, the step of determining the target text clustering result according to the target quality evaluation result includes:

[0024] According to the target quality evaluation result, the first cluster and the second cluster in the target quality evaluation result are input into a preset text buffer area, and cluster names are performed according to the clusters in the text buffer area to obtain cluster names corresponding to the clusters in the text buffer area;

[0025] According to the cluster names corresponding to the clusters in the text buffer area, the clusters with the same cluster name are merged to obtain the target text clustering result.

[0026] In one embodiment, the step of determining the target clustering parameter and the target quality evaluation result corresponding to the target clustering parameter according to the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters includes:

[0027] According to the quality evaluation index values ​​corresponding to each of the plurality of preset clustering parameters, the clustering parameter with the highest quality evaluation index value is determined from the plurality of preset clustering parameters as the target clustering parameter, and the quality evaluation result corresponding to the target clustering parameter is determined as the target quality evaluation result.

[0028] In one embodiment, the step of determining the target clustering parameter and the target quality evaluation result corresponding to the target clustering parameter according to the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters includes:

[0029] Performing difference calculation based on the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters and the preset standard parameters to obtain deviation values ​​corresponding to the plurality of preset clustering parameters;

[0030] A clustering parameter with the smallest deviation value is determined from the plurality of preset clustering parameters as the target clustering parameter, and a quality evaluation result corresponding to the target clustering parameter is determined as the target quality evaluation result.

[0031] In one embodiment, the step of setting the text clustering quality condition includes:

[0032] Accessing a business database, and acquiring account operation behavior data and bank transaction event chain data from the business database according to a preset search engine, wherein the account operation behavior data includes one or more of account login behavior data, transfer behavior data, consumption behavior data, and repayment behavior data, and the bank transaction event chain data is composed of independent transaction event data that meets a preset correlation threshold;

[0033] The text clustering quality condition is set according to the account operation behavior data and the bank transaction event chain.

[0034] In addition, to achieve the above objectives, the present application also proposes a text clustering device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the text clustering method described above.

[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the text clustering method described above are implemented.

[0036] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the text clustering method described above are implemented.

[0037] One or more technical solutions proposed in this application have at least the following technical effects:

[0038] The present application obtains the text to be clustered, and then, through a pre-trained text clustering quality evaluation model, performs text clustering on the text to be clustered according to a number of preset clustering parameters under different clustering parameters, and obtains text clustering results corresponding to each of the several preset clustering parameters, and inputs the text clustering results corresponding to each of the several preset clustering parameters into the pre-trained text clustering quality evaluation model to obtain quality evaluation results corresponding to each of the several preset clustering parameters, wherein the quality evaluation results include a first cluster and a second cluster and a quality evaluation index value, and the first cluster is the text clustering result determined by the text clustering quality evaluation model. The first cluster is a cluster that meets the preset text clustering quality condition, and the second cluster is a cluster that does not meet the text clustering quality condition in the text clustering result determined by the text clustering quality evaluation model. That is, the present application divides the clusters in the text clustering result into two categories through the text clustering quality evaluation model, one category is the cluster that meets the text clustering quality condition, and the other category is the cluster that does not meet the text clustering quality condition. This classification method is more in line with normal semantics and language logic; then, according to the quality evaluation index values ​​corresponding to each of the several preset clustering parameters, the target clustering parameters and the target quality evaluation results corresponding to the target clustering parameters are determined by comparing the different clustering parameters. The clustering results under the above mentioned conditions can select the result with the best text clustering effect in the current iteration process for the next iteration, so as to continuously screen until the target text clustering result that meets the normal semantics is obtained, so as to improve the quality of the text clustering result; finally, the first cluster in the target quality evaluation result is input into the preset text buffer area, and the text constituting the second cluster in the target quality evaluation result is used as the new text to be clustered; return to execute the step of clustering the text to be clustered according to several preset clustering parameters to obtain the text clustering results corresponding to the several preset clustering parameters, until the preset iteration end condition is met, and the target text is determined according to the target quality evaluation result. The target text clustering results are obtained; in each round of iteration, the clusters that meet the text clustering quality conditions (i.e., the first clusters) are retained, and the clusters that do not meet the text clustering quality conditions (i.e., the second clusters) are optimized for the next round of iteration, which makes the final target text clustering results closer to normal semantics; at the same time, in the process of iterative optimization, the number of texts to be clustered in any round of iterative optimization will be reduced compared with the number of texts to be clustered in the previous round of iterative optimization. As the number of iterations increases, the computing cost will be greatly reduced, thereby improving the text clustering efficiency; accordingly, for enterprises with limited computing resources, the quality of text clustering results can be improved while reducing resource pressure.Therefore, in this embodiment, the computational cost is reduced, the text clustering efficiency is improved, and at the same time, a text clustering result that is more in line with normal semantics is generated, and supervised text clustering is implemented to improve the quality of the text clustering result. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0041] Figure 1 A flowchart of the first embodiment of the text clustering method of the present application is provided;

[0042] Figure 2 A flowchart of the second embodiment of the text clustering method of this application is provided;

[0043] Figure 3 A flowchart of the third embodiment of the text clustering method of this application is provided;

[0044] Figure 4 A flowchart of the fourth embodiment of the text clustering method of the present application is provided;

[0045] Figure 5 A brief flowchart of the text clustering method provided in Example 4 of the present application;

[0046] Figure 6 This is a schematic diagram of the device structure of the hardware operating environment involved in the text clustering method of the embodiment of the present application.

[0047] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0048] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0049] The following is a first embodiment of the language model training method of the present application. Figure 1 , Figure 1This is a flowchart of the first embodiment of the text clustering method of this application. It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device that can realize the above functions, a text clustering system, etc. The following takes the text clustering system as an example to illustrate this embodiment and the following embodiments.

[0050] The original large language model to be trained is deployed in the text clustering system. Among them, the large language model is a model that can be used to perform natural language processing tasks, such as LLaMa2 13B, LLaMa2 7B, OPT 7B, etc. The above large language models are specially designed for processing natural language tasks, and due to their huge parameter scale, they can provide rich semantic information and context understanding capabilities. In the financial field, large language models can be used for tasks such as financial news analysis, market trend forecasting, and customer service automation. They are able to process large amounts of financial data and provide valuable insights and suggestions. For example, banks, insurance companies and other companies need to train language models to perform natural language processing tasks in their business scenarios to improve business service effects.

[0051] The model to be trained (the original large language model) refers to the model parameters in the model that need to be optimized through the training process. Its initial model parameters can be obtained after model pre-training (or the pre-trained model can be used as the model to be trained), or its initial model parameters can also be initialized based on experience or randomly. In addition, although the models to be trained have been pre-trained on a large amount of text data and have mastered rich language knowledge and context understanding capabilities, they are not optimized for specific tasks (such as text clustering quality evaluation). The process of training the model to be trained on a specific natural language processing task is also called "fine-tuning". The process of fine-tuning is essentially the process of adapting the model to a specific task.

[0052] The text clustering system performs fine-tuning and model training on the basis of deploying the original large language model to be trained, so as to obtain a large language model (that is, a text clustering quality evaluation model) that can perform the text clustering quality evaluation task. During the fine-tuning and model training process, the model will be trained based on the data set of the text clustering quality evaluation task, learn how to extract key information from the input text clustering results, and predict the corresponding quality evaluation labels. In this way, the final text clustering quality evaluation model can perform the text clustering quality evaluation task more accurately.

[0053] At present, unsupervised text clustering algorithms are usually used to represent text data as vectors and measure similarity. Specifically, text clustering algorithms are an unsupervised machine learning method that is widely used in natural language processing problems. Traditional, unsupervised text clustering algorithms first convert text data into high-dimensional vector representations and calculate quantitative indicators based on high-dimensional vectors. This indicator is generally a distance metric. However, there is information loss when text data is converted into vectors, and the data distribution in high-dimensional space is sparse and irregular, which makes the distance metric itself unreliable. As a result, the final text clustering results have semantic deviations and low quality.

[0054] Based on this, this application proposes a supervised text clustering method. The main solution of the embodiment of this application is:

[0055] Get the text to be clustered;

[0056] Performing text clustering on the text to be clustered according to a plurality of preset clustering parameters to obtain text clustering results corresponding to each of the plurality of preset clustering parameters;

[0057] Inputting the text clustering results corresponding to the plurality of preset clustering parameters into a pre-trained text clustering quality evaluation model to obtain quality evaluation results corresponding to the plurality of preset clustering parameters, wherein the quality evaluation results include a first cluster and a second cluster and a quality evaluation index value, the first cluster being a cluster in the text clustering results determined by the text clustering quality evaluation model that meets a preset text clustering quality condition, and the second cluster being a cluster in the text clustering results determined by the text clustering quality evaluation model that does not meet the text clustering quality condition;

[0058] Determine the target clustering parameter and the target quality evaluation result corresponding to the target clustering parameter according to the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters;

[0059] Inputting the first cluster in the target quality evaluation result into a preset text buffer area, and using the text constituting the second cluster in the target quality evaluation result as a new text to be clustered;

[0060] Return to the step of performing text clustering on the text to be clustered according to a plurality of preset clustering parameters to obtain text clustering results corresponding to each of the plurality of preset clustering parameters, until a preset iteration end condition is met, and then determine the target text clustering result according to the target quality evaluation result.

[0061] This embodiment reduces the computational cost, improves the efficiency of text clustering, and simultaneously generates text clustering results that are more consistent with normal semantics, thereby achieving supervised text clustering to improve the quality of text clustering results.

[0062] In this embodiment, the text clustering method includes steps S10 to S60:

[0063] Step S10, obtaining text to be clustered;

[0064] It should be noted that the text clustering method proposed in this application is applied to the scenario of clustering a large number of texts in a text clustering system. The text clustering system can be carried in a banking business system, and the data corresponding to the texts that need to be clustered can be valuable text data generated in the business operation of the business system, or text data that needs to be archived and organized into the same category for analysis. In this embodiment, the text to be clustered is the original text data that needs to be clustered.

[0065] For example, the text to be clustered can be customer feedback texts received by the bank customer service robot, transaction record descriptions, etc., and can be multiple scattered sentences, paragraphs, articles, etc., and its content can include customer behavior and financial characteristics. Specifically, customer behavior can be withdrawal behavior, transfer behavior, consultation behavior, etc. At the same time, financial characteristics can be the corresponding withdrawal amount, transfer amount, consultation business number, etc. In addition, the text to be clustered can also be sentences in internal reports and documents of the bank, such as internal training materials on improving customer service quality, and credit risk analysis reports of a company in a certain period of time.

[0066] It can be understood that clustering the above-mentioned texts to be clustered means using a text clustering algorithm to group texts with similar themes, content or features into a group or a category. In the banking business system, this clustering process can help banks achieve goals such as customer behavior analysis, personalized financial service recommendations, and risk management. Specifically, by clustering customer feedback and transaction records related to withdrawal behavior, transfer behavior, and consulting behavior, banks can gain an in-depth understanding of customer behavior patterns, identify high-frequency or abnormal behaviors, and then optimize service processes, improve customer satisfaction, or conduct risk management; based on the clustering results, banks can also identify customer groups with similar financial needs and preferences, which helps banks provide more personalized financial service recommendations, such as customized financial products, loan products, etc., thereby enhancing customer stickiness and promoting business growth; in addition, by clustering internal documents such as credit risk analysis reports, banks can identify companies or businesses with similar risk characteristics, thereby implementing more targeted risk management measures; for example, for businesses that are shown as high-risk by clustering results, banks can strengthen audits, increase margin requirements, or take other risk control measures.

[0067] Step S20, performing text clustering on the text to be clustered according to a plurality of preset clustering parameters, and obtaining text clustering results corresponding to each of the plurality of preset clustering parameters;

[0068] It should be noted that, in this embodiment, a plurality of different clustering results are obtained by clustering texts using a clustering algorithm using several preset clustering parameters. The clustering algorithm may be a hierarchical clustering algorithm or a K-Means clustering algorithm (a clustering algorithm that divides data points into K clusters) in the related art. The preset clustering parameters are predefined and used to guide a series of parameters in the text clustering process, such as the number of clusters, the clustering initialization method, the maximum number of iterations, the convergence threshold, etc.

[0069] If the K-Means clustering algorithm is selected as the text clustering algorithm, then choosing the right number of clusters is crucial to the quality of the clustering results. If the number of clusters is too small, some clusters may have too large internal differences and fail to accurately reflect the true structure of the data; if the number of clusters is too large, sample points that should belong to the same cluster may be mistakenly divided into different clusters, resulting in overly fragmented clustering results. In addition, it should be noted that the text clustering result is the result obtained after clustering the text according to the preset clustering parameters, that is, the sentences in the text to be clustered are clustered into different categories to obtain different clusters.

[0070] Step S30, inputting the text clustering results corresponding to the plurality of preset clustering parameters into a pre-trained text clustering quality evaluation model to obtain quality evaluation results corresponding to the plurality of preset clustering parameters, wherein the quality evaluation results include a first cluster and a second cluster and a quality evaluation index value, the first cluster being a cluster in the text clustering results determined by the text clustering quality evaluation model that meets a preset text clustering quality condition, and the second cluster being a cluster in the text clustering results determined by the text clustering quality evaluation model that does not meet the text clustering quality condition;

[0071] It should be noted that the text clustering quality evaluation model is used to evaluate the quality of text clustering results, and can be obtained by training a large language model (such as the Tongyi Qianwen model and the Wenxin Yiyan model) using a large amount of annotated data, wherein the annotated data can be manually annotated according to expert experience, or the annotation can be completed by starting from some preliminary annotated data and gradually expanding the annotation through an iterative process, or a rule engine of specific business logic can be developed to automatically generate annotations. The first cluster in this embodiment is a cluster that meets the preset text clustering quality conditions determined by the text clustering quality evaluation model, and the second cluster is a cluster that does not meet the preset text clustering quality conditions determined by the text clustering quality evaluation model. In addition, it should be noted that the quality evaluation index value can be an indicator that quantitatively describes the quantitative ratio between the first cluster and the second cluster, or it can be the ratio of the first cluster to the total number of clusters, or it can be a silhouette coefficient or a Rand index.

[0072] The silhouette coefficient combines the cohesion and separation of clusters. For each cluster in the text clustering results, its average cohesion and minimum outer cohesion are calculated, and then their difference is divided by the maximum value of the two. This value is between -1 and 1. The larger the value, the better the clustering effect.

[0073] For example, suppose there is a text data set containing 1,000 articles, which is clustered using the K-Means algorithm (K=5). By calculating the silhouette coefficient of each cluster, the clustering quality of each cluster can be evaluated. If the silhouette coefficient of a cluster is close to 1, it means that the text similarity within the cluster is high and the text difference with other clusters is large. In this case, the cluster can be regarded as the first cluster that meets the preset text clustering quality conditions. On the contrary, if the silhouette coefficient of a cluster is far from 1, the cluster can be regarded as the second cluster that does not meet the preset text clustering quality conditions.

[0074] Similarly, when the quality evaluation index value is expressed by the Rand Index, the Rand Index can be used to compare the degree of consistency between the two data divisions.

[0075] For example, suppose there is a group of texts to be clustered with artificially set labels (such as "finance", "administration", etc.), and they are clustered by any of the text clustering algorithms mentioned above. By calculating the Rand Index, the degree of consistency between the text clustering results and the actual labels can be evaluated. If the Rand Index of a cluster in the text is close to 1, it means that the text clustering results are highly consistent with the actual labels, and the cluster can be regarded as the first cluster that meets the preset text clustering quality conditions. On the contrary, if the silhouette coefficient of a cluster is far from 1, the cluster can be regarded as the second cluster that does not meet the preset text clustering quality conditions.

[0076] Step S40, determining a target clustering parameter and a target quality evaluation result corresponding to the target clustering parameter according to the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters;

[0077] In this embodiment, it is necessary to determine the clustering parameters with the best text clustering effect and their corresponding clustering results based on the quality evaluation index value. The target clustering parameter is the best clustering parameter determined according to the quality evaluation index value among multiple preset clustering parameters. The target quality evaluation result is the quality evaluation result corresponding to the target clustering parameter. In addition, the target quality evaluation result and the corresponding quality evaluation index value are also used to determine whether further optimization is needed in the future.

[0078] For example, when the quality evaluation index value is expressed in the form of a quantitative ratio between the first cluster and the second cluster, the better the text clustering effect, the higher the value of the quality evaluation index value, and vice versa, the worse the text clustering effect, the lower the value of the quality evaluation index value. The target clustering parameter can be obtained by selecting the clustering parameter with the highest quality evaluation index value from multiple preset clustering parameters, and the target text clustering result corresponding to the target clustering parameter can be determined at the same time.

[0079] Step S50, inputting the first cluster in the target quality evaluation result into a preset text buffer area, and taking the text constituting the second cluster in the target quality evaluation result as a new text to be clustered;

[0080] In this embodiment, if the text clustering quality result is not good, the first clustering that meets the text clustering quality condition needs to be saved, and the individual texts in the second clustering that do not meet the preset text clustering quality condition need to be re-clustered. It should be noted that the preset text buffer area is used to store clusters that meet the text clustering quality condition and provide data caching and management functions.

[0081] As for the second cluster in the target quality evaluation result, since re-clustering is required, the text constituting the second cluster in the target quality evaluation result is input as a new text to be clustered into step S20 for re-clustering of the text.

[0082] Step S60, returning to the step of performing text clustering on the text to be clustered according to a plurality of preset clustering parameters to obtain text clustering results corresponding to each of the plurality of preset clustering parameters, until a preset iteration end condition is met, and determining a target text clustering result according to the target quality evaluation result.

[0083] It should be noted that the present application performs the next round of text clustering for the new text to be clustered. The process of performing the next round of text clustering is essentially the next round of iterative optimization. In the next round of iterative optimization, the text to be clustered is clustered according to preset clustering parameters, and the clustering parameters may not be limited to the clustering parameters of the previous round.

[0084] For example, the clustering parameter is expressed by the number of clusters. In the current round of text clustering, the preset clustering parameter can be 10, 100, 500, and in the next round of text clustering, the preset clustering parameter can be 10, 100, 250, 500, or 10, 100. In the scenario where the former is applicable, since the total number of texts in the text to be clustered is reduced compared with the previous round in each round of iteration, the computing power resources saved can be used to consider more cluster numbers; in the scenario where the latter is applicable, for enterprises or institutions with limited computing power resources, reducing the number of preset clusters in each round can significantly save computing power resources and increase the speed of generating text clustering results. In addition, the preset clustering parameters in this round of iteration can also be completely different in value from the preset clustering parameters in the next round, and can be set by themselves during the specific implementation, and this embodiment does not limit this.

[0085] The iterative optimization of the text clustering results in this embodiment needs to stop only after the preset iteration end condition is met. The preset iteration end condition can generally be set as a threshold in advance, and by comparing the threshold with the quality evaluation index value in the current round, it is determined whether the quality of the target text clustering result finally outputted can achieve the expected effect.

[0086] For example, assuming that the quality evaluation index value is the quantitative ratio between the first cluster and the second cluster, if the quality evaluation index value in the target quality evaluation result in the current round is greater than or equal to the preset threshold, it means that the clustering quality of the text clustering result after this round of iterative optimization meets the text clustering quality conditions, and the clusters stored in the preset cache area in all iterative rounds can be regarded as clusters that meet the text clustering quality conditions, and the target text clustering result is determined based on the clusters in the text cache area, wherein the target text clustering result is the high-quality text clustering result finally determined after the above-mentioned data processing and model evaluation, and serves as the final output of the entire text clustering process.

[0087] Based on the acquisition of the text to be clustered, this embodiment uses a pre-trained text clustering quality evaluation model to cluster the text to be clustered according to a number of preset clustering parameters under different clustering parameters to obtain text clustering results corresponding to each of the several preset clustering parameters, and inputs the text clustering results corresponding to each of the several preset clustering parameters into the pre-trained text clustering quality evaluation model to obtain quality evaluation results corresponding to each of the several preset clustering parameters, wherein the quality evaluation results include a first cluster and a second cluster and a quality evaluation index value, the first cluster being the text clustering result determined by the text clustering quality evaluation model. The first cluster is a cluster in the text clustering result that meets the preset text clustering quality condition, and the second cluster is a cluster in the text clustering result determined by the text clustering quality evaluation model that does not meet the text clustering quality condition, that is, the present application divides the clusters in the text clustering result into two categories through the text clustering quality evaluation model, one category is the cluster that meets the text clustering quality condition, and the other category is the cluster that does not meet the text clustering quality condition. This classification method is more in line with normal semantics and language logic; then, by determining the target clustering parameters and the target quality evaluation results corresponding to the target clustering parameters according to the quality evaluation index values ​​corresponding to each of the several preset clustering parameters, the target clustering parameters are determined by comparing the different clustering parameters. The clustering results of the number of clustering parameters can be selected to perform the next round of iteration with the best text clustering effect in the current round of iteration, so as to continuously screen until the target text clustering result that meets the normal semantics is obtained, so as to improve the quality of the text clustering result; finally, the first cluster in the target quality evaluation result is input into the preset text buffer area, and the text constituting the second cluster in the target quality evaluation result is used as the new text to be clustered; return to execute the step of clustering the text to be clustered according to several preset clustering parameters to obtain the text clustering results corresponding to each of the several preset clustering parameters, until the preset iteration end condition is met, and determine according to the target quality evaluation result. Target text clustering results; in each round of iteration, the clusters that meet the text clustering quality conditions (i.e., the first clusters) are retained, and the clusters that do not meet the text clustering quality conditions (i.e., the second clusters) are optimized for the next round of iterative optimization, which makes the final target text clustering results closer to normal semantics; at the same time, in the process of iterative optimization, the number of texts to be clustered in any round of iterative optimization will be reduced compared to the number of texts to be clustered in the previous round of iterative optimization. As the number of iterations increases, the computational cost will be greatly reduced, thereby improving the text clustering efficiency; accordingly, for enterprises with limited computing resources, the quality of text clustering results can be improved while reducing resource pressure.Therefore, in this embodiment, the computational cost is reduced, the text clustering efficiency is improved, and at the same time, a text clustering result that is more in line with normal semantics is generated, and supervised text clustering is implemented to improve the quality of the text clustering results. In addition, this embodiment can also adjust the clustering parameters according to specific needs to achieve flexible text clustering operations.

[0088] In a feasible implementation manner, the step of determining the target clustering parameter and the target quality evaluation result corresponding to the target clustering parameter according to the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters includes:

[0089] According to the quality evaluation index values ​​corresponding to each of the plurality of preset clustering parameters, the clustering parameter with the highest quality evaluation index value is determined from the plurality of preset clustering parameters as the target clustering parameter, and the quality evaluation result corresponding to the target clustering parameter is determined as the target quality evaluation result.

[0090] In this embodiment, the clustering parameter with the highest quality evaluation index value is determined as the target clustering parameter. The text clustering result corresponding to the target clustering parameter is the clustering result that can produce the best quality under the current text data and clustering algorithm.

[0091] For example, when the quality evaluation index value is the quantitative ratio between the first cluster and the second cluster or the quantitative ratio of the first cluster to the total clusters in the text clustering result, it is necessary to sort all the calculated quality evaluation index values ​​in order from large to small (or from good to bad), and then select the largest quality evaluation index value from the sorted list; then, determine the clustering parameter corresponding to the highest quality evaluation index value, and set the found quality evaluation result as the target quality evaluation result.

[0092] In another feasible implementation, the target clustering parameters and the target quality evaluation results corresponding to the target clustering parameters are determined according to the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters, and step S40 may include steps S401 to S402:

[0093] Step S401, performing difference calculation based on the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters and the preset standard parameters, to obtain deviation values ​​corresponding to the plurality of preset clustering parameters;

[0094] In this embodiment, it is first necessary to perform a difference calculation based on the quality evaluation index value corresponding to each preset clustering parameter and the preset standard parameter (an ideal or expected quality evaluation index value). This difference represents the degree of deviation between the clustering quality under the current clustering parameter and the expected quality, that is, the deviation value. It should be noted that the preset standard parameter can be set according to the actual situation during implementation, and this embodiment is not specifically limited here.

[0095] Step S402: Determine a clustering parameter with the smallest deviation value from the plurality of preset clustering parameters as the target clustering parameter, and determine a quality evaluation result corresponding to the target clustering parameter as the target quality evaluation result.

[0096] After calculating the deviation values ​​corresponding to the several preset clustering parameters, it is first necessary to compare the deviation values ​​of all the preset clustering parameters to find the smallest deviation value. It should be noted that the deviation values ​​are compared in the form of absolute values. Then, the clustering parameter with the smallest deviation value is determined as the target clustering parameter, and the quality evaluation result corresponding to the target clustering parameter is determined as the target quality evaluation result.

[0097] In this embodiment, the difference between the quality evaluation index value corresponding to each of the several preset clustering parameters and the preset standard parameter is calculated to obtain the deviation value corresponding to the several preset clustering parameters; the clustering parameter with the smallest deviation value is determined as the target clustering parameter from the several preset clustering parameters, and the quality evaluation result corresponding to the target clustering parameter is determined as the target quality evaluation result. Through the above scheme, this embodiment selects a clustering parameter with the smallest deviation value from multiple preset clustering parameters as the target clustering parameter, and determines its corresponding quality evaluation result as the target quality evaluation result. This is of great significance for automatically selecting the optimal clustering parameters and improving clustering quality.

[0098] The above are only two feasible implementations of step S40 provided in this embodiment, and this embodiment does not specifically limit the specific implementation of step S40.

[0099] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 2 , Figure 2This is a flow chart of the second embodiment of the text clustering method of the present application; in this embodiment, before the step of inputting the text clustering results corresponding to the plurality of preset clustering parameters into the pre-trained text clustering quality evaluation model to obtain the quality evaluation results corresponding to the plurality of preset clustering parameters, it is necessary to generate the trained text clustering quality evaluation results by fine-tuning and training the original large language model deployed in the text clustering system, including steps A10 to A20:

[0100] Step A10, constructing a clustering quality evaluation data set;

[0101] Before constructing the clustering quality evaluation data set, it is necessary to first collect the original data for clustering, wherein the original data can be obtained by accessing the enterprise system history database. After the original data is preprocessed (including data cleaning, data conversion and data standardization), it is clustered by a preset text clustering algorithm to obtain the text clustering results corresponding to the original data.

[0102] After obtaining the text clustering results corresponding to the original data, the relevant operators can manually judge the quality of each text clustering result and mark it, that is, judge the quality of each text clustering result through expert experience. Among them, the marking method can adopt binary classification marking to divide the text clustering results corresponding to the original data into "good clusters" with good clustering quality and "bad clusters" with poor clustering quality.

[0103] For example, suppose that a cluster in the text clustering results corresponding to the original data includes three articles, namely article a, article b and article c. Among them, the content of article a is an analysis of the impact of a certain stock market turmoil on the bank's financial business, article b is a summary report of relevant financial statistical data of a certain stock market turmoil, and article c is a risk prediction report of listed companies. Obviously, the clustering categories of article a and article b should be different from the clustering category of article c. Therefore, this cluster will be marked as a "bad cluster".

[0104] Step A20, performing model training according to the clustering quality evaluation data set to obtain the trained text clustering quality evaluation model.

[0105] The text clustering system performs fine-tuning and model training on the basis of deploying the original large language model to be trained, so as to obtain a large language model (that is, a text clustering quality evaluation model) that can perform the text clustering quality evaluation task. During the fine-tuning and model training process, the model will be trained based on the data set of the text clustering quality evaluation task, learn how to extract key information from the input text clustering results, and predict the corresponding quality evaluation labels. In this way, the final text clustering quality evaluation model can perform the text clustering quality evaluation task more accurately.

[0106] In this embodiment, constructing a clustering quality evaluation data set can help the large language model learn how to accurately evaluate the quality of text clustering and improve the quality of text clustering results; performing model training according to the clustering quality evaluation data set to obtain the trained text clustering quality evaluation model can help the large language model learn how to accurately evaluate the quality of text clustering and improve the quality of text clustering results. Further training the model on the basis of obtaining the clustering quality evaluation data set can enable it to accurately perform quality evaluation on text clustering results.

[0107] In a feasible implementation manner, the step of constructing a clustering quality evaluation data set includes steps A101 to A103:

[0108] Step A101, setting text clustering quality conditions;

[0109] Considering that in an ideal text clustering result, the similarity of texts within the same cluster should be as strong as possible, and the similarity of texts between different clusters should be as weak as possible, it is necessary to set text clustering quality conditions as a basis for judging the quality of text clustering results.

[0110] For example, the quality of the text clustering results can be measured according to the quality evaluation index value in the text clustering quality evaluation results, or the first cluster and the second cluster in the text clustering quality evaluation results can be selected according to a certain ratio, and the quality of the clusters can be manually judged. It should be noted that whether judging according to the quality evaluation index value or manually judging by selecting clusters according to a certain ratio, a threshold value needs to be set as a standard so as to obtain a comparison result based on the threshold, and then judge whether to perform the next round of iterative optimization based on the comparison result.

[0111] Step A102, obtaining the original text, and annotating each cluster in the original text with a binary classification label according to the text clustering quality condition, to obtain a first annotated text and a second annotated text, wherein the first annotated text meets the text clustering quality condition, and the second annotated text does not meet the text clustering quality condition;

[0112] This embodiment needs to prepare a clustering quality evaluation data set, which is obtained by manually annotating the original text into many different clusters and annotating each cluster with a binary label of "good" or "bad" to obtain the first annotated text and the second annotated text. It can be understood that the labeling as "good" means that the first annotated text meets the preset quality evaluation conditions, and the labeling as "bad" means that the second annotated text does not meet the preset quality evaluation. This embodiment uses the clustering quality evaluation data set to train the original text clustering quality evaluation model, and optimizes the performance of the model in evaluating the quality of text clustering by adjusting the parameters of the model. During or after the training, an independent test set is used to evaluate the performance of the model to ensure that the model can accurately evaluate the quality of text clustering. Therefore, this embodiment obtains the trained text clustering quality evaluation model in the above manner, and the trained text clustering quality evaluation model outputs the evaluation results of "good" clustering or "bad" clustering for a given sentence clustering input in text form. Correspondingly, the "good" clustering can be the first clustering in the above step S30, and the "bad" clustering can be the second clustering in the above step S30.

[0113] For example, in the banking business scenario, for a cluster about personal financial management product recommendations, the corresponding first annotation text may include: "A fund recommendation, suitable for long-term investment, low risk, expected annualized rate of return of about 4%", "Bank fixed deposit products, minimum deposit amount of 10,000 yuan, term of one year, annual interest rate of 2.5%, "Life insurance products launched by insurance companies, comprehensive protection, suitable for long-term holding". Obviously, the three texts in the above clusters are clearly centered around personal financial management product recommendations, providing users with a variety of choices, and are accompanied by detailed investment advice and product information. This cluster can be considered as a cluster that meets the cluster quality evaluation conditions. Similarly, for a cluster about banking services and financial market dynamics, the corresponding second annotation text may include: "The bank has added 10 new business outlets in the city to facilitate citizens to handle business", "Today's foreign exchange rate fell by 0.5%, a new low this year", "The bank launched a new mobile banking APP that supports a variety of financial service functions". Obviously, this cluster has low cluster quality due to mixed topics and low relevance of text content. If it is unable to provide clear and targeted information or suggestions to the user, the cluster can be considered as a cluster that does not meet the cluster quality evaluation conditions.

[0114] Step A103: construct the clustering quality evaluation data set according to the first annotated text and the second annotated text.

[0115] After obtaining the above-mentioned annotated text, it is necessary to organize the first annotated text and the second annotated text generated in step A102 to ensure that they have the same format and structure for subsequent processing. In addition, this embodiment can also extract useful features from the first annotated text and the second annotated text, and these features will be used to train the text clustering quality evaluation model. The selection of features may include the length of the text, the frequency of keywords, the similarity of the text, etc.

[0116] For example, the difference can be measured by calculating the average similarity or difference between different clusters, or the cosine similarity or Euclidean distance between texts can be calculated through the text representation method of Word2Vec (word vector model).

[0117] In this implementation, first, a text clustering quality condition is set; the original text is obtained, and each cluster in the original text is labeled with a binary classification label according to the text clustering quality condition to obtain a first labeled text and a second labeled text, wherein the first labeled text meets the text clustering quality condition, and the second labeled text does not meet the text clustering quality condition; the clustering quality evaluation data set is constructed according to the first labeled text and the second labeled text. This embodiment can ensure that the clustering model can learn high-quality clustering standards during the training process by clearly setting the text clustering quality condition and labeling the clustering results accordingly; training the text clustering model with a clustering quality evaluation data set containing high-quality annotations can optimize the model's parameters, thereby improving its performance in evaluating text clustering quality; in addition, training with a clustering quality evaluation data set containing various scenarios and topics can enhance the generalization ability of the model.

[0118] In another feasible implementation manner, the step of performing model training according to the clustering quality evaluation data set to obtain the trained text clustering quality evaluation model includes:

[0119] Step A201, obtaining an original large language model, and fine-tuning the original large language model to obtain an original text clustering quality evaluation model;

[0120] In this embodiment, it is first necessary to obtain the original large language model, which is a large language model that has been pre-trained on a large amount of text data, such as a GPT (Generative Pre-trained Transformer) model. It should be noted that the fine-tuning of the original large language model in this embodiment does not require a large amount of data like training the model from scratch, but it also requires some data related to the quality evaluation task to guide the adjustment of the model. After fine-tuning the original large language model, the original text clustering quality evaluation model that can adapt to the task of text clustering quality evaluation can be obtained.

[0121] Step A202: training the original text clustering quality evaluation model according to the clustering quality evaluation data set to obtain the trained text clustering quality evaluation model.

[0122] After obtaining the fine-tuned original text clustering quality evaluation model, a special clustering quality evaluation dataset is needed to further train the model so that it can accurately evaluate the quality of text clustering results.

[0123] In this implementation, the original large language model is obtained and fine-tuned to obtain the original text clustering quality evaluation model; the original text clustering quality evaluation model is trained according to the clustering quality evaluation data set to obtain the trained text clustering quality evaluation model. Thus, this embodiment can obtain the clustering quality evaluation data set, thereby helping the clustering quality evaluation model learn how to accurately evaluate the quality of text clustering.

[0124] Based on the first embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated in the following. Figure 3 , Figure 3 Schematic diagram of the flow of the third embodiment of the text clustering method of this application; Figure 3 As shown, the step of determining the target text clustering result according to the target quality evaluation result may include steps S601 to S602:

[0125] Step S601, according to the target quality evaluation result, input the first cluster and the second cluster in the target quality evaluation result into a preset text buffer area, perform cluster naming according to the clusters in the text buffer area, and obtain cluster names corresponding to the clusters in the text buffer area;

[0126] In this embodiment, if the quality evaluation index value in the target quality evaluation result is the ratio of the number of the first cluster and the second cluster, then when the quality evaluation index value is greater than or equal to the preset threshold, the system will consider that the quality of these clusters (including the first cluster and the second cluster) is good enough and can proceed to the next step. Next, these clusters will be input into a preset text buffer area, and cluster names will be performed based on the general large language model according to the cluster content in the buffer area, that is, one or more descriptive names will be assigned to each cluster. These names should be able to accurately reflect the main content or theme of the cluster.

[0127] Step S602: according to the cluster names corresponding to the clusters in the text buffer area, the clusters with the same cluster name are merged to obtain the target text clustering result.

[0128] In this embodiment, the text clustering system will check whether there are clusters with the same name according to the cluster names corresponding to the clusters in the text buffer area. If so, these clusters will be merged into a larger cluster to obtain the final target text clustering result. The merged new cluster can retain the original cluster name, or generate a new name that can more accurately reflect the content of the merged cluster as needed. After the merging process, the system will output the final target text clustering result. The target text clustering result includes all merged clusters and their corresponding cluster names.

[0129] For example, the cluster to which the three texts "a fund recommendation, suitable for long-term investment, with low risk and an expected annualized rate of return of about 4%", "a bank time deposit product, with a minimum deposit amount of 10,000 yuan, a term of one year, and an annual interest rate of 2.5%", and "a life insurance product launched by an insurance company, with comprehensive protection and suitable for long-term holding" belong is named "recommendation of personal financial management products", and based on this cluster name, it is determined whether there is a cluster with the same name to reduce redundant data in the storage space.

[0130] Through the above scheme, this embodiment inputs the first cluster and the second cluster in the target quality evaluation result into a preset text buffer area according to the target quality evaluation result, and performs cluster naming according to the clusters in the text buffer area to obtain the cluster names corresponding to the clusters in the text buffer area; according to the cluster names corresponding to the clusters in the text buffer area, the clusters with the same cluster names are merged to obtain the target text clustering result. Through the above two steps, this embodiment can automatically name and merge clusters that meet the preset quality evaluation conditions, thereby obtaining a more accurate and meaningful text clustering result.

[0131] Based on the second embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the above-mentioned second embodiment can refer to the above introduction, and will not be repeated in the following. Figure 4 , Figure 4 Schematic diagram of the flow chart of the fourth embodiment of the text clustering method of this application; Figure 4 As shown, the step of setting the text clustering quality condition may include steps A1011 to A1012:

[0132] Step A1011, accessing a business database, and acquiring account operation behavior data and bank transaction event chain data from the business database according to a preset search engine, wherein the account operation behavior data includes one or more of account login behavior data, transfer behavior data, consumption behavior data, and repayment behavior data, and the bank transaction event chain data is composed of independent transaction event data that meets a preset correlation threshold;

[0133] In this embodiment, the text clustering system is carried in the banking system. It is connected to the banking database through a secure data access interface. The preset retrieval engine (including SQL query, API call or special data retrieval tool) is used to retrieve the required data from the database. One or more data including account login behavior data, transfer behavior data, consumption behavior data and repayment behavior data are retrieved. These data contain detailed information such as timestamp, operation type, operation amount, etc. This implementation also retrieves bank transaction event chain data composed of independent transaction event data that meet a preset correlation threshold. The bank transaction event chain data represents a specific banking business scenario or bank customer behavior pattern. Among them, the correlation threshold represents the minimum correlation quantitative indicator required for different independent transaction events to have a banking business logical association.

[0134] For example, the two independent transaction events in the bank transaction event chain data are account opening event and loan application event. Customers need to open a savings account and complete the first deposit before submitting a home loan application. There is an obvious sequence and dependency relationship between these two events, and the quantitative index of the correlation between the two will be higher than the correlation threshold.

[0135] Step A1012, setting the text clustering quality condition according to the account operation behavior data and the bank transaction event chain.

[0136] After obtaining the account operation behavior data and the bank transaction event chain data, this embodiment conducts an in-depth analysis of the obtained account operation behavior data to determine the characteristics, frequency and distribution of different operation types to identify normal user behavior patterns and abnormal or suspicious behaviors. A similar analysis is performed on the bank transaction event chain data to determine the relationship, structure and trend between different event chains. Based on the above analysis, text clustering quality conditions are set. The text clustering quality conditions may include one or more of the compactness within the cluster, the separation between clusters, and the matching degree between the clustering results and the known user behavior patterns. In practical applications, the quality conditions of text clustering can be continuously adjusted and optimized according to the feedback of the clustering results and the changes in business needs to improve the quality and practicality of the clustering results.

[0137] In this embodiment, by accessing the business database, the account operation behavior data and the bank transaction event chain data are obtained from the business database according to the preset search engine, the account operation behavior data includes one or more of the account login behavior data, the transfer behavior data, the consumption behavior data and the repayment behavior data, and the bank transaction event chain data is composed of independent transaction event data that meets the preset correlation threshold; the text clustering quality condition is set according to the account operation behavior data and the bank transaction event chain. Therefore, this embodiment can improve the efficiency of data acquisition and processing, and provide support for text clustering analysis and bank business decision-making, so that the text clustering results are more in line with the bank business logic and normal human perception, and improve the text clustering quality.

[0138] For example, to help understand the implementation process of the text clustering method obtained by combining this embodiment with the above-mentioned embodiment 1, please refer to Figure 5 , Figure 5 A brief flowchart of a text clustering method is provided, as follows:

[0139] First, based on a general large language model, a fine-tuning technique is used on an artificially annotated dataset to train a large language model specifically for evaluating clustering effects; according to different clustering parameters (such as the number of clusters is set to 100, 500, and 1000), different clustering results are obtained using a traditional clustering algorithm; using the large language model obtained in the above steps, each cluster in the clustering result is evaluated, and the ratio of good clusters to bad clusters is calculated; the clustering result with the highest good / bad ratio (for example, 500 clusters) is selected as the clustering result of this clustering; the good clusters in this clustering result are retained, and the sentences belonging to the bad clusters are clustered in the next round; for all the good clusters in the final result, each cluster is named based on the general large language model; finally, clusters with the same name are merged to obtain the clustering result of the target text.

[0140] It should be noted that the above examples are only used to assist in understanding the present application and do not constitute a limitation on the text clustering method of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0141] It should be noted that the above embodiments can be reasonably combined and implemented according to actual conditions, and this embodiment will not be described in detail.

[0142] The present application provides a text clustering device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the text clustering method in the above-mentioned embodiment 1.

[0143] Reference below Figure 6 , which shows a schematic diagram of the structure of a text clustering device suitable for implementing the embodiment of the present application. The text clustering device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The text clustering device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0144] like Figure 6As shown, the text clustering device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the text clustering device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the text clustering device to communicate with other devices wirelessly or by wire to exchange data. Although the text clustering device with various systems is shown in the figure, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.

[0145] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.

[0146] The text clustering device provided by the present application adopts the text clustering method in the above embodiment, which can solve the technical problem of low quality of text clustering results. Compared with the prior art, the beneficial effects of the text clustering device provided by the present application are the same as the beneficial effects of the text clustering method provided by the above embodiment, and other technical features in the text clustering device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0147] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0148] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

[0149] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the text clustering method in the above embodiment.

[0150] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0151] The computer-readable storage medium may be included in the text clustering device; or may exist independently without being assembled into the text clustering device.

[0152] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by the text clustering device, the text clustering device:

[0153] Get the text to be clustered;

[0154] Performing text clustering on the text to be clustered according to a plurality of preset clustering parameters to obtain text clustering results corresponding to each of the plurality of preset clustering parameters;

[0155] Inputting the text clustering results corresponding to the plurality of preset clustering parameters into a pre-trained text clustering quality evaluation model to obtain quality evaluation results corresponding to the plurality of preset clustering parameters, wherein the quality evaluation results include a first cluster and a second cluster and a quality evaluation index value, the first cluster being a cluster in the text clustering results determined by the text clustering quality evaluation model that meets a preset text clustering quality condition, and the second cluster being a cluster in the text clustering results determined by the text clustering quality evaluation model that does not meet the text clustering quality condition;

[0156] Determine the target clustering parameter and the target quality evaluation result corresponding to the target clustering parameter according to the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters;

[0157] Inputting the first cluster in the target quality evaluation result into a preset text buffer area, and using the text constituting the second cluster in the target quality evaluation result as a new text to be clustered;

[0158] Return to the step of performing text clustering on the text to be clustered according to a plurality of preset clustering parameters to obtain text clustering results corresponding to each of the plurality of preset clustering parameters, until a preset iteration end condition is met, and then determine the target text clustering result according to the target quality evaluation result.

[0159] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0160] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0161] The modules involved in the embodiments described in the present application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0162] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned text clustering method, and can solve the technical problem of low quality of text clustering results. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the text clustering method provided by the above-mentioned embodiment, and will not be described in detail here.

[0163] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned text clustering method when executed by a processor.

[0164] The computer program product provided by this application can solve the technical problem of low quality of text clustering results. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the text clustering method provided by the above embodiment, which will not be repeated here.

[0165] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A text clustering method, characterized in that: The method includes: Get the text to be clustered; Performing text clustering on the text to be clustered according to a plurality of preset clustering parameters to obtain text clustering results corresponding to each of the plurality of preset clustering parameters; Inputting the text clustering results corresponding to the plurality of preset clustering parameters into a pre-trained text clustering quality evaluation model to obtain quality evaluation results corresponding to the plurality of preset clustering parameters, wherein the quality evaluation results include a first cluster and a second cluster and a quality evaluation index value, the first cluster being a cluster in the text clustering results determined by the text clustering quality evaluation model that meets a preset text clustering quality condition, and the second cluster being a cluster in the text clustering results determined by the text clustering quality evaluation model that does not meet the text clustering quality condition; Determine the target clustering parameter and the target quality evaluation result corresponding to the target clustering parameter according to the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters; Inputting the first cluster in the target quality evaluation result into a preset text buffer area, and using the text constituting the second cluster in the target quality evaluation result as a new text to be clustered; Return to the step of performing text clustering on the text to be clustered according to a plurality of preset clustering parameters to obtain text clustering results corresponding to each of the plurality of preset clustering parameters, until a preset iteration end condition is met, and then determine the target text clustering result according to the target quality evaluation result.

2. The method according to claim 1, characterized in that Before the step of inputting the text clustering results corresponding to the plurality of preset clustering parameters into a pre-trained text clustering quality evaluation model to obtain the quality evaluation results corresponding to the plurality of preset clustering parameters, the method includes: Construct a clustering quality evaluation dataset; Model training is performed according to the clustering quality evaluation data set to obtain the trained text clustering quality evaluation model.

3. The method according to claim 2, characterized in that The step of constructing a clustering quality evaluation data set includes: Set text clustering quality conditions; Obtaining an original text, and annotating each cluster in the original text with a binary classification label according to the text clustering quality condition to obtain a first annotated text and a second annotated text, wherein the first annotated text meets the text clustering quality condition, and the second annotated text does not meet the text clustering quality condition; The clustering quality evaluation data set is constructed according to the first annotated text and the second annotated text.

4. The method according to claim 2, characterized in that The step of performing model training according to the clustering quality evaluation data set to obtain the trained text clustering quality evaluation model comprises: Obtaining an original large language model, and fine-tuning the original large language model to obtain an original text clustering quality evaluation model; The original text clustering quality evaluation model is trained according to the clustering quality evaluation data set to obtain the trained text clustering quality evaluation model.

5. The method according to claim 1, characterized in that The step of determining the target text clustering result according to the target quality evaluation result comprises: According to the target quality evaluation result, the first cluster and the second cluster in the target quality evaluation result are input into a preset text buffer area, and cluster names are performed according to the clusters in the text buffer area to obtain cluster names corresponding to the clusters in the text buffer area; According to the cluster names corresponding to the clusters in the text buffer area, the clusters with the same cluster name are merged to obtain the target text clustering result.

6. The method according to claim 1, characterized in that The step of determining the target clustering parameter and the target quality evaluation result corresponding to the target clustering parameter according to the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters comprises: According to the quality evaluation index values ​​corresponding to each of the plurality of preset clustering parameters, the clustering parameter with the highest quality evaluation index value is determined from the plurality of preset clustering parameters as the target clustering parameter, and the quality evaluation result corresponding to the target clustering parameter is determined as the target quality evaluation result.

7. The method according to claim 1, characterized in that The step of determining the target clustering parameter and the target quality evaluation result corresponding to the target clustering parameter according to the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters comprises: Performing difference calculation based on the quality evaluation index values ​​corresponding to the plurality of preset clustering parameters and the preset standard parameters to obtain deviation values ​​corresponding to the plurality of preset clustering parameters; A clustering parameter with the smallest deviation value is determined from the plurality of preset clustering parameters as the target clustering parameter, and a quality evaluation result corresponding to the target clustering parameter is determined as the target quality evaluation result.

8. The method according to claim 3, characterized in that The step of setting the text clustering quality condition comprises: Accessing a business database, and acquiring account operation behavior data and bank transaction event chain data from the business database according to a preset search engine, wherein the account operation behavior data includes one or more of account login behavior data, transfer behavior data, consumption behavior data, and repayment behavior data, and the bank transaction event chain data is composed of independent transaction event data that meets a preset correlation threshold; The text clustering quality condition is set according to the account operation behavior data and the bank transaction event chain.

9. A text clustering device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the text clustering method according to any one of claims 1 to 8.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the text clustering method according to any one of claims 1 to 8 are implemented.

11. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the text clustering method according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Intelligent clustering method and device for model elements, equipment and storage medium

    CN121705786A