Text classification method and device
By analyzing the preliminary clustering and clustering statistics of the classified text, the problem of low accuracy of text classification in the existing technology is solved, and more efficient and accurate text classification is achieved.
Patent Information
- Application Number
- CN202310923697.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2025-02-07
AI Technical Summary
In the prior art, due to the clustering accuracy limitation of the preset clustering method during text classification, the text classification accuracy is low.
By first performing preliminary clustering of the classified text, and then determining the cluster statistical results based on the clustering results, the text to be classified is finally divided into multiple text classification subsets.
The accuracy of text classification is improved, the shortcomings of directly using clustering results as the final classification result are avoided, and classification efficiency and accuracy are enhanced.
Smart Images

Figure CN119397012A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of text data processing, and in particular to a text classification method and device. Background Art
[0002] At present, with the rapid development of Internet technology, a large amount of text data will be generated in a certain business processing process. At the same time, in some specific application scenarios, a large amount of text data needs to be classified. For example, for the intelligent customer service system, in order to improve the response efficiency of the intelligent customer service, the same standard reply statement can be replied to multiple similar question statements. Therefore, it is necessary to classify the user question statements in the historical dialogue text and classify similar question statements into the same text subset. Among them, for the text classification process, usually, a preset clustering method is used to cluster multiple texts to be classified into multiple clustering clusters, and each clustering cluster is determined as a text classification subset. However, if the text clustering result is directly used as the final classification result, due to the limitation of the clustering accuracy of the preset clustering method, the text classification accuracy is low. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a text classification method and device, which can improve the accuracy of text classification.
[0004] In order to implement the above technical solution, the embodiment of the present application is implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a text classification method, the method comprising:
[0006] Get the text collection to be classified;
[0007] Performing clustering processing on the texts to be classified in the text set to be classified to obtain a text clustering result;
[0008] Based on the text clustering results, determining text clustering statistics results; wherein the text clustering statistics results include cluster statistics values, and the cluster statistics values correspond to the text pairs to be classified;
[0009] Based on the cluster statistics, the to-be-classified text set is divided into a plurality of text classification subsets.
[0010] In a second aspect, an embodiment of the present application provides a text classification device, the device comprising:
[0011] A text acquisition module is used to acquire a set of texts to be classified;
[0012] A text clustering module, used for clustering the texts to be classified in the text set to be classified to obtain text clustering results;
[0013] A statistical result determination module, used for determining text clustering statistical results based on the text clustering results; wherein the text clustering statistical results include same-cluster statistical values, and the same-cluster statistical values correspond to the text pairs to be classified;
[0014] The text classification module is used to divide the text set to be classified into multiple text classification subsets based on the same cluster statistical value.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, the device comprising:
[0016] A processor; and a memory arranged to store computer executable instructions, the executable instructions being configured to be executed by the processor, the executable instructions comprising instructions for executing the steps in the method as described in the first aspect.
[0017] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the storage medium is used to store computer-executable instructions, and the executable instructions enable the computer to execute the steps in the method described in the first aspect.
[0018] In an embodiment of the present application, after obtaining a set of texts to be classified, text clustering is first performed on the texts to be classified in the set of texts to be classified to obtain text clustering results; and based on the text clustering results, text clustering statistics are determined; and then based on the text clustering statistics, the set of texts to be classified is divided into multiple text classification subsets; it can be seen that the texts to be classified are first preliminarily clustered, and then accurately classified in combination with the preliminary clustering results to obtain the final text classification result, that is, the process of dividing multiple texts to be classified into multiple subsets mainly involves two text processing stages, namely, preliminary text clustering and precise text classification. The text clustering results are not directly used as the final text classification results, but the text clustering statistics are first determined based on the text clustering results, and then text classification is performed based on the text clustering statistics, which can improve the accuracy of text classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] 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, the drawings described below are only some embodiments recorded in one or more of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0020] Figure 1 A first flow chart of the text classification method provided in the embodiment of the present application;
[0021] Figure 2A schematic diagram of the first implementation principle of the text classification method provided in the embodiment of the present application;
[0022] Figure 3 A second flow chart of the text classification method provided in the embodiment of the present application;
[0023] Figure 4 A schematic diagram of a second implementation principle of the text classification method provided in an embodiment of the present application;
[0024] Figure 5 A third implementation principle diagram of the text classification method provided in the embodiment of the present application;
[0025] Figure 6 A fourth implementation principle diagram of the text classification method provided in the embodiment of the present application;
[0026] Figure 7 A schematic diagram of the module composition of the text classification device provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the technical solutions in one or more of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only one or more partial embodiments of the present application, rather than all embodiments. Based on one or more embodiments of the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0029] It should be noted that, in the absence of conflict, one or more embodiments and features in the embodiments of the present application may be combined with each other. The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0030] One or more embodiments of the present application provide a text classification method and device. Considering that if multiple text clustering clusters obtained by using a preset text clustering algorithm are directly used as the final text classification result, then there will inevitably be an impact on the clustering accuracy of the clustering algorithm, resulting in low accuracy of text classification; considering that if a text classification model is used to classify multiple texts to be classified, then it is necessary to pre-train a neural network model as a text classification model, which not only takes a long time for the model training process, but also the accuracy of the selection of model training samples will affect the parameter training accuracy of the text classification model, thereby affecting the accuracy of text classification. Based on the above problems, the present technical solution first uses a preset clustering method to perform preliminary clustering on n texts to be classified, and then combines the preliminary clustering results for precise classification to obtain the final text classification result. That is, the process of dividing n texts into multiple subsets mainly involves two text processing stages, namely, preliminary text clustering and precise text classification, rather than directly using the text clustering results as the final text classification result. In order to improve the accuracy of text classification, the above-mentioned text clustering results may include text clustering sub-results obtained by multiple text clustering operations. In this way, since the text clustering statistical results are obtained based on the text clustering sub-results of multiple text clustering operations, the accuracy of the text clustering statistical results is ensured, and the accuracy of text classification based on the text clustering statistical results can be further improved. In addition, in the entire text classification process, the two text processing stages of clustering and classification are mainly involved, that is, rough classification is first performed with the help of a preset clustering method, and then accurate classification is performed with the help of the statistical results obtained based on the clustering cluster results of multiple text clustering. No neural network model is needed. Therefore, the model training process is omitted, and there is no need to obtain a large number of model training samples, which can take into account both text classification efficiency and accuracy.
[0031] in, Figure 1 A flowchart of a text classification method provided for one or more embodiments of the present application is provided. Figure 1 The method in can be executed by an electronic device, which may be a terminal device or a designated server; Figure 1 As shown, the method comprises at least the following steps:
[0032] S102, obtaining a set of texts to be classified;
[0033] Specifically, the above-mentioned set of texts to be classified may include n texts to be classified, where n is an integer greater than 2; the text to be classified may be a text sentence or multiple text sentences, and the text to be classified is text data generated in the process of a preset business. For example, the text to be classified includes user question sentences extracted from interaction data, and the interaction data may be generated during a voice call between an agent terminal and a user terminal for a preset push service; the interaction data may also be generated during the process of sending instant messaging messages between an intelligent customer service and a user terminal for a preset consulting service.
[0034] S104, clustering the texts to be classified in the above-mentioned text set to be classified to obtain a text clustering result;
[0035] In some example embodiments, the text clustering result may be obtained by performing a clustering process on n to-be-classified texts; however, in order to improve the accuracy of subsequent text clustering statistical results, thereby further improving the accuracy of final text classification, in other example embodiments, the text clustering result may be obtained by performing multiple clustering processes on n to-be-classified texts, and correspondingly, the text clustering result includes N text clustering sub-results, each of which is obtained through a text clustering operation, and N is an integer greater than 1;
[0036] Specifically, for each text clustering operation, n texts to be classified will be divided into multiple text clustering clusters, each text clustering cluster contains multiple texts to be classified with the same or similar semantics, that is, the above text clustering sub-results include multiple text clustering clusters. Therefore, if N text clustering operations are performed, N text clustering sub-results will be obtained; in addition, considering that the larger the value of N, the higher the accuracy of the determined text clustering statistical results, therefore, a minimum value of N can be set, for example, the number of seed points (N×m) selected by N text clustering is required to be no less than 1 / 50 of the total number of texts n, that is, the value of N can be greater than or equal to ROUNDUP means rounding up, and m represents the seed point (i.e., the cluster center K value) selected for each text clustering operation.
[0037] In addition, in the text clustering process, clustering processing is usually performed based on the feature vectors of the texts to be classified. Therefore, it is necessary to perform feature vector conversion on the texts to be classified to obtain the text feature vectors of each text to be classified.
[0038] Specifically, the preset clustering method used for each text clustering operation may be any existing clustering method, may be a K-means clustering method, or may be other clustering methods; taking the above preset clustering method as the K-means clustering method as an example, the corresponding process of determining the above text clustering result specifically includes:
[0039] Determine the number of text cluster centers m; where m is an integer greater than 1, that is, the cluster center K value required by the K-means clustering method is equal to the value of m;
[0040] For each text clustering operation, the n texts to be classified are clustered using the K-means clustering method to obtain m text clustering clusters; based on the m text clustering clusters, the text clustering sub-results corresponding to this text clustering operation are determined;
[0041] Based on the text clustering sub-results of N text clustering operations, a text clustering result is obtained.
[0042] It should be noted that the specific process of obtaining m text clusters using the K-means clustering method can be found in the existing K-means clustering algorithm and will not be repeated here. In addition, in the process of clustering n texts to be classified, other clustering methods can also be used, for example, density-based clustering methods, such as the DBSCAN clustering algorithm, and hierarchical clustering algorithm BIRCH clustering algorithm.
[0043] In the specific implementation, considering that the number m of the text cluster centers may be an artificial empirical value, in order to improve the accuracy of the text cluster sub-results, the number m of the text cluster centers may be determined by any of the following two methods, specifically including:
[0044] (1) Based on the number of preset text categories, determine the number m of text cluster centers;
[0045] Specifically, when the number of preset text categories is known, the number of preset text categories can be directly determined as the number of text clustering centers m, or the sum of the number of preset text categories and the preset compensation number can be determined as the number of text clustering centers m, that is, for each text clustering operation, the number of text clustering clusters obtained is greater than the number of preset text categories, that is, the n texts to be classified are divided into more text clustering clusters.
[0046] (2) For each sampling operation, the number of text categories is determined based on the k texts to be classified extracted in this sampling operation; the number of text cluster centers m is determined based on the number of text categories corresponding to multiple sampling operations; where k is greater than 1 and less than the number n of texts to be classified in the set of texts to be classified.
[0047] Specifically, when the number of preset text categories is unknown, multiple sampling operations can be performed to determine the number of text categories corresponding to each sampling operation; for each sampling operation, k texts to be classified are randomly selected from n texts to be classified, and the k texts to be classified are manually classified to determine the number of text categories to which the k texts to be classified belong, so that after x sampling operations, x numbers of text categories will be obtained, and then the x numbers of text categories are averaged to obtain the target number of categories; then, the number of text clustering centers m is determined based on the target number of categories; for example, the target number of categories can be directly determined as the number of text clustering centers m, or the sum of the target number of categories and the preset compensation number can be determined as the number of text clustering centers m.
[0048] S106, based on the text clustering results, determining text clustering statistics results; wherein the text clustering statistics results include same-cluster statistics values, and the same-cluster statistics values correspond to the text pairs to be classified;
[0049] In some example embodiments, if the above text clustering result is obtained by performing a clustering process on n texts to be classified, then the same-cluster statistical value can characterize whether the texts to be classified contained in the text pair to be classified are divided into the same text clustering cluster in a text clustering operation; for example, the same-cluster statistical value can be equal to 0 or 1, 1 indicates that the texts to be classified contained in the text pair to be classified are divided into the same text clustering cluster in a text clustering operation, and 0 indicates that the texts to be classified contained in the text pair to be classified are not divided into the same text clustering cluster in a text clustering operation.
[0050] In some other example embodiments, if the text clustering result is obtained by performing multiple clustering processes on n texts to be classified, that is, the text clustering result includes N text clustering sub-results, then the same cluster statistic value is used to characterize the probability that the texts to be classified included in the text pair to be classified are classified into the same text clustering cluster in the N text clustering operations;
[0051] Specifically, multiple pairs of texts to be classified are constructed based on n texts to be classified in the text set to be classified, each text to be classified corresponds to a clustering statistic value, and each clustering statistic value can be the number of clustering times of the texts to be classified contained in a text pair to be classified, that is, if a text pair to be classified includes text to be classified T i and the text to be classified T j , then, the cluster statistics of the text pair to be classified refers to the number of texts T that are included in the N text clustering operations. i and the text to be classified T jThe number of text clustering clusters can also be the proportion of the number of clusters of the texts to be classified contained in a text pair to be classified (that is, the quotient of the number of clusters and the total number N). The number of clusters refers to the number of times the texts to be classified contained in the text pair to be classified are divided into the same text clustering cluster in N text clustering operations; wherein, the larger the clustering statistic value, the higher the probability that the texts to be classified contained in the text pair to be classified are divided into the same text clustering cluster in N text clustering operations, that is, the greater the possibility that the texts to be classified contained in the text pair to be classified belong to the same text category. Therefore, the n texts to be classified can be further classified based on the clustering statistic value of the text pair to be classified.
[0052] In addition, in order to improve the accuracy of the same-cluster statistical value, the above-mentioned same-cluster statistical value can also be a value obtained by normalizing the number of same-cluster times of the text pairs to be classified.
[0053] Specifically, the above-mentioned pair of texts to be classified can be obtained by combining two texts to be classified in pairs among n texts to be classified. There is only one way to combine two texts to be classified, that is, two texts to be classified in n texts to be classified correspond to one pair of texts to be classified. Correspondingly, the above-mentioned text clustering statistics result includes the same cluster statistics values corresponding to (n(n-1) / 2) pairs of texts to be classified respectively.
[0054] However, in order to more intuitively present the correspondence between the texts to be classified and the same-cluster statistical values, so as to more accurately classify the n texts to be classified based on the text clustering statistical results, the above text clustering statistical results can be expressed as an n×n matrix, that is, a text clustering statistical matrix containing n×n matrix elements, and each matrix element corresponds to a same-cluster statistical value; wherein, the above text pairs to be classified can also be obtained by sorting the texts to be classified in pairs among the n texts to be classified (corresponding to n(n-1) text pairs to be classified), or a single text to be classified (corresponding to n text pairs to be classified). For the arranged text pairs to be classified, since there are two ways to arrange the two texts to be classified, that is, two texts to be classified among the n texts to be classified correspond to two text pairs to be classified, therefore, the n texts to be classified correspond to n×n text pairs to be classified, and the above text clustering statistical results include n×n same-cluster statistical values;
[0055] Specifically, if a pair of texts to be classified includes the text to be classified T i and the text to be classified T j , the corresponding cluster statistics can be expressed as R ij or R ji , i and j are both integers greater than 0 and less than or equal to n; where for R ij For R, i represents the row number and j represents the column number. jiIn terms of, j represents the row number, i represents the column number, if i is equal to j, then the to-be-classified text pair includes a to-be-classified text, R ij = N, that is, for a certain text to be classified, each text clustering operation is regarded as being divided into the same text clustering cluster; for example, the text pair to be classified includes a text to be classified T1, R 11 = N, for example, the text pair to be classified includes a text to be classified T2, R 22 = N; if i is not equal to j, then the pair of texts to be classified includes two texts to be classified, and R ij =R ji For example, the text pair to be classified includes the text to be classified T1 and the text to be classified T2, R 12 =R 21 , R 12 and R 21 represents the probability that the text to be classified T1 and the text to be classified T2 are classified into the same text cluster in N text clustering operations; for example, the text pair to be classified includes the text to be classified T2 and the text to be classified T3, R 23 =R 32 , R 23 and R 32 It represents the probability that the text to be classified T2 and the text to be classified T3 are classified into the same text cluster in N text clustering operations.
[0056] S108: Based on the same-cluster statistics of the to-be-classified text pairs, the to-be-classified text set is divided into a plurality of text classification subsets.
[0057] Specifically, since the above text clustering statistical results include the same-cluster statistical values of multiple text pairs to be classified, and the same-cluster statistical values can represent the probability that the texts to be classified contained in the text pairs to be classified are classified into the same text clustering cluster in N text clustering operations; considering that if the same-cluster statistical value is greater than the preset threshold, it means that the probability that the two texts to be classified in the text pair to be classified belong to the same text category is relatively large, and if both two same-cluster statistical values are greater than the preset threshold and the corresponding text pairs to be classified contain the same text to be classified, then the multiple texts to be classified contained in the text pairs to be classified corresponding to the two same-cluster statistical values belong to the same text category, for example, the same-cluster statistical value R 12 and R 23 are greater than the preset threshold, it means that the text to be classified T1 and the text to be classified T2 belong to the same text category, and the text to be classified T2 and the text to be classified T3 belong to the same text category, and if the same cluster statistic value R 34is also greater than the preset threshold, it means that the text to be classified T3 and the text to be classified T4 belong to the same text category. Therefore, the text to be classified T1, the text to be classified T2, the text to be classified T3, and the text to be classified T4 belong to the same text category. Therefore, if the same cluster statistics R 12 and R 23 , R 34 By dividing into a same-cluster statistical value group, and then based on the text pairs to be classified corresponding to the multiple same-cluster statistical values contained in the same-cluster statistical value group, the text to be classified T1, text to be classified T2, text to be classified T3, and text to be classified T4 can be divided into the same text classification subset; based on this, the above-mentioned multiple text classification subsets can be based on the size relationship between each same-cluster statistical value in the above-mentioned text clustering statistical result and the preset threshold and whether the text pairs to be classified corresponding to two same-cluster statistical values contain the same text pair to be classified. Specifically, firstly based on each same-cluster statistical value in the above-mentioned text clustering statistical result, the multiple same-cluster statistical values are divided into multiple same-cluster statistical value groups, and then the text classification subset is determined based on the text pairs to be classified corresponding to the multiple same-cluster statistical values contained in each same-cluster statistical value group.
[0058] In some example embodiments, based on the above-mentioned text clustering statistical results, multiple specified same-cluster statistical values greater than a preset threshold can be screened out, and then based on whether the to-be-classified text pairs corresponding to the multiple specified same-cluster statistical values contain the same to-be-classified text, the multiple specified same-cluster statistical values can be divided into multiple same-cluster statistical value groups, and then multiple text classification subsets can be determined; in other example embodiments, if the above-mentioned text clustering statistical results are a text clustering statistical matrix, then multiple statistical value tree groupings can be determined based on the above-mentioned text clustering statistical matrix, and then the n to-be-classified texts can be divided into multiple text classification subsets based on the multiple statistical value tree groupings.
[0059] In an embodiment of the present application, the final text classification result is obtained by first performing preliminary clustering on the texts to be classified in the text set to be classified, and then performing precise classification based on the preliminary clustering results. That is, the process of dividing multiple texts to be classified into multiple subsets mainly involves two text processing stages: preliminary text clustering and precise text classification. The text clustering result is not directly used as the final text classification result. Instead, the text clustering statistical result is first determined based on the text clustering result, and then text classification is performed based on the text clustering statistical result, which can improve the accuracy of text classification.
[0060] In a specific embodiment, taking the above-mentioned text set to be classified as including n user question sentences and the above-mentioned text clustering result as including N text clustering sub-results as an example, Figure 2 As shown in the figure, a specific implementation process of a text classification method is given, which mainly includes:
[0061] Obtain n user question statements to be classified, for example, user question statement 1 to user question statement n;
[0062] Performing N text clustering processing on the n user question sentences to be classified by using a preset clustering method, and obtaining text clustering sub-results corresponding to each text clustering processing; for example, text clustering sub-results 1 to text clustering sub-results N, each text clustering sub-result includes multiple text clustering clusters, for example, text clustering sub-result 1 includes clustering clusters 11, 12, and 13, and text clustering sub-result N includes clustering clusters N1, N2, and N3;
[0063] Based on the N text clustering sub-results, determine the text clustering statistical results; wherein the text clustering statistical results include the same-cluster statistical values of multiple user question sentence pairs, and each same-cluster statistical value is used to characterize the probability that the user question sentences included in the user question sentence pair are classified into the same text clustering cluster in the N text clustering processes; for example, the text clustering statistical results include the same-cluster statistical value 1 of the user question sentence pair 1 to the same-cluster statistical value P of the user question sentence pair P, and the value of P is an integer less than or equal to n×n;
[0064] Based on the above text clustering statistical results, the above n user question sentences to be classified are divided into multiple text classification subsets.
[0065] The above-mentioned text to be classified is a user question sentence extracted from the historical interaction data, and the above-mentioned historical interaction data is generated during the information interaction process between the seat terminal or the customer service terminal and the user terminal within a historical preset time period; correspondingly, Figure 3 As shown, in the above S108, after the above text set to be classified is divided into a plurality of text classification subsets based on the same cluster statistics of the above text pairs to be classified, the following further comprises:
[0066] S110, for each text classification subset, determining a standard question sentence corresponding to the text classification subset;
[0067] S112, determining each user's question sentence in the text classification subset as a similar question sentence to the standard question sentence;
[0068] S114, determining the sentence label information of the similar question sentence based on the sentence label information of the standard question sentence;
[0069] Among them, the above-mentioned sentence label information includes at least one of a standard reply sentence, a user intention label, and a real category label; specifically, for the application scenario of intelligent customer service, after determining multiple text classification subsets, the text classification subset corresponding to each standard question sentence can be determined based on multiple preset standard question sentences; in this way, the user question sentence contained in the text classification subset can be used as a similar question sentence of the corresponding standard question sentence, that is, the effect of expanding the similar question sentence of the standard question sentence is achieved, and the correspondence between the standard question sentence and multiple similar question sentences is established. Therefore, the sentence label information of the standard question sentence can be determined as the sentence label information of the corresponding similar question sentence. For example, if the standard reply sentence of the standard question sentence is known, then the standard reply sentence of the similar question sentence corresponding to the standard question sentence can be quickly determined; for another example, if the user intention label of the standard question sentence is known, then the user intention label of the similar question sentence corresponding to the standard question sentence can be quickly determined, and then the user's question can be quickly answered.
[0070] Among them, for the process of determining the text clustering statistical results based on the text clustering sub-results obtained by multiple text clustering, the above S106, based on the above text clustering results, determines the text clustering statistical results, specifically including:
[0071] Step 1: for each text pair to be classified, based on the above N text clustering sub-results, determine the number of clusters of the text pair to be classified;
[0072] Specifically, taking the value of N equal to 5 as an example, the above N text clustering sub-results include text clustering sub-result 1, text clustering sub-result 2, text clustering sub-result 3, text clustering sub-result 4, and text clustering sub-result 5, and each text clustering sub-result includes multiple text clustering clusters; for example, text clustering sub-result 1 includes text clustering cluster 11, text clustering cluster 12, and text clustering cluster 13; for the text pair to be classified ij, if there is a text clustering cluster in each of the text clustering sub-result 1, the text clustering sub-result 2, and the text clustering sub-result 3 that contains the text to be classified T i and the text to be classified T j , while in text clustering sub-result 4 and text clustering sub-result 5, there is no text clustering cluster containing the text to be classified T at the same time. i and the text to be classified T j , then, the same cluster count of the text pair ij to be classified is equal to 3. Assuming that the same cluster count is directly used as the same cluster statistic value, then R ij =3, and so on, the same cluster statistics of each pair of texts to be classified are determined, and then the same cluster statistics value of each pair of texts to be classified are determined.
[0073] Step 2: determining a text clustering statistical matrix based on the same-cluster statistical times of multiple pairs of texts to be classified corresponding to the n texts to be classified;
[0074] Specifically, the number of clustering statistics of each pair of texts to be classified can be directly used as the clustering statistics value, corresponding to a matrix element, to obtain the text clustering statistics matrix. Alternatively, the number of clustering statistics of each pair of texts to be classified can be normalized first, and then the normalized number of clustering statistics can be used as the clustering statistics value, corresponding to a matrix element, to obtain the text clustering statistics matrix.
[0075] Step three, determine the above text clustering statistical matrix as the text clustering statistical result.
[0076] Specifically, a schematic diagram of the above text clustering statistical matrix is given in the following Table 1, specifically:
[0077] <![CDATA[R 11 ]]> <![CDATA[R 12 ]]> <![CDATA[R 13 ]]> …… <![CDATA[R 1n ]]> <![CDATA[R 21 ]]> <![CDATA[R 22 ]]> <![CDATA[R 23 ]]> …… <![CDATA[R 2n ]]> <![CDATA[R 31 ]]> <![CDATA[R 32 ]]> <![CDATA[R 33 ]]> …… <![CDATA[R 3n ]]> …… …… …… …… …… <![CDATA[R n1 ]]> <![CDATA[R n2 ]]> <![CDATA[R n3 ]]> …… <![CDATA[R nn ]]>
[0078] Table 1
[0079] Among them, in the above Table 1, R 12 represents the cluster statistics of the text pair 12 to be classified. The text pair 12 to be classified includes the text T1 to be classified and the text T2 to be classified. The sequence number of the text T1 to be classified is 1, and the sequence number of the text T2 to be classified is 2. 12 The row number is 1, corresponding to the text to be classified R1, R 12 The column number is 2, corresponding to the text to be classified T2, R 12 The adjacent cluster statistics of are: the cluster statistics with the same row number R 11 、T 13 , and the same cluster statistics R of the same column number 22 ; For example, R 33 represents the cluster statistics of the text pair 33 to be classified. The text pair 33 to be classified includes the text T3 to be classified. The sequence number of the text T3 to be classified is 3. 33 The row number and column number are both 3, corresponding to the text to be classified T3, R 33 The adjacent cluster statistics of are: the cluster statistics with the same row number R 32 , R 34 , and the same cluster statistics R of the same column number 23 , R 43 .
[0080] In addition, in the above Table 1, the n row matrices correspond to the n texts to be classified one by one, the row matrix with row number 1 corresponds to the text to be classified T1, the row matrix with row number 2 corresponds to the text to be classified T2, and the row matrix with row number i corresponds to the text to be classified T i, the row matrix with row number n corresponds to the text to be classified T n , for each row matrix, the row numbers of the n same-cluster statistical values in the row matrix are the same, and the pairs of texts to be classified corresponding to the n same-cluster statistical values contain the same text to be classified, and the same text to be classified is the text to be classified contained in the pairs of texts to be classified corresponding to the same-cluster statistical values with the same row number and column number;
[0081] Similarly, in the above Table 1, the row matrix with column number 1 corresponds to the text to be classified T1, the row matrix with column number 2 corresponds to the text to be classified T2, and the row matrix with column number j corresponds to the text to be classified T j , the row matrix with column number n corresponds to the text to be classified T n , n column matrices correspond one-to-one to n texts to be classified. For each column matrix, the column numbers of the n same-cluster statistical values in the column matrix are the same, and the pairs of texts to be classified corresponding to the n same-cluster statistical values contain the same text to be classified. The same text to be classified is the text to be classified contained in the pairs of texts to be classified corresponding to the same-cluster statistical values with the same row number and column number.
[0082] In the process of text classification based on text clustering statistics, the above S108, based on the same cluster statistics of the above text pairs to be classified, divides the above text set to be classified into multiple text classification subsets, specifically including:
[0083] Step 1: determining a plurality of cluster statistical value groups based on the cluster statistical values of the to-be-classified text pairs and a first preset constraint condition;
[0084] Specifically, the first preset constraint condition may include any one of the following: the same-cluster statistic value is less than a preset threshold value, the sequence number of any text to be classified in the text pair to be classified corresponding to the same-cluster statistic value is equal to n and the same-cluster statistic value is less than the preset threshold value, and the same-cluster statistic value is a grouped same-cluster statistic value (for example, set to a specified value or marked as grouped); multiple same-cluster statistic values are grouped in combination with the first preset constraint condition to obtain multiple same-cluster statistic value groups; wherein each same-cluster statistic value in the same-cluster statistic value group is greater than the preset threshold value, and any same-cluster statistic value in the same-cluster statistic value group and the text pair to be classified corresponding to at least one other same-cluster statistic value contain the same text to be classified, that is, if the same-cluster statistic value R 12 and R 23 If all are greater than the preset threshold, it means that the text to be classified T1 and the text to be classified T2 belong to the same text category, and the text to be classified T2 and the text to be classified T3 belong to the same text category. Then, the rule that the text to be classified T1, the text to be classified T2, and the text to be classified T3 belong to the same text category, that is, due to the text to be classified T2, the same cluster statistics value R 12and R 23 It is transitive (it can be understood that if the pair of to-be-classified texts corresponding to two cluster statistics contain a common to-be-classified text, then these two cluster statistics are transitive), that is, the to-be-classified text T2 belongs to the cluster statistics R 12 and R 23 The corresponding text pairs to be classified have common texts to be classified, so that multiple same-cluster statistical values greater than a preset threshold are concatenated through such common texts to be classified; based on this, the grouping process of the same-cluster statistical values can actually be regarded as dividing multiple same-cluster statistical values with preset transitivity and greater than a preset threshold into the same same-cluster statistical value group, that is, the same-cluster statistical value group includes multiple same-cluster statistical values with preset transitivity and greater than a preset threshold.
[0085] Step 2: for each cluster statistical value grouping, based on each cluster statistical value in the cluster statistical value grouping, determine an initial classification subset corresponding to the cluster statistical value grouping;
[0086] Specifically, after determining multiple same-cluster statistical value groupings, based on the serial number of each text to be classified in the text pair to be classified corresponding to the same-cluster statistical value, it can be known which texts to be classified are contained in the text pair to be classified corresponding to the same-cluster statistical value. Therefore, the texts to be classified contained in the text pair to be classified corresponding to each same-cluster statistical value in the same-cluster statistical value grouping are divided into the same initial classification subset.
[0087] Step 3, based on the multiple initial classification subsets, determining multiple text classification subsets of the above-mentioned text set to be classified;
[0088] Specifically, after determining the initial classification subsets, multiple initial classification subsets can be directly determined as multiple text classification subsets; or based on whether the initial classification subsets contain the same classification text, multiple initial classification subsets can be merged to obtain multiple text classification subsets.
[0089] Among them, considering that the hierarchical relationship between the same-cluster statistical values can be more intuitively presented through a tree structure (that is, two same-cluster statistical values whose row numbers or column numbers satisfy a preset association relationship correspond to a pair of parent-child nodes), therefore, the above-mentioned same-cluster statistical value grouping can also be embodied in a tree structure, that is, the above-mentioned same-cluster statistical value grouping can be a statistical value tree grouping. Based on this, in order to further improve the efficiency and accuracy of text classification, the above-mentioned step 1, based on the same-cluster statistical values of the above-mentioned text pair to be classified and the first preset constraint condition, determines multiple same-cluster statistical value groups, specifically including:
[0090] (1) Based on the same-cluster statistical values of the above-mentioned text pairs to be classified and a second preset constraint condition, a plurality of statistical value tree groups are determined; wherein each same-cluster statistical value in the above-mentioned statistical value tree group is greater than a preset threshold value, and the above-mentioned statistical value tree group includes a plurality of statistical value branches, and the row numbers or column numbers of any two adjacent same-cluster statistical values on each statistical value branch satisfy a preset association relationship, and the preset association relationship may include the same row numbers or the same column numbers, that is, the text pairs to be classified corresponding to the two same-cluster statistical values contain the same text to be classified;
[0091] Specifically, for the case where the above-mentioned same-cluster statistical value grouping is represented by a tree structure, that is, the above-mentioned same-cluster statistical value grouping is a statistical value tree grouping, the above-mentioned second preset constraint condition may not only include at least one of the same-cluster statistical value being less than a preset threshold, the row number or column number of the same-cluster statistical value being equal to n and the same-cluster statistical value being less than the preset threshold, and the same-cluster statistical value being a grouped same-cluster statistical value (for example, set to a specified value or marked as grouped), but may also include that the target node does not have a first-level child node; that is, the above-mentioned second preset constraint condition includes the above-mentioned first preset constraint condition; wherein the second preset constraint condition is used to constrain the determination of the leaf node of each statistical value branch, thereby ensuring that each same-cluster statistical value on each statistical value branch is greater than the preset threshold.
[0092] Specifically, the multiple same-cluster statistical values included in the above text clustering statistical results may not be arranged in a matrix form, that is, the number of the multiple same-cluster statistical values included in the text clustering statistical results is less than n×n, that is, the above text pairs to be classified can be obtained by combining two texts to be classified from n texts to be classified, and there is only one way to combine two texts to be classified, that is, two texts to be classified from n texts to be classified correspond to one text pair to be classified, and correspondingly, the above text clustering statistical results include (n(n-1) / 2) same-cluster statistical values corresponding to the text pairs to be classified respectively; however, in order to more intuitively present the correspondence between the texts to be classified and the same-cluster statistical values, so that the n texts to be classified can be classified more accurately based on the text clustering statistical results, the above text clustering statistical results can be expressed as an n×n matrix, that is, containing an n×n matrix elements, each matrix element corresponds to a same-cluster statistical value, that is, the text clustering statistical matrix is constructed based on the same-cluster statistical values of the n×n text pairs to be classified, so that based on the text clustering statistical matrix, it is possible to more regularly determine which same-cluster statistical values are divided into the same same-cluster statistical value group, and realize grouping of multiple same-cluster statistical values to obtain multiple same-cluster statistical value groups; that is, considering that if the above text clustering statistical result is a text clustering statistical matrix containing n×n matrix elements, each matrix element corresponds to a same-cluster statistical value, then, through the row number and column number of the same-cluster statistical value, it can be quickly determined whether the text pairs to be classified corresponding to two same-cluster statistical values contain the same text to be classified (that is, if any of the row number or the column number is the same, such as two adjacent same-cluster statistical values, it means that they contain the same text to be classified).
[0093] (2) The plurality of statistical value tree groups are determined as a plurality of same-cluster statistical value groups.
[0094] Specifically, for the case where the above text clustering statistical result is a text clustering statistical matrix, for two adjacent matrix elements, the row numbers of the two adjacent matrix elements are the same and the column number difference is 1, or the column numbers are the same and the row number difference is 1; wherein, if the same-cluster statistical value is greater than the preset threshold, it means that the probability that the two to-be-classified texts in the to-be-classified text pair belong to the same text category is relatively large, and if any two adjacent same-cluster statistical values on the statistical value branch are adjacent matrix elements, it means that the row numbers of the two adjacent same-cluster statistical values are the same, or the column numbers are the same, therefore, the text pairs to be classified corresponding to the two adjacent same-cluster statistical values contain the same text to be classified, so that the probability that the multiple texts to be classified contained in the text pairs to be classified corresponding to the two adjacent same-cluster statistical values belong to the same text category is relatively large; based on this, firstly, based on each same-cluster statistical value in the above text clustering statistical matrix, the n×n same-cluster statistical values are grouped to obtain multiple statistical value tree groups; then, based on the text pairs to be classified corresponding to the multiple same-cluster statistical values contained in each statistical value tree grouping, the text classification subset is determined.
[0095] For example, if the clustering statistic R 12 , R 13 , R 23 , R 24 are greater than the preset threshold, and combined with the above Table 1, it can be seen that R 12 and R 13 is the adjacent matrix element, R 13 and R 23 is the adjacent matrix element, R 23 and R 24 are adjacent matrix elements, so R 12 , R 13 , R 23 , R 24 will be identified as a statistical value branch or part of a statistical data branch, so R 12 , R 13 , R 23 , R 24 Will be divided into the same statistical value tree grouping, and then based on the text pairs to be classified corresponding to multiple same-cluster statistical values contained in the statistical value tree grouping, the text to be classified T1, text to be classified T2, text to be classified T3, and text to be classified T4 can be divided into the same text classification subset; based on this, the above-mentioned multiple text classification subsets can be based on the multiple statistical value tree groupings obtained based on the size relationship between each same-cluster statistical value in the above-mentioned text clustering statistical results and the preset threshold and whether two same-cluster statistical values are adjacent matrix elements in the above-mentioned text clustering statistical matrix.
[0096] Correspondingly, the above step 2, for each cluster statistical value grouping, determines the initial classification subset corresponding to the cluster statistical value grouping based on each cluster statistical value in the cluster statistical value grouping, specifically including:
[0097] For each statistical value tree grouping, based on the statistical values of the same cluster in the statistical value tree grouping, an initial classification subset corresponding to the statistical value tree grouping is determined;
[0098] Specifically, after determining multiple statistical value tree groupings, based on the row numbers and column numbers of the same-cluster statistical values, it can be known which texts to be classified are contained in the text pairs to be classified corresponding to the same-cluster statistical values. Therefore, the texts to be classified contained in the text pairs to be classified corresponding to each same-cluster statistical value in the statistical value tree grouping are divided into the same initial classification subset.
[0099] Correspondingly, the above step 3, based on the multiple initial classification subsets, determines multiple text classification subsets of the above text set to be classified, specifically including:
[0100] Based on the initial classification subsets respectively corresponding to the multiple statistical value tree groupings, multiple text classification subsets of the to-be-classified text set are determined.
[0101] Specifically, after determining the initial classification subsets, multiple initial classification subsets can be directly determined as multiple text classification subsets; however, considering that there may be a situation where a statistical value branch is interrupted because a certain cluster statistical value is less than a preset threshold, for example, for the cluster statistical value R 11 , R 21 , R 31 , R 41 , if R 11 , R 21 , R 41 are greater than the preset threshold, and R 31 If it is less than the preset threshold, then R 11 , R 21 Divide into a statistical value tree grouping, and R 41 Divided into another statistical numerical tree grouping, but the text to be classified T2 and the text to be classified T4 have the same text category as the text to be classified T1, that is, the text to be classified T1, the text to be classified T2, and the text to be classified T4 belong to the same text category. Therefore, based on whether the initial classification subsets contain the same classification text, multiple initial classification subsets can be merged to obtain multiple text classification subsets.
[0102] In a specific embodiment, still taking the above-mentioned text set to be classified including n user question sentences and the above-mentioned text clustering result including N text clustering sub-results as an example, if the above-mentioned text clustering statistical result includes a text clustering statistical matrix, in the above Figure 2 On the basis of Figure 4 As shown in the figure, a specific implementation process of a text classification method is given, which mainly includes:
[0103] Obtain n user question statements to be classified, for example, user question statement 1 to user question statement n;
[0104] Performing N text clustering processing on the n user question sentences to be classified by using a preset clustering method, and obtaining text clustering sub-results corresponding to each text clustering processing; for example, text clustering sub-results 1 to text clustering sub-results N, each text clustering sub-result includes multiple text clustering clusters, for example, text clustering sub-result 1 includes clustering clusters 11, 12, and 13, and text clustering sub-result N includes clustering clusters N1, N2, and N3;
[0105] Based on the above N text clustering sub-results, a text clustering statistical matrix is determined; wherein the above text clustering statistical matrix includes n×n same-cluster statistical values, each same-cluster statistical value corresponds to a user question sentence pair, that is, n×n user question sentence pairs are determined based on the above n user question sentences to be classified;
[0106] Based on the above text clustering statistical matrix, n×n same-cluster statistical values are numerically grouped to obtain multiple statistical value tree groups; wherein each same-cluster statistical value in the above statistical value tree group is greater than a preset threshold, and the above statistical value tree group includes multiple statistical value branches, and any two adjacent same-cluster statistical values on each statistical value branch are adjacent matrix elements;
[0107] Based on the statistical values of each same cluster in the tree-like grouping of the multiple statistical values, multiple text classification subsets corresponding to the n user question sentences to be classified are determined.
[0108] Among them, for the above (1) based on the same cluster statistical values of the text pairs to be classified and the second preset constraint condition to determine a plurality of statistical value tree grouping process, that is, based on the text clustering statistical results of a plurality of same cluster statistical values to determine the statistical value tree grouping process, specifically, each statistical value tree grouping is obtained by the following method, specifically:
[0109] Step A1, select a same-cluster statistic value as the root node from multiple ungrouped same-cluster statistic values; specifically, the ungrouped same-cluster statistic value does not include the same-cluster statistic values contained in the previously determined statistical value tree grouping (i.e., the grouped same-cluster statistic values); the grouped same-cluster statistic value is set to a specified value (such as zero), and a grouped mark can also be set for the grouped same-cluster statistic value.
[0110] Wherein, in the case where the above text clustering statistical result is a text clustering statistical matrix, based on multiple ungrouped same-cluster statistical values in the target clustering statistical matrix, a same-cluster statistical value is selected as the root node; the target clustering statistical matrix is the above text clustering statistical matrix or the intermediate clustering statistical matrix, and the intermediate clustering statistical matrix is obtained based on the above text clustering statistical matrix and the previously determined statistical values in a tree-like grouping;
[0111] Specifically, for the process of determining the first statistical value grouping, the target clustering statistical matrix is the above-mentioned text clustering statistical matrix, and each same-cluster statistical value in the target clustering statistical matrix is an ungrouped same-cluster statistical value. For the process of determining the non-first statistical value grouping, the target clustering statistical matrix is an intermediate clustering statistical matrix. In the intermediate clustering statistical matrix, except for the same-cluster statistical values included in the previously determined statistical value tree grouping, the same-cluster statistical values are ungrouped same-cluster statistical values. For example, the previously determined statistical value tree grouping includes statistical value tree grouping 1 and statistical value tree grouping 2. Then, in the process of determining statistical value tree grouping 3, the grouped same-cluster statistical values in the intermediate clustering statistical matrix used include the same-cluster statistical values included in statistical value tree grouping 1 and statistical value tree grouping 2.
[0112] Specifically, the above-mentioned intermediate clustering statistical matrix can be obtained by setting the grouped same-cluster statistical values in the above-mentioned text clustering statistical matrix to specified values (such as zero), or it can be obtained by marking the grouped same-cluster statistical values in the above-mentioned text clustering statistical matrix as grouped; wherein the grouped same-cluster statistical values are the same-cluster statistical values in the previously determined statistical value tree grouping.
[0113] Specifically, the above-mentioned root node can be a same-cluster statistical value randomly selected from multiple ungrouped same-cluster statistical values, or it can be a same-cluster statistical value selected from multiple ungrouped same-cluster statistical values according to a preset selection rule. For example, the same-cluster statistical value whose row number and column number are both the minimum among multiple ungrouped same-cluster statistical values is selected as the root node. For another example, the same-cluster statistical value whose row number and column number are both the maximum among multiple ungrouped same-cluster statistical values is selected as the root node.
[0114] Step A2, determining at least one first-level child node of the target node from the plurality of ungrouped same-cluster statistics values; wherein the target node is the root node or a K-level child node under the root node, where K is an integer greater than zero;
[0115] Specifically, for the first target node in a statistical value grouping, the target node is the root node, and for a non-first target node in a statistical value grouping, the target node is a K-level child node under the root node. For example, for the second target node, the target node is a first-level child node under the root node, that is, K is equal to 1.
[0116] Specifically, the same-cluster statistic value of the first-level child node of the target node and the row number or column number of the target same-cluster statistic value corresponding to the target node satisfy the preset association relationship. Therefore, a target node may have multiple first-level child nodes. For example, in the case where the text clustering statistical result is a text clustering statistical matrix, based on Table 1, if the target node is the same-cluster statistic value R 11 , then the first-level child nodes of the target node include the same cluster statistics R 21 , R 12 , that is, determine the cluster statistic R 11 The adjacent matrix elements of .
[0117] Step A3: if the same-cluster statistics of at least one first-level child node of the target node do not satisfy the second preset constraint condition, then at least one first-level child node of the target node is determined as the next target node;
[0118] Among them, for the case where the above-mentioned same-cluster statistical value grouping is represented by a tree structure, that is, the above-mentioned same-cluster statistical value grouping is a statistical value tree grouping, the above-mentioned second preset constraint condition may include that the same-cluster statistical value is less than a preset threshold, the row number or column number of the same-cluster statistical value is equal to n and the same-cluster statistical value is less than the preset threshold, the same-cluster statistical value is a grouped same-cluster statistical value (for example, set to a specified value or marked as grouped), and the target node does not have any of the first-level child nodes.
[0119] Step A4: if the same-cluster statistics of at least one first-level child node of the target node all meet the second preset constraint condition, the target node is determined as a leaf node, that is, the statistical value branch where at least one first-level child node of the target node is located is interrupted, and at least one first-level child node of the target node is marked as a termination node;
[0120] Step A5, if the number of at least one first-level child node is multiple, and at least one of the same-cluster statistical values of the multiple first-level child nodes of the target node does not satisfy the second preset constraint, then the first-level child node corresponding to the same-cluster statistical value that does not satisfy the second preset constraint is determined as the next target node, that is, the statistical value branch where the first-level child node corresponding to the same-cluster statistical value that satisfies the second preset constraint is located is interrupted, and the first-level child node corresponding to the same-cluster statistical value that satisfies the second preset constraint is marked as a termination node.
[0121] Step A6, determining a statistical value tree grouping based on the root node, multiple leaf nodes, and multiple child nodes between the root node and the leaf nodes.
[0122] Specifically, the above statistical value tree grouping includes multiple statistical value branches, each statistical value branch starts from a root node and ends at a leaf node, and the first-level child nodes that meet the second preset constraint condition are marked as terminal nodes.
[0123] Among them, for the process of selecting a root node from multiple ungrouped same-cluster statistical values, in order to ensure the comprehensiveness of the traversal of the same-cluster statistical values in the text clustering statistical results in the process of determining the first statistical value tree grouping, the same-cluster statistical value whose row number and column number are both the minimum or maximum value among the multiple ungrouped same-cluster statistical values can be selected as the root node; specifically, taking the selection of the same-cluster statistical value whose row number and column number are both the minimum value as the root node as an example, the above step A1, selecting a same-cluster statistical value as the root node from multiple ungrouped same-cluster statistical values, specifically includes:
[0124] Determine the first ungrouped same-cluster statistic value among the plurality of ungrouped same-cluster statistic values as the root node, wherein the row number and the column number of the first ungrouped same-cluster statistic value are both minimum values;
[0125] Correspondingly, the above step A2, determining at least one first-level child node of the target node from the above multiple ungrouped same-cluster statistics, includes:
[0126] Determine the second ungrouped same-cluster statistical value and / or the third ungrouped same-cluster statistical value among the above-mentioned multiple ungrouped same-cluster statistical values as the first-level child node; wherein the row number of the second ungrouped same-cluster statistical value is the same as the row number of the target same-cluster statistical value of the target node and the difference between the column number of the second ungrouped same-cluster statistical value and the column number of the target same-cluster statistical value is equal to a preset value, the difference between the row number of the third ungrouped same-cluster statistical value and the row number of the target same-cluster statistical value is equal to a preset value and the column number of the third ungrouped same-cluster statistical value is equal to the column number of the target same-cluster statistical value;
[0127] Specifically, for the case where the above-mentioned text clustering statistical results include a text clustering statistical matrix, the above-mentioned preset value can be equal to 1, that is, the above-mentioned second ungrouped same-cluster statistical value is the adjacent same-cluster statistical value located on the right side of the target same-cluster statistical value corresponding to the target node, and the above-mentioned third ungrouped same-cluster statistical value is the adjacent same-cluster statistical value located below the target same-cluster statistical value; wherein, the column number of the adjacent same-cluster statistical value below the target same-cluster statistical value is the same as the column number of the target node and the row number difference is 1, and the row number of the adjacent same-cluster statistical value on the right side of the target same-cluster statistical value is the same as the row number of the target node and the column number difference is 1.
[0128] Specifically, for the determination process of the first statistical value grouping, the same cluster statistical value R 11 Determined as the root node, if the target node is the root node, then at least one first-level child node of the target node includes the same cluster statistic value R 12 (i.e., the adjacent cluster statistic value to the right of the target cluster statistic value) and the cluster statistic value R 21 (i.e., the adjacent cluster statistic value below the target cluster statistic value); if the target node is a first-level child node of the root node (i.e., the cluster statistic value R 12 ), then at least one first-level child node of the target node includes the same cluster statistic value R 13 (i.e., the adjacent cluster statistic value to the right of the target cluster statistic value) and the cluster statistic value R 22 (i.e., the adjacent cluster statistic value below the target cluster statistic value); if the target node is a first-level child node of the root node (i.e., the cluster statistic value R 21 ), then at least one first-level child node of the target node includes the same cluster statistic value R 22 (i.e., the adjacent cluster statistic value to the right of the target cluster statistic value) and the cluster statistic value R 31 (i.e., the adjacent cluster statistic value located below the target cluster statistic value).
[0129] In a specific embodiment, if the text clustering statistical result includes a text clustering statistical matrix, based on Table 1, for the determination process of the first statistical value tree grouping, the root node is the same cluster statistical value R 11 For example, Figure 5 As shown in the figure, a specific implementation process of a text classification method is given, which mainly includes:
[0130] The above target clustering statistical matrix is the text clustering statistical matrix shown in Table 1. The same cluster statistical values in the text clustering statistical matrix are all ungrouped same cluster statistical values. The same cluster statistical value R is selected. 11 As the root node;
[0131] Determine the current target node R from the above text clustering statistical matrix 11 At least one first-level child node (i.e., R 12 and R 21 ), where R 12 is the statistic R of the target cluster 11 The adjacent cluster statistics on the right, R 21 is the statistic R of the target cluster 11 The adjacent cluster statistics below;
[0132] If the target node R 11 At least one first-level child node R12 and R 21 If both are greater than the preset threshold (i.e., both do not meet the second preset constraint condition), then R 12 and R 21 All are determined as the next target node;
[0133] Determine the current target node R from the above text clustering statistical matrix 12 At least one first-level child node (i.e., R 13 and R 22 ), where R 13 is the statistic R of the target cluster 12 The adjacent cluster statistics on the right, R 22 is the statistic R of the target cluster 12 The neighboring cluster statistics below; and,
[0134] Determine the current target node R from the above text clustering statistical matrix 21 At least one first-level child node (i.e., R 22 and R 31 ), where R 22 is the statistic R of the target cluster 12 The adjacent cluster statistics on the right, R 31 is the statistic R of the target cluster 12 The adjacent cluster statistics below;
[0135] If the target node R 12 The two first-level child nodes R 13 and R 22 Medium R 13 is greater than the preset threshold and R 22 Less than the preset threshold (ie R 13 The second preset constraint condition is not met, R 22 Satisfy the second preset constraint), then R 13 Determine as the next target node, and 22 The node is marked as a termination node, that is, the statistical value branch where the first-level child node that meets the second preset constraint condition is located is interrupted;
[0136] If the target node R 21 The two first-level child nodes R 22 and R 31 Medium R 31 is greater than the preset threshold and R 22 Less than the preset threshold (ie R 31 The second preset constraint condition is not met, R 22 Satisfy the second preset constraint), then R 31 Determine as the next target node, and 22The node is marked as a termination node, that is, the statistical value branch where the first-level child node that meets the second preset constraint condition is located is interrupted;
[0137] Determine the current target node R from the above text clustering statistical matrix 13 At least one first-level child node (i.e., R 14 and R 23 ), where R 14 is the statistic R of the target cluster 13 The adjacent cluster statistics on the right, R 23 is the statistic R of the target cluster 13 The neighboring cluster statistics below; and,
[0138] Determine the current target node R from the above text clustering statistical matrix 31 At least one first-level child node (i.e., R 32 and R 41 ), where R 32 is the statistic R of the target cluster 31 The adjacent cluster statistics on the right, R 41 is the statistic R of the target cluster 31 The adjacent cluster statistics below;
[0139] If the target node R 13 The two first-level child nodes R 14 and R 23 are both greater than the preset threshold (i.e., do not meet the second preset constraint condition), then R 14 and R 23 All are determined as the next target node;
[0140] If the target node R 31 The two first-level child nodes R 32 and R 41 Medium R 32 is greater than the preset threshold and R 41 Less than the preset threshold (ie R 32 The second preset constraint condition is not met, R 41 Satisfy the second preset constraint), then R 32 Determine as the next target node, and 41 The node is marked as a termination node, that is, the statistical value branch where the first-level child node that meets the second preset constraint condition is located is interrupted;
[0141] Next, determine the target node R in turn 14 , R 23 , R 32 At least one first-level child node corresponding to each of them; 14 At least one first-level child node is R 15, R 24 ; R 23 At least one first-level child node is R 24 , R 33 ; R 32 At least one first-level child node is R 33 , R 42 ; Then, based on R 15 , R 24 , R 33 , R 42 The next target node is found based on the judgment result of whether the second preset constraint condition is satisfied, until all statistical value branches are traversed to the leaf node, and the first statistical value tree grouping is obtained.
[0142] It should be noted that based on the partial traversal results shown in the figure, it can be seen that the first statistical value tree grouping includes at least R 11 , R 12 , R 13 , R 14 , R 15 , R 24 , R 23 , R 33 , R 21 , R 31 , R 32 , R 42 , the first statistical value tree grouping does not include Figure 5 The same cluster statistics are shaded in the middle, that is, they do not include the same cluster statistics R 22 and R 41 . That is to say, since the same-cluster statistical value corresponding to the termination node is less than the preset threshold, the statistical value tree grouping does not include the termination node. In addition, for the determination process of the second statistical value tree grouping, the target clustering statistical matrix includes the same-cluster statistical values in the above-mentioned text clustering statistical matrix except for the same-cluster statistical values in the first statistical value tree grouping (i.e., ungrouped same-cluster statistical values), and the above-mentioned steps A1 to A6 are executed to obtain the second statistical value tree grouping, and the third statistical value tree grouping is obtained in turn, and so on, until n×n same-cluster statistical values are all divided into corresponding statistical value tree groups; wherein, the determination process of the non-first statistical value tree grouping can refer to the determination process of the first statistical value tree grouping, and will not be repeated here.
[0143] Among them, for the process of determining the corresponding initial classification subset based on the same cluster statistical value grouping, the above step 2 determines the initial classification subset corresponding to the same cluster statistical value grouping based on each same cluster statistical value in the same cluster statistical value grouping, specifically including:
[0144] Step B1, determining the row number and column number of the same-cluster statistical values in the above-mentioned same-cluster statistical value grouping; specifically, the row number of the same-cluster statistical value corresponds to the number of one text to be classified in the text pair to be classified corresponding to the same-cluster statistical value, and the column number of the same-cluster statistical value corresponds to the number of the other text to be classified in the text pair to be classified corresponding to the same-cluster statistical value.
[0145] Step B2: if the row number and the column number are the same, the to-be-classified text corresponding to the row number or the column number is determined as the target classification text;
[0146] Step B3, if the row number and the column number are different, the text to be classified corresponding to the row number and the text to be classified corresponding to the column number are determined as target classification texts;
[0147] Step B4: based on the multiple target classification texts, determine the initial classification subset corresponding to the above-mentioned cluster statistical value grouping.
[0148] Specifically, taking the above-mentioned clustered statistical value grouping as a statistical value tree grouping as an example, since the row number of the clustered statistical value corresponds to one text to be classified, and the column number of the clustered statistical value corresponds to one text to be classified, after the statistical value tree grouping is determined, each clustered statistical value in the statistical value tree grouping corresponds to one text to be classified or two texts to be classified; for example, the clustered statistical value R 11 Corresponding to the text to be classified T1, the same cluster statistics R 21 Corresponding to the text to be classified T1 and the text to be classified T2; in addition, considering that the same cluster statistics value is R ij or R ij The corresponding pairs of texts to be classified are the same, therefore, the same cluster statistical values corresponding to the same pair of texts to be classified in the statistical value tree grouping can be deduplicated first; in addition, considering that the multiple target classification texts determined may be repeated, it is also necessary to deduplicate the multiple target classification texts to obtain the corresponding initial classification subsets.
[0149] Among them, considering that the same target classification text may exist in multiple initial classification subsets, the initial classification subsets containing the same target classification text can be merged to obtain the final text classification subset. Specifically, for the process of determining the final text classification subset based on the initial classification subsets, the above step three, based on the initial classification subsets corresponding to the above multiple statistical value tree groupings, determines multiple text classification subsets of the text set to be classified, specifically including:
[0150] Step C1, based on the multiple initial classification subsets, determining multiple classification subset combinations; wherein all the initial classification subsets in the above classification subset combinations contain at least one identical text to be classified;
[0151] Step C2, for each classification subset combination, finding the union of all initial classification subsets in the classification subset combination to obtain the target classification subset;
[0152] Step C3, based on the above multiple target classification subsets, determine multiple text classification subsets of the text set to be classified.
[0153] In addition, considering that if the same-cluster statistic value is less than the preset threshold, it means that the semantics of the two texts to be classified in the text pair to be classified corresponding to the same-cluster statistic value are relatively different, that is, they do not belong to the same text category. Therefore, if one of the texts to be classified or both of the texts to be classified in the text pair to be classified are not divided into any initial classification subset, then such classified texts can be considered as noise texts; considering that if the classified text is divided into a target classification subset, but the number of target classification texts contained in the target classification subset is relatively small, such target classification text may also be noise text. Therefore, the target classification subset with the number of texts less than the preset number threshold can be deleted, and the target classification subset with the number of texts greater than or equal to the preset threshold can be determined as the final text classification subset.
[0154] In a specific embodiment, still taking the above-mentioned text set to be classified as n user question sentences, and the above-mentioned text clustering statistical results include a text clustering statistical matrix, in the above Figure 4 On the basis of Figure 6 As shown in the figure, a specific implementation process of a text classification method is given, which mainly includes:
[0155] After determining a plurality of text classification subsets corresponding to the n user question sentences to be classified, for each text classification subset, determining a standard question sentence corresponding to the text classification subset and a standard reply sentence to the standard question sentence;
[0156] Determine each user's question sentence in the above text classification subset as a similar question sentence to the corresponding standard question sentence;
[0157] Based on the standard reply statements of the above standard question statements, the standard reply statements of the corresponding similar question statements are determined.
[0158] The text classification method in the embodiment of the present application, after obtaining the to-be-classified text set, first performs text clustering processing on the to-be-classified texts in the to-be-classified text set to obtain text clustering results; and based on the text clustering results, determines the text clustering statistics results; and then divides the to-be-classified text set into multiple text classification subsets based on the text clustering statistics results; it can be seen that the to-be-classified texts are firstly clustered, and then accurately classified based on the preliminary clustering results to obtain the final text classification results, that is, the process of dividing multiple to-be-classified texts into multiple subsets mainly involves two text processing stages: preliminary text clustering and precise text classification. In this embodiment, the text clustering result is not directly used as the final text classification result, but the text clustering statistical result is first determined based on the text clustering result, and then the text classification is performed based on the text clustering statistical result, which can improve the accuracy of text classification; further, in order to improve the accuracy of the text clustering statistical result, the above-mentioned text clustering result can include text clustering sub-results obtained by multiple text clustering operations. In this way, since the text clustering statistical result is obtained based on the text clustering sub-results of multiple text clustering operations, the accuracy of the text clustering statistical result is ensured, and the accuracy of text classification based on the text clustering statistical result can be further improved.
[0159] Corresponding to the above Figures 1 to 6 The text classification method described above is based on the same technical concept. The embodiment of the present application also provides a text classification device. Figure 7 A schematic diagram of the module composition of a text classification device provided in an embodiment of the present application, which is used to perform Figures 1 to 6 The text classification method described, such as Figure 7 As shown, the device comprises:
[0160] A text acquisition module 702 is used to acquire a set of texts to be classified;
[0161] The text clustering module 704 is used to perform clustering processing on the texts to be classified in the text set to be classified to obtain text clustering results;
[0162] A statistical result determination module 706 is used to determine text clustering statistical results based on the text clustering results; wherein the text clustering statistical results include same-cluster statistical values, and the same-cluster statistical values correspond to the text pairs to be classified;
[0163] The text classification module 708 is used to divide the to-be-classified text set into a plurality of text classification subsets based on the same cluster statistical value.
[0164] The text classification device in the embodiment of the present application, after acquiring the to-be-classified text set, first performs text clustering processing on the to-be-classified texts in the to-be-classified text set to obtain text clustering results; and based on the text clustering results, determines the text clustering statistics results; and then divides the to-be-classified text set into multiple text classification subsets based on the text clustering statistics results; it can be seen that the to-be-classified texts are firstly clustered, and then accurately classified based on the preliminary clustering results to obtain the final text classification results, that is, the process of dividing multiple to-be-classified texts into multiple subsets mainly involves two text processing stages: preliminary text clustering and precise text classification. , instead of directly taking the text clustering result as the final text classification result, the text clustering statistical result is first determined based on the text clustering result, and then text classification is performed based on the text clustering statistical result, which can improve the accuracy of text classification; further, in order to improve the accuracy of the text clustering statistical result, the above-mentioned text clustering result can include text clustering sub-results obtained by multiple text clustering operations. In this way, since the text clustering statistical result is obtained based on the text clustering sub-results of multiple text clustering operations, the accuracy of the text clustering statistical result is ensured, and the accuracy of text classification based on the text clustering statistical result can be further improved.
[0165] It should be noted that the embodiment of the text classification device in the present application and the embodiment of the text classification method in the present application are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding text classification method mentioned above, and the repeated parts will not be repeated.
[0166] Furthermore, corresponding to the above Figures 1 to 6 Based on the same technical concept, the present application also provides an electronic device for executing the above-mentioned text classification method. Figure 8 shown.
[0167] Electronic devices may have relatively large differences due to different configurations or performances, and may include one or more processors 801 and memory 802, and the memory 802 may store one or more storage applications or data. Among them, the memory 802 may be a short-term storage or a persistent storage. The application stored in the memory 802 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 801 may be configured to communicate with the memory 802 to execute a series of computer executable instructions in the memory 802 on the electronic device. The electronic device may also include one or more power supplies 803, one or more wired or wireless network interfaces 804, one or more input and output interfaces 805, one or more keyboards 806, etc.
[0168] In a specific embodiment, the electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer executable instructions for the electronic device, and the one or more programs configured to be executed by one or more processors include the following computer executable instructions:
[0169] Get the text collection to be classified;
[0170] Performing clustering processing on the texts to be classified in the text set to be classified to obtain a text clustering result;
[0171] Based on the text clustering results, determining text clustering statistics results; wherein the text clustering statistics results include cluster statistics values, and the cluster statistics values correspond to the text pairs to be classified;
[0172] Based on the cluster statistics, the to-be-classified text set is divided into a plurality of text classification subsets.
[0173] The electronic device in the embodiment of the present application, after acquiring the to-be-classified text set, first performs text clustering processing on the to-be-classified texts in the to-be-classified text set to obtain text clustering results; and based on the text clustering results, determines the text clustering statistics results; and then divides the to-be-classified text set into multiple text classification subsets based on the text clustering statistics results; it can be seen that the to-be-classified texts are firstly clustered, and then accurately classified based on the preliminary clustering results to obtain the final text classification results, that is, the process of dividing multiple to-be-classified texts into multiple subsets mainly involves two text processing stages, namely, preliminary text clustering and precise text classification. Rather than directly taking the text clustering result as the final text classification result, the text clustering statistical result is first determined based on the text clustering result, and then text classification is performed based on the text clustering statistical result, which can improve the accuracy of text classification; further, in order to improve the accuracy of the text clustering statistical result, the above-mentioned text clustering result may include text clustering sub-results obtained by multiple text clustering operations. In this way, since the text clustering statistical result is obtained based on the text clustering sub-results of multiple text clustering operations, the accuracy of the text clustering statistical result is ensured, and the accuracy of text classification based on the text clustering statistical result can be further improved.
[0174] It should be noted that the embodiment of the electronic device in the present application and the embodiment of the text classification method in the present application are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding text classification method mentioned above, and the repeated parts will not be repeated.
[0175] Furthermore, corresponding to the above Figures 1 to 6The method shown is based on the same technical concept. The embodiment of the present application also provides a computer-readable storage medium for storing computer-executable instructions. In a specific embodiment, the storage medium can be a USB flash drive, an optical disk, a hard disk, etc. When the computer-executable instructions stored in the storage medium are executed by the processor, the following process can be implemented:
[0176] Get the text collection to be classified;
[0177] Performing clustering processing on the texts to be classified in the text set to be classified to obtain a text clustering result;
[0178] Based on the text clustering results, determining text clustering statistics results; wherein the text clustering statistics results include cluster statistics values, and the cluster statistics values correspond to the text pairs to be classified;
[0179] Based on the cluster statistics, the to-be-classified text set is divided into a plurality of text classification subsets.
[0180] When the computer executable instructions stored in the storage medium in the embodiment of the present application are executed by the processor, after obtaining the set of texts to be classified, the texts to be classified in the set of texts to be classified are firstly subjected to text clustering processing to obtain text clustering results; and based on the text clustering results, the text clustering statistics results are determined; and then based on the text clustering statistics results, the set of texts to be classified is divided into multiple text classification subsets; it can be seen that the texts to be classified are firstly subjected to preliminary clustering, and then precise classification is performed based on the preliminary clustering results to obtain the final text classification results, that is, the process of dividing multiple texts to be classified into multiple subsets mainly involves preliminary text clustering and precise text classification. In these two text processing stages, the text clustering results are not directly used as the final text classification results. Instead, the text clustering statistical results are first determined based on the text clustering results, and then text classification is performed based on the text clustering statistical results, which can improve the accuracy of text classification. Furthermore, in order to improve the accuracy of the text clustering statistical results, the above-mentioned text clustering results may include text clustering sub-results obtained by multiple text clustering operations. In this way, since the text clustering statistical results are obtained based on the text clustering sub-results of multiple text clustering operations, the accuracy of the text clustering statistical results is ensured, and the accuracy of text classification based on the text clustering statistical results can be further improved.
[0181] It should be noted that the embodiment of the storage medium in the present application and the embodiment of the text classification method in the present application are based on the same inventive concept, so the specific implementation of this embodiment can refer to the implementation of the corresponding text classification method mentioned above, and the repeated parts will not be repeated.
[0182] The above describes a specific embodiment of the present application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order from that in the embodiment and still achieve the desired result. In addition, the process depicted in the drawings does not necessarily require the specific order or continuous order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, the embodiments of the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can take the form of a computer program product implemented on one or more computer-readable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the processes and / or boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0183] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0184] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory. Memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium. Computer-readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media for storing information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media, such as modulated data signals and carrier waves. It should also be noted that the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device that includes a series of elements includes not only those elements, but also other elements that are not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device that includes the elements.
[0185] The embodiments of the present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of the present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices. The various embodiments in the present application are described in a progressive manner, and the same and similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The above is only an embodiment of this document and is not intended to limit this document. For those skilled in the art, this document may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this document should be included in the scope of the claims of this document.
Claims
1. A text classification method, characterized in that: The method comprises: Get the text collection to be classified; Performing clustering processing on the texts to be classified in the text set to be classified to obtain a text clustering result; Based on the text clustering results, determining text clustering statistics results; wherein the text clustering statistics results include cluster statistics values, and the cluster statistics values correspond to the text pairs to be classified; Based on the cluster statistics, the to-be-classified text set is divided into a plurality of text classification subsets.
2. The method according to claim 1, characterized in that The step of dividing the to-be-classified text set into a plurality of text classification subsets based on the same-cluster statistical value comprises: Determining a plurality of same-cluster statistical value groups based on the plurality of same-cluster statistical values and a first preset constraint condition; For each of the same-cluster statistical value groups, determining an initial classification subset corresponding to the same-cluster statistical value group based on each same-cluster statistical value in the same-cluster statistical value group; Based on the multiple initial classification subsets, multiple text classification subsets of the to-be-classified text set are determined.
3. The method according to claim 2, characterized in that The determining of a plurality of same-cluster statistical value groups based on the plurality of same-cluster statistical values and the first preset constraint condition comprises: Determine a plurality of statistical value tree groups based on the plurality of same-cluster statistical values and a second preset constraint condition, wherein the second preset constraint condition includes the first preset constraint condition; The plurality of statistical value tree groups are determined as the plurality of same-cluster statistical value groups.
4. The method according to claim 3, characterized in that The step of determining a plurality of statistical value tree groups based on the plurality of same-cluster statistical values and a second preset constraint condition comprises: Select a same-cluster statistic value from the ungrouped same-cluster statistic values as the root node; Determine a first-level child node of a target node from the ungrouped same-cluster statistics; wherein the target node is the root node or a K-level child node under the root node, and K is an integer greater than zero; If the same-cluster statistic value of the first-level child node does not satisfy the second preset constraint condition, determining the first-level child node as the next target node; If the same-cluster statistics value of the first-level child node meets the second preset constraint condition, determining a leaf node based on the first-level child node; The statistical value tree grouping is determined based on the root node, the plurality of leaf nodes, and the plurality of child nodes between the root node and the leaf nodes.
5. The method according to claim 4, characterized in that The step of selecting a same-cluster statistical value from the ungrouped same-cluster statistical values as a root node includes: Determine a first ungrouped same-cluster statistic value among the ungrouped same-cluster statistic values as a root node, wherein the row number and the column number of the first ungrouped same-cluster statistic value are both minimum values; The step of determining the first-level child node of the target node from the ungrouped same-cluster statistical values includes: The second ungrouped same-cluster statistical value and / or the third ungrouped same-cluster statistical value in the ungrouped same-cluster statistical value are determined as first-level child nodes; wherein the row number of the second ungrouped same-cluster statistical value is the same as the row number of the target same-cluster statistical value of the target node and the difference between the column number of the second ungrouped same-cluster statistical value and the column number of the target same-cluster statistical value is equal to a preset value, the difference between the row number of the third ungrouped same-cluster statistical value and the row number of the target same-cluster statistical value is equal to the preset value and the column number of the third ungrouped same-cluster statistical value is equal to the column number of the target same-cluster statistical value.
6. The method according to claim 2, characterized in that The determining, based on each same-cluster statistical value in the same-cluster statistical value grouping, an initial classification subset corresponding to the same-cluster statistical value grouping includes: Determine the row number and column number of the same cluster statistical value in the same cluster statistical value group; If the row number and the column number are the same, the to-be-classified text corresponding to the row number or the column number is determined as the target classification text; If the row number and the column number are different, the text to be classified corresponding to the row number and the text to be classified corresponding to the column number are determined as target classification texts; Based on the plurality of target classification texts, an initial classification subset corresponding to the cluster statistical value grouping is determined.
7. The method according to claim 2, characterized in that The step of determining a plurality of text classification subsets of the to-be-classified text set based on the plurality of initial classification subsets comprises: Based on the multiple initial classification subsets, multiple classification subset combinations are determined; wherein all the initial classification subsets in the classification subset combination contain at least one identical text to be classified; For each of the classification subset combinations, obtaining a union of all initial classification subsets in the classification subset combination to obtain a target classification subset; Based on the multiple target classification subsets, multiple text classification subsets of the to-be-classified text set are determined.
8. The method according to claim 1, characterized in that The text clustering result includes text clustering sub-results obtained by multiple text clustering operations; The clustering process is performed on the texts to be classified in the text set to be classified to obtain a text clustering result, including: Determine the number m of text cluster centers; where m is an integer greater than 1; For each text clustering operation, clustering is performed on the text to be classified in the text set to be classified to obtain m text clustering clusters; and based on the m text clustering clusters, a text clustering sub-result corresponding to the text clustering operation is determined; The text clustering result is obtained based on the text clustering sub-results of the text clustering operation for multiple times.
9. The method according to claim 8, characterized in that The step of determining the number m of text clustering centers includes: Based on the number of preset text categories, determine the number m of text clustering centers; or, For each sampling operation, the number of text categories is determined based on the k texts to be classified extracted by the sampling operation; the number of text clustering centers m is determined based on the number of text categories of multiple sampling operations; wherein k is greater than 1 and less than the number of texts to be classified in the set of texts to be classified.
10. The method according to any one of claims 1 to 9, characterized in that: The text to be classified is a user question sentence extracted from historical interaction data; After dividing the to-be-classified text set into a plurality of text classification subsets based on the same cluster statistical values, the method further includes: For each of the text classification subsets, determining a standard question sentence corresponding to the text classification subset; Determine each user question sentence in the text classification subset as a similar question sentence to the standard question sentence; Based on the sentence label information of the standard question sentence, the sentence label information of the similar question sentence is determined; wherein the sentence label information includes at least one of a standard reply sentence, a user intention label, and a true category label.
11. A text processing device, characterized in that: The device comprises: A text acquisition module is used to acquire a set of texts to be classified; A text clustering module, used for clustering the texts to be classified in the text set to be classified to obtain text clustering results; A statistical result determination module, used for determining text clustering statistical results based on the text clustering results; wherein the text clustering statistical results include same-cluster statistical values, and the same-cluster statistical values correspond to the text pairs to be classified; The text classification module is used to divide the text set to be classified into multiple text classification subsets based on the same cluster statistical value.
12. An electronic device, characterized in that: The device comprises: Processor; and A memory arranged to store computer executable instructions, the executable instructions being configured to be executed by the processor, the executable instructions comprising instructions for performing the steps of the method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: The storage medium is used to store computer-executable instructions, and the executable instructions enable a computer to execute the method according to any one of claims 1 to 10.