Text clustering method and device

By calculating text edit distance and fine-grained word segmentation clustering, combined with semantic similarity error correction, the problems of high text clustering cost and low accuracy in the existing technology are solved, and low-cost and accurate text clustering effects are achieved.

CN118626652APending Publication Date: 2024-09-10BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411035357.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Among existing text clustering methods, the cost of large artificial intelligence models is high and labeling samples is time-consuming and labor-intensive. The edit distance algorithm is not accurate enough and cannot effectively cluster opinions such as "good-looking" and "very good-looking".

Method used

By calculating the edit distance between texts, we obtain the text group and its group name, perform fine-grained word segmentation and clustering on the group names, further perform edit distance clustering on the word segments, find the group names in the segmented groups, and group the same segmented words into Text group aggregation within the system, combined with semantic similarity error correction, enables low-cost and accurate text clustering.

Benefits of technology

It achieves low-cost and accurate text clustering, improves clustering accuracy, reduces the amount of calculation, and can effectively cluster texts with similar semantics but different wordings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626652A
    Figure CN118626652A
Patent Text Reader

Abstract

The invention discloses a text clustering method and device, and relates to the technical field of computers. A specific embodiment of the method comprises the following steps: respectively calculating editing distances among texts in a text set to obtain a plurality of first text groups and corresponding first group names; performing word segmentation on the first group name corresponding to each first text group to obtain a segmented word set; respectively calculating the editing distance of each segmented word in the segmented word set, and clustering each segmented word according to the editing distance to obtain a plurality of segmented word groups; and for each segmented word group, finding out each first group name corresponding to the segmented word group, extracting a second group name from each first group name corresponding to the segmented word group, and aggregating the first text groups corresponding to each first group name corresponding to the segmented word group into a second text group. According to the embodiment, low-cost and accurate text clustering is realized, further fine-grained word segmentation and clustering are performed on the first group name representing the semantics of the first text group, and the calculation amount is reduced on the premise of improving the clustering accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a text clustering method and device. Background Art

[0002] With the promotion and popularization of the Internet, the emergence of social networks, online trading platforms, etc., has made it easier and faster for people to express their personal opinions and experience shopping online. It is particularly important to extract the information needed by consumers, merchants and other groups from massive data, analyze and summarize it, and form targeted and readable analysis results. Existing text clustering methods mainly cluster texts through large artificial intelligence models or by calculating the edit distance between texts.

[0003] In the process of implementing the present invention, the inventors found that the prior art has the following problems:

[0004] Although the method of using large artificial intelligence models is more convenient, manual labeling of samples is time-consuming, labor-intensive and costly. The clustering accuracy of the edit distance method between texts is not enough. For example, the edit distance algorithm cannot cluster the two opinion texts "good-looking" and "very good-looking" into one category. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for text clustering, which realizes a low-cost and accurate text clustering method, fully utilizes the first group name that represents the semantics of the first text group, and further performs fine-grained word segmentation and clustering on the first group name based on the first text group of text clustering. While improving the clustering accuracy, the amount of calculation is reduced to ensure the implementation and application of the text clustering method.

[0006] To achieve the above object, according to one aspect of an embodiment of the present invention, a text clustering method is provided, comprising:

[0007] respectively calculating the edit distance between each text in the text set, and clustering each text based on the edit distance between each text to obtain a plurality of first text groups and their corresponding first group names;

[0008] Segment the first group names corresponding to each first text group to obtain a segmentation set;

[0009] Calculating the edit distance between each word in the word set respectively, clustering each word based on the edit distance between each word, and obtaining a plurality of word groups;

[0010] For each word segmentation group, find out the first group names corresponding to the word segmentation group, extract the second group names from the first group names corresponding to the word segmentation group, and aggregate the first text groups corresponding to the first group names corresponding to the word segmentation group into a second text group.

[0011] Optionally, the word segment group has a word segment group name; extracting the second group name from each first group name corresponding to the word segment group includes: querying the part of speech of the word segment group name corresponding to the word segment group; when the part of speech is an adjective or a noun, selecting the first group name with the highest word frequency among the first group names corresponding to the word segment group as the second group name, wherein the word frequency of the first group name is the total number of texts in the first text group corresponding to the first group name; when the part of speech is a verb, using the word segment group name as the second group name.

[0012] Optionally, the individual word segments are clustered based on the edit distances between the individual word segments to obtain a plurality of word segment groups, including: according to the edit distances between the individual word segments and a preset grouping threshold, the word segments with close edit distances are classified into a group to construct a plurality of word segment groups; according to a preset word segment group name selection principle, a word segment is selected from each word segment group as the corresponding word segment group name to obtain a plurality of word segment groups with word segment group names; wherein the word segment group name selection principle is based on a selection priority, with the word segment with the maximum word frequency being preferentially selected, followed by the word segment with the longest word count, and finally the word segment is selected according to a preset part-of-speech priority.

[0013] Optionally, each participle in the participle set has a group name identifier; before finding out the first group names corresponding to the participle groups, the method also includes: taking the participle with the highest frequency of occurrence in the participle group as the main participle of the participle group; finding out the first group names corresponding to the participle groups, including: according to the group name identifiers of the participles, finding out the first group names corresponding to the participles in the participle group, and when multiple participle groups correspond to the same first group name, determining a participle group from the multiple participle groups to establish a corresponding relationship with the first group name according to the preset grammatical part-of-speech priority of the main participle of the participle group and the priority of the number of participles.

[0014] Optionally, after selecting a participle from each participle group as the corresponding participle group name, the method further includes: calculating the edit distance value between each participle in the participle group and the corresponding participle group name, and when the edit distance value is less than a preset threshold, removing the corresponding participle from the participle group, then calculating the edit distance value between the removed participle and the participle group names of other participle groups, and adding the removed participle to the participle group corresponding to the largest edit distance value.

[0015] Optionally, after extracting the second group names from the first group names corresponding to the word groups, the method further includes: grouping the first group names corresponding to the word groups into a first group name set, wherein the second group names are the names of the first group name set; calculating the semantic similarity between the first group names in the first group name set and the second group names, and if the semantic similarity is less than a preset semantic threshold, removing the corresponding first group name from the first group name set, then calculating the semantic similarity between the removed first group names and the second group names corresponding to other first group name sets, and adding the removed first group names to the first group name set corresponding to the largest semantic similarity.

[0016] Optionally, the edit distance between each text in the text set is calculated respectively, and the texts are clustered based on the edit distance between the texts, including: sorting the texts in the text set according to the text length to obtain a sorted text set, taking the longest text in the sorted text set as the calculation starting point, adding the longest text to the first group, and performing the following operations on each subsequent text according to the order of the texts in the sorted text set until all the texts are traversed: calculating the edit distance value between the text and the shortest text in each group, if the edit distance value exceeds a preset classification threshold, adding the text to the corresponding group, otherwise, adding the text to a new group.

[0017] Optionally, obtaining first group names corresponding to multiple first text groups includes: performing text part-of-speech analysis on the text in each first text group; matching the text in each first text group with a preset text part-of-speech template based on the result of the text part-of-speech analysis, and selecting the text with the highest word frequency from the texts that successfully match the text part-of-speech template as the first group name corresponding to the first text group.

[0018] Optionally, after obtaining multiple first text groups and their corresponding first group names, the method further includes: calculating the edit distance value between each text in each of the first text groups and the corresponding first group name, and when the edit distance value is less than a preset group threshold, removing the corresponding text from the first text group in which it is located, then calculating the edit distance value between the removed text and the first group names of other first text groups, and adding the removed text to the first text group corresponding to the largest edit distance value.

[0019] Optionally, before segmenting the first group names corresponding to each first text group, the method further includes: calculating the semantic similarity between each text in each first text group and the corresponding first group name, and when the semantic similarity is less than a preset semantic threshold, removing the corresponding text from the first text group in which it is located, and then calculating the semantic similarity between the removed text and the first group names of other first text groups, and adding the removed text to the first text group corresponding to the maximum semantic similarity.

[0020] Optionally, the first group names corresponding to each first text group are segmented to obtain a segmented word set, including: inputting the first group names corresponding to each first text group into a pre-built deep learning model, performing grammatical part-of-speech analysis on each of the first group names by the deep learning model, and segmenting each of the first group names according to the results of the grammatical part-of-speech analysis, and outputting a segmented word set.

[0021] According to a second aspect of an embodiment of the present invention, a device for text clustering is provided, comprising:

[0022] A first text group generating module, used for respectively calculating the edit distance between each text in the text set, clustering each text based on the edit distance between each text, and obtaining a plurality of first text groups and their corresponding first group names;

[0023] A first group name segmentation module is used to segment the first group name corresponding to each first text group to obtain a segmentation set;

[0024] A word clustering module, used to calculate the edit distance between each word in the word set, and cluster each word based on the edit distance between each word to obtain multiple word groups;

[0025] The second text group generation module is used to find out the first group names corresponding to each word group, extract the second group names from the first group names corresponding to the word group, and aggregate the first text groups corresponding to the first group names corresponding to the word group into a second text group.

[0026] According to a third aspect of an embodiment of the present invention, there is provided an electronic device for text clustering, comprising:

[0027] one or more processors;

[0028] a storage device for storing one or more programs,

[0029] When the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the first aspect of the embodiment of the present invention.

[0030] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present invention is implemented.

[0031] An embodiment of the invention has the following advantages or beneficial effects: by respectively calculating the edit distance between each text in the text set, clustering each text based on the edit distance between each text, and obtaining multiple first text groups and their corresponding first group names; segmenting the first group names corresponding to each first text group to obtain a segmentation set; respectively calculating the edit distance between each segmentation in the segmentation set, clustering each segmentation based on the edit distance between each segmentation to obtain multiple segmentation groups; for each segmentation group, finding each first group name corresponding to the segmentation group, extracting the second group name from each first group name corresponding to the segmentation group, and aggregating the first text groups corresponding to each first group name corresponding to the segmentation group into a second text group. The technical solution realizes a low-cost and accurate text clustering method, makes full use of the first group name representing the meaning of the first text group, and further performs fine-grained segmentation and clustering on the first group name based on the first text group of text clustering, reduces the amount of calculation while improving the clustering accuracy, and ensures the implementation and application of the text clustering method. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0033] Figure 1 is a schematic diagram of the main process of the text clustering method according to an embodiment of the present invention;

[0034] Figure 2 Detailed flowchart of the text clustering method according to an embodiment of the present invention;

[0035] Figure 3 is a schematic diagram of main modules of a text clustering device according to an embodiment of the present invention;

[0036] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0037] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0038] It should be noted that in the technical solution of the present invention, the collection / collection, update, analysis, use, transmission, storage and other aspects of user personal information involved are in compliance with the provisions of relevant laws and regulations, are used for legal and reasonable purposes, are not shared, leaked or sold outside of these legal uses, and are subject to supervision and management by national regulatory authorities. Necessary measures should be taken for user personal information to selectively block the use or access to personal information data to prevent illegal access to such personal information data, ensure that persons who have access to personal information data comply with the provisions of relevant laws and regulations, and ensure the security of user personal information. In addition, once these user personal information data are no longer needed, the risks should be minimized by limiting or even prohibiting data collection and / or deleting data.

[0039] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0040] Although the current method of using large artificial intelligence models is relatively convenient, manual labeling of samples is time-consuming, labor-intensive and costly; and the clustering accuracy of the method using the edit distance between texts is not enough to meet practical applications.

[0041] In order to solve the above problems existing in the prior art, the present invention proposes a method for text clustering, based on the first text group and its corresponding first group name obtained by calculating the edit distance between texts, fine-grained word segmentation is performed on the first group name representing the semantics of the first text group, and then the edit distance is clustered for each word segmentation to obtain multiple word segmentation groups, and finally the first group name corresponding to the word segmentation in each word segmentation group is searched, and the first text group corresponding to the first group name corresponding to the word segmentation belonging to the same word segmentation group is aggregated into a second text group, and the second group name corresponding to the second text group is extracted from the first group name corresponding to the same word segmentation group. A low-cost and accurate text clustering method is implemented, which makes full use of the first group name representing the semantics of the first text group, and further performs fine-grained word segmentation and clustering on the first group name based on the first text group of text clustering, reduces the amount of calculation under the premise of improving clustering accuracy, and ensures the implementation and application of the text clustering method.

[0042] In the introduction to the embodiments of the present invention, the terms and their meanings are as follows:

[0043] Jieba Word Segmentation: Jieba Word Segmentation is a Chinese word segmentation tool with relatively good performance. It supports Chinese Simplified and Chinese Traditional word segmentation, as well as custom word libraries. Jieba Word Segmentation supports three word segmentation modes: precise mode, full mode and search engine mode.

[0044] GPT: GPT stands for Generative Pre-Trained Transformer, which is a deep learning model for text generation based on the Internet and trained with available data.

[0045] Edit distance: It is a quantitative measure of the difference between two strings (such as English words). The measurement method is to see how many times it takes to transform one string into another string.

[0046] Roformer: Roformer-Sim is a model for calculating semantic similarity. It uses more training data and is not limited to interrogative sentences. RoFormer-Sim can be used to generate similar sentences for general sentences and has a wider range of application scenarios.

[0047] Figure 1 Schematic diagram of the main process of the text clustering method according to an embodiment of the present invention. Figure 1 As shown, the text clustering method of the embodiment of the present invention includes the following steps S101 to S104.

[0048] Step S101 : respectively calculating the edit distances between the various texts in the text set, and clustering the various texts based on the edit distances between the various texts to obtain a plurality of first text groups and their corresponding first group names.

[0049] Specifically, in daily life, people generate a large amount of text data every day, such as news, shopping transaction evaluations, etc. The information contained in these text data is of great significance to the business field and scientific research. Text clustering technology, as an important method of information extraction, mines out the implicit valuable information by classifying and analyzing text data. In the embodiment of the present invention, the shopping transaction evaluation of users in the online trading platform is taken as an example. By clustering the text of the shopping transaction evaluation, the merchant can easily and accurately obtain the user's feedback on the transaction items, which can be positive feedback or suggestion feedback, so that the merchant can clarify the user's needs and increase the transaction amount. According to the configuration, the backend system uses the merchant as the granularity, or the item category as the granularity, or the merchant and item category as the granularity to obtain all the evaluation texts that meet the requirements within the specified time period. These evaluation texts constitute a text set.

[0050] Furthermore, based on the text set obtained above, each text in the text set is cleaned, and based on the text cleaning rules in the preset business scenario, the length of each text is shortened without changing the semantics. For example, "The hair dryer has a very good effect on hair drying" is cleaned to "The hair drying effect is very good", which can effectively reduce the calculation complexity and amount of subsequent edit distance. Then calculate the edit distance between each cleaned text, and classify and group the corresponding cleaned text according to the calculated edit distance value to obtain multiple first text groups, and then select a text from each first text group as the group name of the first text group, that is, the first group name.

[0051] According to one embodiment of the present invention, the edit distance between each text in a text set is calculated respectively, and the texts are clustered based on the edit distance between the texts, including: sorting the texts in the text set according to the text length to obtain a sorted text set, taking the longest text in the sorted text set as the calculation starting point, adding the longest text to the first group, and performing the following operations on each subsequent text according to the order of the texts in the sorted text set until all the texts are traversed: calculating the edit distance value between the text and the shortest text in each group, if the edit distance value exceeds a preset classification threshold, adding the text to the corresponding group, otherwise, adding the text to a new group.

[0052] Specifically, considering that the calculation result of the edit distance is closely related to the length of the two texts to be calculated, before calculating the edit distance, the texts are sorted according to the text length, either from long to short or from short to long. The longest text is used as the calculation starting point, and the longest text is added to the first group. The second longest text adjacent to the longest text after sorting is taken, and the edit distance value between the second longest text and the longest text is calculated. If it is greater than a preset classification threshold (for example, 70), the second longest text is added to the group where the longest text is located. Otherwise, the second longest text is set up as a new group separately. By analogy, the third longest text is taken. If the second longest text is added to the group where the longest text is located, the edit distance value between the third longest text and the second longest text is calculated. If the second longest text is in a new group alone, the edit distance value between the third longest text and the longest text and the edit distance value between the third longest text and the second longest text are calculated respectively. According to the edit distance value and the classification threshold, it is determined whether the third longest text is added to the group where the longest text is located, the group where the second longest text is located, or a new group is added separately. Similarly, for subsequent texts in the sorted text set, the edit distance values ​​are calculated according to the above method, and then the group to which they belong is determined according to the edit distance values ​​to achieve clustering of each text.

[0053] According to another embodiment of the present invention, first group names corresponding to multiple first text groups are obtained, including: performing text part-of-speech analysis on the text in each first text group; matching the text in each first text group with a preset text part-of-speech template based on the result of the text part-of-speech analysis, and selecting the text with the highest word frequency from the texts that successfully match the text part-of-speech template as the first group name corresponding to the first text group.

[0054] Specifically, after the above-mentioned text clustering, each text is classified into a first text group, and then a word segmentation tool, such as Jieba word segmentation, is used to analyze the part-of-speech composition of each text to obtain the result of text part-of-speech analysis. The embodiment of the present invention pre-sets a text part-of-speech template based on business experience. The part-of-speech template lists the part-of-speech composition of 16 types of texts according to priority, as shown in Table 1 below:

[0055]

[0056] The priority of the part-of-speech components in front of Table 1 is higher than that of the part-of-speech components in the back. Match the text part-of-speech analysis results of each text in the first text group with the 16 part-of-speech components in Table 1. It can be understood that after the above-mentioned background system obtains the text component text set according to the configuration and performs text cleaning, there will inevitably be repeated texts. For the convenience of recording, the number of repetitions of the text will be attached to the text to distinguish the frequency of various texts. From the successfully matched texts, select the text with the highest frequency as the first group name of the first text group. If the frequency of the texts with the matching cost is the same, consider the priority of the corresponding part-of-speech component in the part-of-speech template. The earlier the serial number, the higher the priority. The text corresponding to the part-of-speech component with the highest priority is selected as the first group name.

[0057] For example, the part-of-speech components of "beautiful" (5 times) and "very beautiful" (3 times) in the first text group are adjective and adverb + adjective, respectively, both of which meet the part-of-speech template of Table 1. Since "beautiful" has the highest frequency, "beautiful" is selected as the first group name of the first text group.

[0058] According to another embodiment of the present invention, after obtaining multiple first text groups and their corresponding first group names, the method further includes: calculating the edit distance value between each text in each of the first text groups and the corresponding first group name, and when the edit distance value is less than a preset group threshold, removing the corresponding text from the first text group in which it is located, then calculating the edit distance value between the removed text and the first group names of other first text groups, and adding the removed text to the first text group corresponding to the largest edit distance value.

[0059] Specifically, in order to ensure the accuracy of clustering, after obtaining multiple first text groups and their corresponding first group names, the embodiment of the present invention uses the edit distance to verify the clustering results again. The edit distance value between each text in each first text group and the corresponding first group name is calculated, and it is checked whether the edit distance value between each text in the first text group and the first group name meets the preset group threshold. If any non-compliant text is found, the non-compliant text is removed from the first text group. The edit distance between the removed text and the first group names of other first text groups is calculated, and finally the removed text is classified into the first text group where the first group name with the largest edit distance value is located.

[0060] Step S102: Segment the first group names corresponding to the first text groups to obtain a segmentation set.

[0061] According to one embodiment of the present invention, before segmenting the first group names corresponding to each first text group, the method also includes: calculating the semantic similarity between each text in each of the first text groups and the corresponding first group name, and when the semantic similarity is less than a preset semantic threshold, removing the corresponding text from the first text group in which it is located, then calculating the semantic similarity between the removed text and the first group names of other first text groups, and adding the removed text to the first text group corresponding to the maximum semantic similarity.

[0062] Specifically, the above-mentioned clustering process based on edit distance can effectively aggregate texts of similar length and similar expressions into a group, such as "good-looking appearance" and "very good-looking appearance", but it is not suitable for processing texts with low similarity in wording, such as "good-looking appearance" and "beautiful appearance". Therefore, the embodiment of the present invention uses semantic similarity to correct the clustering results. After obtaining multiple first text groups and corresponding first group names, before segmenting the first group names corresponding to each first text group, a semantic similarity algorithm, such as the Roformer algorithm, but not limited to this, is used to calculate the semantic similarity between each text in the first text group and the first group name. If there is a semantic similarity less than a preset semantic threshold, the calculated text is removed from the first text group. The semantic similarity algorithm is then used to calculate the semantic similarity between the removed text and other first group names, and the removed text is added to the first text group corresponding to the first group name with the largest semantic similarity.

[0063] The embodiment of the present invention clusters texts based on edit distance, and then uses a semantic similarity algorithm to perform semantic error correction on the clustered first text group, which not only improves the accuracy of the clustering results but also ensures the clustering efficiency.

[0064] Furthermore, although the above-mentioned use of semantic similarity improves the accuracy of clustering results, it is found in actual applications that the clustering effect is not optimal when only the edit distance and semantic similarity are used in combination. As shown in Table 2 below, there is still the possibility of further aggregation. For example, the first group names in Table 2: "Safety hazards in use", "Safety issues exist" and "Feeling unsafe without a back cover", these first text groups can be classified into one category.

[0065]

[0066] In order to aggregate texts with similar semantics into one group as much as possible, the embodiment of the present invention utilizes the ability of the first group name to represent the semantics of the first text group, performs more fine-grained analysis and classification on the first group name, segmentes the first group names corresponding to all the first text groups, and obtains a segmentation set that aggregates the constituent segmentations of all the first group names.

[0067] According to one embodiment of the present invention, the first group names corresponding to each first text group are segmented to obtain a segmented word set, including: inputting the first group names corresponding to each first text group into a pre-built deep learning model, performing grammatical part-of-speech analysis on each of the first group names by the deep learning model, and segmenting each of the first group names according to the results of the grammatical part-of-speech analysis, and outputting a segmented word set.

[0068] Specifically, the quality of word segmentation directly determines the subsequent clustering effect. Therefore, when segmenting the first group of names, the embodiment of the present invention uses a deep learning model, such as the GPT large model, to quickly, efficiently and accurately perform subject, predicate, and object grammar, as well as noun, verb, adjective and other part-of-speech analysis on all the first group of names. For example: Hair is very smooth after blow-drying –> {“Subject”: “After blow-drying hair”, “Part of speech”: “Verb”; “Predicate”: “very”, “Part of speech”: “Adverb”; “Object”: “Soft”, “Part of speech”: “Adjective”}, and finally outputs a segmentation set of the segmentation results.

[0069] Step S103: Calculate the edit distance between each word in the word set respectively, cluster each word based on the edit distance between each word, and obtain multiple word groups.

[0070] Specifically, for each word in the word set, according to the above-mentioned method for calculating the edit distance between texts, the text is replaced with the word to achieve clustering of each word, and then a word is selected from the word group as the corresponding word group name.

[0071] According to an embodiment of the present invention, the individual participles are clustered based on the edit distances between the individual participles to obtain a plurality of participle groups, including: according to the edit distances between the individual participles and a preset grouping threshold, the participles with close edit distances are classified into a group to construct a plurality of participle groups; according to a preset participle group name selection principle, a participle is selected from each participle group as the corresponding participle group name to obtain a plurality of participle groups with participle group names; wherein the participle group name selection principle is to select the participle with the maximum word frequency according to the selection priority, then select the participle with the longest word number, and finally select according to the preset part of speech priority.

[0072] Specifically, the above-mentioned editing distance calculation method is used to calculate the editing distance value between each segmentation word and the shortest segmentation word in the existing segmentation word group, and the segmentations that exceed the preset grouping threshold, that is, the segmentations with close editing distances are classified into the same segmentation word group, and the segmentations that do not meet the preset grouping threshold are added to the new segmentation word group, so as to achieve clustering of the segmentations of the first group name and construct multiple segmentation word groups. Furthermore, in order to enhance the ability of the segmentation word group name to represent the segmentation word group, the embodiment of the present invention presets the segmentation word group name selection principle based on business experience, and optimizes the segmentations in each segmentation word group before determining the segmentation word group name of each segmentation word group, cleans out the segmentations with a length of 1 in the group, and only retains the segmentations with the part of speech of noun, adjective and verb. Then, according to the segmentation word group name selection principle, the segmentation word with the largest word frequency in the segmentation word group is preferentially selected. It can be understood that the word frequency of the segmentation word in the segmentation word group is usually the word frequency of the corresponding first group name in the embodiment of the present invention. If there are multiple participles with the maximum word frequency, that is, multiple participles have the same maximum word frequency, the participle with the longest number of characters among the multiple participles is selected. If there are multiple alternative participles with the same maximum word frequency and the same number of characters, the participle of the adjective is selected first, followed by the participle of the noun, and finally the participle of the verb, so as to accurately determine the participle group name corresponding to each participle group.

[0073] Step S104: for each word segmentation group, find out each first group name corresponding to the word segmentation group, extract the second group name from each first group name corresponding to the word segmentation group, and aggregate the first text groups corresponding to each first group name corresponding to the word segmentation group into a second text group.

[0074] Specifically, based on the multiple word groups obtained by clustering the word segments of the first group name, each word group can be regarded as the basis for the secondary clustering of the first text group. Since the word segments are derived from the first group name, the first group name corresponding to each word segment can be recorded in the process of word segmentation of the first group name. From the record of the word segmentation of the first group name, the first group name corresponding to each word segment in the same word segment group can be found to achieve tracing back to the corresponding first group name according to the word segmentation. Then, the second group name is extracted from each first group name corresponding to each word segment in the word segment group, and combined with the first text group corresponding to the first group name, the first text groups corresponding to each first group name corresponding to each word segment in the same word segment group are aggregated and classified into a second text group, and the final clustering result of the text is obtained: the second text group and the second group name. Specifically for the text clustering business scenario of shopping transaction evaluation, the second group name can be directly used as the result of opinion mining, and the second text group is used as the original transaction evaluation text of the second group name to support the second group name.

[0075] According to one embodiment of the present invention, each participle in the participle set has a group name identifier; before finding out the first group names corresponding to the participle groups, the method also includes: taking the participle with the highest frequency of occurrence in the participle group as the main participle of the participle group; finding out the first group names corresponding to the participle group, including: according to the group name identifier of each participle, finding out the first group name corresponding to each participle in the participle group, and when multiple participle groups correspond to the same first group name, determining a participle group from the multiple participle groups and establishing a corresponding relationship with the first group name according to the preset grammatical part of speech priority of the main participle of the participle group and the participle number priority.

[0076] Specifically, considering that when searching for the corresponding first group name according to the segmentation, since the first group name may be split into several segmentations, multiple segmentations of a first group name may be located in different segmentation groups, that is, multiple segmentation groups correspond to the same first group name. In this case, it is necessary to select a most suitable segmentation group from multiple segmentation groups based on the main segmentation of the segmentation group. Before finding out the first group names corresponding to the segmentation groups, according to the frequency of occurrence of each segmentation in the segmentation group, the segmentation with the highest frequency is selected as the main segmentation of the segmentation group. In addition, when the first group name is segmented before, the first group name to which each segmentation belongs can also be numbered, and the number can be marked on the segmentation as a group name identifier. According to the group name identifier of the segmentation, the corresponding first group name can be found quickly and easily. If multiple segmentation groups correspond to the same first group name, a most suitable segmentation group is selected according to the grammatical part-of-speech priority of the main segmentations of these multiple segmentation groups and the priority of the number of segmentations. The embodiment of the present invention sets the grammatical part-of-speech priority of the main participle as: subject noun> object noun> predicate verb> predicate adjective> object verb> object adjective, that is, if there are two participle groups A and B corresponding to the same first group name, the grammatical part-of-speech of the main participle of the A participle group is subject noun, and the grammatical part-of-speech of the main participle of the B participle group is predicate verb, then the A participle group is selected to establish a corresponding relationship with the first group name. In addition, if the participle group cannot be determined by the grammatical part-of-speech priority of the main participle, then the participle group with the least number of participles is selected from the multiple participle groups to establish a corresponding relationship with the first group name.

[0077] In addition, based on the main participle of the participle group determined above, before finding out the first group names corresponding to the participle groups, the existing multiple participle groups can be screened to only retain the participle groups whose main participles are subject nouns, object nouns, predicate verbs, predicate adjectives, object verbs, and object adjectives, and remove other meaningless participle groups to reduce the amount of calculation, save computing power, and improve clustering efficiency.

[0078] According to another embodiment of the present invention, the word segmentation group has a word segmentation group name; extracting the second group name from each first group name corresponding to the word segmentation group includes: querying the part of speech of the word segmentation group name corresponding to the word segmentation group; when the part of speech is an adjective or a noun, selecting the first group name with the highest word frequency among the first group names corresponding to the word segmentation group as the second group name, wherein the word frequency of the first group name is the total number of texts in the first text group corresponding to the first group name; when the part of speech is a verb, using the word segmentation group name as the second group name.

[0079] Specifically, as one of the results of text clustering, the accuracy and generality of the second group name determine the effect of text clustering. In order to ensure the accuracy and generality of the second group name, the embodiment of the present invention performs a more fine-grained analysis on the determination of the second group name, and determines the source of the second group name according to the part of speech of the segmented group name corresponding to the segmented group. If the part of speech of the segmented group name is an adjective or a noun, the first group name with the highest word frequency is selected from the corresponding first group names as the second group name. It can be understood that the word frequency of the first group name is the sum of the frequencies of each text in the first text group corresponding to the first group name. If the part of speech of the segmented group name is a verb, considering that verbs have good semantic expression capabilities, the segmented group name can be directly used as the second group name to improve the generality and refinement of the second group name.

[0080] According to another embodiment of the present invention, after selecting a participle from each participle group as the corresponding participle group name, the method further includes: calculating the edit distance value between each participle in the participle group and the corresponding participle group name, and when the edit distance value is less than a preset threshold, removing the corresponding participle from the participle group, then calculating the edit distance value between the removed participle and the participle group names of other participle groups, and adding the removed participle to the participle group corresponding to the largest edit distance value.

[0081] Specifically, in order to ensure the accuracy of word clustering, the embodiment of the present invention uses the edit distance to verify the clustering result again after selecting a word from each word group as the corresponding word group name. The edit distance value between each word in each word group and the corresponding word group name is calculated, and the edit distance value between each word in the word group and the word group name is checked to see whether it meets the preset threshold. If there are non-compliant word segments, the non-compliant word segments are removed from the word group. The edit distance between the removed word and the word group names of other word groups is calculated, and finally the removed word is classified into the word group where the word group name with the largest edit distance value is located.

[0082] According to another embodiment of the present invention, after extracting the second group names from the first group names corresponding to the word group, the method further includes: grouping the first group names corresponding to the word group into a first group name set, wherein the second group names are the names of the first group name set; calculating the semantic similarity between the first group names and the second group names in the first group name set, and if the semantic similarity is less than a preset semantic threshold, removing the corresponding first group name from the first group name set, and then calculating the semantic similarity between the removed first group names and the second group names corresponding to other first group name sets, and adding the removed first group names to the first group name set corresponding to the largest semantic similarity.

[0083] Specifically, in order to further improve the accuracy of clustering, a semantic similarity algorithm is used for error correction based on the clustering process based on the above-mentioned edit distance. It can be understood that when finding out the first group names corresponding to the same word segmentation group, it is equivalent to aggregating the corresponding first group names once, obtaining the first group name set belonging to the same word segmentation group, and determining the second group name, which can be regarded as the name of the first group name set. After determining the second group name, further, using a semantic similarity algorithm, such as the Roformer algorithm, but not limited to this, the semantic similarity between each first group name and the second group name in the first group name set is calculated. If there is a semantic similarity less than a preset semantic threshold, the calculated first group name is removed from the first group name set. Then use the semantic similarity algorithm to calculate the semantic similarity between the removed first group name and other second group names, and add the removed first group name to the first group name set corresponding to the second group name with the largest semantic similarity.

[0084] Exemplarily, the following Table 3 is a schematic table of the second group names and the first group name sets of the text clustering of an embodiment of the present invention, which illustrates the clustering of texts of users' opinions on safety protection in the washing machine industry. It can be seen that there are 4 second group names in the table: leakage, no mouse-proof plate, and the child lock cannot be unlocked, which means there are safety issues, indicating that users have expressed opinions and evaluation texts in these four aspects. There are a total of 15 first group names in the 4 first group name sets corresponding to the 4 second group names in the table. The number after the first group name indicates the frequency of occurrence, that is, the number of texts in the first text group corresponding to the first group name. The 4 first group name sets have a total of 24 evaluated texts.

[0085]

[0086] It can be seen from Table 3 that after text clustering, it is easier for merchants to quickly obtain the value information in user evaluation texts.

[0087] Figure 2It is a detailed flow chart of the text clustering method of the embodiment of the present invention. First, a text set is obtained, and each text in the text set is cleaned to shorten the length of the text. Then, the edit distance between each text after text cleaning is calculated, and each text is clustered based on the edit distance between each text to obtain multiple first text groups and their corresponding first group names. A semantic similarity algorithm is used to calculate the semantic similarity between each text in each first text group and the corresponding first group name, and semantic error correction is performed on the obtained first text group and the corresponding first group name, and the first group name is extracted from the error-corrected result. A large model is used to perform grammatical part-of-speech analysis on the first group name, and segmentation is performed according to the analysis result to obtain a segmentation set. The edit distance between each segmentation in the segmentation set is calculated respectively, and each segmentation is clustered based on the edit distance between each segmentation to obtain multiple segmentation groups. For each segmentation group, the first group names corresponding to the segmentation group are found, and the second group names are extracted from the first group names corresponding to the segmentation group, and the first text groups corresponding to the first group names corresponding to the segmentation group are aggregated into a second text group. Then, semantic similarity algorithm is used to perform semantic correction on each first group name and the corresponding second group name corresponding to the same word group, and the final clustering result is obtained from the correction result, including the second group name and the corresponding second text group.

[0088] The embodiment of the present invention clusters texts based on edit distance, and then utilizes the grammatical part-of-speech analysis capability of a large model and combines it with a semantic similarity algorithm to perform semantic correction on the clustering results, so as to achieve the purpose of low-cost and accurate clustering of scattered texts into multiple text groups with different semantics. The edit distance and semantic correction are used in combination to improve the accuracy of clustering, and fine-grained word segmentation and clustering of the first group name based on grammatical part of speech are performed, which further improves the accuracy of clustering and reduces the amount of calculation, thereby ensuring that customers can accurately mine valuable information from evaluated or published texts.

[0089] Figure 3 Schematic diagram of the main modules of the text clustering device according to an embodiment of the present invention. Figure 3 As shown, the text clustering device 300 mainly includes a first text group generating module 301 , a first group name word segmentation module 302 , a word segmentation clustering module 303 and a second text group generating module 304 .

[0090] A first text group generating module 301, for respectively calculating the edit distance between each text in the text set, and clustering each text based on the edit distance between each text, to obtain a plurality of first text groups and their corresponding first group names;

[0091] A first group name segmentation module 302 is used to segment the first group name corresponding to each first text group to obtain a segmentation set;

[0092] A word clustering module 303, used to respectively calculate the edit distance between each word in the word set, and cluster each word based on the edit distance between each word to obtain multiple word groups;

[0093] The second text group generation module 304 is used to find out the first group names corresponding to each word group, extract the second group names from the first group names corresponding to the word group, and aggregate the first text groups corresponding to the first group names corresponding to the word group into a second text group.

[0094] According to one embodiment of the present invention, the word group has a word group name; the second text group generating module 304 is further used to: query the part of speech of the word group name corresponding to the word group; when the part of speech is an adjective or a noun, select the first group name with the highest word frequency among the first group names corresponding to the word group as the second group name, wherein the word frequency of the first group name is the total number of texts in the first text group corresponding to the first group name; when the part of speech is a verb, use the word group name as the second group name.

[0095] According to another embodiment of the present invention, the word segmentation clustering module 303 is further used to: classify the word segmentations with close edit distances into a group according to the edit distances between the word segmentations and a preset grouping threshold, and construct multiple word segmentation groups; select a word segmentation from each word segmentation group as the corresponding word segmentation group name according to a preset word segmentation group name selection principle, and obtain multiple word segmentation groups with word segmentation group names; wherein the word segmentation group name selection principle is to select the word segmentation with the highest word frequency according to the selection priority, and then select the word segmentation with the longest word number, and finally select according to the preset part of speech priority.

[0096] According to another embodiment of the present invention, each word in the word set has a group name identifier; the text clustering device 300 also includes a main word determination module (not shown in the figure), which is used to: before finding out the first group names corresponding to the word groups, use the word with the highest frequency of occurrence in the word group as the main word of the word group; the second text group generation module 304 is also used to: according to the group name identifier of each word, find the first group name corresponding to each word in the word group, and when multiple word groups correspond to the same first group name, determine a word group from multiple word groups and establish a corresponding relationship with the first group name according to the preset grammatical part of speech priority of the main word of the word group and the word number priority.

[0097] According to another embodiment of the present invention, the text clustering device 300 also includes a word group verification module (not shown in the figure), which is used to: after selecting a word from each word group as the corresponding word group name, calculate the edit distance value between each word in the word group and the corresponding word group name, and when the edit distance value is less than a preset threshold, remove the corresponding word from the word group, then calculate the edit distance value between the removed word and the word group names of other word groups, and add the removed word to the word group corresponding to the largest edit distance value.

[0098] According to another embodiment of the present invention, the text clustering device 300 also includes a semantic error correction module (not shown in the figure), which is used to: after extracting the second group names from the first group names corresponding to the word groups, group the first group names corresponding to the word groups into a first group name set, and the second group names are the names of the first group name set; calculate the semantic similarity between the first group names and the second group names in the first group name set, and when the semantic similarity is less than a preset semantic threshold, remove the corresponding first group name from the first group name set, then calculate the semantic similarity between the removed first group names and the second group names corresponding to other first group name sets, and add the removed first group names to the first group name set corresponding to the maximum semantic similarity.

[0099] According to another embodiment of the present invention, the first text group generating module 301 is further used to: sort the texts in the text set according to the text length to obtain a sorted text set, take the longest text in the sorted text set as the calculation starting point, add the longest text to the first group, and perform the following operations on each subsequent text according to the order of the texts in the sorted text set until all the texts are traversed: calculate the edit distance value between the text and the shortest text in each group, if the edit distance value exceeds a preset classification threshold, add the text to the corresponding group, otherwise, add the text to a new group.

[0100] According to another embodiment of the present invention, the first text group generating module 301 is further used to: perform text part-of-speech analysis on the text in each first text group; match the text in each first text group with a preset text part-of-speech template based on the result of the text part-of-speech analysis, and select the text with the highest word frequency from the texts that successfully match the text part-of-speech template as the first group name corresponding to the first text group.

[0101] According to another embodiment of the present invention, the text clustering device 300 also includes a first text group verification module (not shown in the figure), which is used to: after obtaining multiple first text groups and their corresponding first group names, calculate the edit distance value between each text in each of the first text groups and the corresponding first group name, and when the edit distance value is less than a preset group threshold, remove the corresponding text from the first text group to which it belongs, then calculate the edit distance value between the removed text and the first group names of other first text groups, and add the removed text to the first text group corresponding to the largest edit distance value.

[0102] According to another embodiment of the present invention, the text clustering device 300 also includes a first text group semantic error correction module (not shown in the figure), which is used to: before segmenting the first group name corresponding to each first text group, calculate the semantic similarity between each text in each first text group and the corresponding first group name, and when the semantic similarity is less than a preset semantic threshold, remove the corresponding text from the first text group to which it belongs, then calculate the semantic similarity between the removed text and the first group names of other first text groups, and add the removed text to the first text group corresponding to the maximum semantic similarity.

[0103] According to another embodiment of the present invention, the first group name segmentation module 302 is also used to: input the first group name corresponding to each first text group into a pre-built deep learning model, and the deep learning model performs grammatical part-of-speech analysis on each of the first group names, and segment each of the first group names according to the results of the grammatical part-of-speech analysis, and output a segmentation set.

[0104] Figure 4 is an exemplary system architecture diagram to which embodiments of the present invention can be applied.

[0105] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, network 404 and server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0106] Users can use terminal devices 401, 402, 403 to interact with server 405 through network 404 to receive or send messages, etc. Terminal devices 401, 402, 403 can be installed with various communication client applications, such as text clustering applications, etc. (only for example).

[0107] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0108] The server 405 may be a server that provides various services, such as a background management server that supports the text clustering performed by the user using the terminal devices 401, 402, and 403 (only as an example). The background management server may calculate the edit distance between each text in the text set, cluster each text based on the edit distance between each text, and obtain multiple first text groups and their corresponding first group names; segment the first group names corresponding to each first text group to obtain a segmentation set; calculate the edit distance between each segment in the segmentation set, cluster each segment based on the edit distance between each segment, and obtain multiple segmentation groups; for each segmentation group, find out each first group name corresponding to the segmentation group, extract the second group name from each first group name corresponding to the segmentation group, and aggregate the first text groups corresponding to each first group name corresponding to the segmentation group into a second text group, and feed back the processing results to the terminal device.

[0109] It should be noted that the text clustering method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the text clustering device is generally disposed in the server 405 .

[0110] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0111] Reference below Figure 5 , which shows a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 5 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0112] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage part 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the system 500 are also stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other through a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0113] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, etc.; an output section 507 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 508 including a hard disk, etc.; and a communication section 509 including a network interface card such as a LAN card, a modem, etc. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 510 as needed, so that a computer program read therefrom is installed into the storage section 508 as needed.

[0114] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 509, and / or installed from the removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are executed.

[0115] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination thereof.

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

[0117] The units involved in the embodiments of the present invention may be implemented by software or hardware. The units described may also be arranged in a processor, for example, may be described as follows: a processor includes: a first text group generation module, a first group name segmentation module, a segmentation clustering module, and a second text group generation module.

[0118] Among them, the names of these modules do not constitute a limitation on the modules themselves in certain cases. For example, the first group name segmentation module can also be described as "a module used to segment the first group names corresponding to each first text group to obtain a segmentation set."

[0119] On the other hand, the present invention also provides a computer-readable medium, which may be included in the device described in the embodiment; or it may exist independently and not be assembled into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by a device, the device includes: respectively calculating the edit distance between each text in the text set, clustering each text based on the edit distance between each text, and obtaining multiple first text groups and their corresponding first group names; segmenting the first group names corresponding to each first text group to obtain a segmentation set; respectively calculating the edit distance between each segment in the segmentation set, clustering each segment based on the edit distance between each segment, and obtaining multiple segmentation groups; for each segmentation group, finding out each first group name corresponding to the segmentation group, extracting a second group name from each first group name corresponding to the segmentation group, and aggregating the first text groups corresponding to each first group name corresponding to the segmentation group into a second text group.

[0120] The technical solution according to the embodiment of the present invention has the following advantages or beneficial effects: by respectively calculating the edit distance between each text in the text set, clustering each text based on the edit distance between each text, and obtaining multiple first text groups and their corresponding first group names; segmenting the first group names corresponding to each first text group to obtain a segmentation set; respectively calculating the edit distance between each segmentation in the segmentation set, clustering each segmentation based on the edit distance between each segmentation to obtain multiple segmentation groups; for each segmentation group, finding each first group name corresponding to the segmentation group, extracting the second group name from each first group name corresponding to the segmentation group, and aggregating the first text groups corresponding to each first group name corresponding to the segmentation group into a second text group. The technical solution realizes a low-cost and accurate text clustering method, makes full use of the first group name representing the semantics of the first text group, further performs fine-grained segmentation and clustering on the first group name based on the first text group of text clustering, reduces the amount of calculation while improving the clustering accuracy, and ensures the implementation and application of the text clustering method.

[0121] The specific implementation methods described herein do not constitute limitations on the scope of protection of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention shall be included in the scope of protection of the present invention.

Claims

1. A method for text clustering, It is characterized in that include: respectively calculating the edit distance between each text in the text set, and clustering each text based on the edit distance between each text to obtain a plurality of first text groups and their corresponding first group names; Segment the first group names corresponding to each first text group to obtain a segmentation set; Calculating the edit distance between each word in the word set respectively, clustering each word based on the edit distance between each word, and obtaining a plurality of word groups; For each word segmentation group, find out the first group names corresponding to the word segmentation group, extract the second group names from the first group names corresponding to the word segmentation group, and aggregate the first text groups corresponding to the first group names corresponding to the word segmentation group into a second text group.

2. The method according to claim 1, It is characterized in that The participle group has a participle group name; Extracting the second group name from each first group name corresponding to the word group includes: Query the part of speech of the word group name corresponding to the word group; In the case where the part of speech is an adjective or a noun, selecting the first group name with the highest word frequency among the first group names corresponding to the word groups as the second group name, wherein the word frequency of the first group name is the total number of texts in the first text group corresponding to the first group name; When the part of speech is a verb, the participle group name is used as the second group name.

3. The method according to claim 1, It is characterized in that Clustering the individual word segments based on the edit distances between the individual word segments to obtain multiple word segments groups, including: According to the edit distance between each segmentation word and the preset grouping threshold, the segmentations with close edit distance are classified into one group to construct multiple segmentation word groups; According to the preset segmented word group name selection principle, a segmented word is selected from each segmented word group as the corresponding segmented word group name, and multiple segmented word groups with segmented word group names are obtained; wherein the segmented word group name selection principle is based on the selection priority, and the segmented word with the largest word frequency is selected first, followed by the segmented word with the longest word number, and finally the segmented word is selected according to the preset part of speech priority.

4. The method according to claim 1, It is characterized in that Each word in the word set has a group name identifier; Before searching for each first group name corresponding to the word segmentation group, the method further includes: The participle with the highest frequency of occurrence in the participle group is used as the main participle of the participle group; Find out the first group names corresponding to the word group, including: According to the group name identifier of each of the participles, the first group name corresponding to each participle in the participle group is searched, and when multiple participle groups correspond to the same first group name, according to the preset grammatical part-of-speech priority of the main participle of the participle group and the priority of the number of participles, a participle group is determined from the multiple participle groups to establish a corresponding relationship with the first group name.

5. The method according to claim 3, It is characterized in that After selecting a participle from each participle group as the corresponding participle group name, the method further includes: Calculate the edit distance value between each word in the word group and the corresponding word group name, and when the edit distance value is less than a preset threshold, remove the corresponding word from the word group, then calculate the edit distance value between the removed word and the word group names of other word groups, and add the removed word to the word group corresponding to the largest edit distance value.

6. The method according to claim 1, It is characterized in that After extracting the second group names from the first group names corresponding to the word groups, the method further includes: The first group names corresponding to the word groups are grouped into a first group name set, and the second group name is the name of the first group name set; Calculate the semantic similarity between each first group name in the first group name set and the second group name, and when the semantic similarity is less than a preset semantic threshold, remove the corresponding first group name from the first group name set, then calculate the semantic similarity between the removed first group name and the second group name corresponding to other first group name sets, and add the removed first group name to the first group name set corresponding to the maximum semantic similarity.

7. The method according to claim 1, It is characterized in that Calculating the edit distance between each text in the text set respectively, and clustering each text based on the edit distance between each text, including: Sort the texts in the text set according to the text length to obtain a sorted text set. Take the longest text in the sorted text set as the calculation starting point, add the longest text to the first group, and perform the following operations on each subsequent text according to the order of the texts in the sorted text set until all the texts are traversed: The edit distance between the text and the shortest text in each group is calculated. If the edit distance exceeds a preset classification threshold, the text is added to the corresponding group; otherwise, the text is added to a new group.

8. The method according to claim 1, It is characterized in that The first group names corresponding to the multiple first text groups are obtained, including: Performing part-of-speech analysis on the text in each first text group; According to the result of text part-of-speech analysis, the text in each first text group is matched with a preset text part-of-speech template, and the text with the highest word frequency is selected from the texts successfully matching the text part-of-speech template as the first group name corresponding to the first text group.

9. The method according to claim 1, It is characterized in that After obtaining a plurality of first text groups and their corresponding first group names, the method further includes: Calculate the edit distance value between each text in each of the first text groups and the corresponding first group name, and when the edit distance value is less than a preset group threshold, remove the corresponding text from the first text group, then calculate the edit distance value between the removed text and the first group names of other first text groups, and add the removed text to the first text group corresponding to the largest edit distance value.

10. The method according to claim 1, It is characterized in that Before segmenting the first group names corresponding to the first text groups, the method further includes: Calculate the semantic similarity between each text in each of the first text groups and the corresponding first group name, and when the semantic similarity is less than a preset semantic threshold, remove the corresponding text from the first text group, then calculate the semantic similarity between the removed text and the first group names of other first text groups, and add the removed text to the first text group corresponding to the maximum semantic similarity.

11. The method according to claim 1, It is characterized in that The first group names corresponding to each first text group are segmented to obtain a segmentation set, including: The first group names corresponding to each first text group are input into a pre-built deep learning model, and the deep learning model performs grammatical part-of-speech analysis on each of the first group names, and segments each of the first group names according to the results of the grammatical part-of-speech analysis, and outputs a segmentation set.

12. A device for text clustering, It is characterized in that include: A first text group generating module, used for respectively calculating the edit distance between each text in the text set, clustering each text based on the edit distance between each text, and obtaining a plurality of first text groups and their corresponding first group names; A first group name segmentation module is used to segment the first group name corresponding to each first text group to obtain a segmentation set; A word clustering module, used to calculate the edit distance between each word in the word set, and cluster each word based on the edit distance between each word to obtain multiple word groups; The second text group generation module is used to find out the first group names corresponding to each word group, extract the second group names from the first group names corresponding to the word group, and aggregate the first text groups corresponding to the first group names corresponding to the word group into a second text group.

13. A mobile electronic device terminal, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 11.

14. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 11 is implemented.