CN114357307A - News recommendation method based on multi-dimensional features - Google Patents
News recommendation method based on multi-dimensional features Download PDFInfo
- Publication number
- CN114357307A CN114357307A CN202210025279.3A CN202210025279A CN114357307A CN 114357307 A CN114357307 A CN 114357307A CN 202210025279 A CN202210025279 A CN 202210025279A CN 114357307 A CN114357307 A CN 114357307A
- Authority
- CN
- China
- Prior art keywords
- news
- entity
- vector
- features
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 68
- 230000006870 function Effects 0.000 claims abstract description 19
- 238000012549 training Methods 0.000 claims abstract description 13
- 230000003993 interaction Effects 0.000 claims abstract description 10
- 238000013136 deep learning model Methods 0.000 claims abstract description 9
- 238000013135 deep learning Methods 0.000 claims abstract description 7
- 239000013598 vector Substances 0.000 claims description 181
- 238000004364 calculation method Methods 0.000 claims description 39
- 239000011159 matrix material Substances 0.000 claims description 17
- 230000008569 process Effects 0.000 claims description 15
- 238000000605 extraction Methods 0.000 claims description 13
- 238000013507 mapping Methods 0.000 claims description 10
- 238000013527 convolutional neural network Methods 0.000 claims description 7
- 230000004913 activation Effects 0.000 claims description 6
- 238000005516 engineering process Methods 0.000 claims description 6
- 230000007246 mechanism Effects 0.000 claims description 5
- 238000004458 analytical method Methods 0.000 claims description 3
- 238000013528 artificial neural network Methods 0.000 claims description 3
- 238000001914 filtration Methods 0.000 claims description 3
- 230000004927 fusion Effects 0.000 claims description 3
- 238000001228 spectrum Methods 0.000 claims description 3
- 230000009466 transformation Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000005484 gravity Effects 0.000 description 2
- 241001270131 Agaricus moelleri Species 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000002372 labelling Methods 0.000 description 1
- 238000012216 screening Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a news recommendation method based on multi-dimensional featuresaThe method comprises the steps of obtaining a news category ID characteristic, a news headline text clustering category characteristic, a news headline characteristic and an image characteristic; then constructing a user characteristic processor, multiplying the attention weight obtained by each news through an attention network by the respective news characteristic to obtain a user characteristic u, and multiplying the user characteristic u and the news characteristic raMultiplying to obtain the click probability score of each newsThen, a training set is constructed to define pointsA hit rate loss function is obtained, and interaction records of a plurality of users are input into a batch of deep learning to train a deep learning model; and finally, adopting a trained deep learning model to carry out home page recommendation or personalized recommendation. The invention uses various features to improve the accuracy and diversity of news recommendation.
Description
Technical Field
The invention relates to the technical field of news recommendation, in particular to a news recommendation method based on multi-dimensional features.
Background
With the development of internet technology and the improvement of life needs of people, the number of users reading news is increasing all the time, and people have higher and higher requirements on the recommendation effect of news apps.
Patent CN102929928A proposes to use the title and the text content to obtain the topic feature vector, then construct a news model and a user model according to the topic feature vector and the user behavior data of the news, and then perform personalized recommendation according to the time feature. Although various features such as title, text and time features are considered to a certain extent, only the title and the text are really used for feature extraction in the model, the multi-dimensional features are not really embodied, the proposed time features are only used for strategy screening during recommendation, and a user generally sees the title first and then sees the text when clicking news, and the reading habit of people is not met.
Patent CN111061856A proposes that an entity is identified from a news text, the entity is matched with an entity in a knowledge map, a knowledge representation learning model is used to obtain vector representation of the entity and the relationship, a convolutional neural network is used to fuse word vectors and entity vectors of news, characteristics of news are learned from the vector representation, user characteristics are obtained by an attention mechanism, then candidate news characteristics, user characteristics and path characteristics are used as input, a multi-layer perceptron is used to calculate the click probability of candidate news, and finally personalized recommendation is achieved. Although the entity and the relation in the knowledge graph are well improved in AUC and F1, in actual engineering, not all news apps can build the knowledge graph in advance, and if the knowledge graph is not built or is too sparse, the recommendation effect is reduced.
Because the technical scheme can not meet the requirement of people on news reading recommendation, a new recommendation method is necessary.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a news recommending method based on multi-dimensional features.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows: a news recommendation method based on multi-dimensional features comprises the following specific processes:
step 1: constructing a news feature extractor to extract the news feature raThe process is as follows:
step 1.1: acquiring news, extracting entity information and relationship information from a text of a news title, and constructing a knowledge map; and learning entity vectors and relationship vectors from the constructed knowledge graph spectrum, and calculating the average value of the context vector of each entity, wherein the specific process is as follows:
step 1.1.1: performing entity extraction on news titles based on a named entity identification technology, and combining extracted entities into a news entity set;
step 1.1.2: inputting news titles and corresponding entities into the PCNN for relationship extraction to form triples (h, r, t); h is a head entity, t is a tail entity, h and t are from a news entity set, r is a relation, and the relation is obtained after extraction by PCNN;
step 1.1.3: constructing a knowledge graph on the basis of the triples (h, r, t);
step 1.1.4: learning entity vectors and relationship vectors from the constructed knowledge graph by using a knowledge graph feature learning method;
step 1.1.5: extracting the context information of each entity, namely acquiring the neighborhood of each entity in the graph, and calculating the average value of the context vector of each entity.
The specific calculation formula is as follows:
context(e)={ei|(e,r,ei)∈G or(ei∈G)}
wherein context (e) is a context set of entity e, eiIs the ith entity vector representation of context (e), r is the relationship between entities, G is the knowledge-graph,is the average of the context vector for entity e.
Further, in order to prevent the number of edges in the knowledge-graph from being small and lacking in diversity, the knowledge-graph is expanded, and entities and related edges which are within a threshold distance from the entities in the knowledge-graph are introduced to increase the number of edges.
Step 1.2: the method comprises the following steps of obtaining a word vector of each word in a news title, mapping the word vector and an average value of an entity vector and an entity context vector into a vector space with the same dimensionality, inputting the word vector and the entity vector into a dynamic multi-convolution kernel (CNN) for feature extraction, and obtaining corresponding word features, entity features and entity context features, wherein the specific process is as follows:
step 1.2.1: news title [ w ]1,w2,...,wn]Each word w iniAnd its word vectorEntity vector eiEntity context vector meanOne-to-one correspondence, if the entity vector and the context vector are not matched, replacing the entity vector and the context vector by a zero vector;
step 1.2.2: mapping the word vector, the entity vector and the context vector into a d-dimensional vector space by using a mapping function, unifying the dimensions of the three vectors and obtaining a word vector sequenceEntity vector sequence [ e ]1,e2,...en]Sequence of entity context vectors
The specific mapping function is as follows:
g(e)=tanh(Me+b)
wherein M is equal to Rd×kA transformation matrix is obtained, k is the dimension before transformation, and d is the dimension after transformation; b is a bias constant and e is an entity vector.
Step 1.2.3: respectively inputting the word vector sequence, the entity vector sequence and the entity context vector sequence into a dynamic multi-convolution kernel (CNN), and respectively using the characteristics obtained by a ReLU activation function Represents;
step 1.2.4: attention weights are used on the features obtained in step 2.3 respectively,
obtaining:
wherein,weight value, V, representing the ith word vectorwAnd vwIs the projection parameter at which the vector weight is calculated, qwIs the attention query vector when calculating the vector weights,the word features obtained through the ReLU activation function; obtaining the weight value corresponding to the ith entity vector by the same methodWeight values corresponding to the ith entity context vector
Step 1.2.5: respectively multiplying the word vector, the entity vector and the entity context vector by the respective corresponding weight values, and performing summation calculation to respectively obtain word characteristics rwEntity characteristic reAnd entity context characteristics
The specific calculation formula is as follows:
step 1.3: respectively calculating the corresponding weight values of the word characteristics, the entity characteristics and the entity context characteristics obtained in the step 2, respectively multiplying the corresponding weight values by the corresponding word characteristics, the corresponding entity characteristics and the corresponding entity context characteristics, and then adding the word characteristics, the corresponding entity characteristics and the corresponding entity context characteristics to obtain the final title characteristics rtThe process is as follows:
step 1.3.1: the weight α w on the word feature is calculated as follows:
wherein, Uw、uwTo calculate projection parameters for feature weights, qwIs to calculate the feature weightAttention query vector of time; the weight alpha corresponding to the entity characteristics is calculated and obtained by the same methodeWeights corresponding to entity context characteristics
Step 1.3.2: the final title feature is calculated as follows:
wherein r istIs the final title feature.
Step 1.4: clustering analysis is carried out on the texts of the news headlines by using a k-means mean clustering algorithm, the centroids after clustering are obtained, and the k centroids correspond to k categories to obtain category characteristic representation r of the news headline text clusteringcq;
Further, the category characteristic representation r of the news headline text clustercqThe specific method comprises the following steps:
corresponding the k centroids to k categories, numbering by 0,1,. k respectively, and initializing k category characteristics;
summing news title features, performing Euclidean distance calculation with each centroid vector, and calculating the class feature C corresponding to the closest centroidqInputting the data into a deep learning Dense neural network to obtain the category characteristic representation r of news headline text clusteringcq。
Step 1.5: acquiring a matching image from news, converting the image to obtain an RGB image, converting the RGB image color space to an HSV color space, and calculating hue H, saturation S and brightness V in the HSV color space to obtain the color characteristics of the image;
the specific calculation method is as follows:
step 1.5.1: the hue H is RGB converted and calculated as follows:
step 1.5.2: the saturation S is RGB converted and calculated as follows:
step 1.5.3: the luminance V is RGB-converted and calculated as follows:
step 1.6: calculating the geometric invariant moment of each image f (x, y), and describing the shape characteristics of the image by using the geometric invariant moment; the specific algorithm is as follows:
step 1.6.1: the origin moment of order p + q and the central moment of order p + q for a discrete digital image f (x, y) are calculated as follows:
wherein p, q is 0,1, 2 …, mpqIs the origin moment of order p + q, mupqIs the central moment of order p + q,representing the image center coordinates;
step 1.6.3: the central moments, which represent the distribution of pixels of different gray levels within the image with respect to the center of gravity, are normalized to obtain properties that are independent of the image, and are calculated as follows:
wherein r is (p + q +2)/2, p + q is 2, 3, 4, …, ηpqIs the distance between the centers of the two plates,is a zero order center distance;
step 1.6.4: based on the normalized second and third central moments, 7 moment sets can be derived, calculated as follows:
M1=η20+η02
M2=(η20-η02)2+4η11
M3=(η30-3η12)2+(3η21-η03)2
M4=(η30+η12)2+(η21+η03)2
M5=(η03-3η12)(η30+η12)[(η30+3η12)2-3(η21-η03)2]+
(3η21-η03)(η21+η03)[3(η30+η12)2-(η21+η03)2]
M6=(η20-η02)[(η30+η12)2-(η21+η03)2]+4η11(η30+η12)(η21+η03)
M7=(3η21-η03)(η30+η12)[(η30+η12)2-3(η21+η03)2]+
(3η21-η03)(η21+η03)[3(η30+η12)2-(η21+η03)2]
wherein, the 7 invariant moment groups M1、M2、M3、M4、M5、M6And M7Referred to as geometric invariant moment, is used to characterize the shape.
Step 1.7: calculating a gray level co-occurrence matrix of each image f (x, y), and describing the texture characteristics of the images by using the gray level co-occurrence matrix;
the gray level co-occurrence matrix is obtained by counting that pixel points which keep a certain distance on an image respectively have certain gray level conditions, and the specific calculation method is as follows:
step 1.7.1: for each gray image f (x, y), defining S as a set of pixel pairs having a specific spatial relationship in any region R, the gray co-occurrence matrix is calculated as follows:
m(d,θ)(i,j)=card{[(x1,y1),(x2,y2)]∈S|f(x1,y1)=i&f(x2,y2)=j}
wherein x is2=x1+dcosθ,y2=y1+ dsin θ, card(s) denotes set, m(d,θ)(i, j) represents the number of contributing elements, d is the step distance, and theta is the direction;
step 1.7.2: the gray level co-occurrence matrix is normalized as follows:
further, the gray level co-occurrence matrix is used for describing the texture features of the image, and can be replaced by constructing feature vectors by using entropy, contrast and inverse variance to describe the texture features of the image.
Step 1.8: respectively calculating the feature similarity of the color, shape and texture features of each news image, dynamically adjusting a threshold value according to the feature similarity calculation result, establishing a knowledge graph subgraph of the features of each news image, and linking all the knowledge graph subgraphs together to obtain a knowledge graph of the features of the news images;
step 1.9: representing the color, shape and texture features of the image as a head entity vector and a tail entity vector in a knowledge graph, representing the similarity between the features as a relation vector, and filtering the head entity vector, the tail entity vector and the relation vector by using a TransE0 model;
further, the similarity calculation method between the features is as follows:
A. calculating the similarity of the color features of the images by adopting Euclidean distance;
B. calculating the similarity of the shape characteristics of the images by adopting a correlation coefficient method;
C. and calculating the similarity of the texture features of the images by adopting cosine similarity.
Step 1.10: carrying out linear fusion on the color, shape and texture characteristics of the image to obtain a characteristic vector D of the image;
step 1.11: obtaining news category ID, obtaining initial characteristics corresponding to the category ID, inputting the initial characteristics into the Dense to obtain characteristic representation r of the news category IDca;
Step 1.12: features r of news category IDcaCategory characteristics r of news headline text clusteringcqNews headline characteristic rtAnd fusing the image characteristics D together by using an attention mechanism to obtain final news characteristics ra;
The specific calculation formula is as follows:
ra=αca*rca+αcq*rcq+αD*D+αt*rt。
step 2: constructing a user feature processor, and multiplying the attention weight obtained by each news through an attention network by the news features extracted by the news feature extractor in the step 1 to obtain user features u;
the specific calculation formula is as follows:
wherein,as the ith news featureThe attention weight obtained via the attention network, m being the news volume.
And step 3: user characteristic u and news characteristic raMultiplying to obtain the click probability score of each news
The specific calculation formula is as follows:
and 4, step 4: randomly extracting K pieces of news which are not clicked by users from interaction records of multiple users as negative samples, extracting one piece of news which is clicked by one user as positive samples, combining all user data to form a training set, and calculating the click probability score p of the positive samples of the training setiAnd defining a click rate loss function L, wherein the specific process is as follows:
step 4.1: randomly extracting K pieces of news which are not clicked by the users from the interaction records of the users to serve as negative samples, and meanwhile calculating the click probability score of each piece of negative sample news according to the method in the step 3 to obtain the negative sample setClick probability score, denoted as
Step 4.2: extracting news clicked by a user as a positive sample, calculating the click probability score of the positive sample news according to the method in the step 3, and recording the score as the click probability score
Step 4.3: calculating click probability score p of training set positive sampleiThe formula is as follows:
wherein,is the click probability score for the ith positive sample,is the click probability score of the jth negative sample in the same candidate news sequence as the ith positive sample,scoring the click probability of the positive sample;
step 4.4: defining a click-through rate loss function L, the formula is as follows:
where S is the set of forward training samples.
And 5: inputting the interaction records of a plurality of users into a batch of deep learning, and repeatedly executing the steps 1 to 4 to train a deep learning model;
step 6: inputting the historical browsing news and the candidate news of the user into the deep learning model trained in the step 5, and recommending the home page or recommending the candidate news individually.
Adopt the produced beneficial effect of above-mentioned technical scheme to lie in:
1. the method provided by the invention uses the category after the text clustering, can avoid the deviation caused by the category after manual editing to a certain extent, and can also obtain the implicit category representation of the text.
2. The method provided by the invention uses entity information in the knowledge map, the entity belongs to a mode of knowledge presentation, and news can be connected through the entity, so that the entity characteristics and the entity context characteristics are blended into the title characteristics, and more information can be represented.
3. The method provided by the invention combines the news image data, takes the color, shape and texture characteristics of news into consideration, establishes the knowledge map, and filters through the TransE model to obtain the characteristics of the fused news image, thereby further expanding the data characteristic dimension.
4. The method provided by the invention integrates various characteristics with an attention mechanism, and the information of the category, the news category, the entity and the title after the text clustering is easy to obtain in the actual engineering.
Drawings
FIG. 1 is a flowchart of a news recommendation method based on multidimensional features according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a knowledge-graph structure of news image features in an embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a deep learning model combining a news feature extractor and a user feature processor in an embodiment of the present invention;
FIG. 4 is a flowchart of step 6 in an embodiment of the present invention.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
As shown in fig. 1, the news recommendation method based on the multidimensional feature in the present embodiment is as follows.
Step 1: constructing a news feature extractor to extract the news feature raThe process is as follows:
step 1.1: acquiring news, extracting entity information and relationship information from a text of a news title, and constructing a knowledge map; and learning entity vectors and relationship vectors from the constructed knowledge graph spectrum, and calculating the average value of the context vector of each entity, wherein the specific process is as follows:
step 1.1.1: performing entity extraction on news titles based on a named entity identification technology, and combining extracted entities into a news entity set;
in this embodiment, a named entity recognition technology based on perceptron sequence labeling, a Bi-LSTM + CRF technology, and the like are used to extract entities from news headlines.
Step 1.1.2: inputting news titles and corresponding entities into the PCNN for relationship extraction to form triples (h, r, t); h is a head entity, t is a tail entity, h and t are from a news entity set, r is a relation, and the relation is obtained after extraction by PCNN;
step 1.1.3: constructing a knowledge graph on the basis of the triples (h, r, t);
in this embodiment, a knowledge graph is constructed based on the Neo4j database, data can be accessed, an algorithm for graph operation can be written on the database, the graph can be saved, and the algorithm can be written on the database for operation.
Step 1.1.4: learning entity vectors and relationship vectors from the constructed knowledge graph by using a knowledge graph feature learning method;
in this embodiment, knowledge graph feature learning methods such as transE and TransR are used to learn the entity vector and the relationship vector.
Step 1.1.5: extracting the context information of each entity, namely acquiring the neighborhood of each entity in the graph, and calculating the average value of the context vector of each entity.
The specific calculation formula is as follows:
context(e)={ei|(e,r,ei)∈G or(ei∈G)}
wherein context (e) is a context set of entity e, eiIs the ith entity vector representation of context (e), r is the relationship between entities, G is the knowledge-graph,is the average of the context vector of entity e.
Further, in order to prevent the number of edges in the knowledge-graph from being small and lacking in diversity, the knowledge-graph is expanded, and entities and related edges which are within a threshold distance from the entities in the knowledge-graph are introduced to increase the number of edges.
In this embodiment, the distance between the entities is calculated by using an equidistance calculation method of the euclidean distance and the cosine distance.
Step 1.2: the method comprises the following steps of obtaining a word vector of each word in a news title, mapping the word vector and an average value of an entity vector and an entity context vector into a vector space with the same dimensionality, inputting the word vector and the entity vector into a dynamic multi-convolution kernel (CNN) for feature extraction, and obtaining corresponding word features, entity features and entity context features, wherein the specific process is as follows:
step 1.2.1: news title [ w ]1,w2,...,wn]Each word w iniAnd its word vectorEntity vector eiEntity context vector meanOne-to-one correspondence, if the entity vector and the context vector are not matched, replacing the entity vector and the context vector by a zero vector;
step 1.2.2: vector words using a mapping functionMapping the entity vector and the context vector to a d-dimensional vector space to unify the dimensions of the three vectors to obtain a word vector sequenceEntity vector sequence [ e ]1,e2,...en]Sequence of entity context vectors
The specific mapping function is as follows:
g(e)=tanh(Me+b)
wherein M is equal to Rd×kA transformation matrix is obtained, k is the dimension before transformation, and d is the dimension after transformation; b is a bias constant and e is an entity vector.
Step 1.2.3: respectively inputting the word vector sequence, the entity vector sequence and the entity context vector sequence into a dynamic multi-convolution kernel (CNN), and respectively using the characteristics obtained by a ReLU activation function Represents;
step 1.2.4: attention weights are used on the features obtained in step 2.3 respectively,
obtaining:
wherein,weight value, v, representing the ith word vectorwAnd vwIs to calculate a vectorProjection parameters at weight, qwIs the attention query vector when calculating the vector weights,the word features obtained through the ReLU activation function; obtaining the weight value corresponding to the ith entity vector by the same methodWeight values corresponding to the ith entity context vector
Step 1.2.5: respectively multiplying the word vector, the entity vector and the entity context vector by the respective corresponding weight values, and performing summation calculation to respectively obtain word characteristics rwEntity characteristic reAnd entity context characteristics
The specific calculation formula is as follows:
step 1.3: respectively calculating the corresponding weight values of the word characteristics, the entity characteristics and the entity context characteristics obtained in the step 2, respectively multiplying the corresponding weight values by the corresponding word characteristics, the corresponding entity characteristics and the corresponding entity context characteristics, and then adding the word characteristics, the corresponding entity characteristics and the corresponding entity context characteristics to obtain the final title characteristics rtThe process is as follows:
step 1.3.1: computing a weight alpha on a word featurewDisclosure of the inventionThe formula is as follows:
wherein, Uw、uwTo calculate projection parameters for feature weights, qwIs the attention query vector when calculating the feature weights; the weight alpha corresponding to the entity characteristics is calculated and obtained by the same methodeWeights corresponding to entity context characteristics
Step 1.3.2: the final title feature is calculated as follows:
wherein r istIs the final title feature.
Step 1.4: clustering analysis is carried out on the texts of the news headlines by using a k-means mean clustering algorithm, the centroids after clustering are obtained, and the k centroids correspond to k categories to obtain category characteristic representation r of the news headline text clusteringcq;
Further, the category characteristic representation r of the news headline text clustercqThe specific method comprises the following steps:
corresponding the k centroids to k categories, numbering by 0,1,. k respectively, and initializing k category characteristics;
summing news title features, performing Euclidean distance calculation with each centroid vector, and comparing the initial class feature C corresponding to the closest centroidqInputting the data into a deep learning Dense neural network to obtain the category characteristic representation r of news headline text clusteringcq。
In this embodiment, the specific process of clustering and analyzing the text of the news headline by the k-means mean clustering algorithm is as follows:
step 1.4.1: news title [ w ]1,w2,...,wn]The word vectors corresponding to each word in the text are summed to form a text feature vector diThe calculation formula is as follows:
Step 1.4.2: defining the number of centroids as k, randomly selecting a data point as the centroid coUse of 1-di*coCalculating the distance between the centroid and the data point, wherein di*co=||di||·||c0||cos(di,co);
Step 1.4.3: calculating the sum of the distances from the points in each cluster to the centroid of the cluster, taking the sum as a new criterion function value, and maintaining the distance from each point to the nearest centroid;
step 1.4.4: to select the remaining centroids, the method will proceed by calculating the initial first centroid coA portion of the resulting criteria function value is located as Δ;
step 1.4.5: traversing all the rest data points, and if the distance from the point to the nearest centroid is less than delta, adding the point to a centroid list;
step 1.4.6: traversing all data points, and distributing the data points to the nearest centroid to form a new cluster;
step 1.4.7: recalculating the centroid of each cluster until the centroid does not change, forming k centroids, i.e. [ c ]0,c1…ck]。
Step 1.5: acquiring a matching image from news, converting the image to obtain an RGB image, converting the RGB image color space to an HSV color space, and calculating hue H, saturation S and brightness V in the HSV color space to obtain the color characteristics of the image;
the specific calculation method is as follows:
step 1.5.1: the hue H is RGB converted and calculated as follows:
step 1.5.2: the saturation S is RGB converted and calculated as follows:
step 1.5.3: the luminance V is RGB-converted and calculated as follows:
step 1.6: calculating the geometric invariant moment of each image f (x, y), and describing the shape characteristics of the image by using the geometric invariant moment; the geometric invariant moment is a statistical characteristic of the image, has translation, rotation and scale invariance, and is used for describing the distribution characteristics of the image.
The specific algorithm is as follows:
step 1.6.1: the origin moment of order p + q and the central moment of order p + q for a discrete digital image f (x, y) are calculated as follows:
wherein p, q is 0,1, 2 …, mpqIs the origin moment of order p + q,μpqis the central moment of order p + q,representing the image center coordinates;
step 1.6.3: the central moments, which represent the distribution of pixels of different gray levels within the image with respect to the center of gravity, are normalized to obtain properties that are independent of the image, and are calculated as follows:
wherein r is (p + q +2)/2, p + q is 2, 3, 4, …, ηpqIs the distance between the centers of the two plates,is a zero order center distance;
step 1.6.4: based on the normalized second and third central moments, 7 moment sets can be derived, calculated as follows:
wherein, the 7 invariant moment groups M1、M2、M3、M4、M5、M6And M7Called geometric invariant moment, usingTo describe the shape characteristics.
Step 1.7: calculating a gray level co-occurrence matrix of each image f (x, y), and describing the texture characteristics of the images by using the gray level co-occurrence matrix;
the gray level co-occurrence matrix is obtained by counting that pixel points which keep a certain distance on an image respectively have certain gray level conditions, and the specific calculation method is as follows:
step 1.7.1: for each gray image f (x, y), defining S as a set of pixel pairs having a specific spatial relationship in any region R, the gray co-occurrence matrix is calculated as follows:
m(d,θ)(i,j)=card{[(x1,y1),(x2,y2)]∈S|f(x1,y1)=i&f(x2,y2)=j}
wherein x is2=x1+dcosθ,y2=y1+ dsin θ, card (S) denotes set, m(d,θ)(i, j) represents the number of contributing elements, d is the step distance, and theta is the direction;
step 1.7.2: the gray level co-occurrence matrix is normalized as follows:
furthermore, the gray level co-occurrence matrix is used for describing the texture features of the image, and can be replaced by constructing feature vectors by using entropy, contrast and inverse variance to describe the texture features of the image, so that the calculation amount is reduced. The gray level transformation can be performed on the image, and then the entropy, the contrast and the inverse variance are extracted.
Wherein, the entropy: the amount of information an image has is measured. The texture in the image is more, and the corresponding entropy value is larger; the more sparse the texture is, the smaller the entropy value is, and the entropy value calculation mode is as follows:
Ent=-∑i∑jP(i,j)logP(i,j)
where P (i, j) represents the number of occurrences of two pixels with gray scales i and j, respectively.
Contrast ratio: reflecting the definition of the image texture features. I-j represents the difference between the gray values, the more the pixel pairs with large gray value difference are, the larger the contrast is, the contrast represents the thickness of the texture features, and the calculation mode of the contrast is as follows:
Con=∑i∑j(i-j)2P(i,j)
inverse variance: reflecting the uniformity of the textural features, (i-j)2The smaller the image uniformity characteristic is, the larger the image uniformity characteristic is, and conversely, the smaller the image uniformity characteristic is, the measure of the smoothness of the image is reflected, and the inverse variance calculation is as follows:
step 1.8: respectively calculating the feature similarity of the color, shape and texture features of each news image, dynamically adjusting a threshold according to the feature similarity calculation result, establishing a knowledge graph subgraph of the features of each news image, and linking all the knowledge graph subgraphs together to obtain a knowledge graph of the features of the news images, wherein the structure of the knowledge graph is shown in FIG. 2;
step 1.9: representing the color, shape and texture features of the image as a head entity vector and a tail entity vector in a knowledge graph, representing the similarity between the features as a relation vector, and filtering the head entity vector, the tail entity vector and the relation vector by using a TransE0 model; the distance between the entities is measured by L2 norm, and the smaller the distance is, the stronger the relationship is, the calculation mode is as follows:
wherein, X1Is an entity, X2Is another entity, X1iBeing vectors in entities, X2iIs a vector in another entity.
Further, the similarity calculation method between the features is as follows:
A. calculating the similarity of the color features of the images by adopting Euclidean distance;
the specific process is as follows: h, S, V three components are combined into a one-dimensional characteristic vector, the vector is normalized, and the similarity is calculated by adopting the Euclidean distance, and the calculation is as follows:
wherein P is a feature vector, Q is another feature vector,in the form of a vector of values,is another vector value.
B. Calculating the similarity of the shape characteristics of the images by adopting a correlation coefficient method;
the specific calculation formula is as follows:
wherein r (X, Y) is a correlation coefficient, X is a feature vector, and Y is another feature vector.
C. And calculating the similarity of the texture features of the images by adopting cosine similarity.
The specific calculation formula is as follows:
wherein A is a feature vector and B is another feature vector.
Step 1.10: carrying out linear fusion on the color, shape and texture features of the image to obtain a feature vector D of the image, wherein a calculation formula is as follows:
wherein, wiAs a feature weight, DiIs a feature vector.
Step 1.11: obtaining news category ID, obtaining initial characteristics corresponding to the category ID, inputting the initial characteristics into the Dense to obtain characteristic representation r of the news category IDca;
Step 1.12: features r of news category IDcaCategory characteristics r of news headline text clusteringcqNews headline characteristic rtAnd fusing the image characteristics D together by using an attention mechanism to obtain final news characteristics ra;
The specific calculation formula is as follows:
ra=αca*rca+αcq*rcq+αD*D+αt*rt。
step 2: constructing a user feature processor, and multiplying the attention weight obtained by each news through an attention network by the news features extracted by the news feature extractor in the step 1 to obtain user features u;
the specific calculation formula is as follows:
wherein,as the ith news featureThe attention weight obtained via the attention network, m being the news volume.
And step 3: user characteristic u and news characteristic raMultiplying to obtain the click probability score of each news
The specific calculation formula is as follows:
and 4, step 4: randomly extracting K pieces of news which are not clicked by users from interaction records of multiple users as negative samples, extracting one piece of news which is clicked by one user as positive samples, combining all user data to form a training set, and calculating the click probability score p of the positive samples of the training setiAnd defining a click rate loss function L, wherein the specific process is as follows:
step 4.1: randomly extracting K pieces of news which are not clicked by the users from the interaction records of the users to serve as negative samples, meanwhile, calculating the click probability score of each piece of negative sample news according to the method in the step 3 to obtain the click probability score of the negative sample set, and recording the click probability score as the click probability score of the negative sample set
Step 4.2: extracting news clicked by a user as a positive sample, calculating the click probability score of the positive sample news according to the method in the step 3, and recording the score as the click probability score
Step 4.3: calculating click probability score p of training set positive sampleiThe formula is as follows:
wherein,is the click probability score for the ith positive sample,is the click probability of the jth negative sample in the same candidate news sequence as the ith positive sampleThe method comprises the following steps of dividing,scoring the click probability of the positive sample;
step 4.4: defining a click-through rate loss function L, the formula is as follows:
where S is the set of forward training samples.
And 5: inputting the interaction records of a plurality of users into a batch of deep learning, and repeatedly executing the steps 1 to 4 to train a deep learning model as shown in fig. 3;
step 6: inputting the historical browsing news and the candidate news of the user into the deep learning model trained in the step 5, and performing home page recommendation or personalized recommendation, wherein the flow is shown in fig. 4.
Claims (10)
1. A news recommendation method based on multi-dimensional features is characterized by comprising the following steps:
step 1: constructing a news feature extractor to extract the news feature ra;
Step 2: constructing a user feature processor, and multiplying the attention weight obtained by each news through an attention network by the news features extracted by the news feature extractor in the step 1 to obtain user features u;
and step 3: user characteristic u and news characteristic raMultiplying to obtain the click probability score of each news
And 4, step 4: randomly extracting K pieces of news which are not clicked by users from interaction records of multiple users as negative samples, extracting one piece of news which is clicked by one user as positive samples, combining all user data to form a training set, and calculating the click probability score p of the positive samples of the training setiAnd define pointsHit rate loss function L;
and 5: inputting the interaction records of a plurality of users into a batch of deep learning, and repeatedly executing the steps 1 to 4 to train a deep learning model;
step 6: inputting the historical browsing news and the candidate news of the user into the deep learning model trained in the step 5, and recommending the home page or recommending the candidate news individually.
2. The news recommendation method based on multi-dimensional features as claimed in claim 1, wherein the process of step 1 is as follows:
step 1.1: acquiring news, extracting entity information and relationship information from a text of a news title, and constructing a knowledge map; learning entity vectors and relationship vectors from the constructed knowledge graph spectrum, and calculating the average value of the context vector of each entity;
step 1.2: obtaining a word vector of each word in a news title, mapping the word vector and an average value of an entity vector and an entity context vector into a vector space with the same dimensionality, and inputting the word vector and the entity vector into a dynamic multi-convolution kernel (CNN) for feature extraction to obtain corresponding word features, entity features and entity context features;
step 1.3: respectively calculating the corresponding weight values of the word characteristics, the entity characteristics and the entity context characteristics obtained in the step 2, respectively multiplying the corresponding weight values by the corresponding word characteristics, the corresponding entity characteristics and the corresponding entity context characteristics, and then adding the word characteristics, the corresponding entity characteristics and the corresponding entity context characteristics to obtain the final title characteristics rt;
Step 1.4: clustering analysis is carried out on the texts of the news headlines by using a k-means mean clustering algorithm, the centroids after clustering are obtained, and the k centroids correspond to k categories to obtain category characteristic representation r of the news headline text clusteringcq;
Step 1.5: acquiring a matching image from news, converting the image to obtain an RGB image, converting the RGB image color space to an HSV color space, and calculating hue H, saturation S and brightness V in the HSV color space to obtain the color characteristics of the image;
step 1.6: calculating the geometric invariant moment of each image f (x, y), and describing the shape characteristics of the image by using the geometric invariant moment;
step 1.7: calculating a gray level co-occurrence matrix of each image f (x, y), and describing the texture characteristics of the images by using the gray level co-occurrence matrix;
step 1.8: respectively calculating the feature similarity of the color, shape and texture features of each news image, dynamically adjusting a threshold value according to the feature similarity calculation result, establishing a knowledge graph subgraph of the features of each news image, and linking all the knowledge graph subgraphs together to obtain a knowledge graph of the features of the news images;
step 1.9: representing the color, shape and texture features of the image as a head entity vector and a tail entity vector in a knowledge graph, representing the similarity between the features as a relation vector, and filtering the head entity vector, the tail entity vector and the relation vector by using a TransE0 model;
step 1.10: carrying out linear fusion on the color, shape and texture characteristics of the image to obtain a characteristic vector D of the image;
step 1.11: obtaining news category ID, obtaining initial characteristics corresponding to the category ID, inputting the initial characteristics into the Dense to obtain characteristic representation r of the news category IDca;
Step 1.12: features r of news category IDcaCategory characteristics r of news headline text clusteringcqNews headline characteristic rtAnd fusing the image characteristics D together by using an attention mechanism to obtain final news characteristics ra。
3. A news recommendation method based on multi-dimensional features according to claim 2, characterized in that the procedure of step 1.1 is as follows:
step 1.1.1: performing entity extraction on news titles based on a named entity identification technology, and combining extracted entities into a news entity set;
step 1.1.2: inputting news titles and corresponding entities into the PCNN for relationship extraction to form triples (h, r, t); h is a head entity, t is a tail entity, h and t are from a news entity set, r is a relation, and the relation is obtained after extraction by PCNN;
step 1.1.3: constructing a knowledge graph on the basis of the triples (h, r, t);
step 1.1.4: learning entity vectors and relationship vectors from the constructed knowledge graph by using a knowledge graph feature learning method;
step 1.1.5: extracting the context information of each entity, namely acquiring the neighborhood of each entity in the graph, and calculating the average value of the context vector of each entity.
4. A news recommendation method based on multi-dimensional features according to claim 2 or 3, characterized in that, in order to prevent the number of edges in the knowledge-graph from being small and lacking in diversity, the knowledge-graph is expanded, and entities and related edges within a threshold distance from the entities in the knowledge-graph are introduced to increase the number of edges.
5. A news recommendation method based on multi-dimensional features according to claim 2, characterized in that the procedure of step 1.2 is as follows:
step 1.2.1: news title [ w ]1,w2,…,wn]Each word w iniAnd its word vectorEntity vector eiEntity context vector meanOne-to-one correspondence, if the entity vector and the context vector are not matched, replacing the entity vector and the context vector by a zero vector;
step 1.2.2: mapping the word vector, the entity vector and the context vector into a d-dimensional vector space by using a mapping function, unifying the dimensions of the three vectors and obtaining a word vector sequenceEntity vector sequence [ e ]1,e2,…en]Sequence of entity context vectors
Step 1.2.3: respectively inputting the word vector sequence, the entity vector sequence and the entity context vector sequence into a dynamic multi-convolution kernel (CNN), and respectively using the characteristics obtained by a ReLU activation function Represents;
step 1.2.4: attention weights are used on the features obtained in step 2.3 respectively,
obtaining:
wherein,weight value, V, representing the ith word vectorwAnd vwIs the projection parameter at which the vector weight is calculated, qwIs the attention query vector when calculating the vector weights,the word features obtained through the ReLU activation function; obtaining the weight value corresponding to the ith entity vector by the same methodCorresponding to the ith entity context vectorWeight value of
6. A news recommendation method based on multi-dimensional features according to claim 5, characterized in that the procedure of step 1.3 is as follows:
step 1.3.1: computing a weight alpha on a word featurewThe formula is as follows:
wherein, Uw、uwTo calculate projection parameters for feature weights, qwIs the attention query vector when calculating the feature weights; the weight alpha corresponding to the entity characteristics is calculated and obtained by the same methodeWeights corresponding to entity context characteristics
Step 1.3.2: the final title feature is calculated as follows:
wherein r istIs the final title feature.
7. The news recommendation method based on multi-dimensional features of claim 2, wherein the category feature representation r of the news headline text clustercqThe specific method comprises the following steps:
corresponding the k centroids to k categories, numbering by 0,1 and … k respectively, and initializing k category characteristics;
summing news title features, performing Euclidean distance calculation with each centroid vector, and comparing the initial class feature C corresponding to the closest centroidqInputting the data into a deep learning Dense neural network to obtain the category characteristic representation r of news headline text clusteringcq。
8. A news recommendation method based on multi-dimensional features according to claim 2, characterized in that the gray level co-occurrence matrix in step 1.7 describes the texture features of the image, and is replaced by constructing feature vectors by using entropy, contrast and inverse variance to describe the texture features of the image.
9. A news recommendation method based on multi-dimensional features according to claim 2, characterized in that the similarity calculation method between features in step 1.9 is as follows:
A. calculating the similarity of the color features of the images by adopting Euclidean distance;
B. calculating the similarity of the shape characteristics of the images by adopting a correlation coefficient method;
C. and calculating the similarity of the texture features of the images by adopting cosine similarity.
10. The news recommendation method based on multi-dimensional features of claim 1, wherein the process of step 4 is as follows:
step 4.1: randomly extracting K pieces of news which are not clicked by the users from the interaction records of the users to serve as negative samples, and simultaneously calculating the news of each negative sample according to the method in the step 3The click probability score is obtained, and the click probability score of the negative sample set is recorded as
Step 4.2: extracting news clicked by a user as a positive sample, calculating the click probability score of the positive sample news according to the method in the step 3, and recording the score as the click probability score
Step 4.3: calculating click probability score p of training set positive sampleiThe formula is as follows:
wherein,is the click probability score for the ith positive sample,is the click probability score of the jth negative sample in the same candidate news sequence as the ith positive sample,scoring the click probability of the positive sample;
step 4.4: defining a click-through rate loss function L, the formula is as follows:
where S is the set of forward training samples.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210025279.3A CN114357307A (en) | 2022-01-11 | 2022-01-11 | News recommendation method based on multi-dimensional features |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210025279.3A CN114357307A (en) | 2022-01-11 | 2022-01-11 | News recommendation method based on multi-dimensional features |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114357307A true CN114357307A (en) | 2022-04-15 |
Family
ID=81110181
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210025279.3A Pending CN114357307A (en) | 2022-01-11 | 2022-01-11 | News recommendation method based on multi-dimensional features |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114357307A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116911958A (en) * | 2023-09-12 | 2023-10-20 | 深圳须弥云图空间科技有限公司 | Recommendation system model training method and device, electronic equipment and storage medium |
-
2022
- 2022-01-11 CN CN202210025279.3A patent/CN114357307A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116911958A (en) * | 2023-09-12 | 2023-10-20 | 深圳须弥云图空间科技有限公司 | Recommendation system model training method and device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Yu et al. | Spatial pyramid-enhanced NetVLAD with weighted triplet loss for place recognition | |
CN111177446B (en) | Method for searching footprint image | |
CN108038122B (en) | Trademark image retrieval method | |
Unnikrishnan et al. | Toward objective evaluation of image segmentation algorithms | |
CN107092918B (en) | Image retrieval method based on semantic features and supervised hashing | |
CN108665323B (en) | Integration method for financial product recommendation system | |
CN106845358B (en) | Method and system for recognizing image features of handwritten characters | |
CN109213853B (en) | CCA algorithm-based Chinese community question-answer cross-modal retrieval method | |
CN111062277B (en) | Sign language-lip language conversion method based on monocular vision | |
CN108388639B (en) | Cross-media retrieval method based on subspace learning and semi-supervised regularization | |
CN109635140B (en) | Image retrieval method based on deep learning and density peak clustering | |
CN111125540A (en) | Recommendation method integrating knowledge graph representation learning and bias matrix decomposition | |
CN111538846A (en) | Third-party library recommendation method based on mixed collaborative filtering | |
CN114461839A (en) | Multi-mode pre-training-based similar picture retrieval method and device and electronic equipment | |
CN114299362A (en) | Small sample image classification method based on k-means clustering | |
CN107527058B (en) | Image retrieval method based on weighted local feature aggregation descriptor | |
CN110442736B (en) | Semantic enhancer spatial cross-media retrieval method based on secondary discriminant analysis | |
CN115577080A (en) | Question reply matching method, system, server and storage medium | |
CN110188864B (en) | Small sample learning method based on distribution representation and distribution measurement | |
CN114357307A (en) | News recommendation method based on multi-dimensional features | |
CN113553326A (en) | Spreadsheet data processing method, device, computer equipment and storage medium | |
CN114140657A (en) | Image retrieval method based on multi-feature fusion | |
Nanda et al. | A person re-identification framework by inlier-set group modeling for video surveillance | |
CN117435982A (en) | Method for rapidly identifying network water army through multiple dimensions | |
CN116935057A (en) | Target evaluation method, electronic device, and computer-readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |