FW-LDA topic identification method based on random walk under conditional entropy
By introducing conditional entropy and random walk methods into topic recognition, constructing resource association diagrams and training FW-LDA models, we solve the problems of low recognition accuracy and semantic understanding caused by independent and identically distributed resources in the existing technology, and achieve better results. Efficient topic identification and quality improvement.
Patent Information
- Application Number
- CN202110197982.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-22
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-02-22
AI Technical Summary
Existing topic identification methods have independent and identical distribution characteristics among resources, resulting in low identification accuracy, low quality of potential topics, and poor semantic understanding.
The FW-LDA topic identification method based on random walk under conditional entropy is adopted. By constructing a resource association graph, the random walk method is used to calculate resource weights, and combined with Gibbs sampling to train the FW-LDA model for topic identification.
It improves topic distinction and semantic understandability, improves the efficiency and quality of text topic identification, overcomes the independent and identically distributed characteristics, reveals important document resources and potential semantics, and enhances the effect of topic mining.
Smart Images

Figure CN113378551B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of Internet tag and comment text mining, and specifically is a FW-LDA topic recognition method based on random walk under conditional entropy. Background Art
[0002] With the explosive development of online e-commerce platforms and social platforms, major e-commerce platforms and websites have provided various annotation services. These data come from users' self-selected and autonomous annotation of images, videos, products, music, etc. These annotations are called social tags. Social tagging system is one of the important application methods in the Web2.0 era and a new trend in network information management. It provides a good platform for the effective use of network information resources and can better understand web resource objects and user intentions and preferences. The social tagging system allows Internet users to evaluate or annotate network resources of interest based on their own personal experience, preferences or other understandings. The types of such network resources are rich and varied, such as: text-type document resources, text comment content on social platforms, text evaluation content of products on e-commerce platforms, multimedia-type movies, music, videos and pictures, etc.; and the types of tags can be provided by the platform for users to choose, or users can annotate according to their own preferences. Tag vocabulary can be words or phrases in the existing vocabulary, or new vocabulary popular in today's society. As a kind of metadata generated by social users, tags contain special semantic information.
[0003] The mainstream method of existing topic identification is to use conventional clustering algorithms, such as K-Means, spectral clustering, etc., and LDA or improved LDA models, such as the LDA topic identification method based on the bag-of-words model or various improved LDA models such as s-LDA, L-LDA, etc. The above topic identification methods have achieved good results in topic modeling, but these methods all have defects: there are independent and identically distributed characteristics between resources, resulting in low recognition accuracy, low quality of potential topics, poor semantic understanding and other problems. Summary of the invention
[0004] The purpose of the present invention is to provide a FW-LDA topic identification method based on random walk under conditional entropy, which can solve the independent and identically distributed characteristics between Internet resources and better improve the efficiency and quality of text topic identification in terms of topic distinction and semantic comprehensibility.
[0005] The present invention achieves the purpose of the invention by adopting the following technical solutions:
[0006] A FW-LDA topic identification method based on random walk under conditional entropy is characterized by the following steps:
[0007] Step 1: Based on the original Internet text resources, including social tags and comments, a corpus is constructed; the corpus is preprocessed with stop words to obtain a preprocessed corpus, which is represented in the form of a document set. Assume that there are M resources, denoted by R = {r1, r2, …, r i ,…,r M}, and construct the resource distribution map re_G = (R) of all resources;
[0008] Step 2: Calculate the information entropy corresponding to each text in the preprocessed corpus and express it in vector form: H(R) = {h(r1), h(r2), …, h(r i ),…,h(r M )}, where h(r i ) represents the information entropy of the i-th resource, N i is the text length of the i-th resource; the conditional entropy between any two texts in all preprocessed corpora is calculated based on the information entropy of each resource and is recorded as h(r i |r j ),in And form the conditional entropy matrix between resources, which is expressed as And when i=j, h(r i |r j )=0; According to the conditional entropy h(r) between any two texts in all resources i |r j ) establishes the conditional entropy matrix between resources, and obtains the maximum value max(h(r i |r j ),h(r j |r i )), assuming max(h(r i |r j ),h(r j |r i )) is h(r i |r j ), then in graph re_G, resource r i and r j Add a line between r i Point to r j , and form a resource association relationship directed graph G = (R, E, W);
[0009] Step 3: Use the random walk method to calculate the weight of each resource, apply the weight of each resource to each feature word, and form a feature word weighted vector through the feature word weighting method:
[0010] Step 3.1: For any two vertices r in the graph G = (R, E, W) i and r j , if there is a path from r i Point to r j The directed edge of W i,j =1, otherwise W i,j = 0. For the resource association graph G under a given conditional entropy, the row random matrix P of its adjacency matrix W is used as the transition probability matrix of the random walk process. i,j Represents the resource i Jump to resource j The transition probability is defined as shown in formula (2):
[0011]
[0012] From formula (2), we can get the weight μ of each resource: m , m∈{1,…,M};
[0013] Step 3.2: Obtain the weight μ of each resource in the resource association directed graph G according to the random walk method m , m∈{1,…,M}, assuming that M resources contain V feature words, whose frequency vector is F V (m)=[v1,f(v1,m); v2,f(v2,m);…;v i ,f(v i ,m);…;v V ,f(v V ,m)], where f(v i ,m) represents the feature word v in resource m i frequency of occurrence;
[0014] Step 3.3, the authority score of resource m is μ, and the weighted representation of the resource and its feature words is g_F V (m)=[v1,gf(v1,m); v2,gf(v2,m);…;v i ,gf(v i ,m);…;v V ,gf(v V ,m)], where Represents the feature word v in resource m i The weighted frequency of occurrence of
[0015] Step 3.4: The weight vector of V feature words in M resources is γv =[v1,γgf(v1); v2,γgf(v2);…;v i ,γgf(v i );…;v V ,γgf(v V )],in Indicates that the feature word v in M resources i The weighted frequencies of occurrence are accumulated;
[0016] Step 4: Use the Gibbs sampling method to train the FW-LDA model and perform topic identification:
[0017] Step 4.1, set the number of topics of the model to K and the hyperparameters α, β, input the preprocessed corpus and the hyperparameter γ, where the value of γ comes from the weighted vector value of the γ feature word in step 3;
[0018] Step 4.2: Sampling and updating according to formula (1);
[0019]
[0020] where z i Indicates the topic to which the i-th word belongs, and k indicates the topic number; Represents the topic vector after removing the i-th word, Represented as word vectors; represents the number of words in the kth topic that do not contain the i-th word, α k represents the Dirichlet prior distribution of the kth topic, β t represents the Dirichlet prior distribution of word t, γ t represents the Dirichlet prior distribution of word t, Indicates non-i;
[0021] Step 4.3, repeat the Gibbs sampling of the above corpus until Gibbs sampling converges;
[0022] Step 4.4: Output the model results, count the topics of each feature word in each text, and get the topic distribution and word distribution ω k,t , the calculation formula of topic distribution is as follows:
[0023]
[0024] The formula for calculating word distribution is as follows:
[0025]
[0026] Step 4.4: Output the model results, count the high-frequency topics of each document, and obtain the potential topic with the maximum probability distribution.
[0027] Compared with the prior art, the present invention has the following beneficial effects:
[0028] 1. The present invention combines conditional entropy and random walk methods to discover potential topics based on FW-LDA, overcoming the problems in the prior art that resources have independent and identically distributed characteristics or low correlation, and potential topics are not easy to understand. It can better extract potential topics that describe different aspects, help to conduct more fine-grained analysis of various Internet data resources, and grasp the key aspects and hot trends of events.
[0029] 2. The present invention proposes an LDA model based on feature word weighting, namely the FW-LDA model, which uses the high-feature or high-weight documents of the global corpus to weight the feature words, which can effectively improve the original LDA model's tendency to drown out important feature words in the word sampling process, effectively improve the model's accuracy and quality in topic identification, and better improve the model's ability to express the potential semantics of text information.
[0030] 3. The present invention uses conditional entropy to establish potential associations between resources, which can effectively form associations between independent and identically distributed resources and better improve the effect of topic mining.
[0031] 4. The present invention uses conditional entropy to establish an association relationship diagram between resources and uses the random walk method to obtain the weight of each resource, breaking the barrier of independent and identically distributed characteristics between resources, better highlighting important document resources and potential semantics, and can mine potential topics that are more representative and semantically relevant.
[0032] 5. The present invention can be used to mine the subject information of texts such as social media, e-commerce platforms, Internet news hotspots, and global instant messages, and help governments, enterprises, and individuals discover potential topics so as to perform tasks such as text clustering, public opinion prediction, event detection, network hot event analysis, instant information tracking, and public comment opinion mining. It has a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The present invention will be further described below in conjunction with the accompanying drawings.
[0034] Figure 1 It is a flowchart of the FW-LDA topic identification method based on random walk under conditional entropy;
[0035] Figure 2 is the resource distribution map re_G;
[0036] Figure 3It is a directed graph G of resource association relations;
[0037] Figure 4 It is the FW-LDA model (LDA model based on feature word weighting). DETAILED DESCRIPTION
[0038] In this embodiment, Figure 1 As shown, a FW-LDA topic identification method based on random walk under conditional entropy is carried out in the following steps:
[0039] Step 1. In this embodiment, the selected document corpus set is from the public data set CiteULike, with a total of more than 16,000 data, each of which is regarded as a document resource. In this embodiment, the event belongs to the field of academic text. According to the field to which the event belongs, an academic text field dictionary and an academic field stop word list are constructed for use in the early corpus preprocessing. The preprocessing steps include: removing stop words and word segmentation. The preprocessed document set is denoted as R = {r1, r2, ..., r i ,…,r M}, where r i Represents the i-th preprocessed document and constructs the resource distribution graph re_G=(R) of all resources, see Figure 2 ;
[0040] Step 2: Calculate the information entropy corresponding to each text in the preprocessed corpus and express it in vector form: H(R) = {h(r1), h(r2), …, h(r i ),…,h(r M )}, where h(r i ) represents the information entropy of the i-th resource, N i is the text length of the i-th resource; the conditional entropy between any two texts in all preprocessed corpora is calculated based on the information entropy of each resource and is recorded as h(r i |r j ),in And form the conditional entropy matrix between resources, which is expressed as And when i=j, h(r i |r j )=0; According to the conditional entropy h(r) between any two texts in all resources i |r j ) establishes the conditional entropy matrix between resources, and obtains the maximum value max(h(r i |r j ),h(r j |r i )), assuming max(h(r i |rj ),h(r j |r i )) is h(r i |r j ), then in graph re_G, resource r i and r j Add a line between r i Point to r j , and form a resource association relationship directed graph G = (R, E, W), see Figure 3 ;
[0041] Step 3: Use the random walk method to calculate the weight of each resource, and apply the weight of each resource to the entropy of each feature word to form the feature word weighting:
[0042] Step 3.1: For any two vertices r in the graph G = (R, E, W) i and r j , if there is a path from r i Point to r j The directed edge of W i,j =1, otherwise W i,j = 0. For the resource association graph G under a given conditional entropy, the row random matrix P of its adjacency matrix W is used as the transition probability matrix of the random walk process. i,j Represents the resource i Jump to resource j The transition probability is defined as shown in formula (2):
[0043]
[0044] From formula (2), we can get the weight μ of each resource: m , m∈{1,…,M};
[0045] Step 3.2: Obtain the weight μ of each resource in the resource association directed graph G according to the random walk method m , m∈{1,…,M}, assuming that M resources contain V feature words, whose frequency vector is F V (m)=[v1,f(v1,m); v2,f(v2,m);…;v i ,f(v i ,m);…;v V ,f(v V ,m)], where f(v i ,m) represents the feature word v in resource m i frequency of occurrence;
[0046] Step 3.3, the authority score of resource m is μ, and the weighted representation of the resource and its feature words is g_FV (m)=[v1,gf(v1,m); v2,gf(v2,m);…;v i ,gf(v i ,m);…;v V ,gf(v V ,m)], where Represents the feature word v in resource m i The weighted frequency of occurrence of
[0047] Step 3.4: The weight vector of V feature words in M resources is γ v =[v1,γgf(v1); v2,γgf(v2);…;v i ,γgf(v i );…;v V ,γgf(v V )],in Indicates that the feature word v in M resources i The weighted frequencies of occurrence are accumulated;
[0048] Step 4: Use Gibbs sampling method to train FW-LDA model, see Figure 4 , and perform topic identification:
[0049] Step 4.1, set the number of topics of the model to K and the hyperparameters α, β, γ, where the value of γ comes from the value of the γ vector in step 3;
[0050] Step 4.2: Sampling and updating according to formula (1);
[0051]
[0052] where z i Indicates the topic to which the i-th word belongs, and k indicates the topic number; Represents the topic vector after removing the i-th word, Represented as word vectors; represents the number of words in the kth topic that do not contain the i-th word, α k represents the Dirichlet prior distribution of the kth topic, β t represents the Dirichlet prior distribution of word t, γ t represents the Dirichlet prior distribution of word t, Indicates non-i;
[0053] Step 4.3, repeat the Gibbs sampling of the above corpus until Gibbs sampling converges;
[0054] Step 4.4: Count the topics of each feature word in each text to get the topic distribution and word distribution ω k,t , the calculation formula of topic distribution is as follows:
[0055]
[0056] The formula for calculating word distribution is as follows:
[0057]
[0058] Step 4.4: Output the model results, count the high-frequency topics of each document, and obtain the potential topic with the maximum probability distribution.
Claims
1. A FW-LDA topic identification method based on random walk under conditional entropy, characterized by The method comprises the following steps: Step 1: Based on the original Internet text resources, including social tags and comments, a corpus is constructed; the corpus is preprocessed with stop words to obtain a preprocessed corpus, which is represented in the form of a document set. Assume that there are M resources, denoted by R = {r1, r2, ..., r i ,…,r M }, and construct the resource distribution map re_G = (R) of all resources; Step 2: Calculate the conditional entropy between any two texts in all preprocessed corpora, denoted as h(r i |r j ), and when i = j, h(r i |r j )=0; According to the conditional entropy h(r) between any two texts in all resources i |r j ) establishes the conditional entropy matrix between resources, and obtains the maximum value max(h(r i |r j ),h(r j |r i )), assuming max(h(r i |r j ),h(r j |r i )) is h(r i |r j ), then in graph re_G, it is resource r i and r j Add a line between r i Point to r j , and form a resource association relationship directed graph G = (R, E, W); Step 3: Use the random walk method to calculate the weight of each resource, apply the weight of each resource to each feature word, and form a feature word weighted vector through the feature word weighting method: Step 3.1: Use the random walk method to calculate the weight μ of each resource in the resource association directed graph G m , m∈{1,…,M}; Assume that M resources contain V feature words, whose frequency vector is F V (m)=[v1,f(v1,m); v2,f(v2,m);…;v i ,f(v i ,m);…;v V ,f(v V ,m)], where f(v i ,m) represents the feature word v in resource m i frequency of occurrence; Step 3.2: The authority score of resource m is μ, and the weighted representation of the resource and its feature words is g_F V (m)=[v1,gf(v1,m); v2,gf(v2,m);…;v i ,gf(v i ,m);…;v V ,gf(v V ,m)], where Represents the feature word v in resource m i The weighted frequency of occurrence of Step 3.3: The weight vector of V feature words in M resources is γ v =[v1,γgf(v1); v2,γgf(v2);…;v i ,γgf(v i );…;v V ,γgf(v V )],in Indicates that the characteristic word v in all resources i The weighted frequency is accumulated, that is, for the feature word v in M resources i The weighted frequency is accumulated, that is, each feature word v i Have corresponding weight values Forming the γ vector; Step 4: Use the Gibbs sampling method to train the FW-LDA model and perform topic identification: Step 4.1, set the number of topics of the model to K and the hyperparameters α, β, input the preprocessed corpus and the hyperparameter γ, where the value of γ comes from the weighted vector value of the γ feature word in step 3; Step 4.2: Sampling and updating according to formula (1); where z i Indicates the topic to which the i-th word belongs, and k indicates the topic number; Represents the topic vector after removing the i-th word, Represented as word vectors; represents the number of words in the kth topic that do not contain the i-th word, α k represents the Dirichlet prior distribution of the kth topic, β t represents the Dirichlet prior distribution of word t, γ t represents the Dirichlet prior distribution of word t, Indicates non-i; Step 4.3, repeat the Gibbs sampling of the above corpus until Gibbs sampling converges; Step 4.4: Count the topics of each feature word in each text and get the topic distribution θ m,k and word distribution ω k,t ; Step 4.5: Output the model results, count the high-frequency topics of each document, and obtain the potential topic with the maximum probability distribution.
2. The method according to claim 1, characterized in that: The calculation formula for topic distribution is: The formula for calculating word distribution is:
3. The method according to claim 2, characterized in that: Step 2 includes the following steps: 1) Calculate the information entropy corresponding to all preprocessed corpora and express it in vector form: H(R) = {h(r1), h(r2), …, h(r i ),…,h(r M )}, where h(r i ) represents the information entropy of the i-th resource, N i is the text length of the i-th resource; 2) Based on the information entropy of each resource, the conditional entropy between any two resources is obtained by the following formula: And form the conditional entropy matrix between resources, which is expressed as 3) The maximum value of any two conditional entropies between resources is calculated by the conditional entropy matrix between resources, and the resource distribution graph re_G=(R) of all original resources is transformed into a resource association directed graph G=(R,E,W).
4. The method according to claim 3, characterized in that: Step 3 includes the following steps: The random walk method is used to calculate the weight of each resource in the directed graph G of resource association relationships generated by conditional entropy as follows: For any two vertices r in the graph G = (R, E, W) i and r j , if there is a path from r i Point to r j The directed edge of W i,j =1, otherwise W i,j =0; for the resource association graph G under a given conditional entropy, the row random matrix P of its adjacency matrix W is used as the transition probability matrix of the random walk process; where the node P of P i,j Represents the resource i Jump to resource j The transition probability is defined as shown in formula (2): The weight μ of each resource is obtained by formula (2): m , m∈{1,…,M}.
5. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the FW-LDA topic identification method based on random walk under conditional entropy according to any one of claims 1 to 4 is implemented.
