Cross-border ethnic text clustering method and device integrating domain knowledge graph
By constructing cross-border ethnic cultural document association diagrams and combining heterogeneous graph convolution neural networks and long-term memory networks, the problems of complex semantic environment and lack of cultural background in cross-border ethnic cultural text clustering are solved, and a better text clustering effect is achieved.
Patent Information
- Application Number
- CN202211344205.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-10-31
AI Technical Summary
There are problems in the cross-border national cultural text clustering task of complex semantic environment and lack of cultural background, resulting in poor text clustering effect.
The cross-border ethnic text clustering method of fusion domain knowledge graphs is constructed, and features are extracted using heterogeneous graph convolution neural networks and long and short-term memory networks, combined with knowledge representation models and gating mechanisms to perform feature fusion, and clustering is performed using variational autoencoder and K-means clustering model.
It effectively improves the clustering effect of cross-border ethnic cultural texts, and improves the accuracy and consistency of text clustering by integrating entity semantic information and text data.
Smart Images

Figure CN115658902B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a cross-border ethnic text clustering method and device integrating domain knowledge graphs, and belongs to the technical field of natural language processing. Background Art
[0002] The cross-border ethnic culture text clustering task is the basic work in the cross-border ethnic culture document association analysis, which aims to obtain the document association relationship of cross-border ethnic culture, and is of great significance to the development of cross-border ethnic culture research. The cross-border ethnic culture document association analysis task can be regarded as a clustering process of text data, that is, the text data describing the same cross-border ethnic culture are clustered under the same event cluster. In response to the problem of complex semantic environment in cross-border ethnic culture text data, some scholars have proposed to use additional semantic (such as entity) information to enhance text semantics, but there is a phenomenon that the relationship between entities is not taken into account. At present, there are few studies based on the field of cross-border ethnic culture. The cross-border ethnic culture text clustering task belongs to a specific field clustering problem. In response to the problems existing in cross-border ethnic culture text data, the present invention considers integrating cross-border ethnic culture knowledge graph to assist text clustering in order to achieve better text clustering effect.
[0003] This paper focuses on a cross-border ethnic text clustering method that integrates domain knowledge graphs. Building on the work of Linmei et al., this method effectively integrates entity semantic information from the cross-border ethnic cultural knowledge graph. This gating mechanism combines entity semantic information with cross-border ethnic cultural text data, enriching the semantic information of the text data. A cross-border ethnic cultural document association analysis graph containing topic and entity information is constructed, and a heterogeneous graph convolutional neural network is used to learn representations of the enriched cross-border ethnic cultural text data. Summary of the Invention
[0004] The present invention provides a cross-border ethnic text clustering method and device that integrates domain knowledge graphs, which are used to solve the problem of complex semantic environment in cross-border ethnic text data, as well as the problem of poor text clustering effect caused by the lack of cultural background in cross-border ethnic cultural texts and the large differences between different ethnic cultures.
[0005] The technical solution of the present invention is as follows: In the first aspect, the present invention provides a cross-border ethnic text clustering method based on the fusion of domain knowledge graphs. The specific steps of the cross-border ethnic text clustering method based on the fusion of domain knowledge graphs are as follows:
[0006] Step 1. Preprocessing of cross-border ethnic cultural text data: 33,977 cross-level ethnic cultural vocabulary were collected through Wikipedia and ethnic websites to form a cross-border ethnic cultural dictionary; after filtering, screening, removing stop words, and removing special symbols, the cross-border ethnic text data of Dai, Thai, Yi, and Lolo were obtained, and 18,002 sentences of text data were selected as the cross-border ethnic text clustering dataset; documents, entities, and topics were used to form a cross-border ethnic cultural document association graph, which can better represent the association relationship between cross-border ethnic cultural texts and help improve the effect of cross-border ethnic text clustering.
[0007] Step 2. Feature extraction of cross-border ethnic text data: A heterogeneous graph convolutional neural network is used to extract features from the constructed cross-border ethnic cultural document association graph, and this feature is used as a global feature. A long short-term memory network is used to extract features from cross-border ethnic cultural texts, and this feature is used as a text feature. A knowledge representation model is used to represent the cross-border ethnic cultural domain knowledge graph, and this feature representation is fused with the text feature through a gating mechanism. The fused text feature is used as a local feature. The global feature reflects the potential correlation between texts in the entire text collection. The local feature fuses the triple knowledge in the domain knowledge graph with a single text, reflecting the potential correlation between a single text and a text. Both can effectively improve the effect of cross-border ethnic text clustering.
[0008] Step 3: Clustering cross-border ethnic texts using domain knowledge graphs: The global and local features of the cross-border ethnic text data are combined, further extracted using a variational autoencoder, and then fed into a Kmeans clustering model to obtain the final clustering results. This model utilizes a combination of global and local features to represent cross-border ethnic cultural texts, effectively enhancing the unique cultural characteristics of cross-border ethnic cultural texts and effectively improving the effectiveness of text clustering.
[0009] As a preferred embodiment of the present invention, the specific steps of Step 1 are:
[0010] Step 1.1: Using crawler technology, we collected cross-border ethnic cultural text data from ethnic cultural websites such as Wikipedia, Baidu Encyclopedia, WeChat public accounts, and Dai ethnic network websites. We annotated cross-border ethnic cultural terms from this data. After deduplication and filtering, we obtained 33,977 cross-border ethnic cultural terms, which we then used to form the Cross-border Ethnic Cultural Dictionary. The maximum length of a term was 5 characters, and the minimum was 1 character.
[0011] Step 1.2: After screening, filtering, deduplication, and special character removal of the text data obtained in Step 1.1, we obtained 18,002 pieces of text data from the Dai, Thai (Thailand), Yi, and Lolo (Vietnam) ethnic groups. These data are grouped into 15 categories: Lolo primitive religion, Lolo burial customs, Lolo clothing, Theravada Buddhism of the Dai people, Dai marriage customs, Dai peacock dance, Dai architecture, Dai Water Splashing Festival, Dai clothing, Dai burial customs, Yi primitive religion, Yi festivals, Thai primitive religion, and Thai festivals. Each piece of text data belongs to only one cultural category. The maximum length of a text is 456 characters, and the average length is 146 characters.
[0012] Step 1.3, through the LDA topic model to mine the potential topic information of cross-border ethnic text data, each cross-border ethnic text data is assigned to the p related topics with the highest probability. That is, an edge is constructed between the p topics and the cross-border ethnic cultural text data, and its weight is the corresponding topic probability; with the help of the cross-border ethnic cultural field dictionary, the cross-border ethnic cultural entities in the cross-border ethnic cultural text are identified, and an edge is constructed between the identified entity vocabulary and the cross-border ethnic cultural text data, and its weight is the TF-IDF value of the entity vocabulary; the obtained topic nodes and edges are combined. 主题-文档 , entity nodes, edges 实体-文档 By integrating with document nodes, we can obtain a cross-border ethnic cultural document association graph.
[0013] As a preferred embodiment of the present invention, the specific steps of Step 2 are:
[0014] Step 2.1, extract the global feature information of cross-border ethnic cultural text data: For the cross-border ethnic cultural association analysis graph g = (v, ε), where v and ε represent the set of nodes and weights respectively, X∈R |v|×M Represents the feature x in the node v ∈R |v|×M The matrix (each row x v are all feature matrices of nodes), M refers to the dimension of the vector of a single node, and the heterogeneous convolutional layer aggregates neighbor nodes of different types of τ Update node h with the features (l+1) Representation at the (l+1)th layer (initially, H(0)=X):
[0015]
[0016] Among them, T represents a set of different types of τ, σ represents the activation function, and B τ refers to the attention matrix, represents the node feature matrix at layer l, Represents the transformation matrix corresponding to the node;
[0017] Step 2.2: Cross-border ethnic cultural text data is represented by LSTM d ∈R M , s d Represents the word vector of cross-border ethnic cultural text data, R M Indicates that the word vector is a set of real numbers with a length of M;
[0018] For example, there is cross-border ethnic cultural text data: "Songkran Festival is the most solemn festival of the Thai people". First, the text sentence is segmented using the jieba tool to obtain: "Songkran Festival is the most solemn festival of the Thai people". Since there are a large number of professional terms in the cross-border ethnic cultural text sentences, the present invention uses jieba combined with the domain dictionary for word segmentation, so as to better distinguish the domain terms such as "lemongrass grilled fish" in the cross-border ethnic cultural text sentences. Then the Word2Vec model is used to train the existing cross-border ethnic cultural data to obtain word vectors, and the cross-border ethnic word vectors are used to obtain the word vectors of each word in the title. i ,i∈[1,N]’s embedded representation x i ∈R 100 Where N represents the number of words in the title and 100 represents the word vector dimension. Finally, the word-level representation of the sentence is obtained through the LSTM model: S = [s 宋干节 ,s 是 ,s 泰族 ,s 最 ,s 隆重 ,s 的 ,s 节日 ].
[0019] Step 2.3, semantic representation of cross-border ethnic cultural knowledge graph: TransE model is used to represent entity s in cross-border ethnic cultural knowledge graph. e ∈R M Represent it and get the entity semantic information.
[0020] Given a triplet relationship (head entity h, relationship r, tail entity t) in a cross-border ethnic cultural knowledge graph, the TransE model continuously adjusts h, r, and t to satisfy h + r = t. For example, consider the cross-border ethnic cultural text: "Songkran Festival is the most important festival for the Thai people." This contains the triplet entity ["Thai people," "Thai festival," "Songkran Festival"]. By using the relationships between entities and relationships in the TransE knowledge representation model, we can obtain: 泰族 +e 宋干节 =r 泰族节日 , where the semantic vector of the entity is [e 泰族 ,e 宋干节 ], the semantic vector of the relationship is: [r 泰族节日 ], where entity semantic vectors can be used to expand entity semantics in cross-border ethnic cultural text data.
[0021] Step 2.4: Use a gating mechanism to fuse the word-level features of the sentence captured in Step 2.2 and the entity semantic information captured in Step 2.3 to obtain a local feature representation of cross-border ethnic cultural texts with enhanced entity semantic information. The specific fusion method is shown in the following formula:
[0022] s=g s ⊙s d +(1-g s )⊙s e
[0023]
[0024] in, is a training parameter, g s ∈R M It is a gating vector used to balance the cross-border national cultural entity semantic information and the cross-border national cultural text representation information.
[0025] As a preferred embodiment of the present invention, the specific steps of Step 3 are:
[0026] Step 3.1, combine the global feature information obtained in Step 2.1 and Step 2.4 with the local features of the cross-border ethnic cultural text to obtain the fused text feature h mix , input it into the variational autoencoder VAE, and obtain the potential distribution information Z of the cross-border ethnic cultural text; the VAE model assumes that the posterior probability of the input data basically satisfies the Gaussian distribution under the condition of considering the underlying performance; assuming Z, Z represents the output of the inference network, that is, the potential distribution information of the cross-border ethnic text satisfies the Gaussian prior, in the generation stage, by sampling z~q(z|h mix ) reconstructs the sample, and the VAE error formula is:
[0027]
[0028] Among them, z represents the possible output of VAE, q(z|h mix ) is the posterior probability of the fused text features, p(z) outputs the probability of z, p(h mix |z) means the output is z and the input is h mix The conditional probability of
[0029] Step 3.2: Use the potential distribution information of cross-border ethnic texts obtained in Step 3.1 as the final representation of cross-border ethnic cultural texts, and use the KMeans clustering method to obtain the clustering results of cross-border ethnic cultural texts. In order to better achieve the clustering effect of cross-border ethnic cultural texts and make the training samples closer to the corresponding cluster centers, clustering signals are added in the process of expressing potential learning, so that the distance within the same cluster is smaller and the distance between different clusters is larger. On this basis, the clustering loss is as follows:
[0030]
[0031] Among them, Q represents the target distribution, P represents the auxiliary distribution, and q ij Represents cross-border ethnic cultural texts i The probability assigned to the jth cluster, p ij Indicated by q ij The obtained auxiliary distribution.
[0032] On the other hand, the present invention provides a cross-border ethnic text clustering device integrating domain knowledge graphs, including the following modules:
[0033] The cross-border ethnic cultural text data preprocessing module is used to complete the following functions: it is used to collect cross-level ethnic cultural vocabulary to form a cross-border ethnic cultural dictionary; through filtering, screening, removing stop words and special symbols, it obtains the cross-border ethnic text data of Dai, Thai, Yi, and Lolo, and selects several sentences of text data as the cross-border ethnic text clustering dataset; it uses documents, entities and topics to form a cross-border ethnic cultural document association graph;
[0034] The cross-border ethnic text data feature extraction module is used to complete the following functions: it uses a heterogeneous graph convolutional neural network to extract features from the constructed cross-border ethnic cultural document association graph, and uses this feature as a global feature; it uses a long short-term memory network to extract features from cross-border ethnic cultural texts, and uses this feature as a text feature; it uses a knowledge representation model to represent the cross-border ethnic cultural domain knowledge graph, and fuses this feature representation with the text feature through a gating mechanism, and uses the fused text feature as a local feature; the global feature reflects the potential correlation between texts in the entire text collection; the local feature fuses the triple knowledge in the domain knowledge graph with a single text, reflecting the potential correlation between individual texts. Both can effectively improve the effect of cross-border ethnic text clustering;
[0035] The cross-border ethnic text clustering module that integrates the domain knowledge graph is used to complete the following functions: it is used to splice the global features and local features of the obtained cross-border ethnic text data, and then further extract features through the variational autoencoder; and then send it into the Kmeans clustering model to obtain the final clustering results.
[0036] The beneficial effects of the present invention are:
[0037] 1. The present invention can effectively integrate the entity semantic information in the cross-border ethnic cultural knowledge graph, and combine the entity semantic information with the cross-border ethnic cultural text data through a gating mechanism, thereby enriching the semantic information of the text data.
[0038] 2. We constructed a cross-border ethnic cultural document association analysis graph containing topic and entity information, and used a heterogeneous graph convolutional neural network to learn the representation of rich cross-border ethnic cultural text data;
[0039] 3. In response to the problems existing in cross-border ethnic cultural text data, the present invention considers integrating cross-border ethnic cultural knowledge graphs to assist in text clustering, achieving better text clustering effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 This is a model framework diagram in the present invention;
[0041] Figure 2 A cross-border ethnic cultural document association analysis diagram constructed in the method of the present invention;
[0042] Figure 3 A line graph showing the effect of different numbers of subjects on experimental results in the present invention;
[0043] Figure 4 This is the overall process framework diagram of the cross-border ethnic text clustering method that integrates domain knowledge graphs in the present invention. DETAILED DESCRIPTION
[0044] Example 1: Figure 1 As shown, the specific steps of the cross-border ethnic text clustering method integrating domain knowledge graph are as follows:
[0045] Step 1. Preprocessing Cross-border Ethnic Cultural Text Data: Collect cross-level ethnic cultural vocabulary to construct a cross-border ethnic cultural dictionary. Filter, screen, remove stop words, and remove special symbols to obtain cross-border ethnic text data from the Dai, Thai, Yi, and Lolo ethnic groups. Select several sentences as a cross-border ethnic text clustering dataset. Use documents, entities, and topics to construct a cross-border ethnic cultural document association graph. The document association graph, composed of documents, topics, and entities, can effectively represent the associations between cross-border ethnic cultural texts. Using the topic and entity information of the cross-border ethnic cultural text data, construct a cross-border ethnic document association graph between the text and supplementary information.
[0046] Step 2. Feature extraction of cross-border ethnic text data: A heterogeneous graph convolutional neural network is used to extract features from the constructed cross-border ethnic cultural document association graph, and this feature is used as a global feature. A long short-term memory network is used to extract features from cross-border ethnic cultural texts, and this feature is used as a text feature. A knowledge representation model is used to represent the cross-border ethnic cultural domain knowledge graph, and this feature representation is fused with the text feature through a gating mechanism. The fused text feature is used as a local feature. The global feature reflects the potential correlation between texts in the entire text collection. The local feature fuses the triple knowledge in the domain knowledge graph with a single text, reflecting the potential correlation between a single text and a text. Both can effectively improve the effect of cross-border ethnic text clustering.
[0047] Step 3: Clustering cross-border ethnic texts using the domain knowledge graph: The global and local features of the cross-border ethnic text data are combined, and then further features are extracted using a variational autoencoder. This is then fed into a Kmeans clustering model to obtain the final clustering results. The KMeans clustering model uses a combination of global and local features to represent cross-border ethnic cultural texts, better representing the unique cultural characteristics of cross-border ethnic cultural texts and effectively improving the effectiveness of text clustering.
[0048] As a preferred embodiment of the present invention, the specific steps of Step 1 are:
[0049] Step 1.1 Use crawler technology to obtain cross-border ethnic culture text data from ethnic culture websites, mark the cross-border ethnic culture field vocabulary, and obtain the cross-border ethnic culture field vocabulary after deduplication and filtering to form a cross-border ethnic culture field dictionary; among them, the longest length of a word is 5 characters and the shortest length is 1 character; the construction of the cross-border ethnic culture association map is as follows Figure 2 As shown, the cross-border national cultural association graph integrates additional information - topics and entities, capturing the association relationship between text and supplementary information.
[0050] First, the LDA topic model is used to mine the potential topic information of cross-border ethnic cultural text data. Each cross-border ethnic cultural text data is assigned to the p related topics with the greatest probability. A bidirectional connection is used between the cross-border ethnic cultural text data and the related topics to propagate the topic information. The entities in the cross-border ethnic cultural text data are captured with the help of the cross-border ethnic cultural field dictionary. If this entity exists in the cross-border ethnic cultural text data, an edge between the entity and the cross-border ethnic cultural text data will be constructed. In order to further enrich the semantic information of the cross-border ethnic cultural text, the TF-IDF value of the entity e is calculated as the weight of the edge between the cross-border ethnic cultural entity and the cross-border ethnic cultural text data. The larger the TF-IDF value of the entity e, the higher the relevance between the description and the document. The association relationship between entities is calculated using cosine similarity. If the value obtained is greater than the pre-set threshold, an edge between the entity and the entity is constructed, and the obtained topic nodes and edges are used. 主题-文档 , entity nodes, edges 实体-文档 By integrating with document nodes, we can obtain a cross-border ethnic cultural document association graph.
[0051] For each cross-border ethnic document d, we construct a cross-border ethnic cultural document association graph g = (v, ε), as shown in the figure. The association graph consists of three different nodes: cross-border ethnic cultural text data S = {s1, s2, s3, ..., s n}, cross-border ethnic cultural theme T = {t1, t2, t3, ..., t m}、cross-border ethnic cultural entity E={e1,e2,e3,...,e k}, V = S∪T∪E. ε represents the set of edges, which represents the relationship between cross-border ethnic cultural text data and cross-border ethnic cultural topics and cross-border ethnic cultural entities.
[0052] For example: Figure 2Text 1 in the example, "The Closing Door Festival is one of the Dai ethnic group's most important festivals...", describes the Dai ethnic group's Closing Door Festival and contains the entity "Closing Door Festival." Text 2, "During the Water-Splashing Festival, activities such as throwing bags and dragon boat racing are held...", describes the Dai ethnic group's Water-Splashing Festival and contains the entity "Water-Splashing Festival, throwing bags." Text 3, "Throwing bags, called 'Ruimaguan' in Dai language...", describes the throwing bags activity during Dai marriages and contains the entity "Throwing bags, Ruiimaguan." Although both text 2 and text 3 contain the entity "lost packet", the "lost packet" in text 2 refers to an activity in the Water-Splashing Festival, while the "lost packet" in text 3 refers to an activity in the Dai marriage. Only using the entities in the text data to assist the text clustering task can easily lead to confusion in the text data categories. Therefore, the present invention uses the LDA topic model to first divide the text data into cultural categories, and obtains that the themes of text 1 and text 2 are Dai festivals, and the theme of text 3 is Dai marriage. The edges between documents, topics and entities are constructed through the above content, and finally a cross-border ethnic cultural document association analysis diagram is obtained.
[0053] As a preferred embodiment of the present invention, the specific steps of Step 2 are:
[0054] Step 2.1: Extract the global feature information of cross-border ethnic cultural text data, and use the heterogeneous convolutional neural network and combine it with the association analysis diagram in Step 1.1 to extract the text data features.
[0055] Based on the cross-border ethnic cultural document association graph g, a heterogeneous graph attention network is used to obtain the contextual representation and cross-border ethnic cultural entity representation of cross-border ethnic cultural text data. Each node contains three different feature information T = {τ1, τ2, τ3}: cross-border ethnic cultural text, cross-border ethnic cultural entity, and cross-border ethnic cultural text topic. The cross-border ethnic cultural text representation S and cross-border ethnic cultural entity representation E use TF-IDF vectors as their feature vectors. The cross-border ethnic cultural text topic representation T uses the topic probability representation obtained by the LDA topic model as the cross-border ethnic cultural text topic representation.
[0056] For the cross-border national cultural document association graph g = (v, ε), where v and ε represent the set of nodes and weights respectively. |v|×M Represents the feature x in the node v ∈R |v|×M The matrix (each row x v are all feature matrices of nodes), M refers to the dimension of the vector of a single node, and the heterogeneous convolutional layer aggregates neighbor nodes of different types of τ Update node h with the features (l+1) Representation at the (l+1)th layer (initially, H(0)=X):
[0057]
[0058] Among them, T represents a set of different types of τ, σ represents the activation function, represents the node feature matrix at layer l, Represents the transformation matrix corresponding to the node, h g =[h 1 ,h 2 ,h 3 ...h n ], σ(.) represents the activation function, and the transformation matrix corresponding to different types of τ of the node Is the attention matrix, whose rows represent all nodes and columns represent adjacent nodes of type τ. vv' After normalization using SoftMax, the calculation formulas for the vth row and the vth 'th row are as follows:
[0059] β vv' =Softmax v' (σ(v T α τ [h v ,h v' ]))
[0060] Among them, v represents the attention vector, α τ is the type-level attention weight. h v and h v' Represent the current node v and neighbor node v' respectively.
[0061] Type-level attention weights are embedded in h via nodes v and type embedding h τ Get, h τ The calculation method is (in, represents the normalized adjacency matrix with self-connections)
[0062]
[0063] in, represents the attention vector at type τ.
[0064] Step 2.2, Representation of cross-border ethnic cultural text data: Cross-border ethnic cultural text data is represented by using LSTM d ∈R M ;s d Represents the word vector of cross-border ethnic cultural text data, R M Indicates that the word vector is a set of real numbers with a length of M;
[0065] For example, there is cross-border ethnic cultural text data: "Songkran Festival is the most solemn festival of the Thai people." First, the text sentence is segmented using the jieba tool to obtain: "Songkran Festival is the most solemn festival of the Thai people." Since there are a large number of professional terms in the cross-border ethnic cultural text sentences, the present invention uses jieba + field dictionary for word segmentation to better distinguish special terms such as "lemongrass grilled fish" in the cross-border ethnic cultural text sentences. Then, the Word2Vec model is used to train the existing cross-border ethnic cultural data to obtain word vectors, and the cross-border ethnic word vectors are used to obtain the word vectors for each word in the title. i ,i∈[1,N]’s embedded representation x i ∈R 100 Where N represents the number of words in the title and 100 represents the word vector dimension. Finally, the word-level representation of the sentence is obtained through the LSTM model: S = [s 宋干节 ,s 是 ,s 泰族 ,s 最 ,s 隆重 ,s 的 ,s 节日 ];
[0066] Step 2.3, semantic representation of cross-border ethnic cultural knowledge graph: TransE model is used to represent entity s in cross-border ethnic cultural knowledge graph. e ∈R M Representation is performed to obtain entity semantic information;
[0067] Given a triplet relationship (head entity h, relationship r, tail entity t) in a cross-border ethnic cultural knowledge graph, the TransE model continuously adjusts h, r, and t to satisfy h + r = t. For example, consider the cross-border ethnic cultural text: "Songkran Festival is the most important festival for the Thai people." This contains the triplet entity ["Thai people," "Thai festival," "Songkran Festival"]. By using the relationship between entities and relationships in the TransE knowledge representation model, we can obtain: 泰族 +e 宋干节 =r 泰族节日 , where the semantic vector of the entity is [e 泰族 ,e 宋干节 ], the semantic vector of the relationship is: [r 泰族节日 ], where entity semantic vectors can be used to expand entity semantics in cross-border ethnic cultural text data.
[0068] Step 2.4: Use a gating mechanism to fuse the word-level features of the sentence captured in Step 2.2 and the entity semantic information captured in Step 2.3 to obtain a local feature representation of cross-border ethnic cultural texts with enhanced entity semantic information. The specific fusion method is shown in the following formula:
[0069] s=gs ⊙s d +(1-g s )⌒s e
[0070]
[0071] in, is a training parameter, g s ∈R M is a gated vector used to balance cross-border ethnic cultural entity semantic information and cross-border ethnic cultural text representation information, g s The σ function (SoftMax) is used for normalization. According to the above steps, the word vector representation of the cross-border cultural text data and the entity semantic vector representation contained in the text sentence have been obtained. By fusing these two vectors through the gating mechanism, the local feature vector representation of the cross-border ethnic cultural text data can be obtained: S = [s 宋干节 +e 宋干节 ,s 是 ,s 泰族 +e 泰族 ,s 最 ,s 隆重 ,s 的 ,s 节日 ].
[0072] The specific steps of Step 3 are:
[0073] Step 3.1: Combine the global feature information and the local features of the cross-border ethnic cultural text to obtain the fused text feature h mix , input it into the variational autoencoder VAE, and obtain the potential distribution information Z of the cross-border ethnic cultural text; the VAE model assumes that the posterior probability of the input data basically satisfies the Gaussian distribution under the condition of considering the underlying performance; assuming Z, Z represents the output of the inference network, that is, the potential distribution information of the cross-border ethnic text satisfies the Gaussian prior, in the generation stage, by sampling z~q(z|h mix ) reconstructs the sample, and the VAE error formula is:
[0074]
[0075] Among them, z represents the possible output of VAE, q(z|h mix ) is the posterior probability of the fused text features, p(z) outputs the probability of z, p(h mix |z) means the output is z and the input is h mix The conditional probability of
[0076] Step 3.2: Use the potential distribution information of cross-border ethnic texts obtained in Step 3.1 as the final representation of cross-border ethnic cultural texts, and use the KMeans clustering method to obtain the clustering results of cross-border ethnic cultural texts. In order to better achieve the clustering effect of cross-border ethnic cultural texts and make the training samples closer to the corresponding cluster centers, clustering signals are added in the process of expressing potential learning, so that the distance within the same cluster is smaller and the distance between different clusters is larger. On this basis, the clustering loss is as follows:
[0077]
[0078] Among them, Q represents the target distribution, P represents the auxiliary distribution, and q ij Represents cross-border ethnic cultural texts i The probability assigned to the jth cluster, p ij Indicated by q ij The obtained auxiliary distribution.
[0079] Among them, q ij The calculation of is obtained by the following formula, which adopts the method of calculating clustering loss proposed by Xie et al., as shown in the following formula.
[0080]
[0081] Among them, q ij Represents cross-border ethnic cultural texts i The probability of being assigned to the jth cluster. i Represents the cross-border national cultural text s through the VAE model i The latent feature representation, u j represents the center of the jth cluster. The calculation formula of P (auxiliary distribution) is as follows:
[0082]
[0083] in, It indicates strengthening, which can make the confidence of the distribution higher.
[0084] In summary, the K-Means algorithm is used to initialize the cluster center of the cross-border ethnic cultural text data using the obtained potential representation features. The clustering loss of the cross-border ethnic cultural text data is calculated using the above formula. Finally, the clustering loss function of the cross-border ethnic cultural text is defined as follows:
[0085] L=(1-λ)L VAE +λ·L clustering
[0086] Here, λ represents the weight of the two losses in the balance formula. By incorporating clustering signal feature information into the training process, we ultimately find a representation that is more suitable for clustering cross-border ethnic cultural texts.
[0087] To illustrate the effectiveness of the present invention, the present invention conducted the following comparative experiments. The experimental data used mainly include four cross-border ethnic groups (Dai, Thai (Thailand), Yi, and Lolo (Vietnam). The number of Dai cultural texts on major ethnic websites, Wikipedia, Baidu Encyclopedia and other platforms was analyzed. The specific information of the constructed data set is shown in Table 1:
[0088] Table 1 Attributes of the cross-border ethnic cultural document association analysis task data
[0089]
[0090] The present invention sets the sentence length to 100, the number of topics to 15, each text is associated with K = 2 topics, the number of layers of heterogeneous graph convolution is 2, the word2vec model in the gensim toolkit is used to train word vectors, the dimension of the word vector is 100 dimensions, the Adam algorithm is used as an optimizer to speed up the model training speed, the experimental parameter learning rate is set to 0.003, the batch processing size is set to 128, and the number of training rounds is set to 100.
[0091] In order to verify the performance of the text clustering model proposed in this invention, three commonly used clustering indicators are used: clustering accuracy, normalized information and adjusted Rand coefficient.
[0092] (1) Clustering accuracy
[0093] Clustering accuracy (Acc): The value of Acc is between 0 and 1. The size of the Acc value proves the quality of the model:
[0094]
[0095] (2) Standardized information
[0096] Normalized mutual information (NMI) can evaluate the entropy between the true label and the predicted label obtained by the text clustering model:
[0097]
[0098] Among them, I(y,c) represents the mutual information between y and c, H(.) represents entropy, and the value of NMI is in the interval [0,1]. The size of the value represents the quality of the model effect.
[0099] (2) Adjusting the Rand coefficient
[0100] The adjusted rand index (ARI) formula is as follows:
[0101]
[0102]
[0103] The value of ARI is in the interval [-1, 1], a, b, c, d are statistics, and the specific definition method is shown in Table 2:
[0104] Table 2 Rand coefficient correlation statistics
[0105]
[0106] In order to verify the effectiveness of the cross-border ethnic cultural text clustering model that integrates domain knowledge graphs, the present invention conducted five sets of comparative experiments. The specific experimental results are shown in Table 3:
[0107] (1) K-means (KM): A classic clustering algorithm based on raw data.
[0108] (2) AE: A deep clustering algorithm that uses representations learned from the encoder for K-means clustering.
[0109] (3) DEC: A deep clustering method that uses clustering objectives to guide data representation learning.
[0110] (4) DCN: A deep clustering method based on DNN for data dimensionality reduction and combined with K-means clustering.
[0111] (5) SDCN: It combines the data representation obtained by the autoencoder and the structural information extracted by the graph convolutional network, and designs a dual self-supervised clustering guidance method.
[0112] Table 3 Comparison of the method of the present invention and the baseline model method
[0113]
[0114] The results in Table 3 show that the clustering performance of the K-means model is relatively weak. After using the autoencoder to reduce the data dimension, the fusion of latent features and K-means can effectively improve the clustering effect. Among them, the AE model, which also uses an autoencoder, has a weaker text clustering effect than the DCN model and the DEC model. This is because the DCN model and the DEC model incorporate clustering losses or clustering objective functions, which can serve as supervisory signals in text clustering tasks, thereby greatly improving the performance of text clustering. The reason why the method of the present invention is superior to other baseline models is that the model of the present invention effectively utilizes the association between text and entities, text and topics, and entities and entities as supervisory signals added to the model, thus proving that combining entities and topics in the text can improve the performance of cross-border ethnic cultural text association analysis tasks.
[0115] It is worth noting that both the method of the present invention and SDCN use graph neural networks to extract features from text. However, the entity semantics in the cross-border ethnic cultural field are relatively complex. The SDCN model only uses graph neural networks to extract features, which easily leads to the loss of entity semantics. The method proposed in the present invention improves the clustering performance by integrating the entity semantics in the knowledge graph of the cross-border ethnic cultural field, thereby confirming the correctness of the argument of using the cross-border ethnic cultural knowledge graph to expand the entity semantics in cross-border ethnic cultural text data.
[0116] Ablation experiments
[0117] In order to verify the role of each part in the method of the present invention, the second experiment of the present invention compares the impact of each module on the document association analysis task. The experimental results are shown in Table 4.
[0118] -transE: indicates the extension that removes entity semantics from cross-border ethnic text data.
[0119] -Topic: Indicates that the edges between documents and document topics in the cross-border ethnic cultural association analysis graph are removed, and only the edges between cross-border ethnic texts and entities, and between entities, are retained.
[0120] -Entity: means removing the edges between documents and entities in the cross-border ethnic association analysis graph, and only retaining the edges between cross-border ethnic texts and topics.
[0121] Table 4 Ablation experiment
[0122]
[0123] As can be seen from Table 4, when a certain module in the model is removed, the model performance also decreases. Among them, the performance of "-transE+topic" decreases most significantly, with the Acc value decreasing by 0.033. The emergence of this phenomenon further proves the importance of integrating the cross-border ethnic cultural text theme and the cross-border ethnic cultural entity semantics. In addition, when "-transE" and "-topic" are removed, the performance of the model decreases. This phenomenon proves that integrating cross-border ethnic cultural entity semantics and cross-border ethnic cultural document theme information is equally important for improving the performance of cross-border ethnic cultural text clustering. Among them, the performance of the model without the "-transE" module is worse than that of the model without the "-topic". This is because there are a large number of proper nouns in the cross-border ethnic cultural text data. By enhancing the entity semantic information of the text, it is beneficial for the model to better identify the unique entity information and extract the feature information of the text, thereby improving the performance of the model.
[0124] The impact of the number of topics on model performance:
[0125] In order to verify the impact of assigning different topic information to each cross-border ethnic cultural text data on model performance, the present invention conducted a third experiment. Figure 3 shown.
[0126] Figure 3 This is the performance (Acc. and F1) of the model of the present invention on cross-border ethnic cultural text data. It can be seen from the figure that when the number of topics is 2, the model performance reaches the maximum. When this threshold is exceeded, the model performance gradually decreases. This is because connecting some low-frequency topic information will introduce noise, resulting in a decrease in model performance. Therefore, the number of connected topics is set to 2 in the experiment.
[0127] On the other hand, according to the concept of the present invention, the present invention provides a cross-border ethnic text clustering device integrating domain knowledge graph, such as Figure 4 As shown, it includes the following modules:
[0128] The cross-border ethnic cultural text data preprocessing module is used to complete the following functions: it is used to collect cross-level ethnic cultural vocabulary to form a cross-border ethnic cultural dictionary; through filtering, screening, removing stop words and special symbols, it obtains the cross-border ethnic text data of Dai, Thai, Yi, and Lolo, and selects several sentences of text data as the cross-border ethnic text clustering dataset; it uses documents, entities and topics to form a cross-border ethnic cultural document association graph;
[0129] The cross-border ethnic text data feature extraction module is used to complete the following functions: it uses a heterogeneous graph convolutional neural network to extract features from the constructed cross-border ethnic cultural document association graph, and uses this feature as a global feature; it uses a long short-term memory network to extract features from cross-border ethnic cultural texts, and uses this feature as a text feature; it uses a knowledge representation model to represent the cross-border ethnic cultural domain knowledge graph, and fuses this feature representation with the text feature through a gating mechanism, and uses the fused text feature as a local feature; the global feature reflects the potential correlation between texts in the entire text collection; the local feature fuses the triple knowledge in the domain knowledge graph with a single text, reflecting the potential correlation between individual texts. Both can effectively improve the effect of cross-border ethnic text clustering;
[0130] The cross-border ethnic text clustering module that integrates the domain knowledge graph is used to complete the following functions: it is used to splice the global features and local features of the obtained cross-border ethnic text data, and then further extract features through the variational autoencoder; and then send it into the Kmeans clustering model to obtain the final clustering results.
[0131] The specific embodiments of the present invention are described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the above embodiments. Various changes can be made within the knowledge of ordinary technicians in this field without departing from the scope of the present invention.
Claims
1. A cross-border ethnic text clustering method integrating domain knowledge graphs, characterized by: The specific steps of the method are as follows: Step 1: Preprocessing of cross-border ethnic cultural text data: Collect cross-level ethnic cultural vocabulary to form a cross-border ethnic cultural dictionary; obtain cross-border ethnic text data of Dai, Thai, Yi, and Lolo through filtering, screening, stop word removal, and special symbol removal operations; select several sentences as the cross-border ethnic text clustering dataset; use documents, entities, and topics to form a cross-border ethnic cultural document association graph; Step 2: Feature extraction of cross-border ethnic text data: A heterogeneous graph convolutional neural network is used to extract features from the constructed cross-border ethnic cultural document association graph, and this feature is used as the global feature; Long short-term memory network is used to extract features from cross-border ethnic cultural texts and use these features as text features; A knowledge representation model is used to represent the knowledge graph in the cross-border ethnic culture field. This feature representation is fused with text features through a gating mechanism, and the fused text features are used as local features. Global features reflect the potential correlation between texts in the entire text collection; local features integrate triple knowledge in the domain knowledge graph with individual texts, reflecting the potential correlation between individual texts. Both can effectively improve the effect of cross-ethnic text clustering. Step 3. Clustering of cross-border ethnic texts integrating domain knowledge graphs: The global features and local features of the obtained cross-border ethnic text data are spliced together, and then further features are extracted through the variational autoencoder; then they are sent to the Kmeans clustering model to obtain the final clustering results.
2. The cross-border ethnic text clustering method integrating domain knowledge graph according to claim 1 is characterized by: The specific steps of Step 1 are: Step 1.1: Use crawler technology to obtain cross-border ethnic cultural text data from ethnic cultural websites, annotate cross-border ethnic cultural terms from them, and filter them after deduplication to obtain cross-border ethnic cultural terms, forming a cross-border ethnic cultural dictionary. The maximum length of a word is 5 characters, and the minimum length is 1 character. Step 1.2: After screening, filtering, deduplication, and special character removal of the text data obtained in Step 1.1, the Dai, Thai, Yi, and Lolo text data are obtained. This data contains 15 categories, namely, Lolo primitive religion, Lolo burial customs, Lolo clothing, Dai Theravada Buddhism, Dai marriage customs, Dai peacock dance, Dai architecture, Dai Water Splashing Festival, Dai clothing, Dai burial customs, Yi primitive religion, Yi festivals, Thai primitive religion, and Thai festivals. Each piece of text data belongs to only one cultural category. The maximum length of the text is 456 characters, and the average length is 146 characters. Step 1.3, the LDA topic model is used to mine the potential topic information of cross-border ethnic text data. Each cross-border ethnic text data is assigned to the p most likely related topics, that is, an edge is constructed between the p topics and the cross-border ethnic cultural text data, and its weight is the corresponding topic probability; with the help of the cross-border ethnic cultural field dictionary, the cross-border ethnic cultural entities in the cross-border ethnic cultural text are identified, and an edge is constructed between the identified entity vocabulary and the cross-border ethnic cultural text data, and its weight is the TF-IDF value of the entity vocabulary; the obtained topic nodes and edges are combined. 主题-文档 , entity nodes, edges 实体-文档 By integrating with document nodes, we can obtain a cross-border ethnic cultural document association graph.
3. The cross-border ethnic text clustering method integrating domain knowledge graph according to claim 1 is characterized by: The specific steps of Step 2 are: Step 2.1, extract the global feature information of cross-border ethnic cultural text data: For the cross-border ethnic cultural document association graph g = (v, ε), where v and ε represent the set of nodes and weights respectively, X∈R |v|×M Represents the feature x in the node v ∈R |v|×M Matrix, M refers to the dimension of the vector of a single node, each row x v are all feature matrices of nodes; heterogeneous convolutional layers aggregate neighbor nodes of different types of τ Update node h with the features (l+1) In the representation of the (l+1)th layer, initially, H(0) = X; Among them, T represents a set of different types of τ, σ represents the activation function, and B τ refers to the attention matrix, represents the node feature matrix at layer l, Represents the transformation matrix corresponding to the node; Step 2.2: Cross-border ethnic cultural text data is represented by LSTM d ∈R M ;s d Represents the word vector of cross-border ethnic cultural text data, R M Indicates that the word vector is a set of real numbers with a length of M; First, Jieba is used in combination with domain dictionaries to segment text sentences, so as to better distinguish domain nouns in cross-border ethnic cultural text sentences; then the Word2Vec model is used to train the existing cross-border ethnic cultural data to obtain word vectors, and the cross-border ethnic word vectors are used to obtain the word w of each word in the title. i ,i∈[1,N]’s embedded representation x i ∈R 100 ; Where N represents the number of words in the title, and 100 represents the word vector dimension; Finally, the word-level representation of the sentence is obtained through the LSTM model; Step 2.3, semantic representation of cross-border ethnic cultural knowledge graph: TransE model is used to represent entity s in cross-border ethnic cultural knowledge graph. e ∈R M Representation is performed to obtain entity semantic information; Given a triple relation (head entity h, relation r, tail entity t) in a cross-border ethnic cultural knowledge graph, the TransE model continuously adjusts h, r, and t to satisfy h+r=t; Step 2.4: Use a gating mechanism to fuse the word-level features of the sentence captured in Step 2.2 and the entity semantic information captured in Step 2.3 to obtain a local feature representation of cross-border ethnic cultural texts with enhanced entity semantic information. The specific fusion method is shown in the following formula: s=g s ⊙s d +(1-g s )⊙s e in, is a training parameter, g s ∈R M It is a gating vector used to balance the cross-border national cultural entity semantic information and the cross-border national cultural text representation information.
4. The cross-border ethnic text clustering method integrating domain knowledge graph according to claim 1 is characterized by: The specific steps of Step 3 are: Step 3.1: Combine the global feature information and the local features of the cross-border ethnic cultural text to obtain the fused text feature h mix , input it into the variational autoencoder VAE, and obtain the potential distribution information Z of the cross-border ethnic cultural text; the VAE model assumes that the posterior probability of the input data basically satisfies the Gaussian distribution under the condition of considering the underlying performance; assuming Z, Z represents the output of the inference network, that is, the potential distribution information of the cross-border ethnic text satisfies the Gaussian prior, in the generation stage, by sampling z~q(z|h mix ) reconstructs the sample, and the VAE error formula is: Among them, z represents the possible output of VAE, q(z|h mix ) is the posterior probability of the fused text features, p(z) outputs the probability of z, p(h mix |z) means the output is z and the input is h mix The conditional probability of Step 3.2: Use the potential distribution information of cross-border ethnic texts obtained in Step 3.1 as the final representation of cross-border ethnic cultural texts, and use the KMeans clustering method to obtain the clustering results of cross-border ethnic cultural texts. In order to better achieve the clustering effect of cross-border ethnic cultural texts and make the training samples closer to the corresponding cluster centers, clustering signals are added in the process of expressing potential learning, so that the distance within the same cluster is smaller and the distance between different clusters is larger. On this basis, the clustering loss is as follows: Among them, Q represents the target distribution, P represents the auxiliary distribution, and q ij Represents cross-border ethnic cultural texts i The probability assigned to the jth cluster, p ij Indicated by q ij The obtained auxiliary distribution.
5. A cross-border ethnic text clustering method and device integrating domain knowledge graph is characterized by: The method comprises a module for executing the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Cross-language multi-source vertical domain knowledge graph construction method
CN112199511A
Microblog comment emotion classification method and system
CN112800225A