Text processing method and device, equipment and storage medium
Patent Information
- Application Number
- CN202311139259.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-05
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-09-05
AI Technical Summary
[0003]然而,目前的聚类方法在文本数量比较大的情况下能够取得较好的聚类效果,在文本数量比较小时的聚类效果则较差
[0040]从上述的技术方案可以看出,本申请实施例提供的文本处理方法、装置、设备及存储介质,获得n个文本中各个文本的主题信息;对应获得的n个主题信息的n个可能的分类数中的任一大于1且小于n的分类数k,对n个主题信息进行1次或多次聚类处理,得到分类数k对应的1个或多个聚类结果;其中,多次聚类处理采用了至少两种相似度度量方法和/或采用了从n个主题信息中选择k个主题信息作为k个初始聚类中心的多个可能结果,不同次聚类使用不同的相似度度量方法衡量主题信息间的相似度和/或不同次聚类作为k个初始聚类中心的主题信息不同;基于得到的n个分类数对应的所有聚类结果确定n个主题信息的目标聚类结果。本申请通过穷举n个主题信息所有可能的分类数,并针对每个分类数进行了1次或多次聚类处理,基于所有可能的分类数对应的所有聚类结果确定n个主题信息的目标聚类结果,提高了文本数量较小情况下的聚类效果,而且由于文本数量较少,相应的主题信息量也较小,不会降低处理效率。
Smart Images

Figure CN117150332B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and more specifically, to a text processing method, apparatus, device, and storage medium. Background Technology
[0002] Currently, to help users quickly find the text they need from multiple texts, the topic information of each text is extracted, and then the topic information of each text is clustered. The clustered topic information is then displayed to the user, making it easier for the user to understand the content of each text based on the clustered topic information.
[0003] However, current clustering methods achieve good clustering results when the amount of text is large, but poor clustering results when the amount of text is small. Summary of the Invention
[0004] In view of this, this application provides a text processing method, apparatus, device, and storage medium to improve the clustering effect when the amount of text is small.
[0005] To achieve the above objectives, the following solution is proposed:
[0006] A text processing method, comprising:
[0007] Obtain the topic information of each of the n texts;
[0008] For any number k greater than 1 and less than n among the n possible number of categories of the obtained n topic information, perform one or more clustering processes on the n topic information to obtain one or more clustering results corresponding to the number of categories k; wherein, the multiple clustering processes adopt at least two similarity measurement methods and / or adopt multiple possible results of selecting k topic information as k initial cluster centers from the n topic information, and different similarity measurement methods are used to measure the similarity between topic information in different clusterings and / or the topic information used as k initial cluster centers in different clusterings is different;
[0009] The target clustering result for the n topic information is determined based on all clustering results corresponding to the obtained n classification numbers.
[0010] Optionally, the above method may involve performing multiple clustering processes on the n topic information items, including:
[0011] Obtain multiple combinations from which k different topic information is selected as a single combination from the n topic information;
[0012] For any group of k topic information, using the k topic information in that group as k initial cluster centers, perform a clustering process on the n topic information to obtain a clustering result corresponding to that group; or...
[0013] For any group of k topic information, the k topic information in any group is used as the k initial cluster centers. The n topic information is then subjected to m clustering processes to obtain m clustering results corresponding to any group. Here, m is an integer greater than 1. In the m clustering processes, the initial cluster centers of different clustering processes are the same, and different similarity measurement methods are used to measure the similarity between topic information in different clustering processes.
[0014] Optionally, the above method may involve performing one or more clustering operations on the n topic information items, including:
[0015] Select k distinct topic information from the n topic information information as the target initial cluster centers;
[0016] Based on the initial cluster centers, perform a clustering process on the n topic information to obtain a clustering result; or...
[0017] Based on the target initial cluster center, the n topic information is subjected to m clustering processes to obtain m clustering results; where m is an integer greater than 1. In the m clustering processes, the initial cluster center of each clustering is the target initial cluster center, and different similarity measurement methods are used to measure the similarity between topic information in different clustering processes.
[0018] Optionally, in the above method, determining the target clustering result for the n topic information based on all clustering results corresponding to the obtained n classification numbers includes:
[0019] Obtain the evaluation index for each clustering result among all the clustering results;
[0020] When the n topic information is clustered once or multiple times, and the same similarity metric is used to measure the similarity between topic information in different clustering processes, the clustering result with the best evaluation index is selected as the target clustering result.
[0021] Optionally, in the above method, the first clustering method is used to cluster the n topic information in each clustering process;
[0022] The step of determining the target clustering result for the n topic information based on all clustering results corresponding to the obtained n classification numbers includes:
[0023] Obtain the evaluation index for each clustering result among all the clustering results;
[0024] When multiple clustering processes are performed on the n topic information, and m similarity measurement methods are used in the multiple clustering processes, the clustering result with the best evaluation index is selected from the clustering results corresponding to the same similarity measurement method.
[0025] Based on the optimal clustering result of the evaluation index corresponding to each similarity measurement method, any two topics among the n topics that belong to the same category are voted on, and the proportion of votes received by any two topics is determined as the voting similarity of any two topics.
[0026] Based on the voting similarity among topic information, the n topic information are clustered using a second clustering method to obtain the target clustering result.
[0027] Optionally, the first clustering method includes K-means clustering; the second clustering method includes hierarchical clustering or maximum-minimum distance clustering.
[0028] The above methods may optionally include:
[0029] Output the n topic information according to the target clustering result;
[0030] Obtain a source tracing instruction for any type of topic information, and retrieve the various texts associated with the any type of topic information;
[0031] Output the text associated with any of the aforementioned topic information.
[0032] A text processing apparatus, the apparatus comprising:
[0033] The acquisition module is used to obtain the topic information of each text in n texts;
[0034] The clustering module is used to perform one or more clustering processes on the n topic information for any one of the n possible classification numbers greater than 1 and less than n, corresponding to any classification number k among the n possible classification numbers of the obtained n topic information, to obtain one or more clustering results corresponding to the classification number k; wherein, the multiple clustering processes adopt at least two similarity measurement methods and / or adopt multiple possible results of selecting k topic information as k initial cluster centers from the n topic information, and different similarity measurement methods are used to measure the similarity between topic information in different clusterings and / or the topic information used as k initial cluster centers in different clusterings is different;
[0035] The determination module is used to determine the target clustering result of the n topic information based on all clustering results corresponding to the obtained n classification numbers.
[0036] A text processing device, including a memory and a processor;
[0037] The memory is used to store programs;
[0038] The processor is configured to execute the program to implement the various steps of the text processing method as described in any of the preceding claims.
[0039] A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the text processing method as described in any of the preceding claims.
[0040] As can be seen from the above technical solutions, the text processing method, apparatus, device, and storage medium provided in this application embodiment obtain the topic information of each text in n texts; corresponding to any number k greater than 1 and less than n among the n possible number of categories of the obtained n topic information, perform one or more clustering processes on the n topic information to obtain one or more clustering results corresponding to the number k; wherein, the multiple clustering processes adopt at least two similarity measurement methods and / or adopt multiple possible results of selecting k topic information as k initial cluster centers from the n topic information, different similarity measurement methods are used to measure the similarity between topic information in different clusterings and / or the topic information used as k initial cluster centers in different clusterings is different; the target clustering result of the n topic information is determined based on all clustering results corresponding to the obtained n number of categories. This application exhaustively enumerates all possible categories of n topic information and performs clustering processing once or multiple times for each category. Based on all clustering results corresponding to all possible categories, the target clustering result of n topic information is determined, which improves the clustering effect when the amount of text is small. Moreover, since the amount of text is small, the corresponding amount of topic information is also small, so the processing efficiency is not reduced. Attached Figure Description
[0041] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0042] Figure 1 This is a flowchart illustrating an implementation of the text processing method disclosed in an embodiment of this application;
[0043] Figure 2 This is a flowchart illustrating an implementation of multiple clustering processes for n topic information disclosed in an embodiment of this application.
[0044] Figure 3This is a flowchart illustrating another implementation of multiple clustering processes for n topic information disclosed in an embodiment of this application;
[0045] Figure 4 This is a flowchart illustrating an implementation of clustering n topic information once or multiple times, as disclosed in an embodiment of this application.
[0046] Figure 5 This is a flowchart illustrating another implementation of clustering n topic information once or multiple times as disclosed in an embodiment of this application.
[0047] Figure 6 This is a flowchart illustrating an implementation of determining a target clustering result for n topic information based on all clustering results corresponding to the obtained n classification numbers, as disclosed in an embodiment of this application.
[0048] Figure 7 This is another implementation flowchart of determining the target clustering result of n topic information based on all clustering results corresponding to the obtained n classification numbers, as disclosed in the embodiments of this application;
[0049] Figure 8 This is an example diagram of the voting strategy disclosed in the embodiments of this application;
[0050] Figure 9 This is a schematic diagram of the structure of a text processing device disclosed in an embodiment of this application;
[0051] Figure 10 This is a hardware structure block diagram of the text processing device disclosed in the embodiments of this application. Detailed Implementation
[0052] Before describing the solution proposed in this application, the relevant concepts will be explained.
[0053] Prompt: When conversing with AI (such as a large language model), you need to send instructions to the AI. It can be a text description, such as "Please recommend a popular song for me" when you talk to the AI, or it can be a parameter description in a certain format, such as describing the relevant drawing parameters to ask the AI to draw a picture in a certain format.
[0054] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0055] Text generation is a key focus of natural language processing and represents the cutting edge of artificial intelligence. By understanding and summarizing themes from user-input text, machines can directly generate thematic information for the text. Users can quickly grasp the overall content of the text by viewing the thematic information, saving them significant time from reading the text itself. However, the sheer volume of text can make reading and searching difficult. To address this, text topic clustering technology has emerged. The purpose of text topic clustering is to group topic sentences from multiple long texts together, grouping semantically similar topic sentences into one category to facilitate user searching and recommendations.
[0056] Current text topic clustering techniques still have some limitations. For example, different clustering algorithms may yield different results for the same dataset. This is due to the inherent randomness of clustering algorithms and the diversity of text data. Therefore, when clustering text topics, careful selection of clustering algorithms and parameters is necessary to ensure accurate results. Furthermore, even with the optimal clustering algorithm and parameters, current algorithms require a large amount of data; that is, they only produce accurate clustering results with a large volume of text, and their performance is poor with a small volume of text.
[0057] This application is proposed to improve clustering performance when the number of texts is small.
[0058] like Figure 1 The diagram shown is a flowchart of one implementation of the text processing method provided in this application, which may include:
[0059] Step S101: Obtain the topic information of each text in the n texts.
[0060] Since one topic information is obtained for each text, a total of n topic information are obtained.
[0061] As an example, the topic information of each text can be read from memory. That is, the topic of each of the n texts can be extracted in advance, the topic information of each text can be obtained and stored, and when the topic information of each text in the n texts is needed, it can be read directly from memory.
[0062] As an example, the topic can be extracted from each of the n texts in real time to obtain the topic information of each text.
[0063] Whether the topic information is extracted in advance or in real time, it can be extracted using any of the following methods.
[0064] Method 1: For any text, perform discourse normalization on the text (including but not limited to: removing stop words, removing redundant, erroneous and other invalid information) to obtain normalized text. Then, use a pre-trained text topic generation model to process the normalized text and generate topic information for the text.
[0065] When the text is long, the topic information generated based on method one is prone to losing semantic information. In order to reduce the loss of semantic information by topic information, method two can be used to extract topic information.
[0066] Method 2: For any given text, perform discourse segmentation (e.g., segment by chapter or by paragraph) to obtain multiple short texts corresponding to that text, forming a short text group. Perform discourse normalization on each short text in the short text group (including but not limited to: removing stop words, redundant, erroneous, and other invalid information) to obtain a new short text group. Use a pre-trained text topic generation model to process each short text in the new short text group separately, generating topic information for each short text in the new short text group. Combine the topic information of each short text (the topic information can be concatenated according to the order in which the short texts appear within the given text) to obtain the topic information of the given text.
[0067] Optionally, the text topic generation model in this application can be a generative model, such as a large language model. As an example, generative models can include, but are not limited to, models with a Transformer architecture, such as GPT (Generative Pre-Training)-3, GPT-4, etc. Generative models can also be other generative models, such as PaLM (Pathways Language Model), T5 (Text-to-Text Transfer Transformer), Bart, etc.
[0068] As an example, for the normalized text, a first topic generation instruction can be constructed based on the normalized text. This first topic generation instruction is then input into a pre-trained text topic generation model to obtain the topic information of any given text generated by the model. The first topic generation instruction includes the normalized text and instructs the text topic generation model to generate the topic information of the normalized text (i.e., the topic information of any given text).
[0069] As an example, for any short text, a second topic generation instruction can be constructed based on that short text. This second topic generation instruction is then input into a pre-trained text topic generation model to obtain the topic information of that short text generated by the text topic generation model. The second topic generation instruction includes the short text and instructs the text topic generation model to generate the topic information of that short text.
[0070] Optionally, the text topic model in this application can also be a non-generative model, such as an LDA (Latent Dirichlet Allocation) model.
[0071] Step S102: For any number of possible categories greater than 1 and less than n (i.e., k = 2, 3, ..., n-2, n-1) among the n possible categories of the obtained n topic information, perform clustering processing once or multiple times on the above n topic information to obtain one or more clustering results corresponding to the number of categories k.
[0072] In this process, multiple clustering processes employ at least two similarity measurement methods and / or multiple possible results of selecting k topic information as k initial cluster centers from n topic information. Different clustering processes use different similarity measurement methods to measure the similarity between topic information and / or the topic information used as k initial cluster centers in different clustering processes is different.
[0073] The minimum number of clusters obtained by clustering n topic information is 1 (i.e., at least n topic information can be divided into one class) and the maximum number is n (i.e., at most n topic information can be divided into n classes), resulting in a total of n possible number of clusters. In other words, this application exhaustively enumerates all possible number of clusters for n topic information, and for each number of clusters, clusters are performed on the n topic information separately. For each number of clusters, clustering can be performed only once or multiple times.
[0074] When k=1, it means that n topics belong to one class, and there is only one case, so no clustering step is needed. When k=n, it means that each topic belongs to one class, and there is also only one case, so no clustering step is needed.
[0075] The clustering process requires measuring the similarity between topic information. Based on this, in the case of multiple clustering, only one similarity measurement method can be used to measure the similarity between topic information, or at least two similarity measurement methods can be used to measure the similarity between topic information. However, only one similarity measurement method is needed for a single clustering.
[0076] The clustering process requires selecting k topics from n topics as k initial cluster centers, with each initial cluster center corresponding to a category. Based on this, one approach is to select k topics from the n topics only once, or to select multiple times, choosing k topics as a combination each time, until a predetermined number of combinations containing k topics are obtained from the n topics. However, each clustering operation only uses the k topics from one combination as cluster centers to cluster the n topics. In other words, for the number of categories k, this application can enumerate all combinations or partial combinations of all combinations containing k topics from the n topics, using the k topics from each combination as a set of possible initial cluster centers for clustering.
[0077] Step S103: Determine the target clustering result for the above n topic information based on all clustering results corresponding to the obtained n classification numbers.
[0078] Optionally, the optimal clustering result can be selected as the target clustering result from all clustering results corresponding to n categories. Alternatively, other methods can be used to determine the target clustering result.
[0079] The text processing method provided in this application, after obtaining the topic information of each of the n texts, performs one or more clustering operations on the n topic information for any of the n possible classification numbers greater than 1 and less than n, corresponding to any classification number k among the n possible classification numbers of the obtained n topic information, to obtain one or more clustering results corresponding to classification number k. The multiple clustering operations employ at least two similarity measurement methods and / or employ multiple possible results of selecting k topic information as k initial cluster centers from the n topic information. Different clustering operations use different similarity measurement methods to measure the similarity between topic information and / or the topic information used as k initial cluster centers in different clustering operations is different. The target clustering result for the n topic information is determined based on all clustering results corresponding to the obtained n classification numbers. This application improves the clustering effect when the number of texts is small, and since the number of texts is small, the corresponding amount of topic information is also small, thus not reducing processing efficiency.
[0080] In an optional embodiment, the flowchart for implementing the above-described multiple clustering process for n topic information is as follows: Figure 2 As shown, it may include:
[0081] Step S201: Obtain multiple sets of k distinct topic information from n topic information (denoted as h for ease of description and distinction). k one; h k (A combination of integers greater than 1). That is, h is the combination of n topic information items. k Each combination contains k different topic information, and there is at least one different topic information in different combinations.
[0082] Suppose we want to select k different topics from n topics, and there are g possible combinations. Then:
[0083]
[0084] Then h k Less than or equal to g. If h k The value equals g, indicating that all possible combinations of k categories with k topic information points as k cluster centers have been exhaustively enumerated. In h... k If the value is less than g, it can be selected randomly or according to preset rules.
[0085] For different numbers of categories, h k The values of h can be the same or different. k In different situations, the more possible combinations corresponding to the number of categories, the higher the h. k The larger the value, the better.
[0086] Step S202: For any group of k topic information, use the k topic information in any group as k initial cluster centers, perform a clustering process on the n topic information to obtain a clustering result corresponding to any group.
[0087] During the clustering process of n topic information, any one of the above-mentioned similarity measurement methods can be used to measure the similarity between pairs of topic information.
[0088] In this embodiment, the same similarity metric method is used for different clustering sub-clusters; therefore, each number of categories corresponds to h. k If there are n clustering results, then the total number of clustering results corresponding to n categories is 1. indivual.
[0089] In an optional embodiment, another implementation flowchart for performing multiple clustering processes on n topic information is as follows: Figure 3 As shown, it may include:
[0090] Step S301: Obtain multiple sets (denoted as h) of k distinct topic information selected from n topic information to form a combination. k(a) combination.
[0091] Get h k The process of combining each element can be found in step S201, and will not be repeated here.
[0092] Step S302: For any group of k topic information, take the k topic information in any group as k initial cluster centers, perform m clustering processes on the n topic information to obtain m clustering results corresponding to any group.
[0093] Where m is an integer greater than 1, in m clustering processes, the initial cluster centers of different clustering processes are the same (that is, the initial cluster centers are all k topic information in any combination), and different similarity measurement methods are used to measure the similarity between topic information in different clustering processes.
[0094] In other words, corresponding to h k Each of the combinations involves performing m clustering operations on n topic information, resulting in m clustering results. Different clustering operations for the same combination use different similarity metrics to measure the similarity between topic information; therefore, different clustering results for the same combination correspond to different similarity metrics. Based on this, each number of categories k greater than 1 and less than n corresponds to h. k If there are ×m clustering results, then the total number of clustering results corresponding to n categories is indivual.
[0095] In an optional embodiment, a flowchart illustrating one method of performing clustering processing on n topic information once or multiple times is shown below. Figure 4 As shown, it may include:
[0096] Step S401: Select k distinct topic information from the n topic information as k target initial cluster centers.
[0097] Optionally, k different topic information can be randomly selected from n topic information as k target initial cluster centers, or k different topic information can be selected from n topic information as k target initial cluster centers according to preset rules.
[0098] Step S402: Based on the k initial cluster centers, perform a clustering process on the n topic information to obtain a clustering result.
[0099] During the clustering process of n topic information, any one of the above-mentioned similarity measurement methods can be used to measure the similarity between pairs of topic information.
[0100] In this embodiment, for each number of categories, the initial cluster center is selected only once (i.e., there is only one type of initial cluster center), and a similarity metric is used to measure the similarity between pairs of topic information. Therefore, each number of categories corresponds to one clustering result, and there are a total of n clustering results for n categories.
[0101] In an optional embodiment, another implementation flowchart for performing one or more clustering processes on n topic information is shown below. Figure 5 As shown, it may include:
[0102] Step S501: Select k different topic information from n topic information as k target initial cluster centers.
[0103] For details on the implementation method, please refer to step S401. The specific implementation process will not be elaborated here.
[0104] Step S502: Based on the k initial cluster centers, perform m clustering processes on the n topic information to obtain m clustering results.
[0105] Where m is an integer greater than 1, in m clustering processes, the initial cluster centers of different clustering processes are the target initial cluster centers, and different similarity measurement methods are used to measure the similarity between topic information in different clustering processes.
[0106] In other words, different clustering processes corresponding to the same number of categories use different similarity measurement methods to measure the similarity between topic information. Therefore, different clustering results among the m clustering results corresponding to the same number of categories correspond to different similarity measurement methods. Based on this, each number of categories greater than 1 and less than n corresponds to m clustering results, so the total number of clustering results corresponding to n categories is 2 + (n-2) × m.
[0107] In an optional embodiment, the above-mentioned at least two similarity measurement methods may include, but are not limited to, at least two of the following four similarity measurement methods: Levenshtein Ration algorithm, TextRank algorithm, TF-IDF-based similarity measurement algorithm, and Word2Vec-based similarity measurement algorithm. The above four similarity measurement methods will be described below in conjunction with topic information 1 and topic information 2 (topic information 1 and topic information 2 are any two of the above n topic information).
[0108] (1) The implementation of the Levenshtein Ration algorithm is as follows:
[0109] Calculate the Levenshtein distance between topic information 1 and topic information 2: The Levenshtein distance is the minimum number of edits (such as modification, insertion, and deletion) required when changing from one string to another. For example, the Levenshtein distance between "kitten" and "sitting" is 3. The minimum steps to change "kitten" to "sitting" are: "kitten → sitten" (changing "k" to "s"), "sitting" → "sitting" (changing "e" to "i"), "sitting" → "sitting" (adding "g" at the end). Therefore, the Levenshtein distance between topic information 1 and topic information 2 is the minimum number of edits required when changing from topic information 1 to topic information 2.
[0110] Calculate the similarity r between topic information 1 and topic information 2:
[0111] r = (sum - ldist) / sum
[0112] Where sum refers to the total length of topic information 1 and topic information 2, and ldist is the Levenshtein distance between topic information 1 and topic information 2.
[0113] (2) The implementation of the TextRank algorithm is shown below:
[0114] Perform word segmentation on topic information 1 and topic information 2 respectively to obtain the word sequence result corresponding to topic information 1 (denoted as S1 = w1, w2, ..., w i The word sequence results corresponding to topic information 2 (denoted as S2 = w1, w2, ..., w) and topic information 2 (denoted as S2 = w1, w2, ..., w) i ,);
[0115] Calculate the similarity r between topic information 1 and topic information 2:
[0116]
[0117] Among them, w a The numerator represents the number of identical words that appear in both topic information 1 and topic information 2, and the denominator is the sum of the logarithms of the number of words in topic information 1 and topic information 2.
[0118] (3) The implementation of the similarity measurement algorithm based on the TF-IDF algorithm is as follows:
[0119] The TF-IDF algorithm is a statistical method used to evaluate the importance of a word to a document within a document set or corpus. The importance of a word increases proportionally to its frequency of occurrence in the document. For ease of explanation, the following examples (Sentence 1: This garment is too big, which size fits better.) and (Sentence 2: This garment is not small, which one fits better?) illustrate the implementation steps of the TF-IDF algorithm:
[0120] By segmenting Chinese words, a complete sentence is divided into independent sets of words according to the segmentation algorithm.
[0121] The word segmentation result of sentence 1 is: This / clothes / size / is / too big / , / that / size / is / suitable / .
[0122] The word segmentation result of sentence 1 is: This / clothes / size / is / not / small / , / that / is / more / suitable / .
[0123] Find the union of two word sets and use it as the total dictionary.
[0124] The overall dictionary based on the word sets of sentences 1 and 2 above is "This / clothes / size / too big / that / more / suitable / not / small / , / .".
[0125] The word frequencies of each word set are calculated using the overall dictionary and then vectorized.
[0126] For sentence 1, the word frequencies of each word in the general dictionary are "this 1 / clothes 1 / size 2 / too big 1 / that 1 / more 0 / suitable 1 / not 0 / small 0 / ,1 / 。1", then the word frequency vector corresponding to sentence 1 is {1,1,2,1,1,0,1,0,0,1,1}.
[0127] For sentence 2, the word frequencies of each word in the general dictionary are "this 1 / clothes 1 / size 1 / too big 0 / that 1 / more 1 / suitable 1 / not 1 / small 1 / ,1 / 。1", then the word frequency vector corresponding to sentence 2 is {1,1,1,0,1,1,1,1,1,1,1}.
[0128] Calculate the cosine of the angle between word frequency vectors as the similarity between sentences.
[0129] The cosine of the angle between the word frequency vectors of sentence 1 and sentence 2 is 0.76.
[0130] (4) The implementation of the Word2Vec-based similarity measurement algorithm is shown below:
[0131] The Word2Vec algorithm is a classic word embedding algorithm that trains a two-layer neural network to represent the relationships between word pairs, mapping each word to a vector. The steps for calculating the similarity between topic information 1 and topic information 2 based on Word2Vec are as follows:
[0132] By using Chinese word segmentation, topic information 1 and topic information 2 are divided into independent word sets according to the word segmentation algorithm. For specific word segmentation methods, please refer to the aforementioned word segmentation methods for sentences, which will not be repeated here.
[0133] The Word2Vec algorithm is used to map words in the word set into word vectors.
[0134] The average value of the word vectors in topic information 1 is used as the vector of topic information 1; the average value of the word vectors in topic information 2 is used as the vector of topic information 2.
[0135] Calculate the cosine of the angle between the vector of topic information 1 and the vector of topic information 2, and use it as the similarity between topic information 1 and topic information 2.
[0136] In an optional embodiment, the flowchart for determining the target clustering result of n topic information based on all clustering results corresponding to the obtained n classification numbers is as follows: Figure 6 As shown, it may include:
[0137] Step S601: Obtain the evaluation index of each cluster result in all clustering results.
[0138] As an example, the silhouette coefficient of each clustering result can be calculated as an evaluation metric. The silhouette coefficient describes the clarity of the outlines of each clustered category. It includes two factors: cohesion and separation. Cohesion can be understood as reflecting the closeness of a topic to other topics within the same cluster, while separation can be understood as reflecting the closeness of a topic to other topics outside the same cluster. For any given clustering result, the silhouette coefficient is determined by the silhouette coefficient of each topic corresponding to that clustering result. Furthermore, the silhouette coefficient of any given topic is determined by its cohesion and separation. Specifically, the silhouette coefficient of any clustering result can be obtained by averaging the silhouette coefficients of each topic information corresponding to that clustering result. The silhouette coefficient of any topic information corresponding to that clustering result can be calculated as follows: Obtain the separation (minimum distance from any topic information to all categories that do not contain that topic information; the distance from any topic information to any category that does not contain that topic information is the average distance from any topic information to all topic information belonging to that category) and cohesion (average distance from any topic information to other topic information in its category). Determine the maximum value between the separation and cohesion of that topic information. Calculate the difference between the separation and cohesion of that topic information. The ratio of this difference to the maximum value is determined as the silhouette coefficient of that topic information corresponding to that clustering result. The value range of the silhouette coefficient of any clustering result is [-1, 1]. The larger the silhouette coefficient, the better the clustering effect of that clustering result.
[0139] This application does not limit the evaluation metrics for clustering results; other evaluation metrics, such as the Calinski-Harabaz index, may also be used.
[0140] Step S602: When performing one or more clustering processes on n topic information, and using the same similarity metric to measure the similarity between topic information in different clustering processes, select the clustering result with the best evaluation index as the target clustering result.
[0141] In other words, if each number of categories is used to perform clustering processing on n topic information once or multiple times, and the same similarity metric is used to measure the similarity between topic information in different clustering processes, then the clustering result with the best evaluation index can be directly selected from all the clustering results corresponding to the n categories as the target clustering result.
[0142] In an optional embodiment, when performing clustering processing on n topic information once or multiple times, each clustering process uses a first clustering method to cluster the n topic information. As an example, the first clustering method can be K-means clustering (i.e., the K-Means algorithm).
[0143] The K-Means algorithm is an unsupervised learning algorithm. Assume there are n topics, x1, x2, x3, ..., x... n For any number of categories k and any k distinct topic information, the clustering process based on these k distinct topic information as k initial cluster centers includes:
[0144] For any given topic, calculate the distance from that topic to each cluster center, and assign that topic to the cluster containing the nearest cluster center. After all n topics have been assigned to their respective clusters, update the cluster centers of each cluster. Then, return to the previous steps of calculating the distance from each topic to each cluster center and assigning it to the cluster containing the nearest cluster center, and repeat these steps until the cluster centers no longer change or change very little. After clustering, the topics within a cluster belong to one category.
[0145] For any given cluster, the cluster center can be updated in the following ways: taking each topic information in the cluster as the cluster center, calculate the sum of the distances from each topic information in the cluster to the cluster center, or calculate the mean of the distances from each topic information to the cluster center; take the cluster center corresponding to the minimum sum of distances as the new cluster center of the given cluster, or take the cluster center corresponding to the minimum mean as the new cluster center of the given cluster.
[0146] The K-Means algorithm typically selects initial cluster centers randomly, which greatly affects subsequent clustering results and makes it difficult to converge when updating cluster centers. Furthermore, the selection of the number of groups (i.e., the number of categories) in the K-Means algorithm is generally based on experience, which also increases the uncertainty of the clustering results and reduces the robustness of the clustering algorithm.
[0147] Based on this application, the instability of clustering results caused by randomly selecting the number of groups and randomly initializing cluster centers can be reduced, and the computational cost is within an acceptable range, at least partially overcoming the problems of the K-Means algorithm.
[0148] Of course, the first clustering method in this application can also be other clustering algorithms, as long as all possible clustering results of the clustering method can be enumerated. That is, the first clustering method is a clustering method that, for any sample set, can enumerate all possible clustering results of that sample set based on the first clustering method.
[0149] As an example, this application achieves good results when n is no more than 20. Of course, the value of n in this application can be greater than 20, but the computational load will increase as n increases.
[0150] In an optional embodiment, another implementation flowchart for determining the target clustering result of n topic information based on all clustering results corresponding to the obtained n classification numbers is shown below. Figure 7 As shown, it may include:
[0151] Step S701: Obtain the evaluation index of each cluster result in all clustering results.
[0152] For details on the implementation process, please refer to step S601, which will not be repeated here.
[0153] Step S702: When multiple clustering processes are performed on n topic information and m similarity measurement methods are used in the multiple clustering processes, select the clustering result with the best evaluation index from the clustering results corresponding to the same similarity measurement method.
[0154] In other words, for each number of categories, the n topic information are clustered multiple times, and m similarity measurement methods are used in the multiple clustering processes. Then, the clustering result with the best evaluation index is selected from the clustering results of the same similarity measurement method under all categories. In this way, for each similarity measurement method, a clustering result with the best evaluation index is obtained, that is, a total of m clustering results with the best evaluation index are obtained.
[0155] Step S703: Based on the optimal clustering result of the evaluation index corresponding to each similarity measurement method, vote on any two topics among the n topics that belong to the same class, and determine the voting similarity of any two topics as the proportion of votes received.
[0156] For ease of calculation, an n×n similarity matrix, denoted as M1, can be constructed based on the optimal clustering results for each similarity metric. n×n The matrix element M1(i,j) describes the similarity between topic information i and topic information j. If topic information i and topic information j are in the same category, then M1(i,j) = 1, otherwise M1(i,j) = 0.
[0157] For each of the m similarity measurement methods, a total of m similarity matrices are obtained. The average of these m similarity matrices yields the voting result. The voting result is also an n×n matrix, denoted as M². n×n The matrix element M2(i,j) describes the voting similarity between topic information i and topic information j.
[0158] like Figure 8 The diagram shown is an example of the voting strategy provided in an embodiment of this application. In this example, it is assumed that there are 7 topics, denoted as x1, x2, x3, x4, x5, x6, and x7. When clustering these 7 topics, four similarity measurement methods are used to measure the similarity between them. The similarity matrices corresponding to the optimal clustering results of the four similarity measurement methods are represented as M11, M12, M13, and M14, respectively. The voting result is M2, obtained by averaging the four matrices. Wherein, M11 represents the clustering result as follows: x1 and x2 are grouped together, x3, x4 and x5 are grouped together, and x6 and x7 are grouped together; M12 represents the clustering result as follows: x1, x4 and x5 are grouped together, x2 and x3 are grouped together, and x6 and x7 are grouped together; M13 represents the clustering result as follows: x1 and x2 are grouped together, x3 and x4 are grouped together, and x5, x6 and x7 are grouped together; M14 represents the clustering result as follows: x1 is grouped together, x2 and x3 are grouped together, x4 and x5 are grouped together, and x6 and x7 are grouped together.
[0159] Step S704: Based on the voting similarity between topic information, the second clustering method is used to cluster the n topic information to obtain the target clustering result.
[0160] The second clustering method differs from the first clustering method.
[0161] When using the second clustering method to cluster n topic information, this application adopts voting similarity to determine the similarity between topic information.
[0162] Optionally, the second clustering method can be a hierarchical clustering method, or it can be the maximum-minimum distance method.
[0163] The hierarchical clustering method can be used to cluster n topics as follows:
[0164] 1. Each topic information is classified as a category, and there are a total of n categories.
[0165] 2. Let dist = 1 - M2(i,j) be the distance between topic information i and topic information j.
[0166] 3. Calculate the pairwise distances between all classes, and merge the two classes with the closest pairwise distances into a larger class. Alternatively, for any two classes, the maximum distance between all pairwise topic information items in those two classes can be used as the distance between those two classes.
[0167] 4. Repeat step 3 until the distance between any two classes is 1, and then you will get the final clustering result.
[0168] The method of clustering n topic information using the maximum-minimum distance method can be implemented as follows:
[0169] 1. Let dist = 1 - M2(i,j) be the distance between topic information i and topic information j.
[0170] 2. Calculate cluster centers:
[0171] 2.1 Select any topic information as the first cluster center Z1.
[0172] 2.2 Select the topic information that is farthest from the first cluster center Z1 as the second cluster center Z2.
[0173] 2.3 For any topic information that is not a cluster center, determine the minimum distance between that topic information and each cluster center.
[0174] 2.4. Determine the maximum distance among all minimum distances. If the ratio of this maximum distance to ||Z1-Z2|| is greater than or equal to the target ratio, select the topic information corresponding to the maximum distance as a new cluster center and return to steps 2.3-2.4; otherwise, the cluster center calculation step ends.
[0175] ||Z1-Z2|| represents the distance between the first cluster center Z1 and the second cluster center Z2.
[0176] 3. For any topic information that is not a cluster center, classify the topic information into the category represented by the cluster center that is closest to the topic information.
[0177] In an optional embodiment, after determining the target clustering result, the application may further include:
[0178] Output the clustering results of n topic information according to the target.
[0179] For example, topics categorized together can be displayed side-by-side, making it easier for users to distinguish between them. Additionally, different categories of topics can be displayed with different visual effects, such as using different colors, to further aid user differentiation.
[0180] Obtain a source tracing instruction for any type of topic information, and retrieve the various texts associated with that type of topic information.
[0181] After extracting the topic information from each text, this application stores the topic information in association with the corresponding text.
[0182] When displaying topic information, this application shows interactive controls for each category. Users can trigger the generation of topic information for the corresponding class of the interactive control by performing preset operations on the interactive control (such as single-click or double-click).
[0183] Output the text associated with any of the above-mentioned topic information.
[0184] The text content of one topic from any of the above-mentioned topic information can be displayed first, and the related text of other topic information from any of the above-mentioned topic information can be displayed when the user selects to display them.
[0185] Corresponding to the method embodiments, this application also provides a text processing apparatus. A schematic diagram of the structure of the text processing apparatus provided in this application embodiment is shown below. Figure 9 As shown, it may include:
[0186] The module consists of an acquisition module 901, a clustering processing module 902, and a determination module 903; among which,
[0187] Module 901 is used to obtain the topic information of each text in n texts;
[0188] The clustering processing module 602 is used to perform one or more clustering processes on the n topic information for any of the n possible classification numbers greater than 1 and less than n, corresponding to any classification number k among the n possible classification numbers of the obtained n topic information, to obtain one or more clustering results corresponding to the classification number k; wherein, the multiple clustering processes adopt at least two similarity measurement methods and / or adopt multiple possible results of selecting k topic information as k initial cluster centers from the n topic information, and different similarity measurement methods are used to measure the similarity between topic information in different clusterings and / or the topic information used as k initial cluster centers in different clusterings is different;
[0189] The determination module 903 is used to determine the target clustering result of the n topic information based on all clustering results corresponding to the obtained n classification numbers.
[0190] The text processing apparatus provided in this application, after obtaining the topic information of each of the n texts, performs one or more clustering processes on the n topic information for any of the n possible classification numbers greater than 1 and less than n, corresponding to any classification number k among the n possible classification numbers of the obtained n topic information, to obtain one or more clustering results corresponding to the classification number k. The multiple clustering processes employ at least two similarity measurement methods and / or all possible results of selecting k topic information as k initial cluster centers from the n topic information. Different clustering processes use different similarity measurement methods to measure the similarity between topic information and / or the topic information used as k initial cluster centers in different clustering processes is different. The target clustering result for the n topic information is determined based on all clustering results corresponding to the obtained n classification numbers. This application improves the clustering effect when the number of texts is small, and since the number of texts is small, the corresponding amount of topic information is also small, thus not reducing processing efficiency.
[0191] In an optional embodiment, when the clustering processing module 602 performs multiple clustering processes on the n topic information, it is used to:
[0192] Obtain multiple combinations from which k different topic information is selected as a single combination from the n topic information;
[0193] For any group of k topic information, using the k topic information in that group as k initial cluster centers, perform a clustering process on the n topic information to obtain a clustering result corresponding to that group; or...
[0194] For any group of k topic information, the k topic information in any group is used as the k initial cluster centers. The n topic information is then subjected to m clustering processes to obtain m clustering results corresponding to any group. Here, m is an integer greater than 1. In the m clustering processes, the initial cluster centers of different clustering processes are the same, and different similarity measurement methods are used to measure the similarity between topic information in different clustering processes.
[0195] In an optional embodiment, when the clustering processing module 602 performs one or more clustering processes on the n topic information, it is used to:
[0196] Select k distinct topic information from the n topic information information as the target initial cluster centers;
[0197] Based on the initial cluster centers, perform a clustering process on the n topic information to obtain a clustering result; or...
[0198] Based on the target initial cluster center, the n topic information is subjected to m clustering processes to obtain m clustering results; where m is an integer greater than 1. In the m clustering processes, the initial cluster center of each clustering is the target initial cluster center, and different similarity measurement methods are used to measure the similarity between topic information in different clustering processes.
[0199] In an optional embodiment, the determining module 903 is used to:
[0200] Obtain the evaluation index for each clustering result among all the clustering results;
[0201] When the n topic information is clustered once or multiple times, and the same similarity metric is used to measure the similarity between topic information in different clustering processes, the clustering result with the best evaluation index is selected as the target clustering result.
[0202] In an optional embodiment, each clustering process uses a first clustering method to cluster the n topic information;
[0203] The determining module 903 is used for:
[0204] Obtain the evaluation index for each clustering result among all the clustering results;
[0205] When multiple clustering processes are performed on the n topic information, and m similarity measurement methods are used in the multiple clustering processes, the clustering result with the best evaluation index is selected from the clustering results corresponding to the same similarity measurement method.
[0206] Based on the optimal clustering result of the evaluation index corresponding to each similarity measurement method, any two topics among the n topics that belong to the same category are voted on, and the proportion of votes received by any two topics is determined as the voting similarity of any two topics.
[0207] Based on the voting similarity among topic information, the n topic information are clustered using a second clustering method to obtain the target clustering result.
[0208] In an optional embodiment, the first clustering method includes K-means clustering; the second clustering method includes hierarchical clustering or maximum-minimum distance clustering.
[0209] In an optional embodiment, it further includes:
[0210] Output the n topic information according to the target clustering result;
[0211] Obtain a source tracing instruction for any type of topic information, and retrieve the various texts associated with the any type of topic information;
[0212] Output the text associated with any of the aforementioned topic information.
[0213] The text processing apparatus provided in this application embodiment can be applied to text processing devices, such as PC terminals, mobile terminals, all-in-one machines, cloud platforms, servers, and server clusters. Optionally, Figure 10 A hardware block diagram of a text processing device is shown, with reference to... Figure 10 The hardware structure of a text processing device may include: at least one processor 1, at least one communication interface 2, at least one memory 3, and at least one communication bus 4;
[0214] In this embodiment of the application, the number of processor 1, communication interface 2, memory 3, and communication bus 4 is at least one, and processor 1, communication interface 2, and memory 3 communicate with each other through communication bus 4;
[0215] Processor 1 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0216] Memory 3 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device;
[0217] The memory stores a program, which the processor can call. The program is used for:
[0218] Obtain the topic information of each of the n texts;
[0219] For any number k greater than 1 and less than n among the n possible number of categories of the obtained n topic information, perform one or more clustering processes on the n topic information to obtain one or more clustering results corresponding to the number of categories k; wherein, the multiple clustering processes adopt at least two similarity measurement methods and / or adopt multiple possible results of selecting k topic information as k initial cluster centers from the n topic information, and different similarity measurement methods are used to measure the similarity between topic information in different clusterings and / or the topic information used as k initial cluster centers in different clusterings is different;
[0220] The target clustering result for the n topic information is determined based on all clustering results corresponding to the obtained n classification numbers.
[0221] Optionally, the refined and extended functions of the program can be found in the description above.
[0222] This application embodiment also provides a storage medium that can store a program suitable for execution by a processor, the program being used for:
[0223] Obtain the topic information of each of the n texts;
[0224] For any number k greater than 1 and less than n among the n possible number of categories of the obtained n topic information, perform one or more clustering processes on the n topic information to obtain one or more clustering results corresponding to the number of categories k; wherein, the multiple clustering processes adopt at least two similarity measurement methods and / or adopt multiple possible results of selecting k topic information as k initial cluster centers from the n topic information, and different similarity measurement methods are used to measure the similarity between topic information in different clusterings and / or the topic information used as k initial cluster centers in different clusterings is different;
[0225] The target clustering result for the n topic information is determined based on all clustering results corresponding to the obtained n classification numbers.
[0226] Optionally, the refined and extended functions of the program can be found in the description above.
[0227] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0228] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. Furthermore, the couplings or direct couplings or communication connections shown or discussed may be indirect couplings or communication connections through interfaces, devices, or units, and may be electrical, mechanical, or other forms.
[0229] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0230] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0231] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0232] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0233] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0234] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A text processing method, characterized in that, include: Obtain the topic information of each of the n texts; For any number k greater than 1 and less than n among the n possible number of categories of the obtained n topic information, perform one or more clustering processes on the n topic information to obtain one or more clustering results corresponding to the number k; wherein, the multiple clustering processes adopt at least two similarity measurement methods and / or adopt multiple possible results of selecting k topic information as k initial cluster centers from the n topic information, and different similarity measurement methods are used to measure the similarity between topic information in different clustering and / or the topic information used as k initial cluster centers in different clusterings are different; each clustering process in the multiple clustering processes includes: obtaining k different topic information extracted from the n topic information, using the k different topic information as k initial cluster centers, performing one clustering process on the n topic information to obtain a clustering result corresponding to the k different topic information; The target clustering result for the n topic information is determined based on all clustering results corresponding to the obtained n classification numbers.
2. The method according to claim 1, characterized in that, Multiple clustering processes are performed on the n topic information items, including: Obtain multiple combinations from which k different topic information is selected as a single combination from the n topic information; For any group of k topic information, using the k topic information in that group as k initial cluster centers, perform a clustering process on the n topic information to obtain a clustering result corresponding to that group; or... For any group of k topic information, the k topic information in any group is used as the k initial cluster centers. The n topic information is then subjected to m clustering processes to obtain m clustering results corresponding to any group. Here, m is an integer greater than 1. In the m clustering processes, the initial cluster centers of different clustering processes are the same, and different similarity measurement methods are used to measure the similarity between topic information in different clustering processes.
3. The method according to claim 1, characterized in that, The process of performing one or more clustering operations on the n topic information includes: Select k distinct topic information from the n topic information information as the target initial cluster centers; Based on the initial cluster centers, perform a clustering process on the n topic information to obtain a clustering result; or... Based on the target initial cluster center, the n topic information is subjected to m clustering processes to obtain m clustering results; where m is an integer greater than 1. In the m clustering processes, the initial cluster center of each clustering is the target initial cluster center, and different similarity measurement methods are used to measure the similarity between topic information in different clustering processes.
4. The method according to any one of claims 1-3, characterized in that, The step of determining the target clustering result for the n topic information based on all clustering results corresponding to the obtained n classification numbers includes: Obtain the evaluation index for each clustering result among all the clustering results; When the n topic information is clustered once or multiple times, and the same similarity metric is used to measure the similarity between topic information in different clustering processes, the clustering result with the best evaluation index is selected as the target clustering result.
5. The method according to any one of claims 1-3, characterized in that, Each clustering process uses the first clustering method to cluster the n topic information; The step of determining the target clustering result for the n topic information based on all clustering results corresponding to the obtained n classification numbers includes: Obtain the evaluation index for each clustering result among all the clustering results; When multiple clustering processes are performed on the n topic information, and m similarity measurement methods are used in the multiple clustering processes, the clustering result with the best evaluation index is selected from the clustering results corresponding to the same similarity measurement method. Based on the optimal clustering result of the evaluation index corresponding to each similarity measurement method, any two topics among the n topics that belong to the same category are voted on, and the proportion of votes received by any two topics is determined as the voting similarity of any two topics. Based on the voting similarity among topic information, the n topic information are clustered using a second clustering method to obtain the target clustering result.
6. The method according to claim 5, characterized in that, The first clustering method includes K-means clustering; the second clustering method includes hierarchical clustering or maximum-minimum distance clustering.
7. The method according to claim 1, characterized in that, Also includes: Output the n topic information according to the target clustering result; Obtain a source tracing instruction for any type of topic information, and retrieve the various texts associated with the any type of topic information; Output the text associated with any of the aforementioned topic information.
8. A text processing device, characterized in that, The device includes: The acquisition module is used to obtain the topic information of each text in n texts; The clustering module is used to perform one or more clustering processes on the n topic information for any one of the n possible classification numbers greater than 1 and less than n, corresponding to a classification number k among the n possible classification numbers of the obtained topic information, to obtain one or more clustering results corresponding to the classification number k; wherein, the multiple clustering processes employ at least two similarity measurement methods and / or employ multiple possible results of selecting k topic information as k initial cluster centers from the n topic information, and different similarity measurement methods are used to measure the similarity between topic information in different clustering processes and / or the topic information used as k initial cluster centers in different clustering processes is different; each clustering process in the multiple clustering processes includes: obtaining k different topic information extracted from the n topic information, using the k different topic information as k initial cluster centers, performing one clustering process on the n topic information to obtain a clustering result corresponding to the k different topic information; The determination module is used to determine the target clustering result of the n topic information based on all clustering results corresponding to the obtained n classification numbers.
9. A text processing device, characterized in that, Including memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the various steps of the text processing method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the various steps of the text processing method as described in any one of claims 1-7.
Citation Information
Patent Citations
Text classification method and device, computer equipment and storage medium
CN111723206A