A news recommendation method based on multi-dimensional features
By building a news feature extractor, using knowledge graphs and image features, combined with user features, the problem of failing to fully utilize multi-dimensional features in the existing technology is solved, and a more accurate news recommendation effect is achieved.
Patent Information
- Application Number
- CN202210025279.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-11
- Publication Date
- 2024-08-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing news recommendation technology fails to make full use of multi-dimensional features, resulting in poor recommendation results. Especially when the knowledge graph is lacking or the graph is sparse, it cannot meet users' high requirements for personalized recommendations.
By building a news feature extractor, we extract entity information and relationship information in news titles, build a knowledge graph, learn entity and relationship vectors, and combine word vectors, context vectors, and image features, using dynamic multi-convolution kernel CNN and attention mechanisms. Perform feature extraction and fusion to establish multi-dimensional news features and make personalized recommendations based on user characteristics.
It improves the accuracy and effect of news recommendation, avoids manual editing bias, incorporates entity and image features, increases the dimension of data features, and improves the prediction accuracy and recommendation effect of the model.
Smart Images

Figure CN114357307B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of news recommendation, and in particular to a news recommendation method based on multi-dimensional features. Background Art
[0002] With the development of Internet technology and the improvement of people's life needs, the number of users reading news has been increasing, and people have higher and higher requirements for the recommendation effect of news apps.
[0003] Patent CN102929928A proposes to use the title and text content to obtain the theme feature vector, then construct the news model and user model based on the news theme feature vector and user behavior data, and then make personalized recommendations based on the time feature. Although multiple features are considered to a certain extent, such as title, text, and time features, only the title and text are actually used for feature extraction in the model, and it does not truly reflect multi-dimensionality. The proposed time feature is only a strategic screening for recommendation, and when users click on news, they generally see the title first and then read the text, which does not conform to people's reading habits.
[0004] Patent CN111061856A proposes to identify entities from news texts, match them with entities in the knowledge graph, use the knowledge representation learning model to obtain vector representations of entities and relationships, use convolutional neural networks to fuse news word vectors and entity vectors, learn news features from them, use attention mechanisms to obtain user features, and then use candidate news features, user features, and path features as inputs, use a multi-layer perceptron to calculate the click probability of candidate news, and finally achieve personalized recommendations. The invention proposes to use entities and relationships in the knowledge graph, which has a great improvement in AUC and F1, but in actual projects, not all news apps will build knowledge graphs in advance. If the knowledge graph is not established or is too sparse, the recommendation effect will be reduced.
[0005] Since the above technical solutions cannot meet people's needs for news reading recommendation, it is necessary to propose a new recommendation method. Summary of the invention
[0006] In view of the above-mentioned deficiencies in the prior art, the present invention provides a news recommendation method based on multi-dimensional features.
[0007] In order to solve the above technical problems, the technical solution adopted by the present invention is: a news recommendation method based on multi-dimensional features, the specific process is as follows:
[0008] Step 1: Build a news feature extractor to extract news features r a , the process is as follows:
[0009] Step 1.1: Get news, extract entity information and relationship information from the text of the news title, and build a knowledge graph; learn entity vectors and relationship vectors from the constructed knowledge graph, and calculate the average value of the context vector of each entity. The specific process is as follows:
[0010] Step 1.1.1: Extract entities from news titles based on named entity recognition technology, and combine the extracted entities into a news entity set;
[0011] Step 1.1.2: Input the news title and the corresponding entity into PCNN for relation extraction to form a triple (h, r, t); where h is the head entity and t is the tail entity, both of which are from the news entity set, and r is the relation extracted by PCNN;
[0012] Step 1.1.3: Build a knowledge graph based on the triple (h, r, t);
[0013] Step 1.1.4: Use the knowledge graph feature learning method to learn entity vectors and relationship vectors from the constructed knowledge graph;
[0014] Step 1.1.5: Extract the context information of each entity, that is, obtain the neighbors of each entity in the graph and calculate the average value of the context vector of each entity.
[0015] The specific calculation formula is as follows:
[0016]
[0017] context(e) = {e i |(e,r,e i )∈G or(e i ∈G)}
[0018] Among them, context(e) is the context set of entity e, e i is the i-th entity vector representation of context(e), r is the relationship between entities, G is the knowledge graph, is the average value of the context vector of entity e.
[0019] Furthermore, in order to prevent the knowledge graph from having a small number of edges and lacking diversity, the knowledge graph is expanded, and entities and related edges whose distances from the entities in the knowledge graph are within a threshold are introduced to increase the number of edges.
[0020] Step 1.2: Get the word vector of each word in the news title, map it to the vector space of the same dimension together with the average of the entity vector and the entity context vector, and input it into the dynamic multi-convolution kernel CNN for feature extraction to obtain the corresponding word features, entity features and entity context features. The specific process is as follows:
[0021] Step 1.2.1: Substitute the news titles [w1, w2, ..., w n Each word w in ] i With its word vector Entity vector e i , the average value of entity context vector One-to-one correspondence: if there is no match between the entity vector and the context vector, a zero vector is used instead;
[0022] Step 1.2.2: Use the mapping function to map the word vector, entity vector, and context vector into a d-dimensional vector space to unify the dimensions of the three vectors and obtain a word vector sequence. Entity vector sequence [e1, e2, ...e n ], entity context vector sequence
[0023] The specific mapping function is as follows:
[0024] g(e)=tanh(Me+b)
[0025] Among them, M∈R d×k is the transformation matrix, k is the dimension before transformation, d is the dimension after transformation, b is the bias constant, and e is the entity vector.
[0026] Step 1.2.3: Input the word vector sequence, entity vector sequence, and entity context vector sequence into the dynamic multi-convolution kernel CNN respectively, and use the features obtained by the ReLU activation function to express;
[0027] Step 1.2.4: Use attention weights on the features obtained in step 2.3.
[0028] get:
[0029]
[0030]
[0031] in, Represents the weight value of the i-th word vector, V w and v w is the projection parameter when calculating the vector weight, q wis the attention query vector when calculating the vector weight, is the word feature obtained by ReLU activation function; the same method is used to obtain the weight value corresponding to the i-th entity vector The weight value corresponding to the context vector of the i-th entity
[0032] Step 1.2.5: Multiply the word vector, entity vector, and entity context vector by their respective weight values and sum them up to obtain the word feature r w , entity feature r e and entity context features
[0033] The specific calculation formula is as follows:
[0034]
[0035]
[0036]
[0037] Step 1.3: Calculate the corresponding weight values of the word feature, entity feature, and entity context feature obtained in step 2 respectively, and multiply them by the corresponding word feature, entity feature, and entity context feature respectively, and then add them together to obtain the final title feature r t , the process is as follows:
[0038] Step 1.3.1: Calculate the weight αw on the word feature, the formula is as follows:
[0039]
[0040]
[0041] Among them, U w 、u w is the projection parameter when calculating feature weights, q w is the attention query vector when calculating the feature weight; the weight α corresponding to the entity feature is calculated using the same method e The weights corresponding to the entity context features
[0042] Step 1.3.2: Calculate the final title features, the formula is as follows:
[0043]
[0044] Among them, r t For the final title feature.
[0045] Step 1.4: Use the k-means clustering algorithm to cluster the news headlines, obtain the centroids after clustering, and correspond the k centroids to k categories to obtain the category feature representation r of the news headlines text clustering. cq ;
[0046] Furthermore, the category feature representation of the news headline text clustering is r cq The specific method is as follows:
[0047] Correspond k centroids to k categories, number them with 0, 1, ...k respectively, and initialize k category features;
[0048] Sum the news headline features, then calculate the Euclidean distance with each centroid vector, and take the category feature C corresponding to the centroid closest to it q Input into the Dense neural network of deep learning to obtain the category feature representation r of news headline text clustering cq .
[0049] Step 1.5: Get a picture from the news, convert the image to an RGB image, convert the RGB image color space to the HSV color space, and calculate the hue H, saturation S and brightness V to obtain the color features of the image;
[0050] The specific calculation method is as follows:
[0051] Step 1.5.1: Convert hue H to RGB. The calculation is as follows:
[0052]
[0053] Step 1.5.2: Convert the saturation S to RGB. The calculation is as follows:
[0054]
[0055] Step 1.5.3: Convert the brightness V to RGB. The calculation is as follows:
[0056]
[0057] Step 1.6: For each image f(x, y), calculate its geometric invariant moment and use the geometric invariant moment to describe the shape characteristics of the image; the specific algorithm is as follows:
[0058] Step 1.6.1: The calculation method of the p+q-order origin moment and p+q-order central moment of the discrete digital image f(x, y) is as follows:
[0059]
[0060]
[0061] Where p, q = 0, 1, 2, ..., m pq is the p+q-order origin moment, μ pq is the p+q order central moment, Indicates the coordinates of the center of the image;
[0062] Step 1.6.2: Image center coordinates The calculation is as follows:
[0063]
[0064]
[0065] Step 1.6.3: The central moment represents the distribution of pixels of different gray levels in the image relative to the center of gravity. The central moment is normalized to obtain image-independent properties. The calculation of the normalized central moment is as follows:
[0066]
[0067] Where r = (p + q + 2) / 2, p + q = 2, 3, 4, ..., η pq is the center distance, is the zero-order center distance;
[0068] Step 1.6.4: Based on the normalized second-order and third-order central moments, seven moment groups can be derived, calculated as follows:
[0069] M1=η 20 +η 02
[0070] M2=(η 20 -η 02 ) 2 +4η 11
[0071] M3=(η 30 -3η 12 ) 2 +(3η 21 -η 03 ) 2
[0072] M4=(η 30 +η 12 ) 2 +(η 21 +η 03 ) 2
[0073] M5=(η 03 -3η12 )(or 30 +n 12 )[(or 30 +3rd 12 ) 2 -3(h 21 -or 03 ) 2 ]+
[0074] (3rd 21 -or 03 )(or 21 +n 03 )[3(h 30 +n 12 ) 2 -(or 21 +n 03 ) 2 ]
[0075] M6=(η 20 -or 02 )[(or 30 +n 12 ) 2 -(or 21 +n 03 ) 2 ]+4th 11 (or 30 +n 12 )(or 21 +n 03 )
[0076] M7=(3rd 21 -or 03 )(or 30 +n 12 )[(or 30 +n 12 ) 2 -3(h 21 +n 03 ) 2 ]+
[0077] (3rd 21 -or 03 )(or 21 +n 03 )[3(h 30 +n 12 ) 2 -(or 21 +n 03 ) 2 ]
[0078] Among them, the above-mentioned 7 invariable moments group M1、M2、M3、M4、M5、M6 and M7 are called geometric invariant moments, used to describe the shape characteristics.
[0079] Step 1.7: For each image f(x, y), calculate its gray level co-occurrence matrix and use the gray level co-occurrence matrix to describe the texture features of the image;
[0080] The gray level co-occurrence matrix is obtained by counting the gray levels of pixels at a certain distance on the image. The specific calculation method is as follows:
[0081] Step 1.7.1: For each grayscale image f(x, y), define S as a set of pixel pairs with a specific spatial connection in any region R. The grayscale co-occurrence matrix is calculated as follows:
[0082] m(d, θ)(i, j)=card{[(x1, y1), (x2, y2)]∈S|f(x1, y1)=i&f(x2, y2)=j}
[0083] Among them, x2=x1+dcosθ,y2=y1+dsinθ,Card(s) represents a set, m (d,θ) (i, j) represents the number of contributing elements, d is the step size, and θ is the direction;
[0084] Step 1.7.2: Normalize the gray-level co-occurrence matrix as follows:
[0085]
[0086] Furthermore, the gray-level co-occurrence matrix used to describe the texture features of the image can also be replaced by using entropy, contrast, and inverse variance to construct a feature vector to describe the texture features of the image.
[0087] Step 1.8: Calculate the feature similarity of the color, shape and texture features of each news image respectively, and dynamically adjust the threshold according to the feature similarity calculation results, establish a knowledge graph subgraph of each news image feature, link all knowledge graph subgraphs together, and obtain the knowledge graph of news image features;
[0088] Step 1.9: Represent the color, shape and texture features of the image as the head entity vector and the tail entity vector in the knowledge graph, represent the similarity between the features as the relationship vector, and filter the head entity vector, the tail entity vector and the relationship vector using the TransE0 model;
[0089] Furthermore, the similarity calculation method between the features is as follows:
[0090] A. The similarity of the color features of the images is calculated using the Euclidean distance;
[0091] B. The similarity of the shape features of the images is calculated using the correlation coefficient method;
[0092] C. The similarity of the texture features of the images is calculated using cosine similarity.
[0093] Step 1.10: Linearly fuse the color, shape and texture features of the image to obtain the feature vector D of the image;
[0094] Step 1.11: Get the news category ID and the initial features corresponding to the category ID, input the initial features into Dense to get the feature representation r of the news category ID ca ;
[0095] Step 1.12: Substitute the feature r of the news category ID ca , Category features of news headline text clustering r cq , News title features t , image features D are fused together using the attention mechanism as the final news feature r a ;
[0096] The specific calculation formula is as follows:
[0097] r a =αc a *r ca +α cq *r cq +α D *D+α t *r t .
[0098] Step 2: Build a user feature processor, multiply the attention weight of each news article obtained through the attention network by the news feature extracted by the news feature extractor in step 1, and obtain the user feature u;
[0099] The specific calculation formula is as follows:
[0100]
[0101] in, is the i-th news feature The attention weight obtained by the attention network, m is the number of news.
[0102] Step 3: Combine user features u and news features r a Multiply to get the click probability score of each news article
[0103] The specific calculation formula is as follows:
[0104]
[0105] Step 4: Randomly extract K news articles that users have not clicked on from the interaction records of multiple users as negative samples, and extract one news article that a user has clicked on as a positive sample. All user data are combined together to form a training set, and the click probability score p of the positive sample in the training set is calculated. i , and define the click rate loss function L. The specific process is as follows:
[0106] Step 4.1: Randomly extract K news articles that are not clicked by users from the interaction records of multiple users as negative samples, and calculate the click probability score of each negative sample news article according to the method in step 3 to obtain the click probability score of the negative sample set, which is recorded as
[0107] Step 4.2: Extract a piece of news that a user has clicked on as a positive sample, and calculate the click probability score of the positive sample news according to the method in step 3, which is recorded as
[0108] Step 4.3: Calculate the click probability score p of the positive sample in the training set i , the formula is as follows:
[0109]
[0110] in, is the click probability score of the i-th positive sample, is the click probability score of the jth negative sample in the same candidate news sequence as the i-th positive sample, is the click probability score of the positive sample;
[0111] Step 4.4: Define the click-through rate loss function L, the formula is as follows:
[0112]
[0113] Among them, S is the set of positive training samples.
[0114] Step 5: Input the interaction records of multiple users into the deep learning batch, and repeat steps 1 to 4 to train the deep learning model;
[0115] Step 6: Input the user's historical browsing news and candidate news into the deep learning model trained in step 5 to make home page recommendations or personalized recommendations.
[0116] The beneficial effects of adopting the above technical solution are:
[0117] 1. The method provided by the present invention uses the categories after text clustering, which can avoid the deviation caused by the categories after manual editing to a certain extent, and can also obtain the implicit category representation of the text.
[0118] 2. The method provided by the present invention uses entity information in the knowledge graph. Entity is a way of presenting knowledge, and news can be connected through entities. Therefore, entity features and entity context features are integrated into the title features, which can represent more information.
[0119] 3. The method provided by the present invention combines news image data, takes into account the color, shape and texture features of the news and establishes a knowledge graph, and filters it through the TransE model to obtain the fused news image features, further expanding the data feature dimension.
[0120] 4. The method provided by the present invention uses an attention mechanism to integrate multiple features together, and the information of categories, news categories, entities, and titles after text clustering is also easy to obtain in actual engineering. Using multiple features in the model can improve the accuracy of model prediction and recommendation effect to a certain extent. BRIEF DESCRIPTION OF THE DRAWINGS
[0121] Figure 1 is a flowchart of a news recommendation method based on multi-dimensional features in an embodiment of the present invention;
[0122] Figure 2 Schematic diagram of the knowledge graph structure of news image features in an embodiment of the present invention;
[0123] Figure 3 It is a structural diagram of a deep learning model combining a news feature extractor and a user feature processor in an embodiment of the present invention;
[0124] Figure 4 Flow chart of step 6 in the embodiment of the present invention. DETAILED DESCRIPTION
[0125] The specific implementation of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0126] like Figure 1 As shown, the news recommendation method based on multi-dimensional features in this embodiment is described as follows.
[0127] Step 1: Build a news feature extractor to extract news features r a , the process is as follows:
[0128] Step 1.1: Get news, extract entity information and relationship information from the text of the news title, and build a knowledge graph; learn entity vectors and relationship vectors from the constructed knowledge graph, and calculate the average value of the context vector of each entity. The specific process is as follows:
[0129] Step 1.1.1: Extract entities from news titles based on named entity recognition technology, and combine the extracted entities into a news entity set;
[0130] In this embodiment, named entity recognition technology based on perceptron sequence labeling, Bi-LSTM+CRF and other technologies are used to extract entities from news titles.
[0131] Step 1.1.2: Input the news title and the corresponding entity into PCNN for relation extraction to form a triple (h, r, t); where h is the head entity and t is the tail entity, both of which are from the news entity set, and r is the relation extracted by PCNN;
[0132] Step 1.1.3: Build a knowledge graph based on the triple (h, r, t);
[0133] In this embodiment, a knowledge graph is constructed based on the Neo4j database, data can be accessed, and algorithms for graph operations can be written on the database. The graph can be saved, and algorithms can be written to operate on it.
[0134] Step 1.1.4: Use the knowledge graph feature learning method to learn entity vectors and relationship vectors from the constructed knowledge graph;
[0135] In this embodiment, knowledge graph feature learning methods such as TransE and TransR are used to learn entity vectors and relationship vectors.
[0136] Step 1.1.5: Extract the context information of each entity, that is, obtain the neighbors of each entity in the graph and calculate the average value of the context vector of each entity.
[0137] The specific calculation formula is as follows:
[0138]
[0139] context(e) = {e i |(e,r,e i )∈G or(e i ∈G)}
[0140] Among them, context(e) is the context set of entity e, e i is the i-th entity vector representation of context(e), r is the relationship between entities, G is the knowledge graph, is the average value of the context vector of entity e.
[0141] Furthermore, in order to prevent the knowledge graph from having a small number of edges and lacking diversity, the knowledge graph is expanded, and entities and related edges whose distances from the entities in the knowledge graph are within a threshold are introduced to increase the number of edges.
[0142] In this embodiment, distance calculation methods such as Euclidean distance and cosine distance are used to calculate the distance between entities.
[0143] Step 1.2: Get the word vector of each word in the news title, map it to the vector space of the same dimension together with the average of the entity vector and the entity context vector, and input it into the dynamic multi-convolution kernel CNN for feature extraction to obtain the corresponding word features, entity features and entity context features. The specific process is as follows:
[0144] Step 1.2.1: Substitute the news titles [w1, w2, ..., w n Each word w in ] i With its word vector Entity vector e i , the average value of entity context vector One-to-one correspondence: if there is no match between the entity vector and the context vector, a zero vector is used instead;
[0145] Step 1.2.2: Use the mapping function to map the word vector, entity vector, and context vector into a d-dimensional vector space to unify the dimensions of the three vectors and obtain a word vector sequence. Entity vector sequence [e1, e2, ...e n ], entity context vector sequence
[0146] The specific mapping function is as follows:
[0147] g(e)=tanh(Me+b)
[0148] Where M∈R d×k is the transformation matrix, k is the dimension before transformation, d is the dimension after transformation, b is the bias constant, and e is the entity vector.
[0149] Step 1.2.3: Input the word vector sequence, entity vector sequence, and entity context vector sequence into the dynamic multi-convolution kernel CNN respectively, and use the features obtained by the ReLU activation function to express;
[0150] Step 1.2.4: Use attention weights on the features obtained in step 2.3.
[0151] get:
[0152]
[0153]
[0154] in, Represents the weight value of the i-th word vector, v w and v w is the projection parameter when calculating the vector weight, q w is the attention query vector when calculating the vector weight, is the word feature obtained by ReLU activation function; the same method is used to obtain the weight value corresponding to the i-th entity vector The weight value corresponding to the context vector of the i-th entity
[0155] Step 1.2.5: Multiply the word vector, entity vector, and entity context vector by their respective weight values and sum them up to obtain the word feature r w , entity feature r e and entity context features
[0156] The specific calculation formula is as follows:
[0157]
[0158]
[0159]
[0160] Step 1.3: Calculate the corresponding weight values of the word feature, entity feature, and entity context feature obtained in step 2 respectively, and multiply them by the corresponding word feature, entity feature, and entity context feature respectively, and then add them together to obtain the final title feature r t , the process is as follows:
[0161] Step 1.3.1: Calculate the weight α on the word feature w , the formula is as follows:
[0162]
[0163]
[0164] Among them, U w 、u w is the projection parameter when calculating feature weights, q w is the attention query vector when calculating the feature weight; the weight α corresponding to the entity feature is calculated using the same method e The weights corresponding to the entity context features
[0165] Step 1.3.2: Calculate the final title features, the formula is as follows:
[0166]
[0167] Among them, r t For the final title feature.
[0168] Step 1.4: Use the k-means clustering algorithm to cluster the text of the news headlines, obtain the centroid after clustering, and correspond the k centroids to k categories to obtain the category feature representation r of the news headline text clustering. cq ;
[0169] Furthermore, the category feature representation of the news headline text clustering is r cq The specific method is as follows:
[0170] Correspond k centroids to k categories, number them with 0, 1, ...k respectively, and initialize k category features;
[0171] Sum the news headline features, then perform Euclidean distance calculation with each centroid vector, and take the initial category feature C corresponding to the centroid closest to it q Input into the Dense neural network of deep learning to obtain the category feature representation r of news headline text clustering cq .
[0172] In this embodiment, the specific process of clustering analysis of the news headline text by the k-means clustering algorithm is as follows:
[0173] Step 1.4.1: Substitute the news titles [w1, w2, ..., w n The word vectors corresponding to each word in ] are summed to form the text feature vector d i , the calculation formula is as follows:
[0174]
[0175] in, is the word vector corresponding to the word in the news title.
[0176] Step 1.4.2: Define the number of centroids as k and randomly select a data point as the centroid c o , using 1-d i *c o Calculate the distance between the centroid and the data point, where d i *c o =||d i ||·||c0||cos(d i , c o );
[0177] Step 1.4.3: Calculate the sum of the distances from each point in each cluster to the centroid of the cluster, use it as the new criterion function value, and maintain the distance from each point to the nearest centroid;
[0178] Step 1.4.4: To select the remaining centroids, the initial first centroid c is calculated o A portion of the obtained criterion function value is located as Δ;
[0179] Step 1.4.5: Traverse all remaining data points. If the distance from the point to the nearest centroid is less than Δ, add the point to the centroid list;
[0180] Step 1.4.6: Traverse all data points and assign them to the nearest centroid to form a new cluster;
[0181] Step 1.4.7: Recalculate the centroid of each cluster until the centroid does not change, forming k centroids, i.e. [c0, c1…c k ].
[0182] Step 1.5: Get a picture from the news, convert the image to an RGB image, convert the RGB image color space to the HSV color space, and calculate the hue H, saturation S and brightness V to obtain the color features of the image;
[0183] The specific calculation method is as follows:
[0184] Step 1.5.1: Convert hue H to RGB. The calculation is as follows:
[0185]
[0186] Step 1.5.2: Convert the saturation S to RGB. The calculation is as follows:
[0187]
[0188] Step 1.5.3: Convert the brightness V to RGB. The calculation is as follows:
[0189]
[0190] Step 1.6: For each image f(x, y), calculate its geometric invariant moment and use it to describe the shape characteristics of the image; as a statistical feature of the image, the geometric invariant moment has translation, rotation and scale invariance and is used to describe the distribution characteristics of the image.
[0191] The specific algorithm is as follows:
[0192] Step 1.6.1: The calculation method of the p+q-order origin moment and p+q-order central moment of the discrete digital image f(x, y) is as follows:
[0193]
[0194]
[0195] Where p, q = 0, 1, 2, ..., m pq is the p+q-order origin moment, μ pq is the p+q order central moment, Indicates the coordinates of the center of the image;
[0196] Step 1.6.2: Image center coordinates The calculation is as follows:
[0197]
[0198]
[0199] Step 1.6.3: The central moment represents the distribution of pixels of different gray levels in the image relative to the center of gravity. The central moment is normalized to obtain image-independent properties. The calculation of the normalized central moment is as follows:
[0200]
[0201] Where r = (p + q + 2) / 2, p + q = 2, 3, 4, ..., η pq is the center distance, is the zero-order center distance;
[0202] Step 1.6.4: Based on the normalized second-order and third-order central moments, seven moment groups can be derived, calculated as follows:
[0203]
[0204] Among them, the above 7 invariant moment groups M1, M2, M3, M4, M5, M6 and M7 are called geometric invariant moments, which are used to describe shape characteristics.
[0205] Step 1.7: For each image f(x, y), calculate its gray level co-occurrence matrix and use the gray level co-occurrence matrix to describe the texture features of the image;
[0206] The gray level co-occurrence matrix is obtained by counting the gray levels of pixels at a certain distance on the image. The specific calculation method is as follows:
[0207] Step 1.7.1: For each grayscale image f(x, y), define S as a set of pixel pairs with a specific spatial connection in any region R. The grayscale co-occurrence matrix is calculated as follows:
[0208] m (d,θ) (i,j)=card{[(x1,y1),(x2,y2)]∈S|f(x1,y1)=i&f(x2,y2)=j}
[0209] Among them, x2=x1+dcosθ,y2=y1+dsinθ,Card(S) represents a set, m (d,θ) (i, j) represents the number of contributing elements, d is the step size, and θ is the direction;
[0210] Step 1.7.2: Normalize the gray-level co-occurrence matrix as follows:
[0211]
[0212] Furthermore, the gray level co-occurrence matrix used to describe the texture features of the image can also be replaced by constructing a feature vector using entropy, contrast, and inverse variance to describe the texture features of the image, thereby reducing the amount of calculation. The image can be gray-scale transformed first, and then the entropy, contrast, and inverse variance can be extracted.
[0213] Among them, entropy measures the amount of information in an image. The more textures in an image, the larger the corresponding entropy value; the sparser the texture, the smaller the entropy value. The entropy value is calculated as follows:
[0214] Ent=-∑ i ∑ j P(i, j)logP(i, j)
[0215] Wherein, P(i, j) represents the number of times two pixels with grayscales i and j appear respectively.
[0216] Contrast: reflects the clarity of image texture features. |ij| represents the difference between grayscale values. The more pixel pairs with large grayscale differences, the greater the contrast. Contrast represents the coarseness and fineness of texture features. The contrast calculation method is as follows:
[0217] Con=∑ i ∑ j (ij) 2 P(i, j)
[0218] Inverse variance: reflects the uniformity of texture features, (ij) 2 The smaller it is, the greater the uniformity of the image. Conversely, the smaller the uniformity of the image is, which reflects the measure of the smoothness of the image. The inverse variance is calculated as follows:
[0219]
[0220] Step 1.8: Calculate the feature similarity of the color, shape and texture features of each news image respectively, and dynamically adjust the threshold according to the feature similarity calculation results, establish a knowledge graph subgraph of each news image feature, link all knowledge graph subgraphs together, and obtain the knowledge graph of news image features. Its structure is as follows: Figure 2 As shown;
[0221] Step 1.9: Represent the color, shape, and texture features of the image as the head entity vector and the tail entity vector in the knowledge graph. Represent the similarity between the features as the relationship vector. Filter the head entity vector, the tail entity vector, and the relationship vector using the TransE0 model. Use the L2 norm to measure the distance between entities. The smaller the distance, the stronger the relationship. The calculation method is as follows:
[0222]
[0223] Among them, X1 is an entity, X2 is another entity, and X 1i is the vector in the entity, X 2i is a vector in another entity.
[0224] Furthermore, the similarity calculation method between the features is as follows:
[0225] A. The similarity of the color features of the images is calculated using the Euclidean distance;
[0226] The specific process is: synthesize the three components of H, S, and V into a one-dimensional feature vector, normalize the vector, and use Euclidean distance to calculate the similarity. The calculation is as follows:
[0227]
[0228] Among them, P is a eigenvector, Q is another eigenvector, is a vector value, is another vector value.
[0229] B. The similarity of the shape features of the images is calculated using the correlation coefficient method;
[0230] The specific calculation formula is as follows:
[0231]
[0232] Among them, r(X, Y) is the correlation coefficient, X is the eigenvector, and Y is another eigenvector.
[0233] C. The similarity of the texture features of the images is calculated using cosine similarity.
[0234] The specific calculation formula is as follows:
[0235]
[0236] Among them, A is an eigenvector and B is another eigenvector.
[0237] Step 1.10: Linearly fuse the color, shape and texture features of the image to obtain the feature vector D of the image. The calculation formula is as follows:
[0238]
[0239] Among them, w i is the feature weight, D i is the feature vector.
[0240] Step 1.11: Get the news category ID and the initial features corresponding to the category ID, input the initial features into Dense to get the feature representation r of the news category ID ca ;
[0241] Step 1.12: Substitute the feature r of the news category ID ca , Category features of news headline text clustering r cq , News title features t , image features D are fused together using the attention mechanism as the final news feature r a ;
[0242] The specific calculation formula is as follows:
[0243] r a =α ca *r ca +α cq *r cq +α D *D+α t *r t .
[0244] Step 2: Build a user feature processor, multiply the attention weight of each news article obtained through the attention network by the news feature extracted by the news feature extractor in step 1, and obtain the user feature u;
[0245] The specific calculation formula is as follows:
[0246]
[0247] in, is the i-th news feature The attention weight obtained by the attention network, m is the number of news.
[0248] Step 3: Combine user features u and news features r a Multiply to get the click probability score of each news article
[0249] The specific calculation formula is as follows:
[0250]
[0251] Step 4: Randomly extract K news articles that users have not clicked on from the interaction records of multiple users as negative samples, and extract one news article that a user has clicked on as a positive sample. All user data are combined together to form a training set, and the click probability score p of the positive sample in the training set is calculated. i , and define the click rate loss function L. The specific process is as follows:
[0252] Step 4.1: Randomly extract K news articles that are not clicked by users from the interaction records of multiple users as negative samples, and calculate the click probability score of each negative sample news article according to the method in step 3 to obtain the click probability score of the negative sample set, which is recorded as
[0253] Step 4.2: Extract a piece of news that a user has clicked on as a positive sample, and calculate the click probability score of the positive sample news according to the method in step 3, which is recorded as
[0254] Step 4.3: Calculate the click probability score p of the positive sample in the training set i , the formula is as follows:
[0255]
[0256] in, is the click probability score of the i-th positive sample, is the click probability score of the jth negative sample in the same candidate news sequence as the i-th positive sample, is the click probability score of the positive sample;
[0257] Step 4.4: Define the click-through rate loss function L, the formula is as follows:
[0258]
[0259] Among them, S is the set of positive training samples.
[0260] Step 5: Input the interaction records of multiple users into the deep learning batch, such as Figure 3 As shown, repeat steps 1 to 4 to train the deep learning model;
[0261] Step 6: Input the user's historical browsing news and candidate news into the deep learning model trained in step 5 to make homepage recommendations or personalized recommendations. The process is as follows: Figure 4 shown.
Claims
1. A news recommendation method based on multi-dimensional features, It is characterized in that The steps include: Step 1: Build a news feature extractor to extract news features r a ; Step 2: Build a user feature processor, multiply the attention weight of each news article obtained through the attention network by the news feature extracted by the news feature extractor in step 1, and obtain the user feature u; Step 3: Combine user features u and news features r a Multiply to get the click probability score of each news article Step 4: Randomly extract K news articles that users have not clicked on from the interaction records of multiple users as negative samples, and extract one news article that a user has clicked on as a positive sample. All user data are combined together to form a training set, and the click probability score p of the positive sample in the training set is calculated. i , and define the click rate loss function L; Step 5: Input the interaction records of multiple users into the deep learning batch, and repeat steps 1 to 4 to train the deep learning model; Step 6: Input the user's historical browsing news and candidate news into the deep learning model trained in step 5 to make homepage recommendations or personalized recommendations; The process of step 1 is as follows: Step 1.1: Get news, extract entity information and relationship information from the text of the news title, and build a knowledge graph; learn entity vectors and relationship vectors from the constructed knowledge graph, and calculate the average value of the context vector of each entity; Step 1.2: Obtain the word vector of each word in the news title, map it together with the average of the entity vector and the entity context vector into a vector space of the same dimension, and input it into the dynamic multi-convolution kernel CNN for feature extraction to obtain the corresponding word features, entity features and entity context features; Step 1.3: Calculate the corresponding weight values of the word feature, entity feature, and entity context feature obtained in step 2 respectively, and multiply them by the corresponding word feature, entity feature, and entity context feature respectively, and then add them together to obtain the final title feature r t ; Step 1.4: Use the k-means clustering algorithm to cluster the text of the news headlines, obtain the centroid after clustering, and correspond the k centroids to k categories to obtain the category feature representation r of the news headline text clustering. cq ; Step 1.5: Get a picture from the news, convert the image to an RGB image, convert the RGB image color space to the HSV color space, and calculate the hue H, saturation S and brightness V to obtain the color features of the image; Step 1.6: For each image f(x, y), calculate its geometric invariant moment and use the geometric invariant moment to describe the shape characteristics of the image; Step 1.7: For each image f(x, y), calculate its gray level co-occurrence matrix and use the gray level co-occurrence matrix to describe the texture features of the image; Step 1.8: Calculate the feature similarity of the color, shape and texture features of each news image respectively, and dynamically adjust the threshold according to the feature similarity calculation results, establish a knowledge graph subgraph of each news image feature, link all knowledge graph subgraphs together, and obtain the knowledge graph of news image features; Step 1.9: Represent the color, shape and texture features of the image as the head entity vector and the tail entity vector in the knowledge graph, represent the similarity between the features as the relationship vector, and filter the head entity vector, the tail entity vector and the relationship vector using the TransE0 model; Step 1.10: Linearly fuse the color, shape and texture features of the image to obtain the feature vector D of the image; Step 1.11: Get the news category ID and the initial features corresponding to the category ID, input the initial features into Dense to get the feature representation r of the news category ID ca ; Step 1.12: Substitute the feature r of the news category ID ca , Category features of news headline text clustering r cq , News title features t , image features D are fused together using the attention mechanism as the final news feature r a .
2. The news recommendation method based on multi-dimensional features according to claim 1, It is characterized in that The process of step 1.1 is as follows: Step 1.1.1: Extract entities from news titles based on named entity recognition technology, and combine the extracted entities into a news entity set; Step 1.1.2: Input the news title and the corresponding entity into PCNN for relation extraction to form a triple (h, r, t); where h is the head entity and t is the tail entity, both of which are from the news entity set, and r is the relation extracted by PCNN; Step 1.1.3: Build a knowledge graph based on the triple (h, r, t); Step 1.1.4: Use the knowledge graph feature learning method to learn entity vectors and relationship vectors from the constructed knowledge graph; Step 1.1.5: Extract the context information of each entity, that is, obtain the neighbors of each entity in the graph and calculate the average value of the context vector of each entity.
3. The news recommendation method based on multi-dimensional features according to claim 1 or 2, It is characterized in that In order to prevent the knowledge graph from having a small number of edges and lacking diversity, the knowledge graph is expanded, and entities and related edges whose distances from the entities in the knowledge graph are within a threshold are introduced to increase the number of edges.
4. The news recommendation method based on multi-dimensional features according to claim 1, It is characterized in that The process of step 1.2 is as follows: Step 1.2.1: Change the news title [w 1 , w 2 , ..., w n Each word w in ] i With its word vector Entity vector e i , the average value of entity context vector One-to-one correspondence: if there is no match between the entity vector and the context vector, a zero vector is used instead; Step 1.2.2: Use the mapping function to map the word vector, entity vector, and context vector into a d-dimensional vector space to unify the dimensions of the three vectors and obtain a word vector sequence. Entity vector sequence [e 1 , e 2 ,...e n ], entity context vector sequence Step 1.2.3: Input the word vector sequence, entity vector sequence, and entity context vector sequence into the dynamic multi-convolution kernel CNN respectively, and use the features obtained by the ReLU activation function to express; Step 1.2.4: Use attention weights on the features obtained in step 2.
3. get: in, Represents the weight value of the i-th word vector, V w and v w is the projection parameter when calculating the vector weight, q w is the attention query vector when calculating the vector weight, is the word feature obtained by ReLU activation function; The same method is used to obtain the weight value corresponding to the i-th entity vector The weight value corresponding to the context vector of the i-th entity Step 1.2.5: Multiply the word vector, entity vector, and entity context vector by their respective weight values and sum them up to obtain the word feature r w , entity feature r e and entity context features 5. The news recommendation method based on multi-dimensional features according to claim 4, It is characterized in that The process of step 1.3 is as follows: Step 1.3.1: Calculate the weight α on the word feature w , the formula is as follows: Among them, U w 、u w is the projection parameter when calculating feature weights, q w is the attention query vector when calculating the feature weight; the weight α corresponding to the entity feature is calculated using the same method e The weights corresponding to the entity context features Step 1.3.2: Calculate the final title features, the formula is as follows: Among them, r t For the final title feature.
6. The news recommendation method based on multi-dimensional features according to claim 1, It is characterized in that The category feature representation r of the news headline text clustering cq The specific method is as follows: Correspond k centroids to k categories, number them with 0, 1, ...k respectively, and initialize k category features; Sum the news headline features, then perform Euclidean distance calculation with each centroid vector, and take the initial category feature C corresponding to the centroid closest to it q Input into the Dense neural network of deep learning to obtain the category feature representation r of news headline text clustering cq .
7. The news recommendation method based on multi-dimensional features according to claim 1, It is characterized in that In the step 1.7, the gray level co-occurrence matrix is used to describe the texture features of the image, which is replaced by using entropy, contrast, and inverse variance to construct a feature vector to describe the texture features of the image.
8. The news recommendation method based on multi-dimensional features according to claim 1, It is characterized in that The method for calculating the similarity between the features in step 1.9 is as follows: A. The similarity of the color features of the images is calculated using the Euclidean distance; B. The similarity of the shape features of the images is calculated using the correlation coefficient method; C. The similarity of the texture features of the images is calculated using cosine similarity.
9. The news recommendation method based on multi-dimensional features according to claim 1, It is characterized in that The process of step 4 is as follows: Step 4.1: Randomly extract K news articles that are not clicked by users from the interaction records of multiple users as negative samples, and calculate the click probability score of each negative sample news article according to the method in step 3 to obtain the click probability score of the negative sample set, which is recorded as Step 4.2: Extract a piece of news that a user has clicked on as a positive sample, and calculate the click probability score of the positive sample news according to the method in step 3, which is recorded as Step 4.3: Calculate the click probability score p of the positive sample in the training set i , the formula is as follows: in, is the click probability score of the i-th positive sample, is the click probability score of the jth negative sample in the same candidate news sequence as the i-th positive sample, is the click probability score of the positive sample; Step 4.4: Define the click-through rate loss function L, the formula is as follows: Among them, S is the set of positive training samples.
