Text clustering method and related apparatus

By first performing text extraction and vectorization at the event granularity during the text clustering process, the problem of inaccurate clustering granularity control in the existing technology is solved, and the accuracy and adaptability of the clustering results are achieved.

WO2025208994A1PCT designated stage Publication Date: 2025-10-09HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/071979
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-04-02
Filing Date
2025-01-13
Publication Date
2025-10-09

AI Technical Summary

Technical Problem

Existing text clustering algorithms indirectly control the clustering granularity through the number of clusters, resulting in inaccurate clustering results and making it difficult to meet the needs of different application scenarios.

Method used

By performing text extraction and vectorization on the text at the preset event granularity, vectors of key information are obtained, and clustering is performed based on these vectors to ensure that the clustering results converge to the granularity expected by the user.

Benefits of technology

The accuracy and precision of clustering results are improved, which can adapt to user needs in different scenarios and ensure that the clustering results meet the expected granularity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025071979_09102025_PF_FP_ABST
    Figure CN2025071979_09102025_PF_FP_ABST
Patent Text Reader

Abstract

A text clustering method, by means of which a clustering result can converge to a granularity desired by a user, thereby improving the text clustering effect. In the text clustering method, for a plurality of texts to be clustered, text extraction is first executed on the plurality of texts at a preset event granularity by means of a model, in order to obtain key information of each text at the specific granularity; and text vectorization is then executed on the extracted key information to obtain vectors of the key information, and on the basis of the vectors of the key information, clustering is executed, in order to realize clustering of the plurality of texts. In the solution, key information of texts is first extracted from the texts on the basis of a set event granularity, and clustering is then executed on the basis of the key information, so that a clustering process can be effectively guided to cluster texts on the basis of information at a fixed granularity, thereby driving a clustering result to converge to a granularity desired by a user, and thus improving the text clustering effect.
Need to check novelty before this filing date? Find Prior Art

Description

A text clustering method and related device

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on April 2, 2024, with application number 202410397447.0 and application name “A text clustering method and related device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of text processing technology, and in particular to a text clustering method and related devices. Background Art

[0003] With the development of the information age, text data continues to emerge. Text clustering algorithms, as an effective means of processing and organizing text data, have received widespread attention.

[0004] Accurately setting the clustering granularity of text clustering algorithms based on user needs is a major challenge currently faced by text clustering algorithms. Generally speaking, different application scenarios have vastly different requirements for text clustering granularity. Some scenarios require fine-grained clustering results to more accurately reflect the subtle structure inherent in the information, while others prioritize coarse-grained clustering results to achieve higher-level abstraction and understanding of the information.

[0005] In related art, when using text clustering algorithms, the clustering granularity is mainly controlled by setting the number of clusters obtained. Simply put, when the user expects a coarse-grained clustering result, the number of clusters is set to a small number, so that coarse-grained texts are clustered together; when the user expects a fine-grained clustering result, the number of clusters is set to a large number, so that fine-grained texts are clustered together.

[0006] However, related technologies essentially indirectly control the clustering granularity through the number of clusters, and the final clustering results are not necessarily divided based on the granularity of the text, resulting in poor clustering results. Summary of the Invention

[0007] The present application provides a text clustering method that can converge the clustering results to the granularity expected by the user and improve the text clustering effect.

[0008] In a first aspect, a text clustering method is provided for clustering text at a specific granularity. The text clustering method comprises: first obtaining multiple texts to be clustered; then, using a first model, performing text extraction on each of the multiple texts at a preset event granularity to obtain multiple subtexts, wherein the events represented by the multiple subtexts have the same granularity. That is, text extraction is performed on each of the multiple texts, and the granularity of the events described by the extracted subtexts conforms to the preset event granularity. The preset event granularity refers to a pre-set event granularity. At a finer event granularity, events are described in a more detailed and specific manner; at a coarser event granularity, events are described in a more abstract and broad manner.

[0009] Next, text vectorization is performed on each of the subtexts to generate multiple subtext vectors. Text vectorization involves representing text information as vectors that express the text's semantics, using numerical vectors to represent the text's semantics. Therefore, a subtext vector is essentially an N-dimensional real-valued vector that represents the corresponding subtext as a point in a continuous numerical space.

[0010] Finally, based on multiple sub-text vectors, clustering is performed on multiple texts to obtain clustering results.

[0011] In this solution, for multiple texts that need to be clustered, the model first performs text extraction on the multiple texts at a preset event granularity, thereby obtaining the key information of each text at a specific granularity. Then, text vectorization is performed on the extracted key information to obtain a vector of the key information, and clustering is performed based on the vector of the key information, thereby achieving clustering of multiple texts. Because this solution first extracts the key information from the text according to the set event granularity and then performs clustering based on the key information, it can effectively guide the clustering process to cluster the text according to information of a fixed granularity, prompting the clustering results to converge to the granularity desired by the user, thereby improving the text clustering effect.

[0012] In one possible implementation, after acquiring multiple texts, text vectorization can be performed on each of the multiple texts to obtain multiple text vectors. Then, based on the multiple sub-text vectors and multiple text vectors, the sub-text vectors and text vectors corresponding to the same text are fused to obtain multiple fused vectors corresponding to the multiple texts. Since each text vector has a corresponding text, and each sub-text vector also establishes a corresponding relationship between the sub-text and the text based on the sub-text, it is possible to determine the sub-text vector and text vector corresponding to each of the multiple texts, thereby achieving the fusion of the sub-text vector and text vector corresponding to the same text.

[0013] When clustering multiple documents, the multiple documents can be clustered based on multiple fused vectors. Specifically, since the multiple fused vectors correspond one-to-one to the multiple documents, clustering the multiple fused vectors based on the distance between them yields a clustering result for the multiple documents, allowing the category to be determined for each document.

[0014] In this solution, by fusing the text vector with the vector of key information extracted from the text, and then realizing text clustering based on the fused vector, the overall semantics of the text itself and the semantics of the key information in the text can be taken into account during the clustering process, thereby improving the accuracy of the clustering results and prompting the clustering results to converge to the granularity expected by the user, thereby ensuring the accuracy of the final clustering results.

[0015] In one possible implementation, based on multiple sub-text vectors and multiple text vectors, the sub-text vectors and text vectors corresponding to the same text are fused respectively, including: obtaining a first sub-text vector and a first text vector corresponding to the same text, the first sub-text vector belonging to multiple sub-text vectors, and the first text vector belonging to multiple text vectors; weighting and splicing the first sub-text vector and the first text vector to obtain a first fused vector, the first fused vector belonging to multiple fused vectors.

[0016] In this solution, during the process of vector fusion, by weighting two different vectors and then splicing them together, the proportion of the vectors in the fusion process can be adjusted, thereby highlighting the vectors of key information in the text, guiding the clustering results to converge to the granularity expected by the user, and improving the accuracy of the clustering results.

[0017] In one possible implementation, clustering is performed on multiple texts based on multiple fusion vectors, including: dividing the multiple fusion vectors into different clusters to obtain multiple clusters. That is, each fusion vector corresponds to a cluster, and the clustering process is the process of merging the multiple clusters initially divided. If the text corresponding to the fusion vector in a first cluster and the text corresponding to the fusion vector in a second cluster both describe the same event at a preset event granularity, the first cluster and the second cluster are merged to obtain a new cluster; wherein the multiple clusters include the first cluster and the second cluster.

[0018] In this scheme, by dividing multiple fusion vectors into multiple clusters and judging whether the texts corresponding to the fusion vectors in the clusters describe the same event, it is decided whether to merge the clusters. This can effectively improve the accuracy of cluster merging and ensure that the texts corresponding to the merged clusters are all texts in the same category, thereby ensuring the accuracy of the clustering results.

[0019] In one possible implementation, when determining whether two clusters can be merged from among multiple clusters, the first and second clusters determined are the two clusters with the smallest vector distance among the multiple clusters. Then, using a second model, it is determined whether the text corresponding to the fused vector in the first cluster and the text corresponding to the fused vector in the second cluster describe the same event.

[0020] In this solution, by selecting two clusters with the smallest vector distance from multiple clusters for merging when merging clusters, it can be ensured that the two clusters with the highest merging probability are selected for merging each time, thereby effectively improving the efficiency of cluster convergence.

[0021] In one possible implementation, the text clustering method further includes: constructing a sample pair including a first subtext and a second subtext, wherein the first subtext and the second subtext both belong to multiple subtexts; determining a label for the sample pair, wherein the label is used to indicate whether the first subtext and the second subtext describe the same event; and updating a semantic representation model based on the sample pair and the label to obtain an updated semantic representation model, wherein the updated semantic representation model is used to perform text vectorization on each of the multiple subtexts. When updating the semantic representation model, a loss function may be constructed based on the label of the sample pair and the output of the semantic representation model, and the weight parameters of the semantic representation model may be updated by minimizing the value of the loss function.

[0022] In this solution, by using subtexts to construct sample pairs and fine-tuning the semantic representation model, the discrimination between vectors output by the semantic representation model can be effectively improved, which is conducive to improving the subsequent clustering accuracy.

[0023] In one possible implementation, to determine the first subtext and the second subtext, clustering may be performed on multiple subtexts to obtain multiple subtext clusters; and based on the multiple subtext clusters, the first subtext and the second subtext are determined. The first subtext and the second subtext are both located on the edge of any one of the multiple subtext clusters.

[0024] In this scheme, by selecting sub-texts on the edge of the cluster to construct sample pairs, we can effectively select samples that are difficult for the semantic representation model to distinguish to perform the fine-tuning process, avoiding fine-tuning the semantic representation model based on all sub-texts. While ensuring the fine-tuning effect of the semantic representation model, the workload of fine-tuning is reduced as much as possible.

[0025] In one possible implementation, determining a label for a sample pair specifically includes: inputting the first subtext and the second subtext into a third model to obtain a label output by the third model; wherein the third model is used to determine whether the two input texts describe the same event.

[0026] In one possible implementation, when the label is used to indicate that the first subtext and the second subtext describe the same event, the update goal of the semantic representation model is to reduce the distance between the vectors obtained by performing text vectorization on the first subtext and the second subtext; when the label is used to indicate that the first subtext and the second subtext do not describe the same event, the update goal of the semantic representation model is to increase the distance between the vectors obtained by performing text vectorization on the first subtext and the second subtext.

[0027] In one possible implementation, the preset event granularity includes a first event granularity, a second event granularity, or a third event granularity; the first event granularity is used to indicate the field or subject to which the event belongs, the second event granularity is used to indicate the subject and action of the event, and the third event granularity is used to indicate the subject, object, action, time, and place of the event.

[0028] In a second aspect, a text clustering device is provided, including: an acquisition module for acquiring multiple texts to be clustered; a processing module for performing text extraction on the multiple texts at a preset event granularity through a first model to obtain multiple sub-texts, and the granularity of the events represented by the multiple sub-texts is the same; the processing module is also used to perform text vectorization on the multiple sub-texts to obtain multiple sub-text vectors; the processing module is also used to perform clustering on the multiple texts based on the multiple sub-text vectors to obtain clustering results.

[0029] In one possible implementation, the processing module is further used to: perform text vectorization on multiple texts separately to obtain multiple text vectors; based on multiple sub-text vectors and multiple text vectors, fuse the sub-text vectors and text vectors corresponding to the same text respectively to obtain multiple fused vectors corresponding to multiple texts; and perform clustering on multiple texts based on the multiple fused vectors.

[0030] In one possible implementation, the acquisition module is further used to obtain a first sub-text vector and a first text vector corresponding to the same text, where the first sub-text vector belongs to multiple sub-text vectors, and the first text vector belongs to multiple text vectors; the processing module is further used to weightedly splice the first sub-text vector and the first text vector to obtain a first fusion vector, where the first fusion vector belongs to multiple fusion vectors.

[0031] In one possible implementation, the processing module is further used to: divide multiple fusion vectors into different clusters to obtain multiple clusters; when the text corresponding to the fusion vector in the first cluster and the text corresponding to the fusion vector in the second cluster both describe the same event at a preset event granularity, merge the first cluster and the second cluster to obtain a new cluster; wherein the multiple clusters include the first cluster and the second cluster.

[0032] In one possible implementation, the processing module is further used to: determine a first cluster and a second cluster among multiple clusters, the first cluster and the second cluster being the two clusters with the smallest vector distance among the multiple clusters; and determine, through a second model, whether the text corresponding to the fusion vector in the first cluster and the text corresponding to the fusion vector in the second cluster describe the same event.

[0033] In one possible implementation, the processing module is further used to: construct a sample pair including a first subtext and a second subtext, where the first subtext and the second subtext both belong to multiple subtexts; determine a label for the sample pair, where the label is used to indicate whether the first subtext and the second subtext describe the same event; and update the semantic representation model based on the sample pair and the label to obtain an updated semantic representation model, where the updated semantic representation model is used to perform text vectorization on the multiple subtexts respectively.

[0034] In one possible implementation, the processing module is further configured to: perform clustering on a plurality of subtexts to obtain a plurality of subtext clusters; and determine a first subtext and a second subtext based on the plurality of subtext clusters; wherein the first subtext and the second subtext are both located at the edge of any one of the plurality of subtext clusters.

[0035] In one possible implementation, the processing module is further configured to: input the first subtext and the second subtext into a third model to obtain a label output by the third model; wherein the third model is configured to determine whether the two input texts describe the same event.

[0036] In one possible implementation, when the label is used to indicate that the first subtext and the second subtext describe the same event, the update goal of the semantic representation model is to reduce the distance between the vectors obtained by performing text vectorization on the first subtext and the second subtext; when the label is used to indicate that the first subtext and the second subtext do not describe the same event, the update goal of the semantic representation model is to increase the distance between the vectors obtained by performing text vectorization on the first subtext and the second subtext.

[0037] In one possible implementation, the preset event granularity includes a first event granularity, a second event granularity, or a third event granularity; the first event granularity is used to indicate the field or subject to which the event belongs, the second event granularity is used to indicate the subject and action of the event, and the third event granularity is used to indicate the subject, object, action, time, and place of the event.

[0038] In a third aspect, a computing device is provided, comprising: a processor and a memory; the memory is used to store computer instructions, and when the processor executes the instructions, the computing device executes any of the above methods.

[0039] In a fourth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer can execute any of the above methods.

[0040] In a fifth aspect, a computer program product comprising instructions is provided, which, when the instructions are executed on a computer, enables the computer to execute any of the methods described above.

[0041] In the sixth aspect, a chip system is provided, which includes a processor and a communication interface, wherein the communication interface is used to communicate with modules outside the chip shown, and the processor is used to run computer programs or instructions so that the device installed with the chip system can execute any of the methods mentioned above.

[0042] In the seventh aspect, a computing device is provided, comprising the chip system as described in the sixth aspect above, the chip system comprising a processor and a communication interface, the communication interface being used to communicate with modules outside the chip system shown, the processor being used to run computer programs or instructions so that the computing device can execute the method of any of the above aspects.

[0043] In an eighth aspect, a computing cluster is provided, comprising at least one computing device according to the third aspect or the seventh aspect, wherein any one of the computing devices is configured to execute a computer program or instruction, so that the computing device cluster can perform the method of any of the aforementioned aspects. Alternatively, some or all of the computing devices are configured to execute the computer program or instruction, so that the computing device cluster can perform the method of any of the aforementioned aspects.

[0044] Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] FIG1 is a schematic diagram of a system architecture 100 provided in an embodiment of the present application;

[0046] FIG2 is a flow chart of a text clustering method provided in an embodiment of the present application;

[0047] FIG3 is a schematic diagram of a process for clustering multiple texts provided in an embodiment of the present application;

[0048] FIG4 is a schematic diagram of a system architecture for executing a text clustering method provided in an embodiment of the present application;

[0049] FIG5 is a schematic diagram of a workflow of a key information extraction and amplification module provided in an embodiment of the present application;

[0050] FIG6 is a schematic diagram of a workflow of a text vector fine-tuning module provided in an embodiment of the present application;

[0051] FIG7 is a schematic diagram of a workflow of a hierarchical clustering module with adaptive cluster granularity provided in an embodiment of the present application;

[0052] FIG8 is a schematic diagram of a connection of multiple modules provided in an embodiment of the present application;

[0053] FIG9 is a schematic structural diagram of a text clustering device provided in an embodiment of the present application;

[0054] FIG10 is a schematic structural diagram of a chip provided in an embodiment of the present application;

[0055] FIG11 is a schematic diagram of the structure of a computing device 1100 provided in an embodiment of the present application;

[0056] FIG12 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;

[0057] FIG13 is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application;

[0058] FIG14 is a schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solutions and advantages of this application more clear, the embodiments of this application are described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only embodiments of a part of this application, rather than all embodiments. It is known to those skilled in the art that with the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0060] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the descriptions used in this way can be interchangeable where appropriate so that the embodiments can be implemented in a sequence other than that illustrated or described in this application. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or modules is not necessarily limited to those steps or modules clearly listed, but may include other steps or modules that are not clearly listed or that are inherent to these processes, methods, products or devices. The naming or numbering of steps in this application does not mean that the steps in the method flow must be executed in the time / logical sequence indicated by the naming or numbering. The named or numbered process steps can change the execution order according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved. The division of units in this application is a logical division. In actual application, there may be other division methods. For example, multiple units can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, and the indirect coupling or communication connection between units can be electrical or other similar forms, which are not limited in this application. Moreover, the units or sub-units described as separate components may or may not be physically separated, may or may not be physical units, or may be distributed into multiple circuit units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this application.

[0061] To facilitate understanding, some technical terms involved in the embodiments of this application are first introduced below.

[0062] (1) Particle size

[0063] Granularity indicates the degree of abstraction of information. The process from coarse to fine granularity is a process from abstract to concrete, and information is gradually divided into smaller, specific elements or parts.

[0064] (2) Clustering

[0065] Clustering is the process of dividing a collection of physical or abstract objects into clusters of similar objects. A cluster is a set of objects that are similar to objects in the same cluster and dissimilar to objects in other clusters.

[0066] (3) Clustering granularity

[0067] Cluster granularity represents the granularity or level at which data is grouped into clusters through clustering. Smaller cluster granularity results in more and finer clusters, while larger cluster granularity results in fewer and broader clusters.

[0068] (4) Text vectorization

[0069] Text vectorization refers to representing text information into vectors that can express the semantics of the text, that is, using numerical vectors to represent the semantics of the text.

[0070] (5) Event Argument

[0071] Event arguments are the carriers of important information about an event, including the event subject, event object, time, place or action, etc.

[0072] (6)Embedding

[0073] In machine learning and natural language processing, embedding refers to the process of mapping high-dimensional data (such as text, images, and videos) into a low-dimensional space, thereby generating an embedding vector. Simply put, an embedding vector is an N-dimensional real-valued vector that represents the input data as a point in a continuous numerical space.

[0074] Taking embedding as an example, which converts text into embedding vectors, the importance of embedding lies in its ability to represent the semantics of words or sentences. Embedding vectors can represent word semantics primarily because they are learned based on the patterns of word occurrence in language contexts. For example, if a word frequently appears with another word in certain contexts, the embedding vectors of these two words will have similar positions in vector space, indicating that they have similar meanings and semantics. Furthermore, mathematical operations can be performed between embedding vectors to reveal potential relationships between objects.

[0075] (7) Embedding Model

[0076] An embedding model is a model that maps high-dimensional data to a low-dimensional space. Generally, an embedding model is a neural network model.

[0077] (8) Large language model (LLM)

[0078] Large language models are deep learning models trained using large amounts of text data. They can generate natural language text or understand the meaning of text. Large language models can handle a variety of natural language tasks, such as text clustering, question-answering, and conversation, and are an important path to artificial intelligence.

[0079] Specifically, large language models are a technology that has emerged in recent years. Because they undergo sophisticated data engineering and training processes, their parameters already incorporate a wealth of existing natural language processing knowledge. This knowledge can already replace humans in many language-related tasks, such as having large language models write code or perform text summarization.

[0080] (9) Prompt words

[0081] Prompt words originated from a form of input designed by researchers for downstream tasks. Its function is to help the pre-trained model "recall" what it "learned" during pre-training, so it can also be called prompt words. For large language models, prompt words are user input, used to indicate the task that the large language model needs to complete. Prompt words can be a simple question, a longer text, or a set of instructions, depending on the specific needs of the user. Generally speaking, prompt words are usually short text strings that can provide context and task-related information to help the model better understand the requirements and generate correct outputs. For example, in question-answering tasks, prompt words may contain a description of the question or topic to help the large language model generate the correct answer. In addition, prompt words are usually designed by humans to help large language models better understand specific tasks or fields.

[0082] When the large language model generates content, it first processes the prompt word and then generates output based on its understanding of the prompt word. The large language model works by predicting the probability of the next word appearing based on the previous context entered by the user, thereby generating the following text word by word. Therefore, differences in the prompt word entered by the user can directly affect the quality of the large language model's output. In some cases, even if the prompt word entered by the user differs by just a few words, the large language model may still generate significantly different content.

[0083] (10) Text extraction

[0084] Text extraction refers to extracting useful information or knowledge from large amounts of text data. The information extracted from text can be entities, relationships, or events. Text extraction technology can help humans quickly and accurately obtain the required information from massive amounts of text data.

[0085] Currently, text clustering algorithms typically preprocess text into vectors and then use clustering techniques to cluster these vectors to obtain the final text clustering results. Because different application scenarios have vastly different requirements for text clustering granularity, accurately setting the clustering granularity based on actual application constants is a major challenge facing text clustering algorithms.

[0086] In related art, when using a text clustering algorithm, the clustering granularity is mainly controlled by setting the number of clusters obtained by clustering. Taking the k-means clustering algorithm as an example, the user needs to pre-set a k value as the number of clusters. When the user expects to obtain a coarse-grained clustering result, the k value (i.e., the number of clusters) is set to a smaller value, so that texts that are similar in coarse granularity will be clustered together; when the user expects to obtain a fine-grained clustering result, the k value is set to a larger value, so that texts that are similar in fine granularity will be clustered together.

[0087] However, these techniques essentially indirectly control the clustering granularity by using the number of clusters. The resulting clustering results are not necessarily based on the granularity of the text, resulting in poor clustering results. Furthermore, real-world text data is often dynamic and complex, making it even more complex to select the appropriate clustering granularity in different scenarios.

[0088] In view of this, the present application provides a text clustering method that can adaptively control the clustering granularity according to the needs of the user, ensuring that the results obtained by clustering can adapt to the needs of the user in different scenarios. Specifically, for multiple texts that need to be clustered, the model is first used to perform text extraction on the multiple texts at a preset event granularity, thereby obtaining the key information of each text at a specific granularity. Then, text vectorization is performed on the extracted key information to obtain a vector of the key information, and clustering is performed based on the vector of the key information, thereby realizing the clustering of multiple texts. Since the present solution first extracts the key information of the text according to the set event granularity, and then performs clustering based on the key information, it can effectively guide the clustering process to cluster the text according to information of a fixed granularity, prompting the clustering results to converge to the granularity expected by the user, thereby improving the clustering effect of the text.

[0089] For ease of understanding, the following first introduces the system architecture and application scenarios of the text clustering method provided in the embodiments of the present application.

[0090] Please refer to Figure 1, which is a schematic diagram of a system architecture 100 provided in an embodiment of the present application. As shown in Figure 1, in this system architecture 100, the execution device 110 can be implemented by at least one computing instance of a physical host (computing device), a virtual machine, or a container. When the execution device 110 is implemented by a virtual machine or a container, the execution device 110 actually exists in the form of a cloud computing product and can provide cloud services.

[0091] Optionally, the execution device 110 cooperates with other computing devices, such as data storage devices, load balancers, and other devices; the execution device 110 can be deployed on one physical site or distributed on multiple physical sites.

[0092] In addition, a text database 120 is also provided in the system architecture 100 . The text database 120 is used to store texts that need to be clustered and the clustering results of the texts.

[0093] Optionally, in order to store data persistently, the text database 120 can be implemented through a data storage system. The data storage system can be located outside the execution device 110 and exchange data with the execution device 110 through a network. Optionally, in the case where the execution device 110 is a physical host, the data storage system can also be located inside the execution device 110, such as the data storage system exchanges data with the processor through a bus. In this case, the data storage system is manifested as a hard disk. In the case of having a data storage system, the execution device 110 can use the data in the data storage system (such as the text in the text database 120), or call the program code in the data storage system to implement the text clustering method provided in the embodiment of the present application.

[0094] Optionally, users can operate their respective user devices (such as local device 101 and local device 102) to interact with execution device 110. Each local device can represent any computing device, such as a personal computer, a computer workstation, a smart phone, a tablet computer, a laptop computer, and a smart car.

[0095] Each user's local device can interact with the execution device 110 through a communication network of any communication mechanism / communication standard. The communication network can be a wide area network, a local area network, a point-to-point connection, etc., or any combination thereof.

[0096] In one implementation, the execution device 110 is used to implement the text clustering method provided in the embodiment of the present application, thereby obtaining corresponding text clustering results.

[0097] Optionally, during the process of executing device 110 implementing the text clustering method, local device 101 and local device 102 may provide executing device 110 with text to be clustered so that executing device 110 can perform clustering on the text. Furthermore, after executing device 110 executes the text clustering method and obtains the text clustering results, the text clustering results may be fed back to local device 101 and local device 102.

[0098] Optionally, the text required when the execution device 110 executes the text clustering method may also be pre-stored in the text database 120 , and the execution device 110 obtains the text to be clustered by reading the text data from the text database 120 .

[0099] In another implementation, one or more aspects of the execution device 110 can be implemented by each local device. For example, the local device 101 can provide local data or feedback calculation results to the execution device 110, or execute the text clustering method provided in the embodiment of the present application.

[0100] In general, the text clustering method provided in the embodiments of the present application can be applied to electronic devices, such as the aforementioned execution device 110 , local device 101 , or local device 102 .

[0101] Specifically, the text clustering method provided in the embodiments of the present application can be applied to any scenario where text clustering is required. In most scenarios, text clustering is often used to cluster batches of texts so that the clustered texts can be applied to downstream tasks.

[0102] In one possible application scenario, the text clustering method provided by this application can be applied to a hotspot mining system. In a hotspot mining system, it is first necessary to cluster the events in the text, and then perform heat feature analysis on each event cluster to identify hot events. Based on the text clustering method of this application, it is possible to control the granularity of hotspot information in the hotspot mining system and generate cluster information of corresponding granularity based on user demands, so that the hotspot information mined by the hotspot mining system better meets user expectations.

[0103] In another possible application scenario, the text clustering method provided by this application can be applied to information retrieval systems to cluster different texts. Based on the text clustering method of this application, the text clustering effect in information retrieval systems can be improved, and index tags of different granularities corresponding to different levels of text can be generated for each text, thereby making the retrieved information more accurate and efficient.

[0104] In another possible application scenario, the text clustering method provided in this application can be applied to social media analysis. In social media data, user-generated text content may contain multiple levels of topics and relationships. Therefore, when clustering user-generated text content, the clustering granularity is affected by the complexity of the topics and the diversity of user behavior. Based on the text clustering method of this application, an appropriate clustering granularity can be selected during text clustering, and user-generated text content can be clustered according to the set clustering granularity, thereby improving clustering accuracy.

[0105] In another possible application scenario, the text clustering method provided in this application can be applied to e-commerce product clustering. On e-commerce platforms, products may be clustered in multiple dimensions, such as by category, brand, function, etc. Based on the text clustering method provided in this application, appropriate clustering dimensions can be dynamically selected to cluster products at the clustering granularity required by the scenario.

[0106] Please refer to Figure 2, which is a flow chart of a text clustering method provided in an embodiment of the present application. As shown in Figure 2, the text clustering method provided in an embodiment of the present application includes the following steps 201-204.

[0107] Step 201: Acquire multiple texts to be clustered.

[0108] In this embodiment, the execution device can obtain multiple pre-stored texts from a database, and the obtained multiple texts are all texts that need to be clustered. The execution device can also obtain the multiple texts that need to be clustered by receiving texts sent by the user using a client.

[0109] The multiple texts to be clustered can be of various types, depending on the application scenario of text clustering and are not specifically limited here. For example, in a hotspot mining scenario, the multiple texts to be clustered can be various hot news items retrieved from the Internet; in an information retrieval scenario, the multiple texts to be clustered can be pre-collected text knowledge stored in a database; in a product clustering scenario, the multiple texts to be clustered can be introduction texts of various products.

[0110] In step 202, text extraction is performed on the plurality of texts at a preset event granularity using the first model to obtain a plurality of sub-texts, wherein the granularity of the events represented by the plurality of sub-texts is the same.

[0111] In this embodiment, performing text extraction on multiple texts at a preset event granularity refers to performing text extraction on each of the multiple texts (i.e., extracting key information from the text), so that the granularity of the event described by the extracted subtext (i.e., the key information of the text) conforms to the preset event granularity. In this way, for each of the multiple texts, a corresponding subtext can be extracted through the first model, that is, multiple texts correspond one-to-one to multiple subtexts. Among them, the preset event granularity refers to a pre-set event granularity. There are many forms of description of events from abstract to concrete, and event granularity is often a specific form of event description, so event granularity often has diversity. At different event granularities, the description form of the same event is often different. For example, at a finer event granularity, the event will be described in more detail and concretely; at a coarser event granularity, the event will be described in more abstract and broad terms.

[0112] Specifically, the preset event granularity may be an event granularity specified by a user according to an actual application scenario, or the preset event granularity may be determined based on an analysis result of an event granularity analysis of a batch of texts provided by a user.

[0113] Exemplarily, the preset event granularity may include a first event granularity, a second event granularity, or a third event granularity, i.e., the preset event granularity may be any of the three event granularities mentioned above. The first event granularity may be understood as a higher-level event, used to indicate the field or subject to which the event belongs; the second event granularity may be understood as a lower-level event, used to indicate the subject and action of the event; and the third event granularity may be understood as an event instance, used to indicate the subject, object, action, time, and location of the event. Specifically, the definitions of various event granularities and textual examples can be found in Table 1 below.

[0114] Table 1

[0115] In general, the text to be clustered usually contains a lot of redundant information. After performing text extraction on the text using the first model, the key information in the text can be extracted. Moreover, the key information extracted from the text actually describes specific events at a preset event granularity.

[0116] The first model may be, for example, a large language model, a long short-term memory (LSTM) network, a gated recurrent unit (GRU) network, an attention network, a bidirectional encoder representation from Transformers (BERT), a generative pre-trained transformer (GPT), or other natural language processing models. This embodiment does not limit the specific structure of the first model.

[0117] Taking the first model as a large language model and the preset event granularity as an event instance as an example, we can construct prompt words based on the text to instruct the large language model to perform text extraction according to the preset event granularity. Specifically, the prompt words constructed based on the text are as follows: "Text: xxx; Task: The above is an article, please extract the events in it. The description of the event needs to include all the event arguments: time, place, action, subject and object, etc. For example, "On July 28, 2022, XX Bank announced an increase in the reserve balance interest rate, xxx."

[0118] Step 203 : Perform text vectorization on the multiple sub-texts respectively to obtain multiple sub-text vectors.

[0119] In this step, after extracting multiple subtexts, text vectorization can be performed on each of the multiple subtexts, thereby converting each subtext into a corresponding subtext vector. Text vectorization refers to representing text information as a vector that can express the text's semantics, that is, using a numerical vector to represent the text's semantics. Therefore, a subtext vector is essentially an N-dimensional real-valued vector that can represent the corresponding subtext as a point in a continuous numerical space.

[0120] Optionally, in order to facilitate subsequent clustering processing, the dimensions of the multiple sub-text vectors are the same, for example, the multiple sub-text vectors are all N-dimensional vectors. That is to say, regardless of whether the lengths of the multiple sub-texts are the same, the lengths of the multiple sub-text vectors obtained after performing text vectorization on the multiple sub-texts are the same. Exemplarily, this step can be to use a pre-trained semantic representation model (such as an Embedding model) to perform text vectorization on the multiple sub-texts respectively, thereby converting the multiple sub-texts into Embedding vectors (i.e., the multiple sub-text vectors mentioned above).

[0121] After converting a subtext into a subtext vector, the subtext vector can be used to represent the semantics of the subtext. Furthermore, if the vector distance between two subtext vectors is close, it means that the semantics of the subtexts corresponding to these two subtext vectors are similar; if the vector distance between two subtext vectors is far, it means that the semantics of the subtexts corresponding to these two subtext vectors are significantly different. Therefore, based on the ability of subtext vectors to represent subtext semantics, clustering can be performed based on the distance between subtext vectors.

[0122] Step 204 : clustering the multiple texts based on the multiple sub-text vectors to obtain a clustering result.

[0123] Specifically, since multiple subtext vectors are derived from multiple subtexts, and multiple subtexts are derived from text extraction on multiple texts, there is a one-to-one correspondence between the multiple subtext vectors and the multiple texts. Therefore, clustering multiple texts based on multiple subtext vectors is essentially the process of clustering the multiple subtext vectors. Since each subtext vector uniquely corresponds to a single text, after obtaining the clustering results for multiple subtext vectors, the text clustering results can also be obtained based on the correspondence between the subtext vectors and the texts.

[0124] After clustering multiple texts based on multiple sub-text vectors, texts describing the same event at a preset event granularity will be clustered into the same category, allowing texts to be clustered according to the event granularity desired by the user.

[0125] For example, please refer to Figure 3, which is a schematic diagram of a process for clustering multiple texts provided in an embodiment of the present application. As shown in Figure 3, the multiple texts to be clustered include text 1-text N. By inputting text 1-text N into the first model to perform text extraction, the subtext 1-subtext N output by the first model can be obtained. Then, the semantic representation model is used to perform text vectorization on the subtext 1-subtext N respectively, thereby obtaining the subtext vector 1-subtext vector N. Finally, by performing clustering on the subtext vector 1-subtext vector N, each subtext vector can be divided into a corresponding cluster cluster, thereby obtaining multiple cluster clusters. Since the subtext vector 1-subtext vector N is one-to-one corresponding to the text 1-text N, after obtaining the clustering result of the subtext vector 1-subtext vector N, the clustering result of the text 1-text N can actually be obtained, thereby realizing the clustering of the text.

[0126] Optionally, in some embodiments, when performing clustering on text, the vector of the text and the vector of the sub-text may be fused to achieve text clustering based on the fused vector.

[0127] For example, after acquiring multiple texts, text vectorization can be performed on each of the multiple texts to obtain multiple text vectors. The process of performing text vectorization on multiple texts is similar to the process of performing text vectorization on multiple sub-texts. For example, both can be performed based on the same semantic representation model, thereby ensuring that text vectorization is implemented based on the same standard.

[0128] Then, based on the multiple sub-text vectors and multiple text vectors, the sub-text vectors and text vectors corresponding to the same text are fused to obtain multiple fused vectors corresponding to the multiple texts. Specifically, since each text vector has a corresponding text, and each sub-text vector also has a corresponding relationship between the sub-text and the text, it is possible to determine the sub-text vector and text vector corresponding to each text in the multiple texts, thereby achieving the fusion of the sub-text vectors and text vectors corresponding to the same text.

[0129] Thus, in step 204, the multiple documents may be clustered based on the multiple fused vectors. That is, since the multiple fused vectors correspond one-to-one to the multiple documents, clustering the multiple fused vectors based on the distance between them yields a clustering result for the multiple documents, thereby enabling the determination of the category to which each document belongs.

[0130] In this solution, by fusing the text vector with the vector of key information extracted from the text, and then realizing text clustering based on the fused vector, the overall semantics of the text itself and the semantics of the key information in the text can be taken into account during the clustering process, thereby improving the accuracy of the clustering results and prompting the clustering results to converge to the granularity expected by the user, thereby ensuring the accuracy of the final clustering results.

[0131] There are many ways to fuse subtext vectors and text vectors. Some of these vector fusion methods are introduced below.

[0132] Exemplarily, based on multiple sub-text vectors and multiple text vectors, a first sub-text vector and a first text vector corresponding to the same text can be obtained, the first sub-text vector belongs to multiple sub-text vectors, and the first text vector belongs to multiple text vectors.

[0133] Then, the first subtext vector and the first text vector are weighted and concatenated to obtain a first fusion vector, which belongs to multiple fusion vectors. For example, assuming that the first subtext vector and the first text vector are both 3-dimensional vectors, a weight can be assigned to the first subtext vector and the first text vector respectively, and the first subtext vector is multiplied by the corresponding weight, and the first text vector is multiplied by the corresponding weight, and finally the two multiplication results are concatenated together to obtain a 5-dimensional vector. For example, assuming that the first subtext vector is [0.1, 0.2, 0.3], and the weight of the first subtext vector is 0.9, and the first text vector is [0.2, 0.3, 0.5], and the weight of the first text vector is 0.1, then the first fusion vector is specifically [0.1*0.9, 0.2*0.9, 0.3*0.9, 0.2*0.1, 0.3*0.1, 0.5*0.1].

[0134] In other words, for the subtext vector and text vector corresponding to the same text, the pair of vectors can be weighted and concatenated to obtain the corresponding fusion vector. Generally, the weight of the subtext vector will be higher than the weight of the text vector to highlight the subtext vector.

[0135] In this solution, during the process of vector fusion, by weighting two different vectors and then splicing them together, the proportion of the vectors in the fusion process can be adjusted, thereby highlighting the vectors of key information in the text, guiding the clustering results to converge to the granularity expected by the user, and improving the accuracy of the clustering results.

[0136] In addition, the following will introduce in detail how to perform clustering on multiple texts based on multiple fusion vectors.

[0137] For example, after obtaining multiple fusion vectors, the multiple fusion vectors can be divided into different clusters to obtain multiple clusters. That is, each fusion vector corresponds to a cluster, and the clustering process is the process of merging the multiple clusters initially divided.

[0138] Then, in the process of merging clusters, if the text corresponding to the fused vector in the first cluster and the text corresponding to the fused vector in the second cluster both describe the same event at a preset event granularity, the first cluster and the second cluster are merged to obtain a new cluster. The multiple clusters include the first cluster and the second cluster.

[0139] That is to say, when merging clusters, two clusters are actually taken out from multiple clusters, and it is determined whether the text corresponding to the fusion vectors in the two clusters (for example, the fusion vector representing the cluster center) describes the same event at the preset event granularity. If the text corresponding to the fusion vectors in the two clusters describes the same event at the preset event granularity, it means that the text corresponding to the two clusters belongs to the same category, so the two clusters can be merged to obtain a new cluster. If the text corresponding to the fusion vectors in the two clusters does not describe the same event at the preset event granularity, it means that the text corresponding to the two clusters does not belong to the same category, so the two clusters cannot be merged.

[0140] The above introduces the process of merging the first cluster and the second cluster. In practical applications, the process can be to cyclically extract two clusters from multiple existing clusters and determine whether the two clusters can be merged, and perform the cluster merging operation when the two clusters can be merged, until there are no more clusters that can be merged in the existing clusters.

[0141] In this scheme, by dividing multiple fusion vectors into multiple clusters and judging whether the texts corresponding to the fusion vectors in the clusters describe the same event, it is decided whether to merge the clusters. This can effectively improve the accuracy of cluster merging and ensure that the texts corresponding to the merged clusters are all texts in the same category, thereby ensuring the accuracy of the clustering results.

[0142] Optionally, to improve the efficiency of cluster merging, when determining two clusters to be merged from multiple clusters, the first cluster and the second cluster determined are the two clusters with the smallest vector distance among the multiple clusters.

[0143] Then, using the second model, it is determined whether the text corresponding to the fused vector in the first cluster and the text corresponding to the fused vector in the second cluster describe the same event. The second model can be, for example, a natural language processing model such as a large language model, an LSTM network, a GRU network, an attention network, BERT, or GPT. The second model and the first model can be the same model. This embodiment does not limit the specific structure of the second model.

[0144] In other words, each time two clusters are selected from the existing clusters to determine whether they can be merged, the two clusters with the smallest vector distance are selected. Because the two clusters with the smallest vector distance have the highest probability of merging, if two clusters are randomly selected for each evaluation, it may take many evaluations before a single merge occurs, resulting in slow cluster convergence. Furthermore, using the model to determine whether two clusters can be merged is a time-consuming operation, so the number of evaluations should be minimized, selecting only the two clusters most likely to be merged for evaluation each time.

[0145] In this solution, by selecting two clusters with the smallest vector distance from multiple clusters for merging when merging clusters, it can be ensured that the two clusters with the highest merging probability are selected for merging each time, thereby effectively improving the efficiency of cluster convergence.

[0146] The above step 203 introduces the process of performing text vectorization on the subtext based on the semantic feature model. Optionally, in some embodiments, in order to improve the accuracy of the text vectorization performed by the semantic feature model and to ensure that the vector output by the semantic feature model can effectively improve the clustering effect, the present application also provides a method for fine-tuning the semantic feature model. Specifically, the process of fine-tuning the semantic feature model may include the following steps 301-305.

[0147] Step 301: clustering is performed on a plurality of subtexts to obtain a plurality of subtext clusters.

[0148] The clustering method for multiple subtexts may be to use an existing clustering algorithm, such as the K-Means algorithm, the density-based spatial clustering algorithm (DBSCAN), or the hierarchical clustering algorithm, which is not specifically limited in this embodiment.

[0149] Step 302: Determine a first subtext and a second subtext based on a plurality of subtext clusters.

[0150] The first subtext and the second subtext are both located at the edge of any one of the multiple subtext clusters.

[0151] Specifically, after obtaining multiple subtext clusters, the subtext vectors within the subtext cluster are averaged to obtain the cluster center vector. The distance between each subtext vector within the subtext cluster and the cluster center vector is then calculated. If the distance between a subtext vector and the cluster center vector is greater than a set threshold, the subtext corresponding to the subtext vector is considered to be on the edge of the subtext cluster.

[0152] In this way, by clustering subtexts and identifying subtexts at the edge of the subtext clusters, we can effectively select subtexts with more ambiguous boundaries (i.e., subtexts whose semantic representation model has difficulty accurately expressing their meaning). Then, when the semantic representation model is subsequently updated based on the selected subtexts, it can effectively strengthen the semantic representation model's understanding of these difficult-to-recognize subtexts, thereby guiding the semantic representation model to output accurate vectors.

[0153] Step 303: construct a sample pair including a first subtext and a second subtext, where both the first subtext and the second subtext belong to multiple subtexts.

[0154] Step 304 : Determine a label for the sample pair, where the label is used to indicate whether the first subtext and the second subtext describe the same event.

[0155] Specifically, in this step, the first subtext and the second subtext may be input into a third model to obtain a label output by the third model; wherein the third model is used to determine whether the two input texts describe the same event. The third model may be, for example, a large language model, an LSTM network, a GRU network, an attention network, BERT, a GPT, or other natural language processing model. The third model may be the same model as the first and second models described above. This embodiment does not limit the specific structure of the third model.

[0156] Step 305 : Based on the sample pairs and the labels, the semantic representation model is updated to obtain an updated semantic representation model. The updated semantic representation model is used to perform text vectorization on the multiple sub-texts respectively.

[0157] When updating the semantic representation model, a loss function can be constructed based on the labels of the sample pairs and the output of the semantic representation model, and the weight parameters of the semantic representation model can be updated by minimizing the value of the loss function.

[0158] Specifically, when the label indicates that the first subtext and the second subtext describe the same event, the update goal of the semantic representation model is to reduce the distance between the vectors obtained by performing text vectorization on the first subtext and the second subtext. When the label indicates that the first subtext and the second subtext do not describe the same event, the update goal of the semantic representation model is to increase the distance between the vectors obtained by performing text vectorization on the first subtext and the second subtext. In other words, the update goal of the semantic representation model is to shorten the distance between text vectors representing the same event and increase the distance between text vectors representing different events, thereby improving the distinguishability between the vectors output by the semantic representation model.

[0159] The above describes the execution process of a text clustering method provided by the present application. To facilitate understanding, the following will describe in detail the process of performing text clustering with reference to specific examples.

[0160] Please refer to Figure 4, which is a schematic diagram of a system architecture for executing a text clustering method provided in an embodiment of the present application. As shown in Figure 4, the system architecture for executing the text clustering method includes three modules: a key information extraction and amplification module, a text vector fine-tuning module, and a granularity-adaptive hierarchical clustering module.

[0161] Regarding the key information extraction and amplification module, since text content is usually diverse and contains redundant expressions, the key information extraction and amplification module uses a large language model to explicitly extract the key information that users are concerned about in the text to match the user's demand for information granularity and extract key information of the corresponding event granularity. Then, when performing text vectorization, the key information extraction and amplification module will give this part of key information a greater weight to amplify the proportion of this part of key information in the vector. Finally, when clustering based on the vector, the similarity of key information will be emphasized, so that texts with similar key information at a fixed granularity are clustered together, and the resulting clustering granularity is more in line with user demands.

[0162] The text vector fine-tuning module extracts text at the edge of a cluster after clustering and randomly combines them into multiple pairs. Next, the module uses the large language model as a binary clusterer, repeatedly asking the large language model whether two texts belong to the same cluster. Based on the large model's responses, the text pairs are labeled with positive and negative labels to generate a training set. Finally, the module uses the training set to fine-tune the text vectors, aiming to reduce the distance between text vectors belonging to the same cluster and increase the distance between text vectors belonging to different clusters, thereby improving clustering effectiveness.

[0163] The granularity-adaptive hierarchical clustering module employs a bottom-up, merged hierarchical clustering approach. It first considers each document as a cluster, and the vector distance between the documents at the cluster center as the distance between the clusters. It then identifies the two closest clusters and uses the large language model to determine whether the key information corresponding to the two documents at the cluster center belongs to the same cluster, merging or terminating the clusters. Specifically, the large language model determines the consistency of key information at a fixed granularity and dynamically controls the merging of clusters, ensuring that the clustering results converge to the desired granularity.

[0164] In general, the key information extraction and amplification module can match user demands, extract key information of a certain granularity and amplify its proportion. The downstream clustering based on the information of this granularity can obtain clusters of corresponding granularity; the text vector fine-tuning module can shorten the distance between text vectors belonging to the same cluster, expand the distance between text vectors that do not belong to the same cluster, and improve clustering accuracy; the granularity-adaptive hierarchical clustering module can dynamically control the granularity of clusters and converge the clustering results to the granularity required by the user.

[0165] The following will introduce in detail each module in the system architecture and the joint use process of these modules.

[0166] For example, please refer to Figure 5, which is a schematic diagram of the workflow of a key information extraction and amplification module provided in an embodiment of the present application. As shown in Figure 5, the key information extraction and amplification module is mainly used to implement two processes: key information extraction and information amplification.

[0167] Process 1: Extraction of key information.

[0168] First, the user's desired event granularity can be determined through demand analysis. For example, this can be determined through interviews or surveys with users in real-world scenarios. Alternatively, the user's desired event granularity can be determined based on the results of an event granularity analysis of a batch of text provided by the user.

[0169] Assuming the user's desired event granularity is event instances, we can leverage the information extraction capabilities of large language models to extract key information from each text to be clustered at the event instance granularity, aligning the extracted key information (i.e., event instances) with the user's desired granularity. This way, when downstream clustering is performed based on this granularity, each resulting cluster represents a group of similar event instances, achieving the desired granularity.

[0170] For example, in Figure 5, the text input into the large language model is: "Expectations of interest rate hikes by XX Bank are rising, and domestic PMI data indicate insufficient endogenous economic momentum..." After the large language model extracts key information at the granularity of event instances, the key information obtained is: "XX Bank continued to raise interest rates in July this year."

[0171] Process 2: Information amplification.

[0172] Before performing text clustering, the text needs to be vectorized. Specifically, a semantic representation model is first used to simultaneously vectorize the original text and the extracted event instances (i.e., key information) to obtain text vectors and event vectors (i.e., the sub-text vectors introduced in the above embodiment). The text vectors and event vectors are then weighted and horizontally spliced ​​to obtain the final fusion vector.

[0173] As shown in Figure 5, assuming the text vector has a weight of α and the event vector has a weight of β, the fusion vector is (α × text vector, β × event vector). Both weights are predefined hyperparameters and can be adjusted based on the downstream clustering effect. For example, if the granularity of the clusters has not converged to the granularity of the event instance, the weight β of the event vector can be increased.

[0174] In general, the function of the key information extraction and information amplification module is to input a piece of original text, extract key information and amplify information to obtain a vector representation of the text for use in downstream clustering to guide the convergence granularity of the clustering clusters.

[0175] Please refer to Figure 6, which is a schematic diagram of the workflow of a text vector fine-tuning module provided in an embodiment of the present application. As shown in Figure 6, the text vector fine-tuning module is mainly used to implement the two processes of clustering and training set construction and fine-tuning.

[0176] Process 1, clustering.

[0177] After obtaining the event vectors output by the key information extraction and amplification module, a clustering algorithm is used to cluster these event vectors, resulting in a clustering result. Low-confidence event vectors located at the edge of the clusters are then extracted from the clustering result to construct a fine-tuning training set. These fused vectors at the edge of the clusters can be understood as difficult sample points with fuzzy boundaries, making them difficult to accurately classify during the clustering process. A fused vector at the edge of a cluster is one whose distance from the vector representing the cluster center is greater than a preset threshold.

[0178] Process 2: training set construction and fine-tuning.

[0179] During the construction of the fine-tuning training set, the event vectors used to construct the fine-tuning training set are combined in pairs to generate multiple event vector pairs. Then, for each of these event vector pairs, the two event instances corresponding to each event vector pair are extracted, and the large language model is used to determine whether the two event instances describe the same event. In this way, samples are labeled based on the responses of the large language model, resulting in the fine-tuning training set. Finally, the semantic representation model in the key information extraction and amplification module is fine-tuned based on the fine-tuning training set to increase the discriminability between the vectors generated by the semantic representation model and improve the accuracy of downstream clustering.

[0180] As shown in Figure 6, by extracting the two event instances corresponding to each pair of event vectors, we can obtain the text corresponding to any two event instances, such as Text 1 and Text 2, and Text 3 and Text 4. In this way, we can construct prompt words to query the large language model: whether Text 1 and Text 2 describe the same event instance, and whether Text 3 and Text 2 describe the same event instance. The large language model outputs the answer, and then assigns a corresponding label to each pair of event instances.

[0181] In general, the function of the text vector fine-tuning module is to cluster the fusion vectors output by the key information extraction and information amplification modules, construct a batch of samples based on the sample points at the edge of the cluster, and then use the large language model to label the samples to obtain a training set for fine-tuning the semantic representation model. The purpose is to narrow the distance between vectors of the same event instance, increase the distance between vectors of different event instances, and improve the discrimination between samples.

[0182] It should be noted that the text vector fine-tuning module can be used only in the initial stage of performing text clustering to fine-tune the semantic representation model. After the semantic representation model is fine-tuned, the text vector fine-tuning module can be discontinued.

[0183] Please refer to Figure 7, which is a schematic diagram of the workflow of a hierarchical clustering module with adaptive cluster granularity, provided in an embodiment of the present application. As shown in Figure 7, the hierarchical clustering module with adaptive cluster granularity is only used to implement the hierarchical clustering process with adaptive cluster granularity. Furthermore, the input of the hierarchical clustering module with adaptive cluster granularity is the output of the key information extraction and information amplification module.

[0184] Specifically, for texts that need to be clustered, the text is first input into the key information extraction and amplification module to obtain a fusion vector. Then, hierarchical clustering is performed based on the fusion vector to obtain the clustering result. The specific process of hierarchical clustering is as follows: each text that needs to be clustered is first regarded as a cluster, and the distance between the fusion vectors serving as cluster centers is used as the distance between clusters. Then, the two clusters with the smallest distance are selected as candidates each time, and the large language model is used to determine whether the texts in the two cluster centers describe the same event instance. If the texts in the two cluster centers describe the same event instance, the two clusters are merged into one cluster; if the texts in the two cluster centers do not describe the same event instance, the merging is stopped. In this way, by continuously selecting the two clusters with the smallest distance and performing merging until no clusters can be merged, the clustering results will converge to the granularity of the event instance.

[0185] In general, the function of the hierarchical clustering module with adaptive cluster granularity is to input a batch of text vectors, then perform hierarchical clustering on these vectors, dynamically control the merging of clusters based on the large language model, and control the cluster granularity of the clustering results. The final clustering result is that each cluster corresponds to a batch of similar event instances, which meets the user's demand for information granularity.

[0186] For example, please refer to Figure 8, which is a schematic diagram of the connection of multiple modules provided in an embodiment of the present application. The connection relationship between the key information extraction and amplification module, the text vector fine-tuning module, and the granularity-adaptive hierarchical clustering module is shown in Figure 8, and the workflow of the coordination between these three modules is described below.

[0187] 1. Input a batch of texts to be clustered into the key information extraction and amplification module. After processing, a text vector with fixed granularity and highlighted key information is generated.

[0188] 2. The resulting text vectors are fed into the Text Vector Fine-tuning Module. After clustering, sample pair construction, and sample labeling based on the large language model, a fine-tuning training set is generated. The semantic representation model in the Key Information Extraction and Amplification Module is then fine-tuned based on the fine-tuning training set to make the vectors generated by the semantic representation model more discriminative.

[0189] 3. Use the fine-tuned semantic representation model to regenerate the corresponding fusion vector for the text to be clustered. Then input it into the hierarchical clustering module with adaptive cluster granularity. Each time, find the two clusters with the closest vector distance and use the large language model to dynamically control the cluster granularity, ultimately obtaining a clustering result with a granularity that meets user needs.

[0190] It should be noted that the solution proposed in this application can be applied to various scenarios involving the selection of clustering granularity. Simply aligning the granularity of the key information extracted in the solution with the granularity required by the scenario will ensure that the clustering results meet the requirements. The following briefly describes how this solution is implemented in application scenarios such as information retrieval and text mining, social network analysis, and customer segmentation and marketing.

[0191] 1) Information retrieval and text mining.

[0192] In the field of information retrieval, it is necessary to organize a large number of documents according to different granularity levels through text clustering, and the effect of text clustering at each level can directly affect the effect and efficiency of information retrieval. Therefore, the solution provided by this application can be applied to information retrieval scenarios to accurately control the clustering granularity of each level. For example, documents at a certain level are organized together based on topic similarity. Then, taking the text topic as the key information in the solution, the clustering result obtained through topic information amplification, vector fine-tuning, and adaptive hierarchical clustering will be that texts with the same topic are divided together, which can well meet the needs of this level.

[0193] 2) Social network analysis.

[0194] In social networks, user social behaviors are diverse, and selecting the appropriate user or community clustering granularity can be difficult due to the complexity of the social network structure. Therefore, the solution provided in this application can be applied to social network analysis scenarios. First, determine which dimension of behavioral characteristics the scenario requires for network analysis. Then, use this dimension information as the key information in this solution. After processing, user clusters that meet the scenario can be obtained. User clusters contain users or communities with consistent behavioral characteristics along a certain dimension.

[0195] 3) Customer segmentation and marketing.

[0196] In market research and customer analysis, it is necessary to cluster customer behavior data to identify different customer groups. Generally speaking, choosing an appropriate clustering granularity helps to better formulate marketing strategies, but the clustering granularity is affected by different market environments and industry characteristics. Therefore, the solution provided in this application can be applied to customer segmentation and marketing scenarios. First, determine the behavioral characteristics based on which to calculate the similarity between customers, and then use these behavioral characteristics as the key information in this solution to obtain the corresponding clustering results.

[0197] The above describes in detail the method provided by the embodiment of the present application. Next, the device provided by the embodiment of the present application for executing the above method will be introduced.

[0198] Please refer to Figure 9, which is a schematic diagram of the structure of a text clustering device provided in an embodiment of the present application. As shown in Figure 9, the text clustering device provided in an embodiment of the present application includes: an acquisition module 901 for acquiring multiple texts to be clustered; a processing module 902 for performing text extraction on the multiple texts at a preset event granularity through a first model to obtain multiple sub-texts, and the granularity of the events represented by the multiple sub-texts is the same; the processing module 902 is also used to perform text vectorization on the multiple sub-texts to obtain multiple sub-text vectors; the processing module 902 is also used to perform clustering on the multiple texts based on the multiple sub-text vectors to obtain clustering results.

[0199] In one possible implementation, the processing module 902 is further used to: perform text vectorization on multiple texts separately to obtain multiple text vectors; based on multiple sub-text vectors and multiple text vectors, fuse the sub-text vectors and text vectors corresponding to the same text respectively to obtain multiple fused vectors corresponding to multiple texts; and perform clustering on multiple texts based on the multiple fused vectors.

[0200] In one possible implementation, the acquisition module 901 is further used to obtain a first sub-text vector and a first text vector corresponding to the same text, where the first sub-text vector belongs to multiple sub-text vectors, and the first text vector belongs to multiple text vectors; the processing module 902 is further used to weightedly splice the first sub-text vector and the first text vector to obtain a first fusion vector, where the first fusion vector belongs to multiple fusion vectors.

[0201] In one possible implementation, the processing module 902 is further used to: divide the multiple fusion vectors into different clusters to obtain multiple clusters; when the text corresponding to the fusion vector in the first cluster and the text corresponding to the fusion vector in the second cluster both describe the same event at a preset event granularity, merge the first cluster and the second cluster to obtain a new cluster; wherein the multiple clusters include the first cluster and the second cluster.

[0202] In one possible implementation, the processing module 902 is further used to: determine a first cluster and a second cluster among multiple clusters, the first cluster and the second cluster being the two clusters with the smallest vector distance among the multiple clusters; and determine, through a second model, whether the text corresponding to the fusion vector in the first cluster and the text corresponding to the fusion vector in the second cluster describe the same event.

[0203] In one possible implementation, the processing module 902 is further used to: construct a sample pair including a first subtext and a second subtext, where the first subtext and the second subtext both belong to multiple subtexts; determine a label for the sample pair, where the label is used to indicate whether the first subtext and the second subtext describe the same event; and update the semantic representation model based on the sample pair and the label to obtain an updated semantic representation model, where the updated semantic representation model is used to perform text vectorization on the multiple subtexts respectively.

[0204] In one possible implementation, the processing module 902 is further configured to: perform clustering on the plurality of subtexts to obtain a plurality of subtext clusters; and determine a first subtext and a second subtext based on the plurality of subtext clusters; wherein the first subtext and the second subtext are both located at the edge of any one of the plurality of subtext clusters.

[0205] In one possible implementation, the processing module 902 is further configured to input the first subtext and the second subtext into a third model to obtain a label output by the third model; wherein the third model is configured to determine whether the two input texts describe the same event.

[0206] In one possible implementation, when the label is used to indicate that the first subtext and the second subtext describe the same event, the update goal of the semantic representation model is to reduce the distance between the vectors obtained by performing text vectorization on the first subtext and the second subtext; when the label is used to indicate that the first subtext and the second subtext do not describe the same event, the update goal of the semantic representation model is to increase the distance between the vectors obtained by performing text vectorization on the first subtext and the second subtext.

[0207] In one possible implementation, the preset event granularity includes a first event granularity, a second event granularity, or a third event granularity; the first event granularity is used to indicate the field or subject to which the event belongs, the second event granularity is used to indicate the subject and action of the event, and the third event granularity is used to indicate the subject, object, action, time, and place of the event.

[0208] The acquisition module 901 and the processing module 902 can be implemented by software or hardware. For example, the implementation of the processing module 902 will be described below using the processing module 902 as an example. Similarly, the implementation of the acquisition module 901 can refer to the implementation of the processing module 902.

[0209] The processing module 902 is an example of a software functional unit. The processing module 902 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the processing module 902 may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.

[0210] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0211] As an example of a hardware functional unit, processing module 902 may include at least one computing device, such as a server. Alternatively, processing module 902 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0212] The multiple computing devices included in processing module 902 can be distributed in the same region or in different regions. The multiple computing devices included in processing module 902 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in processing module 902 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.

[0213] It should be noted that the information interaction, implementation process, etc. between the modules / units of the above-mentioned device are based on the same concept as the method embodiment of the present application, and the technical effects they bring are the same as those of the method embodiment of the present application. For specific contents, please refer to the description in the method embodiment shown above in the embodiment of the present application, and no further details will be given here.

[0214] The text clustering device provided in the embodiment of the present application can be specifically a chip, and the chip includes: a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, a pin or a circuit. The processing unit can execute the computer execution instructions stored in the storage unit so that the chip in the electronic device executes the method described in the above embodiment. Optionally, the storage unit is a storage unit in the chip, such as a register, a cache, etc. The storage unit can also be a storage unit located outside the chip in the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc.

[0215] Specifically, please refer to Figure 10, which is a schematic diagram of the structure of a chip provided in an embodiment of the present application. The chip can be expressed as a neural processing unit (NPU), a graphics processing unit (GPU) or a tensor processing unit (TPU). The following will be introduced using the chip as an NPU 1000 as an example. Specifically, the NPU 1000 is mounted on the main CPU (Host CPU) as a coprocessor, and the Host CPU assigns tasks. The core part of the NPU is the operation circuit 1003, which is controlled by the controller 1004 to extract matrix data from the memory and perform multiplication operations.

[0216] In some implementations, the arithmetic circuit 1003 includes multiple processing units (PEs). In some implementations, the arithmetic circuit 1003 is a two-dimensional systolic array. The arithmetic circuit 1003 can also be a one-dimensional systolic array or other electronic circuit capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 1003 is a general-purpose matrix processor.

[0217] For example, assume there are input matrix A, weight matrix B, and output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from weight memory 1002 and caches it on each PE in the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from input memory 1001 and performs a matrix operation on matrix B. The partial or final matrix result is stored in accumulator 1008.

[0218] Unified memory 1006 is used to store input and output data. Weight data is directly transferred to weight memory 1002 through the Direct Memory Access Controller (DMAC) 1005. Input data is also transferred to unified memory 1006 through the DMAC.

[0219] BIU stands for Bus Interface Unit, i.e., bus interface unit 1010 , which is used for interaction between the AXI bus, DMAC, and instruction fetch buffer (IFB) 1009 .

[0220] The bus interface unit 1010 (BIU) is used for the instruction fetch memory 1009 to obtain instructions from the external memory, and is also used for the storage unit access controller 1005 to obtain the original data of the input matrix A or the weight matrix B from the external memory.

[0221] DMAC is mainly used to transfer input data in the external memory DDR to the unified memory 1006 or transfer weight data to the weight memory 1002 or transfer input data to the input memory 1001.

[0222] The vector calculation unit 1007 includes multiple operation processing units. When necessary, it further processes the output of the operation circuit 1003, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. It is mainly used for non-convolutional / fully connected layer network calculations in neural networks, such as batch normalization, pixel-level summation, and upsampling of feature planes.

[0223] In some implementations, the vector calculation unit 1007 can store the processed output vector to the unified memory 1006. For example, the vector calculation unit 1007 can apply a linear function or a nonlinear function to the output of the operation circuit 1003, such as linear interpolation of the feature plane extracted by the convolution layer, or accumulate a vector of values ​​to generate an activation value. In some implementations, the vector calculation unit 1007 generates a normalized value, a pixel-level summed value, or both. In some implementations, the processed output vector can be used as an activation input to the operation circuit 1003, for example, for use in subsequent layers in a neural network.

[0224] An instruction fetch buffer 1009 connected to the controller 1004 is used to store instructions used by the controller 1004;

[0225] Unified memory 1006, input memory 1001, weight memory 1002, and instruction fetch memory 1009 are all on-chip memories. External memories are private to the NPU hardware architecture.

[0226] The processor mentioned in any of the above places can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the above program.

[0227] An embodiment of the present application also provides a computing device 1100. Please refer to Figure 11, which is a schematic diagram of the structure of a computing device 1100 provided in an embodiment of the present application. As shown in Figure 11, computing device 1100 includes: a bus 1102, a processor 1104, a memory 1106, and a communication interface 1108. The processor 1104, the memory 1106, and the communication interface 1108 communicate with each other via bus 1102. Computing device 1100 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 1100.

[0228] Bus 1102 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG11 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 1102 may include a path for transmitting information between various components of computing device 1100 (e.g., memory 1106, processor 1104, and communication interface 1108).

[0229] The processor 1104 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0230] The memory 1106 may include volatile memory, such as random access memory (RAM). The processor 1104 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0231] The memory 1106 stores executable program codes, and the processor 1104 executes the executable program codes to implement the functions of the acquisition module and the processing module, thereby implementing the above-mentioned text clustering method. In other words, the memory 1106 stores instructions for executing the text clustering method.

[0232] The communication interface 1108 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1100 and other devices or a communication network.

[0233] Embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.

[0234] Please refer to Figure 12, which is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application. As shown in Figure 12, the computing device cluster includes at least one computing device 1100. The memory 1106 of one or more computing devices 1100 in the computing device cluster may store the same instructions for executing the text clustering method.

[0235] In some possible implementations, the memory 1106 of one or more computing devices 1100 in the computing device cluster may also store partial instructions for executing the text clustering method. In other words, the combination of one or more computing devices 1100 can jointly execute the instructions for executing the text clustering method.

[0236] It should be noted that the memory 1106 in different computing devices 1100 in the computing device cluster can store different instructions, each for executing a portion of the functions of the data processing apparatus. In other words, the instructions stored in the memory 1106 in different computing devices 1100 can implement the functions of one or more of the aforementioned acquisition module and processing module.

[0237] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network or a local area network, etc. FIG13 shows a possible implementation. FIG13 is a schematic structural diagram of another computing device cluster provided in an embodiment of the present application. As shown in FIG13 , in a computing device cluster 1300, two computing devices 1100A and 1100B are connected via a network. Specifically, the network is connected via a communication interface in each computing device. In this type of possible implementation, the memory 1106 in the computing device 1100A stores instructions for executing the functions of the acquisition module. At the same time, the memory 1106 in the computing device 1100B stores instructions for executing the functions of the processing module.

[0238] It should be understood that the functionality of the computing device 1100A shown in FIG13 may also be implemented by multiple computing devices 1100. Similarly, the functionality of the computing device 1100B may also be implemented by multiple computing devices 1100.

[0239] Please refer to Figure 14, which is a schematic diagram of the structure of a computer-readable storage medium provided in an embodiment of the present application. The present application also provides a computer-readable storage medium. In some embodiments, the workflow executed by the above-mentioned database system can be implemented as computer program instructions encoded in a machine-readable format on a computer-readable storage medium or on other non-transitory media or products.

[0240] 14 schematically illustrates a conceptual partial view of an example computer-readable storage medium including a computer program for executing a computer process on a computing device, arranged in accordance with at least some embodiments presented herein.

[0241] In one embodiment, the computer-readable storage medium 1400 is provided using a signal-bearing medium 1401. The signal-bearing medium 1401 may include one or more program instructions 1402, which when executed by one or more processors may provide the functions or part of the functions described above for the database system.

[0242] In some examples, signal bearing medium 1401 may include computer readable medium 1403 such as, but not limited to, a hard drive, compact disk (CD), digital video disk (DVD), digital tape, memory, ROM or RAM, and the like.

[0243] In some embodiments, the signal-bearing medium 1401 may include a computer-recordable medium 1404, such as, but not limited to, a memory, a read / write (R / W) CD, a R / W DVD, or the like. In some embodiments, the signal-bearing medium 1401 may include a communication medium 1405, such as, but not limited to, a digital and / or analog communication medium (e.g., a fiber optic cable, a waveguide, a wired communication link, a wireless communication link, or the like). Thus, for example, the signal-bearing medium 1401 may be communicated via a wireless form of the communication medium 1405 (e.g., a wireless communication medium conforming to the IEEE 802.X standard or other transmission protocol).

[0244] The one or more program instructions 1402 may be, for example, computer-executable instructions or logic-implemented instructions. In some examples, the computing device may be configured to provide various operations, functions, or actions in response to the program instructions 1402 communicated to the computing device via one or more of computer-readable media 1403, computer-recordable media 1404, and / or communication media 1405.

[0245] The present application also provides a computer program product including instructions. The computer program product may be software or a program product including instructions that can be executed on a computing device or stored in any available medium. When the computer program product is executed on at least one computing device, the at least one computing device executes the text clustering method described in the above embodiment.

[0246] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course can also be implemented by special hardware including application-specific integrated circuits, special CPUs, special memories, special components, etc. In general, all functions performed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structures used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits, etc. However, for the present application, software program implementation is a better implementation method in most cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer's floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., and includes a number of instructions to enable a computer device (which can be a personal computer, training equipment, or network equipment, etc.) to execute the methods of each embodiment of the present application.

[0247] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

Claims

1. A text clustering method, characterized in that: include: Get multiple texts to be clustered; Using the first model, performing text extraction on the multiple texts at a preset event granularity to obtain multiple subtexts, where the events represented by the multiple subtexts have the same granularity; Performing text vectorization on the multiple sub-texts respectively to obtain multiple sub-text vectors; Clustering is performed on the multiple texts based on the multiple sub-text vectors to obtain a clustering result.

2. The method according to claim 1, characterized in that The method further comprises: Performing text vectorization on the multiple texts respectively to obtain the multiple text vectors; Based on the multiple sub-text vectors and the multiple text vectors, respectively fusing the sub-text vectors and the text vector corresponding to the same text to obtain multiple fused vectors corresponding to the multiple texts; Performing clustering on the plurality of texts based on the plurality of sub-text vectors, comprising: Clustering is performed on the plurality of texts based on the plurality of fusion vectors.

3. The method according to claim 2, characterized in that The step of fusing the sub-text vectors and the text vector corresponding to the same text based on the multiple sub-text vectors and the multiple text vectors comprises: Obtaining a first subtext vector and a first text vector corresponding to the same text, wherein the first subtext vector belongs to the multiple subtext vectors, and the first text vector belongs to the multiple text vectors; The first sub-text vector and the first text vector are weighted and concatenated to obtain a first fusion vector, where the first fusion vector belongs to the multiple fusion vectors.

4. The method according to claim 2 or 3, characterized in that The performing clustering on the plurality of texts based on the plurality of fusion vectors comprises: Dividing the multiple fusion vectors into different clusters to obtain multiple clusters; When the text corresponding to the fusion vector in the first cluster and the text corresponding to the fusion vector in the second cluster both describe the same event at the preset event granularity, merging the first cluster and the second cluster to obtain a new cluster; The multiple clusters include the first cluster and the second cluster.

5. The method according to claim 4, characterized in that The method further comprises: Determining the first cluster and the second cluster from the plurality of clusters, where the first cluster and the second cluster are two clusters with the smallest vector distance among the plurality of clusters; Through the second model, it is determined whether the text corresponding to the fusion vector in the first cluster and the text corresponding to the fusion vector in the second cluster describe the same event.

6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: constructing a sample pair including a first subtext and a second subtext, wherein the first subtext and the second subtext both belong to the plurality of subtexts; determining a label for the sample pair, the label being used to indicate whether the first subtext and the second subtext describe the same event; Based on the sample pairs and the labels, a semantic representation model is updated to obtain an updated semantic representation model, and the updated semantic representation model is used to perform text vectorization on the multiple sub-texts respectively.

7. The method according to claim 6, characterized in that The method further comprises: Performing clustering on the multiple subtexts to obtain multiple subtext clusters; determining the first subtext and the second subtext based on the plurality of subtext clusters; The first subtext and the second subtext are both located at the edge of any one of the multiple subtext clusters.

8. The method according to claim 6 or 7, characterized in that Determining the label of the sample pair includes: Inputting the first subtext and the second subtext into a third model to obtain the label output by the third model; The third model is used to determine whether the two input texts describe the same event.

9. The method according to any one of claims 6 to 8, characterized in that: In a case where the label indicates that the first subtext and the second subtext describe the same event, the updating goal of the semantic representation model is to reduce the distance between vectors obtained by performing text vectorization on the first subtext and the second subtext; When the label indicates that the first subtext and the second subtext do not describe the same event, the updating goal of the semantic representation model is to increase the distance between vectors obtained by performing text vectorization on the first subtext and the second subtext.

10. The method according to any one of claims 1 to 9, characterized in that: The preset event granularity includes a first event granularity, a second event granularity or a third event granularity; The first event granularity is used to indicate the field or subject to which the event belongs, the second event granularity is used to indicate the subject and action of the event, and the third event granularity is used to indicate the subject, object, action, time and location of the event.

11. A text clustering device, characterized in that: include: An acquisition module is used to obtain multiple texts to be clustered; A processing module, configured to perform text extraction on the plurality of texts at a preset event granularity using a first model to obtain a plurality of subtexts, wherein the granularity of the events represented by the plurality of subtexts is the same; The processing module is further configured to perform text vectorization on the multiple subtexts respectively to obtain multiple subtext vectors; The processing module is further configured to perform clustering on the multiple texts based on the multiple sub-text vectors to obtain a clustering result.

12. The device according to claim 11, characterized in that The processing module is further configured to: Performing text vectorization on the multiple texts respectively to obtain the multiple text vectors; Based on the multiple sub-text vectors and the multiple text vectors, respectively fusing the sub-text vectors and the text vector corresponding to the same text to obtain multiple fused vectors corresponding to the multiple texts; Clustering is performed on the plurality of texts based on the plurality of fusion vectors.

13. The device according to claim 12, characterized in that The acquisition module is further configured to acquire a first subtext vector and a first text vector corresponding to the same text, wherein the first subtext vector belongs to the plurality of subtext vectors, and the first text vector belongs to the plurality of text vectors; The processing module is further configured to perform weighted concatenation on the first sub-text vector and the first text vector to obtain a first fusion vector, where the first fusion vector belongs to the multiple fusion vectors.

14. The device according to claim 12 or 13, characterized in that The processing module is further configured to: Dividing the multiple fusion vectors into different clusters to obtain multiple clusters; When the text corresponding to the fusion vector in the first cluster and the text corresponding to the fusion vector in the second cluster both describe the same event at the preset event granularity, merging the first cluster and the second cluster to obtain a new cluster; The multiple clusters include the first cluster and the second cluster.

15. The device according to claim 14, characterized in that The processing module is further configured to: Determining the first cluster and the second cluster from the plurality of clusters, where the first cluster and the second cluster are two clusters with the smallest vector distance among the plurality of clusters; Through the second model, it is determined whether the text corresponding to the fusion vector in the first cluster and the text corresponding to the fusion vector in the second cluster describe the same event.

16. The device according to any one of claims 11 to 15, characterized in that The processing module is further configured to: constructing a sample pair including a first subtext and a second subtext, wherein the first subtext and the second subtext both belong to the plurality of subtexts; determining a label for the sample pair, the label being used to indicate whether the first subtext and the second subtext describe the same event; Based on the sample pairs and the labels, a semantic representation model is updated to obtain an updated semantic representation model, and the updated semantic representation model is used to perform text vectorization on the multiple sub-texts respectively.

17. The device according to claim 16, characterized in that The processing module is further configured to: Performing clustering on the multiple subtexts to obtain multiple subtext clusters; determining the first subtext and the second subtext based on the plurality of subtext clusters; The first subtext and the second subtext are both located at the edge of any one of the multiple subtext clusters.

18. The device according to claim 16 or 17, characterized in that The processing module is further configured to: Inputting the first subtext and the second subtext into a third model to obtain the label output by the third model; The third model is used to determine whether the two input texts describe the same event.

19. The device according to any one of claims 16 to 18, characterized in that In a case where the label indicates that the first subtext and the second subtext describe the same event, the updating goal of the semantic representation model is to reduce the distance between vectors obtained by performing text vectorization on the first subtext and the second subtext; When the label indicates that the first subtext and the second subtext do not describe the same event, the updating goal of the semantic representation model is to increase the distance between vectors obtained by performing text vectorization on the first subtext and the second subtext.

20. The device according to any one of claims 11 to 19, characterized in that The preset event granularity includes a first event granularity, a second event granularity or a third event granularity; The first event granularity is used to indicate the field or subject to which the event belongs, the second event granularity is used to indicate the subject and action of the event, and the third event granularity is used to indicate the subject, object, action, time and location of the event.

21. A chip system, characterized in that: The chip system includes a processor and a communication interface, the communication interface is used to communicate with a module outside the chip system, and the processor is used to execute the method according to any one of claims 1 to 10.

22. A computing device cluster, characterized in that: comprising at least one computing device, each computing device including a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in a memory of the at least one computing device, so that the computing device cluster performs the operating steps of the method according to any one of claims 1 to 10.

23. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the operation steps of the method according to any one of claims 1 to 10.

24. A computer-readable storage medium, characterized in that The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster performs the operation steps of the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Method and apparatus for cutting large and small granularity of Chinese language text

    CN101246472A

  • Medical information extraction method based on multilayer semantic analysis

    CN111180076A

  • Online comment screening device

    CN111639172A

  • Method and device for constructing hierarchical pattern for information extraction

    CN112100228A

  • System to determine a credibility weighting for electronic records

    US20180096055A1