Topic clustering method and device, electronic equipment and readable storage medium

By combining the first and second clustering algorithms and adjusting the radius coefficient to optimize the clustering results, the problem of automatically determining the number of hot topic categories on social application platforms was solved, and fast and accurate hot event identification was achieved.

CN117195013BActive Publication Date: 2026-04-07MICRO DREAM TECHTRONIC NETWORK TECH CHINACO
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-24
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Clustering trending topics on social media platforms requires quickly and automatically determining the number of topic categories. Existing algorithms rely on poor-quality initial centers and cannot automatically determine the number of categories, resulting in inaccurate clustering results.

Method used

The first clustering algorithm is used for initial clustering, and the topic centroids are used for second clustering. The radius coefficient is adjusted to optimize the clustering results, ensuring that the expected number of categories is met, and hot topics are automatically identified.

Benefits of technology

It enables rapid and accurate identification of trending topics on social media platforms, automatically selects the number of center points, optimizes clustering results, and improves the accuracy of trending event identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117195013B_ABST
    Figure CN117195013B_ABST
Patent Text Reader

Abstract

This specification discloses a topic clustering method, apparatus, electronic device, and readable storage medium. The method includes: acquiring multiple topics from a social application platform at the current time; using the multiple topics as a sample topic set, clustering the sample topic set using a first clustering algorithm to obtain a first clustering result; using a first centroid of each topic category as the center, re-clustering the sample topic set using a second clustering algorithm to obtain a second clustering result; comparing the number of topic categories in the second clustering result with a pre-set threshold for the number of cluster categories; if the number of topic categories in the second clustering result does not meet the threshold for the number of cluster categories, adjusting the radius coefficient of the first clustering algorithm until a second clustering result that meets the threshold for the number of cluster categories is obtained as the target clustering result; and determining hot events among the multiple topics based on the number of topics included in each topic category in the target clustering result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of computer technology, and in particular to a topic clustering method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] Social media platforms generate numerous trending topics daily. Different media outlets create very similar but not identical topics to act as moderators and capture more traffic. To avoid recommending duplicate content, social media platforms' recommendation systems need to identify these similar topics and quickly select a representative one from among them.

[0003] Trending topics can emerge at any time, and their duration is usually less than two hours, sometimes even fading in just 20 minutes. Therefore, clustering operations must be completed in a short period of time, the faster the better. Summary of the Invention

[0004] The purpose of this application is to provide a topic clustering method, apparatus, electronic device, and readable storage medium for rapidly clustering trending topics on social application platforms.

[0005] To solve the above-mentioned technical problems, the embodiments of this application are implemented as follows:

[0006] Firstly, a topic clustering method is proposed, including:

[0007] Get multiple topics on social media platforms at the current time;

[0008] The multiple topics are used as a sample topic set, and the sample topic set is clustered using a first clustering algorithm to obtain a first clustering result; the first clustering result includes multiple topic categories, a first centroid of each topic category, and the number of first topics contained in each topic category.

[0009] Using the first centroid of each topic category as the center, the sample topic set is re-clustered using a second clustering algorithm to obtain a second clustering result; the second clustering result includes the multiple topic categories, the second centroid of each topic category, and the number of second topics contained in each topic category;

[0010] The number of topic categories in the second clustering result is compared with a pre-set threshold for the number of clustering categories;

[0011] If the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, the radius coefficient of the first clustering algorithm is adjusted until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result; the radius coefficient is used to characterize the radius of the topic category;

[0012] Based on the number of topics included in each topic category in the target clustering results, hot topics among the multiple topics are determined.

[0013] Secondly, a topic clustering device is proposed, including:

[0014] The acquisition unit retrieves multiple topics from social application platforms at the current time;

[0015] The first clustering unit takes the multiple topics as a sample topic set and uses a first clustering algorithm to cluster the sample topic set to obtain a first clustering result; the first clustering result includes multiple topic categories, a first centroid of each topic category, and the number of first topics contained in each topic category.

[0016] The second clustering unit, using the first centroid of each topic category as the center, re-clusters the sample topic set using a second clustering algorithm to obtain a second clustering result; the second clustering result includes the multiple topic categories, the second centroid of each topic category, and the number of second topics contained in each topic category;

[0017] The comparison unit compares the number of topic categories in the second clustering result with a pre-set threshold for the number of clustering categories;

[0018] The adjustment unit adjusts the radius coefficient of the first clustering algorithm when the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result; the radius coefficient is used to characterize the radius of the topic category;

[0019] The processing unit determines the hot topics among the multiple topics based on the number of topics included in each topic category in the target clustering results.

[0020] Thirdly, an electronic device is proposed, comprising:

[0021] Processor; and

[0022] A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the following operations:

[0023] Get multiple topics on social media platforms at the current time;

[0024] The multiple topics are used as a sample topic set, and the sample topic set is clustered using a first clustering algorithm to obtain a first clustering result; the first clustering result includes multiple topic categories, a first centroid of each topic category, and the number of first topics contained in each topic category.

[0025] Using the first centroid of each topic category as the center, the sample topic set is re-clustered using a second clustering algorithm to obtain a second clustering result; the second clustering result includes the multiple topic categories, the second centroid of each topic category, and the number of second topics contained in each topic category;

[0026] The number of topic categories in the second clustering result is compared with a pre-set threshold for the number of clustering categories;

[0027] If the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, the radius coefficient of the first clustering algorithm is adjusted until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result; the radius coefficient is used to characterize the radius of the topic category;

[0028] Based on the number of topics included in each topic category in the target clustering results, hot topics among the multiple topics are determined.

[0029] Fourthly, a computer-readable storage medium is provided that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform the following operations:

[0030] Get multiple topics on social media platforms at the current time;

[0031] The multiple topics are used as a sample topic set, and the sample topic set is clustered using a first clustering algorithm to obtain a first clustering result; the first clustering result includes multiple topic categories, a first centroid of each topic category, and the number of first topics contained in each topic category.

[0032] Using the first centroid of each topic category as the center, the sample topic set is re-clustered using a second clustering algorithm to obtain a second clustering result; the second clustering result includes the multiple topic categories, the second centroid of each topic category, and the number of second topics contained in each topic category;

[0033] The number of topic categories in the second clustering result is compared with a pre-set threshold for the number of clustering categories;

[0034] If the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, the radius coefficient of the first clustering algorithm is adjusted until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result; the radius coefficient is used to characterize the radius of the topic category;

[0035] Based on the number of topics included in each topic category in the target clustering results, hot topics among the multiple topics are determined.

[0036] As can be seen from the technical solutions provided in the embodiments of this specification above, the solutions in the embodiments of this specification have at least one of the following technical effects:

[0037] The process involves: acquiring multiple topics from a social media platform at the current time; using these topics as a sample topic set and clustering them using a first clustering algorithm to obtain a first clustering result; the first clustering result includes multiple topic categories, the first centroid of each topic category, and the number of first topics contained in each topic category; re-clustering the sample topic set using a second clustering algorithm with the first centroid of each topic category as the center to obtain a second clustering result; the second clustering result includes multiple topic categories, the second centroid of each topic category, and the number of second topics contained in each topic category; comparing the number of topic categories in the second clustering result with a pre-set threshold for the number of clustering categories; if the number of topic categories in the second clustering result does not meet the threshold, adjusting the radius coefficient of the first clustering algorithm until a second clustering result that meets the threshold is obtained as the target clustering result; the radius coefficient is used to characterize the radius of a topic category; and determining the hot topics among the multiple topics based on the number of topics contained in each topic category in the target clustering result.

[0038] The system uses a first clustering algorithm to cluster multiple topics on a social application platform at the current time, automatically selecting the number of centroids for each topic category. A second clustering algorithm further clusters these topics based on the first algorithm's results, yielding more accurate topic classifications and the centroids included within each category. The clustering results are optimized by adjusting the radius coefficient of the first clustering algorithm, ensuring the expected number of cluster categories is met. This allows for the automatic acquisition of trending topics on social application platforms and rapid cluster analysis of these topics, resulting in more accurate identification of trending events. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0040] Figure 1 This is a schematic diagram illustrating the implementation process of a topic clustering method provided in one embodiment of this specification.

[0041] Figure 2This is a schematic diagram of a topic clustering device provided in one embodiment of this specification.

[0042] Figure 3 This is a schematic diagram of the structure of an electronic device provided in one embodiment of the specification. Detailed Implementation

[0043] To make the objectives, technical solutions, and advantages of this document clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without creative effort are within the scope of protection of this document.

[0044] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0045] Social media platforms, such as Weibo, generate numerous trending topics daily. Different media outlets often create very similar but not identical topics, aiming to become the topic's moderator and capture more traffic. To avoid recommending duplicate content, social media platforms' recommendation systems need to identify these similar topics and quickly select a representative one from them.

[0046] A "topic" is a string enclosed in two hash symbols, such as "#Netizens found a needle on the back of the chair while watching 'The Disappearing Girl'#", which represents a topic. "Vectorization" involves using a language model to convert topics into vectors. The vector length can be arbitrarily specified, such as 32, 64, 128, or 768. The language model can be, but is not limited to, BERT, word2vec, etc. Collecting the topic vectors from 30 days creates a "topic vector library." Clustering all topic vectors yields multiple topic categories. The topic corresponding to the center of each category is designated as the representative topic, and topics belonging to the same category are considered the same event.

[0047] Taking Weibo as an example, clustering in this scenario has its own characteristics:

[0048] The number of categories is uncertain in advance;

[0049] There are many categories, and the total number of topics can reach 500,000, but no more than 1,000 topics can trend on social media every day, and the corresponding events are also no more than 1,000. Therefore, the vast majority of events only have one topic.

[0050] The clustering process needs to be fast, as trending topics can emerge at any time and typically last less than two hours, sometimes even fading after just 20 minutes. Therefore, the clustering operation must be completed within five minutes, the faster the better.

[0051] While some related algorithms can meet the above requirements, they have some drawbacks. For example, they require manual specification of the number of topic categories and cannot automatically determine the number of topic categories. In the Weibo topic clustering task, it is impossible for humans to predict how many topic categories there will be each day, and the clustering results are heavily dependent on the initial centers. If the initial centers are of poor quality, then the clustering results will also be of poor quality.

[0052] To address the problems existing in related algorithms, this specification provides a topic clustering method, which involves acquiring multiple topics from a social application platform at the current time; using these multiple topics as a sample topic set, and clustering the sample topic set using a first clustering algorithm to obtain a first clustering result; the first clustering result includes multiple topic categories, a first centroid of each topic category, and the number of first topics contained in each topic category; using the first centroid of each topic category as the center, re-clustering the sample topic set using a second clustering algorithm to obtain a second clustering result; the second clustering result includes multiple topic categories, a second centroid of each topic category, and the number of second topics contained in each topic category; comparing the number of topic categories in the second clustering result with a pre-set threshold for the number of clustering categories; if the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, adjusting the radius coefficient of the first clustering algorithm until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result; the radius coefficient is used to characterize the radius of the topic category; and based on the number of topics contained in each topic category in the target clustering result, determining the hot topics among the multiple topics.

[0053] The system uses a first clustering algorithm to cluster multiple topics on a social application platform at the current time, automatically selecting the number of centroids for each topic category. A second clustering algorithm further clusters these topics based on the first algorithm's results, yielding finer-grained topic classifications and centroid counts. The clustering results are optimized by adjusting the radius coefficient of the first clustering algorithm, ensuring the expected number of cluster categories is achieved. This system automatically acquires trending topics on social application platforms and quickly performs cluster analysis on these topics, resulting in more accurate identification of trending events.

[0054] The topic clustering method provided in the embodiments of this specification is executed by a computer device, such as at least one of a server, laptop, desktop computer, tablet computer, or intelligent robot. Alternatively, the execution subject of the topic clustering method can also be a client (such as a social application) capable of executing the method itself.

[0055] For ease of description, the following description uses an electronic device capable of executing the topic clustering method as the execution subject of this method. This electronic device can specifically be a server, laptop, desktop computer, tablet computer, or intelligent robot, etc., to introduce the implementation of the method. It is understood that using an electronic device as the execution subject is merely an illustrative example and should not be construed as a limitation of the method.

[0056] Figure 1 This is a schematic diagram illustrating the implementation process of a topic clustering method provided in one embodiment of this specification, including:

[0057] S110 retrieves multiple topics on social media platforms at the current time.

[0058] For example, by using the API (interface) of a social application platform or third-party data analysis tools, one can obtain detailed data such as real-time trending lists, topic tags, popular users and topics on the social application platform, such as the number of discussions, reposts, and related users of popular topics, which can help analyze and explore current topics.

[0059] The obtained N topics are mapped to topic vectors, denoted as x1, x2, ..., xn. N This is used for subsequent topic clustering. The goal of the topic clustering task is to divide all topic vectors into several classes, so that sample topics of the same class are close to each other, and sample topics of different classes are far apart from each other.

[0060] S120: Multiple topics are used as a sample topic set, and the first clustering algorithm is used to cluster the sample topic set to obtain the first clustering result.

[0061] Using the aforementioned topic vectors as a sample topic set, the first clustering algorithm is used to cluster the sample topic set to obtain the first clustering result.

[0062] For example, firstly, a topic is selected from the sample topic set as the initial center point. This can be the first topic x1 in the sample topic set, denoted as c1, or a topic can be randomly selected from the sample topic set as the center point. Then, a radius σ0 is specified. The radius σ0 is determined based on the radius coefficient r, the mean, and the variance of the sample topic set. In one implementation... The radius coefficient r can take a value of 0.2, and the variance of the sample topic set... Mean of the sample topic set

[0063] Then check each topic x in index order. i Let i = 1, 2, ..., N, if x i If the distance from the initial center c1 is less than or equal to the radius σ0, then the topic x... iThe first category is marked as the first topic category, and is represented by topic x. i Update the initial center point c1 so that the initial center point c1 is directed toward topic x. i Slide an appropriate distance; if topic x i If the distance from the initial center point c1 is greater than the radius, then the topic x... i As a new central point c2, and to the topic x i It is marked as the second category, meaning the second topic category.

[0064] It should be noted that, fruit x i The distance from the initial center c1 can be, but is not limited to, Euclidean distance, cosine distance, etc.

[0065] Assume that K center points have been generated, c1, c2, ..., c3. N Calculate topic x i With center points c1, c2, ..., c N The distance between them, if x i If it falls within the radius of at least one center point, then find the relationship with topic x. i The nearest center point c k Then, sample topic x i Labeled as class k, and denoted by x i Update center point c k , so that the center point c k To topic x i Slide an appropriate distance; if topic x i Outside the radius of all center points, then x i As a new center point c k+1 and x i Mark it as class K+1. Continue in this manner until all topics x are classified. i After one pass, the first clustering result is obtained, which includes K topic categories, and the first centroid c of each topic category. k and the number of first topics contained in each topic category, n1, n2, ..., n K n1 represents the number of first topics contained in the first topic category, and n K This represents the number of first topics included in the Kth topic category.

[0066] In Weibo topic clustering tasks, it's impossible for humans to predict the number of topic clusters each day, and the clustering results heavily rely on the initial centers. If the initial centers are of poor quality, the clustering results will also be of poor quality. Using the first clustering algorithm to cluster topic sets eliminates the need for manual specification of the number of topic categories, automatically determining the number of categories and grouping similar topics into the same category. This allows for a faster and more effective selection of a representative topic from among these similar topics.

[0067] S130: Using the first centroid of each topic category as the center, the sample topic set is re-clustered using the second clustering algorithm to obtain the second clustering result.

[0068] Using all the first center points as centers, determine the distance between each topic and the existing first center points in turn; classify the topics into the topic categories of the first center points corresponding to the smallest distances, and update the positions of the first center points through the topics to obtain the second center points; after traversing each topic, obtain multiple topic categories, the second center point of each topic category, and the number of topics contained in each topic category.

[0069] For example, topic x i The number of first centroids K, the K topic categories of the first clustering result, and the first centroids c1, c2, ..., c of each topic category. k and the number of first topics contained in each topic category, n1, n2, ..., n K The first centroid sequence c is used as input to the second clustering algorithm. k Record these values ​​and keep them unchanged, and record the number of the first topic contained in each of the K topic categories, n1, n2, ..., n. K To clear to zero, that is, to set n to zero. K =0.

[0070] Then calculate topic x i To the first center point c k The distance, d ik =dist(x i c k ), k = 1, 2, ..., K. Select the topics that are farthest from the topic x. i The nearest first centroid is incremented by 1 for all topics contained within that centroid. This process continues until all topics x have been traversed. i Then, the second clustering result is obtained, which includes K topic categories, K number of second centroids, and the second centroids c1, c2, ..., c of each topic category. k′ and the number of second topics included in each question category, n1, n2, ..., n K′ .

[0071] By using a second clustering algorithm to further cluster based on the results of the first clustering, we can obtain more accurate topic classifications and the centroids contained in the topic classifications.

[0072] It should be noted that the second clustering algorithm directly re-clusters the topic set using the first centroids as centers. Therefore, the number of second centroids is equal to the number of first centroids, and the number of topic categories in the second clustering result is also equal to the number in the first clustering result. The difference lies in the number of topics contained in each topic category in the second clustering result. Therefore, after obtaining the second clustering result, it is necessary to compare the number of first topics and the number of second topics corresponding to the same category identifier. If the number of second topics is less than or equal to the number of first topics, the position of the centroid corresponding to the category identifier is updated using the topics contained in the first centroid, and this position is used as the position of the second centroid. If the number of second topics is greater than the number of first topics, the position of the centroid corresponding to the category identifier is updated using the topics contained in the second centroid, and this position is used as the position of the second centroid. The category identifier is the topic category number; number 1 is the first topic category, number 2 is the second topic category, and so on. This will not be elaborated further here.

[0073] For example, taking the first topic category c1 as an example, the category identifier is 1. Its corresponding second center point contains 10,000 second topics, while the first center point contains 8,000 first topics. Since the number of second topics is greater than the number of first topics, the position of the center point corresponding to category identifier 1 is updated based on the topics contained in the second center point, and this position is used as the position of the second center point. The specific update method is that when traversing topics, for each new topic added to topic category c1, the center point is moved closer to the newly added topic by an appropriate distance. The appropriate distance is obtained based on empirical data or other methods, which will not be elaborated here.

[0074] It should be noted that when traversing topics using the second clustering algorithm, it does not traverse them one by one. Instead, it fully utilizes the CPU's vectorized computing capabilities and the memory's block read / write capabilities to traverse multiple sample topics at once, increasing the amount of computation per step and speeding up the acquisition of clustering results.

[0075] S140, compare the number of topic categories in the second clustering result with the pre-set threshold for the number of clustering categories.

[0076] After iterating through several rounds of the second clustering algorithm to reach a stable state, the next step is to increase or decrease the number of centroids based on the comparison between the number of topic categories in the second clustering results and the pre-set threshold for the number of cluster categories. Since the centroid is the center of each cluster category, the number of centroids is equal to the number of cluster categories.

[0077] The threshold for the number of cluster categories includes a first threshold, a second threshold, and a range of thresholds for the number of categories.

[0078] S150, if the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, adjust the radius coefficient of the first clustering algorithm until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result.

[0079] If there are too many centroids, such as exceeding the first threshold, then the radius coefficient r is increased, and the clustering algorithm restarts from the first one. The larger the radius coefficient r, the larger the radius of each cluster category will be. The larger the radius, the more topics each cluster category will contain, resulting in fewer cluster categories and fewer centroids.

[0080] If the number of centroids is insufficient, such as below the second threshold, the radius coefficient r needs to be reduced, and the clustering algorithm should be restarted from the first stage. A smaller radius coefficient r results in a smaller radius for each cluster category, fewer topics per cluster, more cluster categories, and thus more centroids.

[0081] If the number of center points is not excessive, such as if it falls within the category number threshold range (which is a sub-interval of the range between the second and first thresholds), then the third algorithm is used to prune some. If the number of center points is greater than the second threshold but less than the first threshold, and outside the category number threshold range, the topic categories with the fewest contained topics are deleted sequentially until the number of topic categories falls within the category number threshold range. For example, topic categories with 0 topics can be deleted first, followed by topic categories with 1 topic, until the number of center points falls within the category number threshold range.

[0082] The aforementioned first threshold, second threshold, and category quantity threshold range are all determined based on user needs or other feasible methods, and this disclosure does not impose any restrictions on them.

[0083] S160: Determine the hot topics in the current topic based on the number of topics included in each topic category in the target clustering results.

[0084] Determine the number of topics contained in each topic category in the target clustering results. Sort the topic categories in descending order according to the number of topics they contain. Select the top specified number of topic categories as the target topic categories. The topic corresponding to the centroid of each target topic category is then identified as a hot topic event. For example, the top 50 topic categories can be selected as the target topic categories.

[0085] In summary, one embodiment of this specification provides a topic clustering method that obtains multiple topics from a social application platform at the current time; uses these multiple topics as a sample topic set, and clusters the sample topic set using a first clustering algorithm to obtain a first clustering result; the first clustering result includes multiple topic categories, a first centroid of each topic category, and the number of first topics contained in each topic category; using all the first centroids as centers, the sample topic set is re-clustered using a second clustering algorithm to obtain a second clustering result; the second clustering result includes multiple topic categories, a second centroid of each topic category, and the number of second topics contained in each topic category; the number of topic categories in the second clustering result is compared with a pre-set threshold for the number of clustering categories; if the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, the radius coefficient of the first clustering algorithm is adjusted until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result; the radius coefficient is used to adjust the radius of the topic categories; and hot events among the multiple topics are determined based on the number of topics contained in each topic category in the target clustering result.

[0086] The system uses a first clustering algorithm to cluster multiple topics on a social application platform at the current time, automatically selecting the number of centroids for each topic category. A second clustering algorithm further clusters these topics based on the first algorithm's results, yielding more accurate topic classifications and the centroids included within each category. The clustering results are optimized by adjusting the radius coefficient of the first clustering algorithm, ensuring the expected number of cluster categories is met. This allows for the automatic acquisition of trending topics on social application platforms and rapid cluster analysis of these topics, resulting in more accurate identification of trending events.

[0087] Figure 2 This is a schematic diagram of the structure of a topic clustering device 200 provided in one embodiment of this specification, including:

[0088] Unit 210 retrieves multiple topics from social application platforms at the current time;

[0089] The first clustering unit 220 uses the multiple topics as a sample topic set and performs clustering on the sample topic set using a first clustering algorithm to obtain a first clustering result; the first clustering result includes multiple topic categories, a first centroid of each topic category, and the number of first topics contained in each topic category.

[0090] The second clustering unit 230 re-clusters the sample topic set using a second clustering algorithm, with the first centroid of each topic category as the center, to obtain a second clustering result; the second clustering result includes the multiple topic categories, the second centroid of each topic category, and the number of second topics contained in each topic category;

[0091] The comparison unit 240 compares the number of topic categories in the second clustering result with a pre-set threshold for the number of clustering categories;

[0092] The adjustment unit 250 adjusts the radius coefficient of the first clustering algorithm when the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result; the radius coefficient is used to characterize the radius of the topic category.

[0093] The processing unit 260 determines the hot topics among the multiple topics based on the number of topics included in each topic category in the target clustering result.

[0094] Optionally, in one embodiment, the first clustering unit 220 is configured to:

[0095] The radius of each topic category after clustering is determined based on the radius coefficient of the first clustering algorithm, the mean and variance of the sample topic set;

[0096] Select one topic from the sample topic set as the initial center point;

[0097] Iterate through the list to determine whether each topic is within the radius of the existing center point;

[0098] Topics within the radius are categorized into the corresponding topic categories of the central point;

[0099] The topic outside the stated radius will be used as the new center point;

[0100] After traversing each topic in the sample topic set, we obtain the multiple topic categories and the first center point of each topic category.

[0101] Optionally, in one embodiment, the second clustering unit 230 is used for:

[0102] The distance between each topic in the sample topic set and each existing first center point is determined sequentially;

[0103] The topic is categorized into the topic category corresponding to the first center point with the minimum distance, and the second center point of the topic category is obtained by updating the position of the first center point of the topic category through the topic.

[0104] After traversing each topic, we obtain the multiple topic categories, the second center point of each topic category, and the number of topics contained in each topic category.

[0105] Optionally, in one embodiment, the processing unit 260 is configured to:

[0106] Compare the number of first topics and the number of second topics corresponding to the same topic category;

[0107] If the number of the second topic is less than or equal to the number of the first topic, the position of the center point corresponding to the topic category is updated by the topics included in the first center point of the topic category, and this is used as the second center point of the topic category.

[0108] If the number of second topics is greater than the number of first topics, the position of the center point corresponding to the topic category is updated by the topics included in the second center point of the topic category, and this is used as the second center point of the topic category.

[0109] Optionally, in one embodiment, the processing unit 260 is configured to:

[0110] If the number of topic categories is greater than the first threshold, the radius coefficient is increased; if the number of topic categories is less than the second threshold, the radius coefficient is decreased until the number of topic categories is greater than the second threshold and less than the first threshold.

[0111] Optionally, in one embodiment, the processing unit 260 is configured to:

[0112] If the number of topic categories is greater than the second threshold, less than the first threshold, and outside the threshold range for the number of categories, the topic categories with the fewest topics are deleted sequentially until the number of topic categories within the threshold range for the number of categories is obtained.

[0113] Optionally, in one embodiment, the processing unit 260 is configured to:

[0114] Sort the results in descending order based on the number of topics contained in each topic category in the target clustering results;

[0115] Determine the specified number of topic categories that are ranked at the top as the target topic categories;

[0116] The target topic category is designated as the trending event.

[0117] Topic clustering device 200 can achieve Figure 1 For details of the method implementation examples, please refer to [link / reference]. Figure 1 The topic clustering method shown in the embodiment will not be described in detail.

[0118] Figure 3 This is a schematic diagram of the structure of an electronic device according to one embodiment of this specification. Please refer to it. Figure 3At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for other business operations.

[0119] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0120] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.

[0121] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a topic clustering device at the logical level. The processor executes the program stored in memory and specifically performs the following operations:

[0122] Get multiple topics on social media platforms at the current time;

[0123] The multiple topics are used as a sample topic set, and the sample topic set is clustered using a first clustering algorithm to obtain a first clustering result; the first clustering result includes multiple topic categories, a first centroid of each topic category, and the number of first topics contained in each topic category.

[0124] Using the first centroid of each topic category as the center, the sample topic set is re-clustered using a second clustering algorithm to obtain a second clustering result; the second clustering result includes the multiple topic categories, the second centroid of each topic category, and the number of second topics contained in each topic category;

[0125] The number of topic categories in the second clustering result is compared with a pre-set threshold for the number of clustering categories;

[0126] If the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, the radius coefficient of the first clustering algorithm is adjusted until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result; the radius coefficient is used to characterize the radius of the topic category;

[0127] Based on the number of topics included in each topic category in the target clustering results, hot topics among the multiple topics are determined.

[0128] The system uses a first clustering algorithm to cluster multiple topics on a social application platform at the current time, automatically selecting the number of centroids for each topic category. A second clustering algorithm further clusters these topics based on the first algorithm's results, yielding more accurate topic classifications and the centroids included within each category. The clustering results are optimized by adjusting the radius coefficient of the first clustering algorithm, ensuring the expected number of cluster categories is met. This allows for the automatic acquisition of trending topics on social application platforms and rapid cluster analysis of these topics, resulting in more accurate identification of trending events.

[0129] The above is as stated in this application. Figure 1The method executed by the topic clustering device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly embodied as being executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0130] The electronic device can also perform Figure 1 The method, and implement the topic clustering device in Figure 1 The functions of the embodiments shown are not described in detail here.

[0131] Of course, in addition to software implementation, the electronic device of this application does not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0132] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by a portable electronic device including multiple applications, enable the portable electronic device to perform... Figure 3 The method of the illustrated embodiment is specifically used to perform the following operations:

[0133] Get multiple topics on social media platforms at the current time;

[0134] The multiple topics are used as a sample topic set, and the sample topic set is clustered using a first clustering algorithm to obtain a first clustering result; the first clustering result includes multiple topic categories, a first centroid of each topic category, and the number of first topics contained in each topic category.

[0135] Using the first centroid of each topic category as the center, the sample topic set is re-clustered using a second clustering algorithm to obtain a second clustering result; the second clustering result includes the multiple topic categories, the second centroid of each topic category, and the number of second topics contained in each topic category;

[0136] The number of topic categories in the second clustering result is compared with a pre-set threshold for the number of clustering categories;

[0137] If the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, the radius coefficient of the first clustering algorithm is adjusted until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result; the radius coefficient is used to characterize the radius of the topic category;

[0138] Based on the number of topics included in each topic category in the target clustering results, hot topics among the multiple topics are determined.

[0139] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0140] In summary, the above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

[0141] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0142] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0143] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0144] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

Claims

1. A topic clustering method, characterized in that, The method includes: Get multiple topics on social media platforms at the current time; The multiple topics are used as a sample topic set, and the sample topic set is clustered using a first clustering algorithm to obtain a first clustering result; the first clustering result includes multiple topic categories, a first centroid of each topic category, and the number of first topics contained in each topic category. Using the first centroid of each topic category as the center, the sample topic set is re-clustered using a second clustering algorithm to obtain a second clustering result; the second clustering result includes the multiple topic categories, the second centroid of each topic category, and the number of second topics contained in each topic category; The number of topic categories in the second clustering result is compared with a pre-set threshold for the number of clustering categories; If the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, the radius coefficient of the first clustering algorithm is adjusted until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result; the radius coefficient is used to characterize the radius of the topic category; Based on the number of topics included in each topic category in the target clustering results, hot topics among the multiple topics are determined; After obtaining the second clustering result, the following steps are also included: Compare the number of first topics and the number of second topics corresponding to the same topic category; If the number of the second topic is less than or equal to the number of the first topic, the position of the center point corresponding to the topic category is updated by the topics included in the first center point of the topic category, and this is used as the second center point of the topic category. If the number of second topics is greater than the number of first topics, the position of the center point corresponding to the topic category is updated by the topics included in the second center point of the topic category, and this is used as the second center point of the topic category.

2. The method as described in claim 1, characterized in that, Using the multiple topics as a sample topic set, the first clustering algorithm is used to cluster the sample topic set to obtain the first clustering result, including: The radius of each topic category after clustering is determined based on the radius coefficient of the first clustering algorithm, the mean and variance of the sample topic set; Select one topic from the sample topic set as the initial center point; Iterate through the list to determine whether each topic is within the radius of the existing center point; Topics within the radius are categorized into the corresponding topic categories of the central point; The topic outside the stated radius will be used as the new center point; After traversing each topic in the sample topic set, we obtain the multiple topic categories and the first center point of each topic category.

3. The method as described in claim 2, characterized in that, Using the first centroid of each topic category as the center, the sample topic set is re-clustered using a second clustering algorithm to obtain the second clustering result, including: The distance between each topic in the sample topic set and each existing first center point is determined sequentially; The topic is categorized into the topic category corresponding to the first center point with the minimum distance, and the second center point of the topic category is obtained by updating the position of the first center point of the topic category through the topic. After traversing each topic, we obtain the multiple topic categories, the second center point of each topic category, and the number of topics contained in each topic category.

4. The method as described in claim 1, characterized in that, The threshold for the number of cluster categories includes a first threshold and a second threshold, wherein the first threshold is greater than the second threshold; if the number of topic categories in the second clustering result does not meet the threshold for the number of cluster categories, the radius coefficient of the first clustering algorithm is adjusted until a second clustering result that meets the threshold for the number of cluster categories is obtained as the target clustering result, including: If the number of topic categories is greater than the first threshold, the radius coefficient is increased; if the number of topic categories is less than the second threshold, the radius coefficient is decreased until the number of topic categories is greater than the second threshold and less than the first threshold.

5. The method as described in claim 4, characterized in that, The clustering category number threshold includes a category number threshold range, which is a sub-interval of the interval range determined by the second threshold and the first threshold; If the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, the radius coefficient of the first clustering algorithm is adjusted until a second clustering result that meets the threshold for the number of clustering categories is obtained, including: If the number of topic categories is greater than the second threshold, less than the first threshold, and outside the threshold range for the number of categories, the topic categories with the fewest topics are deleted sequentially until the number of topic categories within the threshold range for the number of categories is obtained.

6. The method as described in claim 1, characterized in that, Based on the number of topics included in each topic category in the target clustering results, hot events among the multiple topics are determined, including: Sort the results in descending order based on the number of topics contained in each topic category in the target clustering results; Determine the specified number of topic categories that are ranked at the top as the target topic categories; The target topic category is designated as the trending event.

7. A topic clustering device, characterized in that, include: The acquisition unit retrieves multiple topics from social application platforms at the current time; The first clustering unit takes the multiple topics as a sample topic set and uses the first clustering algorithm to cluster the sample topic set to obtain the first clustering result. The first clustering result includes multiple topic categories, the first centroid of each topic category, and the number of first topics contained in each topic category; The second clustering unit, with the first centroid of each topic category as the center, re-clusters the sample topic set using the second clustering algorithm to obtain the second clustering result; The second clustering result includes the multiple topic categories, the second centroid of each topic category, and the number of second topics contained in each topic category; The comparison unit compares the number of topic categories in the second clustering result with a pre-set threshold for the number of clustering categories; The adjustment unit adjusts the radius coefficient of the first clustering algorithm when the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result; the radius coefficient is used to characterize the radius of the topic category; The processing unit determines the hot topics among the multiple topics based on the number of topics included in each topic category in the target clustering results. The processing unit is also used to compare the number of first topics and the number of second topics corresponding to the same topic category; If the number of the second topic is less than or equal to the number of the first topic, the position of the center point corresponding to the topic category is updated by the topics included in the first center point of the topic category, and this is used as the second center point of the topic category. If the number of second topics is greater than the number of first topics, the position of the center point corresponding to the topic category is updated by the topics included in the second center point of the topic category, and this is used as the second center point of the topic category.

8. An electronic device, characterized in that, include: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the following operations: Get multiple topics on social media platforms at the current time; The multiple topics are used as a sample topic set, and the sample topic set is clustered using the first clustering algorithm to obtain the first clustering result; The first clustering result includes multiple topic categories, the first centroid of each topic category, and the number of first topics contained in each topic category; Using the first centroid of each topic category as the center, the sample topic set is re-clustered using a second clustering algorithm to obtain a second clustering result; the second clustering result includes the multiple topic categories, the second centroid of each topic category, and the number of second topics contained in each topic category; The number of topic categories in the second clustering result is compared with a pre-set threshold for the number of clustering categories; If the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, the radius coefficient of the first clustering algorithm is adjusted until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result; the radius coefficient is used to characterize the radius of the topic category; Based on the number of topics included in each topic category in the target clustering results, hot topics among the multiple topics are determined; After obtaining the second clustering result, the following steps are also included: Compare the number of first topics and the number of second topics corresponding to the same topic category; If the number of the second topic is less than or equal to the number of the first topic, the position of the center point corresponding to the topic category is updated by the topics included in the first center point of the topic category, and this is used as the second center point of the topic category. If the number of second topics is greater than the number of first topics, the position of the center point corresponding to the topic category is updated by the topics included in the second center point of the topic category, and this is used as the second center point of the topic category.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores one or more programs that, when executed by an electronic device including multiple applications, cause the electronic device to perform the following operations: Get multiple topics on social media platforms at the current time; The multiple topics are used as a sample topic set, and the sample topic set is clustered using the first clustering algorithm to obtain the first clustering result; The first clustering result includes multiple topic categories, the first centroid of each topic category, and the number of first topics contained in each topic category; Using the first centroid of each topic category as the center, the sample topic set is re-clustered using a second clustering algorithm to obtain a second clustering result; the second clustering result includes the multiple topic categories, the second centroid of each topic category, and the number of second topics contained in each topic category; The number of topic categories in the second clustering result is compared with a pre-set threshold for the number of clustering categories; If the number of topic categories in the second clustering result does not meet the threshold for the number of clustering categories, the radius coefficient of the first clustering algorithm is adjusted until a second clustering result that meets the threshold for the number of clustering categories is obtained as the target clustering result; the radius coefficient is used to characterize the radius of the topic category; Based on the number of topics included in each topic category in the target clustering results, hot topics among the multiple topics are determined; After obtaining the second clustering result, the following steps are also included: Compare the number of first topics and the number of second topics corresponding to the same topic category; If the number of the second topic is less than or equal to the number of the first topic, the position of the center point corresponding to the topic category is updated by the topics included in the first center point of the topic category, and this is used as the second center point of the topic category. If the number of second topics is greater than the number of first topics, the position of the center point corresponding to the topic category is updated by the topics included in the second center point of the topic category, and this is used as the second center point of the topic category.

Citation Information

Patent Citations

  • Hot topic analysis method based on big data

    CN107193867A