Theme classification method based on hyperbolic graph convolutional network and hierarchical clustering

Through the hyperbolic graph convolution network and hierarchical clustering method, the hierarchical structure of Weibo text data is processed, which solves the classification difficulty of Weibo text topic classification in complex networks in the existing technology and achieves high-accuracy topic classification effects. .

CN118673928AActive Publication Date: 2024-09-20BEIJING INST OF TECH

Patent Information

Application Number
CN202410639670.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-22
Publication Date
2024-09-20
Estimated Expiration
2044-05-22

AI Technical Summary

Technical Problem

Existing microblog text topic classification methods have problems such as insufficient depth of hierarchical structure mining and single learning of network topology structure information and node attribute information when processing high-dimensional, non-Euclidean structure data of complex networks.

Method used

A method based on hyperbolic graph convolution network and hierarchical clustering is used to preprocess Weibo text data, establish an adjacency matrix of Euclidean space through cosine similarity, map the data to hyperbolic space, and calculate the hyperbolic distance between nodes. Curvature distance, combined with hierarchical clustering algorithm, captures the hierarchical structure relationship of Weibo text data, fuses two matrices as the input of graph convolution, and trains hyperbolic graph convolution network to achieve high-quality topic classification.

Benefits of technology

Effectively captures the hierarchical structure relationship of Weibo text data, improves the representation and classification capabilities of complex network data, solves the classification difficulties of traditional methods in high-dimensional, non-Euclidean structured data spaces, and achieves highly accurate topic classification .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118673928A
    Figure CN118673928A
Patent Text Reader

Abstract

The invention discloses a topic classification method based on a hyperbolic graph convolutional network and hierarchical clustering, and belongs to the technical field of text topic classification in natural language processing. The implementation method comprises the following steps: preprocessing microblog text data, including data cleaning, Chinese word segmentation and stop word removal; and calculating a feature vector by using a TF-IDF method. The preprocessed text data is mapped to a hyperbolic space, information is converted between an Euclidean space and the hyperbolic space through exponential mapping and logarithm mapping, and meanwhile the hierarchical structure features of the hyperbolic space are reserved. The hyperbolic distance between the nodes is calculated, and in combination with a hierarchical clustering algorithm, the relationship in hierarchical structure data is captured. Similar or related nodes can obtain higher weights in the information aggregation process of the hyperbolic graph convolutional network, the hierarchical structure of text data is mined, the hierarchical structure relationship of microblog text data is captured by training the hyperbolic graph convolutional neural network, and high-quality topic classification is realized by using the trained hyperbolic graph convolutional neural network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a neural network text classification method, in particular to a method based on a hyperbolic graph convolution network and a hierarchical clustering method, belonging to the technical field of text topic classification in natural language processing. Background Art

[0002] With the continuous advancement of the country's informatization process, the Internet has become an important platform for netizens to express their opinions and wishes, and has gradually formed influential network information. Information networks are typical social complex networks with the characteristics of complex systems, so it is necessary to learn the representation of complex networks. Since real-world networks usually show non-Euclidean structures, have hierarchical structures similar to trees, and some also satisfy power-law distributions, this leads to distortion and dimensionality explosion in traditional Euclidean space embedding. The content posted on Weibo can be organized into different levels according to topics or tags. This topic hierarchy can help understand Weibo content, but the existing Weibo text topic classification mostly uses a latent Dirichlet distribution model and convolutional neural network models to classify Weibo text topics. This has the problem of insufficient depth of hierarchical structure mining and single learning of network topology information and node attribute information. Therefore, a Weibo text topic classification method based on hyperbolic graph convolutional neural network and hierarchical clustering is proposed. Summary of the invention

[0003] The purpose of the present invention is to provide a topic classification method based on a hyperbolic graph convolutional network and hierarchical clustering, which pre-processes microblog text data, including data cleaning, removal of stop words and Chinese word segmentation; uses the TF-IDF method to calculate feature vectors; establishes an adjacency matrix in Euclidean space through cosine similarity, further uses the hyperbolic space to process data, maps to the hyperbolic space and calculates the hyperbolic distance between nodes, combines the hierarchical clustering algorithm, establishes an adjacency matrix in the hyperbolic space, and fuses the two matrices as the input of the graph convolution. The present invention captures the hierarchical structure relationship of microblog text data by training the hyperbolic graph convolutional network to achieve high-quality topic classification. The present invention is particularly suitable for processing topic classification and public information monitoring of complex networks such as social information networks, solves the classification difficulties of traditional methods in high-dimensional, non-Euclidean structure data space, and improves the representation and classification capabilities of microblog texts in network data.

[0004] The objective of the present invention is achieved through the following technical solutions:

[0005] The present invention discloses a topic classification method based on a hyperbolic graph convolutional network and hierarchical clustering, which maps preprocessed text data to a hyperbolic space, uses exponential mapping and logarithmic mapping to convert information between Euclidean space and hyperbolic space, and retains the hierarchical structure characteristics of the hyperbolic space. The hyperbolic distance between nodes is calculated and combined with a hierarchical clustering algorithm to capture the relationship in the hierarchical data. Similar or related nodes can obtain higher weights in the information aggregation process of the hyperbolic graph convolutional network, and the hierarchical structure of the text data is mined. The hierarchical relationship of the microblog text data is captured by training the hyperbolic graph convolutional network, and the trained hyperbolic graph convolutional network is used to achieve high-quality topic classification.

[0006] The present invention discloses a method for classifying microblog text topics based on a hyperbolic graph convolutional network and hierarchical clustering, comprising the following steps:

[0007] Step 1: Collect microblog texts under a specified topic, preprocess the text data, and annotate the subject categories of the microblog texts to obtain an annotated microblog text dataset, which is used as input for microblog text vectorization in the subsequent step 2. The preprocessing includes data cleaning, Chinese word segmentation, and stop word removal.

[0008] Step 1.1: Collect microblog texts under the specified topic.

[0009] Step 1.2: Clean the microblog text data collected in step 1.1 according to the preset standard information cleaning principle, remove irrelevant information, and obtain standard information microblog text. The preset standard information cleaning principle includes cleaning and filtering out microblog texts with text length less than the preset length threshold and microblog texts containing only emoticons but no text information.

[0010] Step 1.3: Perform Chinese word segmentation on the microblog text of the standard information obtained in step 1.2. Chinese text is different from English text. English text is composed of words separated by spaces, while Chinese text is connected into a sentence. Therefore, a Chinese word segmentation tool is used to segment the Chinese text to obtain the microblog text after Chinese word segmentation for step 1.4.

[0011] Step 1.4: Refer to the stop word list to remove meaningless information in the segmented Weibo text. The removed meaningless information includes Chinese auxiliary words and conjunctions. Chinese auxiliary words include "de", "shi", "zai", and conjunctions include "erqie", "danshi". Although Chinese auxiliary words and conjunctions play a role in the grammatical structure of sentences, for the task of text topic classification, the information value they provide is relatively low. Removing these high-frequency but low-information words allows the hyperbolic graph convolutional network to focus more on the keywords that substantially contribute to the text meaning, obtaining the Weibo text after removing stop words, reducing the amount of Weibo text data processed by the hyperbolic graph convolutional network in the subsequent steps, and improving the accuracy and efficiency of the hyperbolic graph convolutional network classification.

[0012] Step 1.5: Perform topic category annotation on the Weibo text after data cleaning, Chinese word segmentation, and stop word removal preprocessing to obtain the labeled Weibo text dataset, and use the Weibo text dataset as the input for the subsequent step two for vectorizing the Weibo text.

[0013] Step Two: For the Weibo text in the Weibo text dataset obtained in Step One, calculate the feature vector of the Weibo text by the TF-IDF method in the Euclidean space E, convert the Weibo text into vector form, and each dimension of the vector corresponds to the TF-IDF value of a word, that is, obtain the feature vector x corresponding to each Weibo text. E 。

[0014] Step 2.1: For the Weibo text in the Weibo text dataset obtained in Step One, in the Euclidean space E, normalize the number of occurrences of words in the Weibo text according to the word frequency TF normalization formula shown in Equation (1) to obtain the normalized word frequency TF of the Weibo text. The numerator of the TF normalization formula is the number of occurrences of the word in the document, and the denominator is the total number of all characters in the document.

[0015]

[0016] where, n t,d is the number of occurrences of word t in document d, and the denominator is the sum of the number of occurrences of all words in document d.

[0017] Step 2.2: For the Weibo text in the Weibo text dataset obtained in Step One, in the Euclidean space E, calculate the inverse document frequency IDF according to Formula (2).

[0018] IDF is called the inverse document frequency and is the reciprocal of the document frequency, which is used to reduce the effect of words that are common in all documents but have little impact on the document. The fewer documents that contain word t, the more able to distinguish documents by word t. The formula for IDF is as follows:

[0019]

[0020] Where |D| is the total number of documents in the corpus. The denominator is the number of documents containing the word t.

[0021] Step 2.3: Based on the term frequency TF obtained in step 2.1 and the inverse document frequency IDF obtained in step 2.2, the feature vector x in the Euclidean space E of the microblog text is calculated according to the TF-IDF feature vector formula shown in formula (3): E , vector x E Each dimension corresponds to the TF-IDF value of a word.

[0022] The TF-IDF value is obtained by multiplying the two, and the formula is:

[0023] TF-IDF(t,d,D)=TF(t,d)×IDF(t,D)#(3)

[0024] Convert the text into vector form, where each dimension corresponds to the TF-IDF value of a word, that is, the feature vector x corresponding to each microblog text is obtained. E , where E represents Euclidean space.

[0025] Step 3: The feature vector x corresponding to each microblog text obtained in step 2 E , the similarity between word vectors is calculated according to the formula of cosine similarity, and the adjacency matrix M for the hyperbolic graph convolutional network is established.

[0026] The adjacency matrix M is established by the similarity between the obtained word vectors, so the cosine similarity is used to calculate their adjacency relationship. The formula of cosine similarity is:

[0027] cosine-similarity i,j =(x i ·x j ) / (||x i ||||x j ||)#(4)

[0028] where x i ·x j is the vector x i and x j The dot product of , ||·|| is the modulus of the vector.

[0029] The adjacency matrix M is an n*n matrix representing the relationship between n microblog texts. If two microblog texts x i With x j The cosine similarity between the two is greater than the set threshold, and the adjacency matrix M corresponds to position M i,j The value of is 1.

[0030] Step 4: Use exponential mapping to convert the feature vector x corresponding to each microblog text obtained in step 2 E Mapping to hyperbolic space, converting information between Euclidean space and hyperbolic space while retaining the hyperbolic structure characteristics of hyperbolic space x 0,H As input to step 5.

[0031] The processed data is mapped to the hyperbolic space, and the exponential mapping is used to convert information between the Euclidean space and the hyperbolic space, while retaining the hierarchical structure characteristics of the hyperbolic space.

[0032]

[0033] Among them, x 0,E represents a feature in Euclidean space, H d,K is a d-dimensional hyperbolic sphere with constant negative curvature -1 / K (K>0), Indicates that H d,K The origin used as a reference point in tangent space operations.

[0034] Step 5: Use the hyperbolic feature x obtained in step 4 0,H The hyperbolic distance formula between nodes is used as input, and the hyperbolic distance between nodes is calculated according to the mapping characteristics of the hyperbolic space; the hierarchical clustering algorithm captures the relationship in the hierarchical data according to the hyperbolic distance, and obtains the adjacency matrix representing the hyperbolic space as the input of the hyperbolic graph convolutional network.

[0035] Step 5.1: Take the hyperbolic feature x obtained in step 4 0,H As input, the hyperbolic distance between nodes is calculated according to formula (6):

[0036]

[0037] in and is a hyperbolic space node representation, ||·|| 2 is the Euclidean norm.

[0038] Step 5.2: Based on the hyperbolic distance between nodes obtained in step 5.1, perform hierarchical clustering in the hyperbolic space to obtain an adjacency matrix representing the hyperbolic space as the input of the hyperbolic graph convolutional network.

[0039] The basic steps of hierarchical clustering in hyperbolic space are as follows:

[0040] 1) Initialization: At the beginning, each data point is considered as a cluster. Therefore, if there are N data points, the number of initial clusters is also N.

[0041] 2) Calculate distance: Calculate the hyperbolic distance between all possible cluster pairs.

[0042] 3) Merge clusters: Find the two closest clusters and merge them into a new cluster.

[0043] 4) Update distance: Update the distance matrix to reflect the distance between the merged cluster and other clusters.

[0044] 5) Repeat steps 2) to 4) until all data points are clustered into one cluster.

[0045] In each merging step of hierarchical clustering, the distance between any two sub-clusters is calculated according to formula (7):

[0046]

[0047] in the formula Sub-cluster C a , C b The samples in n a 、n b C a , C b The two closest subclusters will be divided into C b Grouped together to form a new sub-cluster.

[0048] Hierarchical clustering is achieved by calculating the distance in hyperbolic space to obtain a dendrogram. Each merge operation in the dendrogram is represented by a connecting line, and the height of the line represents the distance between the merged clusters. The data is divided by dividing the result dendrogram into different hyperbolic distance scales to obtain the corresponding clustering results. The clustering information of the hyperbolic space hierarchical clustering is used to construct the adjacency matrix X. The calculation of each element in the matrix X is shown in formula (8):

[0049]

[0050] If the node x i With x j In the hyperbolic space hierarchical clustering, if they belong to the same category at the same time, the position of row i and column j in the matrix G is set to 1, otherwise it is 0. The adjacency matrix G = X + M is established, and the adjacency matrices of the Euclidean space and the hyperbolic space are merged as the input of the hyperbolic graph convolutional network.

[0051] Step 6: Transform the hyperbolic eigenvector x 0,HThe adjacency matrix G is input into the hyperbolic graph convolutional network, and the hierarchical information is extracted in the hyperbolic graph convolutional network. The hyperbolic graph convolutional network updates the node information through three steps: feature conversion, neighborhood aggregation, and nonlinear activation. In the topic classification layer, the Softmax function is used to convert the output value of the hyperbolic graph convolutional network into a probability value, which represents the possibility of different topic categories and is used to perform topic classification. The topic with the highest probability is selected as the predicted classification result.

[0052] Step 6.1: Take the hyperbolic feature x obtained in step 4 0,H As the initial input, the feature conversion in the hyperbolic graph convolutional neural network is performed to obtain the hyperbolic feature The feature conversion formula is as shown in formula (10).

[0053]

[0054] Where l is the corresponding number of layers, W l With b l is a trainable parameter and K is the curvature.

[0055] Step 6.2: Input the hyperbolic features from step 6.1 The adjacency matrix G obtained in step 5 is used to aggregate the node information. In the aggregation operation, each node aggregates its own information with the information of its neighboring nodes, thereby updating its own representation and obtaining the node information aggregation representation after information aggregation. The information aggregation formula in hyperbolic space is shown in formula (11).

[0056]

[0057] w i,j The calculation is shown in formula (11).

[0058]

[0059] Step 6.3: Perform nonlinear activation on the features obtained after aggregation, introduce nonlinear transformation to enhance the learning ability of the hyperbolic neural network model, improve the expression ability of the hyperbolic neural network model and improve the convergence speed of the model. When performing nonlinear activation in the hyperbolic space, the hyperbolic graph convolutional network uses the mapping operation between the hyperbolic space and the tangent space to enable the hyperbolic graph convolutional network to achieve nonlinear processing of graph data while maintaining the hyperbolic geometric properties. The nonlinear activation formula in the hyperbolic space is shown in formula (12).

[0060]

[0061] Step 6.4: By using the Softmax function, the topic classification layer converts the output x of the hyperbolic graph convolutional network l+1'The probability value is converted into a probability value in the range of [0,1], which represents the possibility of different topic categories and is used to perform topic classification. The topic with the highest probability is selected as the predicted classification result.

[0062]

[0063] Where X is the hyperbolic vector output by the hyperbolic neural network step 6.3, and W a is the parameter matrix, b a is the bias term.

[0064] Step 7: Combine the loss function to train the hyperbolic graph convolutional network constructed in step 6 to obtain a trained hyperbolic graph convolutional network.

[0065] The loss function uses the cross entropy function, and the formula is as shown in formula (15).

[0066]

[0067] Where c is the total number of categories, representing the categories of the topic, N is the total number of texts, and y i,c is an indicator function, which is 1 when sample i belongs to category c and 0 otherwise; is the probability that the model predicts that sample i belongs to category c.

[0068] Step 8: Input the microblog text to be classified into the trained hyperbolic graph convolutional network to obtain the topic classification result of the microblog text to be classified, that is, realize the topic classification of the microblog text based on the hyperbolic graph convolutional network and hierarchical clustering.

[0069] The method also includes step nine: applying the topic classification results of the microblog text obtained in step eight to the fields of natural language processing and machine learning to solve related technical problems.

[0070] The related technical issues include intelligent text mining and services, social network information mining, and information monitoring.

[0071] The trained hyperbolic graph convolutional network is applied to network information monitoring. By classifying the microblog text by topic, information related to the scheduled events and topics is monitored, and real-time information monitoring and early warning are realized. According to the results of topic classification, different response strategies are adopted for different information topics to deal with negative information and strengthen the dissemination of positive information, improve the accuracy and efficiency of the information monitoring system, enhance the effectiveness of information monitoring work, and maintain positive network information and social stability.

[0072] Beneficial effects:

[0073] 1. The present invention discloses a topic classification method based on a hyperbolic graph convolutional network and hierarchical clustering. The adjacency matrix of the Euclidean space is established through cosine similarity, and then the data is mapped to the hyperbolic space and the hyperbolic distance between nodes is calculated. The adjacency matrix of the hyperbolic space is established in combination with the hierarchical clustering algorithm. The two matrices are fused as the input of the graph convolution. This method can effectively capture the hierarchical structure relationship of microblog text data and achieve high-accuracy topic classification.

[0074] 2. The present invention discloses a topic classification method based on a hyperbolic graph convolutional network and hierarchical clustering, which uses a hyperbolic graph convolutional network to extract features from data and mine hierarchical features of data. It is suitable for processing topic classification of complex networks such as social information networks, solving the classification difficulties of traditional methods in high-dimensional, non-Euclidean structured data space, and improving the representation and classification capabilities of microblog texts in network data.

[0075] 3. The present invention discloses a topic classification method based on a hyperbolic graph convolutional network and hierarchical clustering, which combines the beneficial effects 1 and 2, maps the preprocessed text data to the hyperbolic space, uses exponential mapping and logarithmic mapping to convert information between Euclidean space and hyperbolic space, and retains the hierarchical structure characteristics of the hyperbolic space. The hyperbolic distance between nodes is calculated and combined with a hierarchical clustering algorithm to capture the relationship in the hierarchical data. Similar or related nodes can obtain higher weights in the information aggregation process of the hyperbolic graph convolutional network, excavate the hierarchical structure of the text data, and achieve high-quality topic classification by capturing the hierarchical relationship of the microblog text data.

[0076] 4. The present invention discloses a topic classification method based on a hyperbolic graph convolutional network and hierarchical clustering, which collects microblog texts under a specified topic, preprocesses the text data, and annotates the topic categories of the microblog texts to obtain an annotated microblog text data set, and uses the microblog text data set as an input for microblog text vectorization. The preprocessing includes data cleaning, Chinese word segmentation, and stop word removal. Through preprocessing, the hyperbolic graph convolutional network is more focused on keywords that have a substantial contribution to the meaning of the text, and microblog texts without stop words are obtained, thereby reducing the amount of microblog text data processed by the subsequent hyperbolic graph convolutional network and improving the accuracy and efficiency of hyperbolic graph convolutional network classification.

[0077] 5. The present invention discloses a topic classification method based on hyperbolic graph convolutional network and hierarchical clustering, which applies the topic classification results of microblog texts to the fields of natural language processing and machine learning to solve related technical problems, such as intelligent text mining and services, social network information mining, information monitoring and other technical problems. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1A flowchart of a topic classification based on a hyperbolic graph convolutional network and hierarchical clustering disclosed in the present invention.

[0079] Figure 2 It is the hierarchical clustering dendrogram of the present invention. DETAILED DESCRIPTION

[0080] In order to better illustrate the purpose and advantages of the present invention, the invention is further described below with reference to the accompanying drawings and examples.

[0081] Embodiment 1:

[0082] This experiment was conducted on a computer with the following configurations: Intel Core i5-10400 2.9GHz CPU 2.40GHz, 16GB memory, GPU GT 730, operating system Windows 10, 64-bit; programming language Python 3.9, integrated development environment Pycharm 2022, programming framework Pytorch. The results were evaluated using accuracy and F1-measure values.

[0083] like Figure 1 As shown, the present embodiment discloses a topic classification method based on a hyperbolic graph convolutional network and hierarchical clustering, and the specific implementation steps are as follows:

[0084] Step 1: Collect microblog texts under a specified topic, preprocess the text data, and annotate the subject categories of the microblog texts to obtain an annotated microblog text dataset, which is used as input for microblog text vectorization in the subsequent step 2. The preprocessing includes data cleaning, Chinese word segmentation, and stop word removal.

[0085] Step 1.1: Collect microblog texts under the specified topic. Use a crawler to crawl microblog text data on the microblog website.

[0086] Step 1.2: Clean the microblog text data collected in step 1.1 according to the preset standard information cleaning principle, remove irrelevant information, and obtain standard information microblog text. The preset standard information cleaning principle includes cleaning and filtering out microblog texts with a text length of less than 10 characters and microblog texts that only contain emoticons but no text information.

[0087] Step 1.3: Perform Chinese word segmentation on the microblog text of the standard information obtained in step 1.2. Chinese text is different from English text. English text is composed of words separated by spaces, while Chinese text is connected into a sentence. Therefore, the present invention uses the Chinese word segmentation tool Jieba to perform word segmentation to obtain the microblog text after Chinese word segmentation for step 1.4.

[0088] Step 1.4: Refer to the Harbin Institute of Technology stop word list to remove meaningless information in the segmented Weibo text, such as Chinese auxiliary words like "de" (的), "shi" (是), "zai" (在), etc., and conjunctions like "erqie" (而且), "danshi" (但是), etc. Obtain the Weibo text after removing stop words, reduce the amount of Weibo text data processed by the subsequent hyperbolic graph convolutional network, and improve the accuracy and efficiency of the hyperbolic graph convolutional network classification.

[0089] Step 1.5: Perform topic category annotation on the Weibo text after data cleaning, Chinese word segmentation, and stop word removal preprocessing to obtain the labeled Weibo text dataset, and use the Weibo text dataset as the input for the subsequent step two to vectorize the Weibo text.

[0090] Step two: For the Weibo text in the Weibo text dataset obtained in step one, calculate the feature vector of the Weibo text by the TF-IDF method in the Euclidean space E, convert the Weibo text into vector form, and each dimension of the vector corresponds to the TF-IDF value of a word, that is, obtain the feature vector x corresponding to each Weibo text. E 。

[0091] Step 2.1: For the Weibo text in the Weibo text dataset obtained in step one, in the Euclidean space E, normalize the number of occurrences of words in the Weibo text according to the word frequency TF normalization formula shown in Equation (1) to obtain the normalized word frequency TF of the Weibo text. The numerator of the TF normalization formula is the number of occurrences of the word in the document, and the denominator is the total number of all characters in the document.

[0092]

[0093] where, n t,d is the number of occurrences of word t in document d, and the denominator is the sum of the number of occurrences of all words in document d.

[0094] Step 2.2: For the Weibo text in the Weibo text dataset obtained in step one, in the Euclidean space E, calculate the inverse document frequency IDF according to formula (2).

[0095] IDF is called the inverse document frequency and is the reciprocal of the document frequency, which is used to reduce the effect of words that are common in all documents but have little impact on the document. The fewer documents that contain word t, the more able to distinguish documents by word t. The formula for IDF is as follows:

[0096]

[0097] where, |D| is the total number of documents in the corpus. The denominator is the number of documents that contain word t.

[0098] Step 2.3: Based on the term frequency TF obtained in step 2.1 and the inverse document frequency IDF obtained in step 2.2, the feature vector x in the Euclidean space E of the microblog text is calculated according to the TF-IDF feature vector formula shown in formula (3): E , vector x E Each dimension corresponds to the TF-IDF value of a word.

[0099] The TF-IDF value is obtained by multiplying the two, and the formula is:

[0100] TF-IDf(t,d,D)=TF(t,d)×IDFt,D)#(3)

[0101] Convert the text into vector form, where each dimension corresponds to the TF-IDF value of a word, that is, the feature vector x corresponding to each microblog text is obtained. E , where E represents Euclidean space.

[0102] Step 3: The feature vector x corresponding to each microblog text obtained in step 2 E , the similarity between word vectors is calculated according to formula (4) to establish the adjacency matrix M for the hyperbolic graph convolutional network.

[0103] The adjacency matrix M is established by the similarity between the obtained word vectors, so the cosine similarity is used to calculate their adjacency relationship. The formula of cosine similarity is:

[0104] cosine-similarity i,j =(x i ·x j ) / (||x i ||||x j ||)#(4)

[0105] where x i ·x j is the vector x i and x j The dot product of , ||·|| is the modulus of the vector.

[0106] The adjacency matrix M is an n*n matrix representing the relationship between n microblog texts. If two microblog texts x i With x j The cosine similarity between them is greater than 0.1, and the adjacency matrix M corresponds to position M i,j The value of is 1.

[0107] Step 4: Use exponential mapping to convert the feature vector x corresponding to each microblog text obtained in step 2 E Mapping to hyperbolic space, converting information between Euclidean space and hyperbolic space while retaining the hyperbolic structure characteristics of hyperbolic space x 0,HAs input to step 5.

[0108] The processed data is mapped to the hyperbolic space, and the exponential mapping is used to convert information between the Euclidean space and the hyperbolic space, while retaining the hierarchical structure characteristics of the hyperbolic space.

[0109]

[0110] Among them, x 0,E represents a feature in Euclidean space, H d,K is a d-dimensional hyperbolic sphere with constant negative curvature -1 / K (K>0), Indicates that H d,K The origin used as a reference point in tangent space operations.

[0111] Step 5: Use the hyperbolic feature x obtained in step 4 0,H The hyperbolic distance formula between nodes is used as input, and the hyperbolic distance between nodes is calculated according to the mapping characteristics of the hyperbolic space; the hierarchical clustering algorithm captures the relationship in the hierarchical data according to the hyperbolic distance, and obtains the adjacency matrix representing the hyperbolic space as the input of the hyperbolic graph convolutional network.

[0112] Step 5.1: Take the hyperbolic feature x obtained in step 4 0,H As input, the hyperbolic distance between nodes is calculated according to formula (6):

[0113]

[0114] in and is a hyperbolic space node representation, ||·|| 2 is the Euclidean norm.

[0115] Step 5.2: Based on the hyperbolic distance between nodes obtained in step 5.1, perform hierarchical clustering in the hyperbolic space to obtain an adjacency matrix representing the hyperbolic space as the input of the hyperbolic graph convolutional network.

[0116] The basic steps of hierarchical clustering in hyperbolic space are as follows:

[0117] 1) Initialization: At the beginning, each data point is considered as a cluster. Therefore, if there are N data points, the number of initial clusters is also N.

[0118] 2) Calculate distance: Calculate the hyperbolic distance between all possible cluster pairs.

[0119] 3) Merge clusters: Find the two closest clusters and merge them into a new cluster.

[0120] 4) Update distance: Update the distance matrix to reflect the distance between the merged cluster and other clusters.

[0121] 5) Repeat steps 2) to 4): Repeat the steps until all data points are clustered into one cluster.

[0122] In each merging step of hierarchical clustering, the distance between any two sub-clusters is calculated according to formula (7):

[0123]

[0124] in the formula Sub-cluster C a , C b The samples in n a 、n b C a , C b The two closest subclusters will be divided into C b Grouped together to form a new sub-cluster.

[0125] Hierarchical clustering is achieved by calculating the distance in hyperbolic space to obtain a dendrogram, such as Figure 2 As shown in the figure, each merge operation in the dendrogram is represented by a connecting line, and the height of the line represents the distance between the merged clusters. The data is divided by dividing the result dendrogram into different hyperbolic distance scales x and y to obtain the corresponding clustering results. At the same time, the clustering information of the hyperbolic space hierarchical clustering is used to construct the adjacency matrix X. The calculation of each element in the matrix X is shown in formula (8):

[0126]

[0127] If the node x i With x j In the hyperbolic space hierarchical clustering, if they belong to the same category at the same time, the position of row i and column j in the matrix G is set to 1, otherwise it is 0. Similar or related nodes can obtain higher weights w in the information aggregation process. i,,j . Establish the adjacency matrix G = X + M, merge the adjacency matrices of Euclidean space and hyperbolic space as the input of the hyperbolic graph convolutional network, w i,j The calculation is shown in formula (9).

[0128]

[0129] Step 6: Transform the hyperbolic eigenvector x 0,HThe adjacency matrix is ​​input into the hyperbolic graph convolutional network, where hierarchical information extraction is completed. The hyperbolic graph convolutional network updates node information through three steps: feature conversion, neighborhood aggregation, and nonlinear activation. The topic classification layer uses the Softmax function to convert the output value of the hyperbolic graph convolutional network into probability values. These probability values ​​represent the possibility of different topic categories and are used to perform topic classification. Finally, the topic with the highest probability is selected as the predicted classification result.

[0130] Step 6.1: Take the hyperbolic feature x obtained in step 4 0,H As the initial input, the feature conversion in the hyperbolic graph convolutional neural network is performed to obtain the hyperbolic feature The feature conversion formula is as shown in formula (10).

[0131]

[0132] Where l is the corresponding number of layers, W l With b l is a trainable parameter and K is the curvature.

[0133] Step 6.2: Input the hyperbolic features from step 6.1 And through the w obtained in step 5 i,j Aggregate node information. In the aggregation operation, each node aggregates its own information with the information of its neighboring nodes, thereby updating its own representation and obtaining the node information aggregation representation after information aggregation. The information aggregation formula in hyperbolic space is shown in formula (11).

[0134]

[0135] Step 6.3: Next, we need to perform nonlinear activation on the features obtained after aggregation, introduce nonlinear transformation to enhance the learning ability of the model, improve the model's expressiveness and improve the convergence speed of the model. When performing nonlinear activation in the hyperbolic space, the hyperbolic graph convolutional network uses the mapping operation between the hyperbolic space and the tangent space to enable the hyperbolic graph convolutional network to achieve nonlinear processing of graph data while maintaining the hyperbolic geometric properties. The nonlinear activation formula in the hyperbolic space is shown in formula (12).

[0136]

[0137] Step 6.4: The topic classification layer passes the Softmax function to convert the output x of the hyperbolic graph convolutional network l+1' The probability values ​​are converted into probability values ​​in the range of [0,1], which represent the possibility of different topic categories and are used to perform topic classification. Finally, the topic with the highest probability is selected as the predicted classification result.

[0138]

[0139] Where X is the hyperbolic vector output by the hyperbolic neural network step 6.3, and W a is the parameter matrix, b a is the bias term.

[0140] Step 7: Refer to the sample training step 6 to build the hyperbolic graph convolutional network and obtain the trained hyperbolic graph convolutional network.

[0141] The loss function uses the cross entropy function, and the formula is as shown in formula (15).

[0142]

[0143] Where c is the total number of categories, representing the categories of the topic, N is the total number of texts, and y i,c is an indicator function, which is 1 when sample i belongs to category c and 0 otherwise; is the probability that the model predicts that sample i belongs to category c.

[0144] Step 8: Input the microblog text to be classified into the trained hyperbolic graph convolutional network to obtain the topic classification result of the microblog text to be classified, that is, realize the topic classification of the microblog text based on the hyperbolic graph convolutional network and hierarchical clustering.

[0145] The method also includes step nine: applying the topic classification results of the microblog text obtained in step eight to the fields of natural language processing and machine learning to solve related technical problems.

[0146] In order to investigate the effect of the microblog text topic classification method based on hyperbolic hierarchical clustering and hyperbolic graph convolutional neural network, the present invention is compared with the classic K-MEANS and Agglomerative clustering algorithms in Euclidean space and the neural network classification method based on Euclidean space. The results of the experiment on Weibo and PubMed data sets are shown in Table 1.

[0147] Table 1 Experimental results

[0148]

[0149] The accuracy and F1 value of the present invention on Weibo and PubMed data sets are higher than those of other models, showing excellent text classification capabilities. When processing data with obvious hierarchical structures or complex relationships, the use of hyperbolic space methods has potential advantages. The advantages of the present invention in processing data sets show its efficient processing capabilities for social media texts.

[0150] The specific description above further illustrates the purpose, technical solutions and beneficial effects of the invention in detail. It should be understood that the above is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A topic classification method based on hyperbolic graph convolutional network and hierarchical clustering, characterized by: including the following steps, Step 1: Collect Weibo texts under a specified topic, preprocess the text data, and label the topic categories of the Weibo texts to obtain a labeled Weibo text dataset, which is used as the input for the subsequent Step 2 to vectorize the Weibo texts; the preprocessing includes data cleaning, Chinese word segmentation, and stop word removal; Step 2: For the microblog texts in the microblog text data set obtained in step 1, calculate the feature vector of the microblog text by the TF-IDF method in the Euclidean space E, convert the microblog text into a vector form, and each dimension of the vector corresponds to the TF-IDF value of a word, that is, obtain the feature vector x corresponding to each microblog text E ; Step 3: The feature vector x corresponding to each microblog text obtained in step 2 E , calculate the similarity between word vectors according to the formula of cosine similarity, and establish the adjacency matrix M for the hyperbolic graph convolutional network; Step 4: Use exponential mapping to convert the feature vector x corresponding to each microblog text obtained in step 2 E Mapping to hyperbolic space, converting information between Euclidean space and hyperbolic space while retaining the hyperbolic structure characteristics of hyperbolic space x 0,H As input for step 5: Step 5: Use the hyperbolic feature x obtained in step 4 0,H The hyperbolic distance formula between nodes is used as input, and the hyperbolic distance formula between nodes is used to calculate the hyperbolic distance between nodes according to the mapping characteristics of the hyperbolic space; the hierarchical clustering algorithm captures the relationship in the hierarchical data according to the hyperbolic distance, and obtains the adjacency matrix represented in the hyperbolic space as the input of the hyperbolic graph convolutional network; Step 6: Transform the hyperbolic eigenvector x 0,H The adjacency matrix G is input into the hyperbolic graph convolutional network, and the hierarchical information is extracted in the hyperbolic graph convolutional network. The hyperbolic graph convolutional network updates the node information through three steps: feature conversion, neighborhood aggregation, and nonlinear activation. In the topic classification layer, the Softmax function is used to convert the output value of the hyperbolic graph convolutional network into a probability value, which represents the possibility of different topic categories and is used to perform topic classification. Select the topic with the highest probability as the predicted classification result; Step 7: Train the hyperbolic graph convolutional network constructed in Step 6 in combination with the loss function to obtain a trained hyperbolic graph convolutional network; Step 8: Input the Weibo text to be classified into the trained hyperbolic graph convolutional network to obtain the topic classification result of the Weibo text to be classified, that is, realize the topic classification of Weibo texts based on the hyperbolic graph convolutional network and hierarchical clustering.

2. A topic classification method based on hyperbolic graph convolutional network and hierarchical clustering as claimed in claim 1, characterized in that: It also includes Step 9: Apply the topic classification result of the Weibo text obtained in Step 8 to the fields of natural language processing and machine learning to solve related technical problems; The related technical problems include intelligent text mining and services, social network information mining, and information monitoring; Apply the trained hyperbolic graph convolutional network to network information monitoring. By classifying the topics of Weibo texts, monitor information related to predetermined events and topics, realize real-time monitoring and early warning of information; according to the topic classification results, adopt different response strategies for different information topics, dispose of negative information, strengthen the dissemination of positive information, improve the accuracy and efficiency of the information monitoring system, enhance the effect of information monitoring work, and maintain the positive orientation of network information and social stability.

3. A topic classification method based on hyperbolic graph convolutional network and hierarchical clustering as claimed in claim 1 or 2, characterized in that: The implementation method of Step 1 is, Step 1.1: Collect Weibo texts under a specified topic; Step 1.2: Perform data cleaning on the Weibo text data collected in Step 1.1 through a preset specification information cleaning principle to remove irrelevant information and obtain Weibo texts with standardized information; the preset specification information cleaning principle includes cleaning and filtering out Weibo texts with a length less than a preset length threshold and Weibo texts containing only emojis without text information; Step 1.3: Perform Chinese word segmentation on the Weibo texts with standardized information obtained in Step 1.2 to obtain the Chinese word-segmented Weibo texts for Step 1.4; Step 1.4: Refer to the stop word list to剔除 the meaningless information in the word-segmented Weibo texts. The meaningless information to be剔除 includes Chinese auxiliary words and conjunctions. Chinese auxiliary words include "de", "shi", "zai", and conjunctions include "erqie", "danshi"; although Chinese auxiliary words and conjunctions play a role in the grammatical structure of sentences; remove these high-frequency but low-information-content words to make the hyperbolic graph convolutional network more focused on the keywords that make a substantial contribution to the text meaning and obtain the Weibo texts with stop words removed; Step 1.5: Perform topic category labeling on the Weibo texts after data cleaning, Chinese word segmentation, and stop word removal preprocessing to obtain a labeled Weibo text dataset, which is used as the input for the subsequent Step 2 to vectorize the Weibo texts.

4. A topic classification method based on hyperbolic graph convolutional network and hierarchical clustering as claimed in claim 3, characterized in that: The implementation method of Step 2 is, Step 2.1: For the microblog texts in the microblog text data set obtained in step 1, in the Euclidean space E, the number of times a word appears in the microblog text is normalized according to the word frequency TF normalization formula shown in formula (1) to obtain the normalized word frequency TF of the microblog text words; the numerator of the TF normalization formula is the number of times the word appears in the document, and the denominator is the total number of all characters in the document; Among them, n t , d is the number of occurrences of word t in document d, and the denominator is the sum of the number of occurrences of all words in document d; Step 2.2: For the microblog texts in the microblog text dataset obtained in step 1, calculate the inverse document frequency IDF in the Euclidean space E according to formula (2); IDF is called inverse document frequency, which is the inverse of document frequency. It is used to reduce the effect of words that are common in all documents but have little impact on the document. The fewer documents contain word t, the more documents can be distinguished by word t. The formula of IDF is as follows: Where |D| is the total number of documents in the corpus; the denominator is the number of documents containing word t; Step 2.3: Based on the term frequency TF obtained in step 2.1 and the inverse document frequency IDF obtained in step 2.2, the feature vector x in the Euclidean space E of the microblog text is calculated according to the TF-IDF feature vector formula shown in formula (3): E , vector x E Each dimension corresponds to the TF-IDF value of a word; The TF-IDF value is obtained by multiplying the two, and the formula is: TF-IDF(t,d,D)=TF(t,d)×IDF(t,D)#(3) Convert the text into vector form, where each dimension corresponds to the TF-IDF value of a word, that is, the feature vector x corresponding to each microblog text is obtained. E , where E represents Euclidean space.

5. A topic classification method based on hyperbolic graph convolutional network and hierarchical clustering as claimed in claim 4, characterized in that: In step three, The adjacency matrix M is established by the similarity between the obtained word vectors, so the cosine similarity is used to calculate their adjacency relationship. The formula of cosine similarity is: cosine-similarity i,j =(x i ·x j ) / (||x i ||||x j ||)#(4) where x i ·x j is the vector x i and x j The dot product of ||·|| is the modulus of the vector; The adjacency matrix M is an n*n matrix representing the relationship between n microblog texts. If two microblog texts x i With x j The cosine similarity between the two is greater than the set threshold, and the adjacency matrix M corresponds to position M i,j The value of M is 1. i,i The value of is also 1.

6. A topic classification method based on hyperbolic graph convolutional network and hierarchical clustering as claimed in claim 5, characterized in that: In step four, Map the processed data to the hyperbolic space, and use the exponential mapping to convert information between the Euclidean space and the hyperbolic space, while retaining the hierarchical structure characteristics of the hyperbolic space; Among them, x 0,E represents a feature in Euclidean space, H d,K is a d-dimensional hyperbolic sphere with constant negative curvature -1 / K (K>0), Indicates that H d,K The origin used as a reference point in tangent space operations.

7. A topic classification method based on hyperbolic graph convolutional network and hierarchical clustering as claimed in claim 6, characterized in that: The implementation method of step five is: Step 5.1: Take the hyperbolic feature x obtained in step 4 0,H As input, the hyperbolic distance between nodes is calculated according to formula (6): in and is a hyperbolic space node representation, ||·|| 2 is the Euclidean norm; Step 5.2: Based on the hyperbolic distance between nodes obtained in step 5.1, perform hierarchical clustering in the hyperbolic space to obtain an adjacency matrix representing the hyperbolic space as the input of the hyperbolic graph convolutional network; The basic steps of hierarchical clustering in hyperbolic space are as follows: 1) Initialization: At the beginning, each data point is considered as a cluster. Therefore, if there are N data points, the number of initial clusters is also N. 2) Calculate distance: Calculate the hyperbolic distance between all possible cluster pairs; 3) Merge clusters: find the two closest clusters and merge them into a new cluster; 4) Update distance: Update the distance matrix to reflect the distance between the merged cluster and other clusters; 5) Repeat steps 2) to 4) until all data points are clustered into one cluster; In each merging step of hierarchical clustering, the distance between any two sub-clusters is calculated according to formula (7): in the formula Sub-cluster C a , C b The samples in n a 、n b C a , C b The number of samples in C; the two closest sub-clusters will be divided into b Grouped together to form a new sub-cluster; Hierarchical clustering is achieved by calculating the distance in hyperbolic space to obtain a dendrogram. Each merge operation in the dendrogram is represented by a connecting line, and the height of the line represents the distance between the merged clusters. The data is divided by dividing the result dendrogram into different hyperbolic distance scales to obtain the corresponding clustering results. The clustering information of the hyperbolic space hierarchical clustering is used to construct the adjacency matrix X. The calculation of each element in the matrix X is shown in formula (8): If the node x i With x j In the hyperbolic space hierarchical clustering, if they belong to the same category at the same time, the position of the i row and j column in the matrix G is set to 1, otherwise it is 0; establish the adjacency matrix G = X + M, merge the adjacency matrices of the Euclidean space and the hyperbolic space as the input of the hyperbolic graph convolutional network.

8. A topic classification method based on hyperbolic graph convolutional network and hierarchical clustering as claimed in claim 7, characterized in that: The implementation method of step six is: Step 6.1: Take the hyperbolic feature x obtained in step 4 0,H As the initial input, the feature conversion in the hyperbolic graph convolutional neural network is performed to obtain the hyperbolic feature The feature conversion formula is as shown in formula (10); Where 1 is the corresponding layer number, W l With b t is a trainable parameter, K is the curvature; Step 6.2: Input the hyperbolic features from step 6.1 The adjacency matrix G obtained in step 5 is used to aggregate the node information. In the aggregation operation, each node aggregates its own information with the information of its neighboring nodes, thereby updating its own representation and obtaining the node information aggregation representation after information aggregation. The information aggregation formula in hyperbolic space is as shown in formula (11); w i,j The calculation is shown in formula (11); Step 6.3: Perform nonlinear activation on the features obtained after aggregation, introduce nonlinear transformation to enhance the learning ability of the hyperbolic graph convolutional network model, improve the expression ability of the hyperbolic graph convolutional network model and improve the convergence speed of the model; when performing nonlinear activation in the hyperbolic space, the hyperbolic graph convolutional network performs a mapping operation between the hyperbolic space and the tangent space, so that the hyperbolic graph convolutional network can realize nonlinear processing of graph data while maintaining the hyperbolic geometric properties. The nonlinear activation formula in the hyperbolic space is shown in formula (12); Step 6.4: By using the Softmax function, the topic classification layer converts the output x of the hyperbolic graph convolutional network l+1 Converted into a probability value in the range of [0, 1] for topic classification; Select the topic with the highest probability as the predicted classification result; Where X is the hyperbolic vector output by the hyperbolic neural network step 6.3, and W a is the parameter matrix, b a is the bias term.

9. A topic classification method based on hyperbolic graph convolutional network and hierarchical clustering as claimed in claim 8, characterized in that: In step seven, The loss function adopts the cross entropy function formula as shown in formula (15); Where c is the total number of categories, representing the categories of the topic, N is the total number of texts, and y i,c is an indicator function, which is 1 when sample i belongs to category c and 0 otherwise; is the probability that the model predicts that sample i belongs to category c.

Citation Information

Patent Citations

  • Network abnormal point detection method based on hyperbolic space

    CN115664970A

  • Structured deep clustering network and method based on graph structure learning

    CN115712848A

  • Individual travel mode analysis method based on semi-supervised hypergraph clustering

    CN115809279A

  • Short text classification method and device based on hyperbolic graph attention network

    CN116150372A

  • Community detection method of hyperbolic graph convolutional network based on adaptive curvature

    CN117237141A

Cited By

  • Internet of Things terminal protocol classification method

    CN119484672A

  • Multi-modal data processing method and device, electronic equipment and storage medium

    CN120974176A