Intelligent news recommendation method and system based on fine-grained aspect features
By adopting the method of fine-grained aspect feature representation in the news recommendation system, the problems of inaccurate recommendation results and lack of content diversity in the existing technology are solved, and higher recommendation accuracy and diversity are achieved.
Patent Information
- Application Number
- CN202210619313.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-01
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2042-06-01
AI Technical Summary
Existing news recommendation methods are mainly oriented to topic-level feature information and ignore fine-grained aspect-level feature information, resulting in inaccurate recommendation results and a lack of content diversity.
An intelligent news recommendation method based on fine-grained aspect features is adopted. Aspect-level news encoder and user encoder are used to perform fine-grained representation of news and user features, and a click-through rate predictor is used to output the prediction score of candidate news to improve the recommendation quality. Accuracy and variety.
Through fine-grained aspect feature representation, the accuracy and content diversity of news recommendations are improved, and more accurate news and user representations are provided, thereby improving the overall performance of the recommendation system.
Smart Images

Figure CN114943034B
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of artificial intelligence and natural language processing, and in particular to an intelligent news recommendation method and system based on fine-grained aspect features. Background Art
[0002] With the rapid development of Internet technology, more and more users like to read news through online news platforms such as Sohu, Sina and Toutiao. Although these platforms try to provide users with personalized news recommendation services, they are still inevitably plagued by problems such as inaccurate recommendation results and lack of content diversity. These problems will affect the user's reading experience. The key to solving the above problems is to accurately model news texts and user interests, that is, to accurately capture news text features and user interest features.
[0003] At present, most of the existing news recommendation methods are oriented to topic-level feature information, but do not consider fine-grained aspect-level feature information. Existing news recommendation methods usually establish topic-level news text features and user interest representations according to news topic classification information, and then perform topic-level recommendation tasks. Although these methods have improved the accuracy of recommendation results to a certain extent in news recommendation tasks, they all ignore the fine-grained aspect-level feature information in news; modeling news text and user interests only at the topic level often fails to accurately capture news text features and user interest features, which inevitably affects the accuracy of news recommendation results and the diversity of content. Summary of the invention
[0004] The technical task of the present invention is to provide an intelligent news recommendation method and system based on fine-grained aspect features to solve the problems of inaccurate recommendation results and lack of content diversity in news recommendation systems.
[0005] The intelligent news recommendation method and system based on fine-grained aspect features have the following advantages:
[0006] (i) The present invention proposes an intelligent news recommendation method based on fine-grained aspect features, which uses the potential aspect-level information of news content. Compared with the feature representation based on topic-level information of existing methods, it can enhance the feature representation of news and users at the fine-grained aspect level, thereby improving the accuracy of news recommendation and increasing the diversity of news recommendation content.
[0007] (ii) The present invention can extract features from the embedded representation of news through the aspect-level news encoder, and establish a news representation based on fine-grained aspect features, thereby obtaining a more accurate news representation.
[0008] (III) The present invention can extract features from news embedding representations in user browsing records through an aspect-level user encoder, and establish user representations based on fine-grained aspect features, thereby obtaining more accurate user representations.
[0009] (IV) The present invention can accurately output the prediction scores of candidate news sequences based on accurate news representation and user representation through a click rate predictor.
[0010] As a preferred method, the construction process of the aspect-level news encoder is as follows:
[0011] Aspect-level news encoder, specifically, including building a news feature extractor and building an aspect-level feature extractor;
[0012] Construct a news feature extractor, which includes four modules: title learning module, summary learning module, classification learning module and attention module, as follows:
[0013] Construct title learning module: construct a word mapping table for each word in the data set, and map each word in the table to a unique digital identifier. The mapping rule is: start with number 1, and then sort each word in the order in which it is entered into the word mapping table, thereby forming a word mapping conversion table; use the Glove pre-trained language model to obtain the word vector representation of each word; in the embedding layer, transform each news title T = [w 1 ,w 2 ,...,w N ] is converted into a vector representation, denoted as E = [e 1 ,e 2 ,...,e N ], where N represents the length of a news title, e N Represents the vector representation of each word.
[0014] For E = [e 1 ,e 2 ,...,e N ]Use convolutional neural network CNN to extract features and obtain context feature vector [c 1 ,c 2 ,...,c N ], the formula is as follows:
[0015] c i =ReLU(Q w ×e (i-k):(i+k) +b w );
[0016] Among them, i represents the relative position of the corresponding word vector in the news title, k represents the difference from the relative position of i, and e (i-k):(i+k) represents the word vector that aggregates the word from (ik) to (i+k), Q w represents the convolution kernel of the CNN filter, b w represents bias, ReLU is an activation function, and operator × is matrix multiplication.
[0017] For the context feature vector [c 1 , c 2 , ..., c N ], use the attention mechanism to further extract key features and obtain the final news title vector r t , the formula is as follows:
[0018] a i =q T tanh(V×c i +v);
[0019]
[0020]
[0021] Among them, q is the attention query vector obtained from the context feature vector, V and v are parameters learned during the training process, tanh is an activation function, the operator × is matrix multiplication, exp is the logarithmic function operation, and a i is the attention score of the i-th word, α i is the attention weight of the i-th word, N is the context feature vector [c 1 , c 2 , ..., c N ]'s length.
[0022] Construct summary learning module: The specific steps are the same as constructing title learning module to obtain summary vector r a .
[0023] Construct a classification learning module: In the embedding layer, the main category label and subcategory label are mapped to low-dimensional space vectors through the word vector method to obtain the word vector representation of each category label. c and e sc , and then use the activation function ReLU to generate the final vector r of the category label c and r sc , the formula is as follows:
[0024] r c =ReLU(V c ×e c +v c );
[0025] r sc =ReLU(V sc ×e sc +v sc );
[0026] Among them, ReLU is an activation function, V c , V sc , v sc and v c are the parameters learned from the training process and the operator × is matrix multiplication.
[0027] Constructing the attention module: vector r for the title, summary, main category label, and subcategory label t 、r a 、r c and r sc , use the activation function tanh to calculate their respective attention scores, that is, a t 、a a 、a c 、a sc , and then further obtain their respective attention weights through the attention mechanism, the formula is as follows:
[0028]
[0029]
[0030]
[0031]
[0032]
[0033]
[0034]
[0035]
[0036] Among them, V t 、V a 、V c 、V sc 、v t 、v a 、v c 、v sc To calculate the title attention score a t , summary attention score a a , main category label attention score a c and subcategory label attention score a sc Parameters, is the title vector r t The generated attention query vector, is the summary vector r a The generated attention query vector, is the main category label vector r c The generated attention query vector, is the subcategory label vector r sc The generated attention query vector, tanh is an activation function, the operator × is matrix multiplication, exp is the logarithmic function operation, α t is the attention weight of the title, α a is the attention weight of the summary, α c is the attention weight of the main category label, α sc is the attention weight of the subcategory label.
[0037] The final news feature vector r is composed of the title vector r t , Abstract vector r a , main category label vector r c and the subcategory label vector r sc And their respective attention weights are determined by the following formula:
[0038] r=[α t r t ; α a r a ; α c r c ; α sc r sc ];
[0039] Among them, the symbol; represents the connection operation.
[0040] Build an Aspect-level feature extractor:
[0041] In the embedding layer, for each piece of news, the word vector representation is calculated by weighted average to obtain its global word vector representation, and then the news vector is reconstructed using the word-level attention mechanism to obtain the attention-based news vector representation z d The formula is as follows:
[0042]
[0043]
[0044]
[0045]
[0046] Among them, e iis the word vector representation corresponding to each word in each news item, y is the global word vector representation, N is the length of a news vector, and h i is the attention weight, H is the vector of y and news word e i The mapping matrix between them, exp is the logarithmic function operation, α′ i is the attention weight, z d It is an attention-based news vector representation, and the operator is the vector inner product operation, that is, the operation of multiplying and adding the values at corresponding positions of two vectors.
[0047] For all news word vectors, we use the feature clustering algorithm K-means to obtain the fine-grained aspect feature matrix A, and then reconstruct the attention-based news vector representation z through matrix multiplication. d , and obtain the news vector r based on fine-grained aspect features d The formula is as follows:
[0048] p=softmax(W p ·z d + b);
[0049] r d =A T ·p;
[0050] Among them, W p is the weight matrix parameter, b is the bias vector, and p is the product of z d The fine-grained aspect feature weight vector calculated by the normalized softmax function, r d It is a news vector based on fine-grained features. The operator is the vector inner product operation, that is, the operation of multiplying and adding the values at corresponding positions of two vectors.
[0051] Finally, by joining the news feature vector r and the news vector r based on fine-grained aspect features d The aspect-level news vector representation n is obtained using the following formula:
[0052] n=[r;r d ].
[0053] Preferably, the construction process of the aspect-level user encoder is as follows:
[0054] Construct an aspect-level user encoder, specifically, including a news feature extractor, an aspect-level feature extractor, and a user interest extractor; wherein, the processes of the news feature extractor and the aspect-level feature extractor are the same as those described above and will not be repeated here.
[0055] Build a user interest extractor: Based on the user's browsing history, use the news feature extractor to obtain the news feature vector k; then use the aspect-level feature extractor to build a news vector k based on fine-grained aspect features d ; Finally, k and k d The connection is represented by n′, the final user browsing record. The formula is as follows:
[0056] n′=[k;k d ];
[0057] For the user browsing record representation n′, the sentence-level attention mechanism is used to obtain the aspect-level user vector representation u. The formula is as follows:
[0058]
[0059]
[0060]
[0061] Among them, q n is the attention query vector generated by the user browsing record representation n′, V n and v n are parameters learned during training, tanh is an activation function, is the attention score of the i-th news, is the attention weight of the i-th news in each user's browsing record, and M is the length of the user's browsing record.
[0062] Preferably, the construction process of the click rate predictor is as follows:
[0063] For each candidate news, the Aspect-level news vector representation and the Aspect-level user vector representation are calculated by vector inner product to obtain the final click rate score. The formula is as follows:
[0064] y=n T u;
[0065] When the model of this method has not been fully trained, it needs to be trained on the training data set to optimize the model parameters; when the model training is completed, the click rate predictor can predict the recommendation score of each candidate news, and recommend suitable news to users based on the score.
[0066] Preferably, the construction process of the training data set is as follows:
[0067] Build a news dataset or select a publicly available news dataset;
[0068] Preprocessing news data set: Preprocess each news text in the news data set, remove stop words and special characters in the news data set; extract the title, main category, subcategory and summary information of each news text;
[0069] Constructing positive training examples: Use the historical news sequence in the user's browsing history and the news number with label 1 in the interactive behavior sequence, that is, the number of the news clicked by the user, to construct positive training examples;
[0070] Constructing negative training examples: Use the news numbers with label 0 in the historical news sequence in the user's browsing history and the interactive behavior sequence, that is, the numbers of the news that have not been clicked by the user, to construct negative training examples;
[0071] Constructing a training data set: Combine all positive and negative data and shuffle their order to construct the final training data set;
[0072] After the news recommendation model is constructed, the training and optimization of the news recommendation model is performed through the training data set, as follows:
[0073] Using negative sampling technology, we define the news that a user has clicked as positive samples and the news that has not been clicked as negative samples, and calculate the click prediction value p of the positive samples. i The formula is as follows:
[0074]
[0075] in, is the click rate of the jth negative example relative to the ith positive example in the same click sequence, is the i-th positive example, and G is the number of negative examples.
[0076] The loss function of news recommendation is the negative log-likelihood function of all positive examples, and the formula is as follows:
[0077]
[0078] in, is the set of positive examples.
[0079] At the same time, in order to ensure the quality of the aspect features obtained by the model, a loss function for the aspect-level feature extractor is designed. The formula is as follows:
[0080]
[0081] Among them, G is the number of negative samples, is the training data set, r d and z d is the feature vector generated by the Aspect feature extractor, nj is the vector representation of the jth negative sample, A n is a matrix where each row of the fine-grained feature matrix A is normalized to a length of 1, I is the identity matrix, and λ is a parameter that controls the weight of the regularization term.
[0082] The loss function U(θ) of the news recommendation method and the loss function J(θ) of the aspect-level feature extractor are added together to get the loss function of the entire model. The formula is as follows:
[0083] L = U (θ) + J (θ).
[0084] Optimize the training model: Select the Adam optimization function as the optimization function of this model, where the learning rate is set to 0.001, the smoothing constant is set to (0.9, 0.999), the eps is set to 1e-8, and the L2 penalty value is set to 0.
[0085] An intelligent news recommendation system based on fine-grained aspect features, the system comprising:
[0086] The training data set generation unit first obtains the user's browsing record information on the online news website, and then performs a preprocessing operation on it, so as to obtain the user's browsing record and news text content that meet the training requirements; the training data set generation unit includes:
[0087] The original data acquisition unit is responsible for downloading the publicly available news website datasets on the Internet and using them as the original data for constructing the training dataset;
[0088] The raw data preprocessing unit is responsible for preprocessing each news text in the news data set, removing stop words and special characters in the news data set; extracting key information of each news text, such as title, category, and summary; and thus constructing a training data set;
[0089] The news recommendation model construction unit based on fine-grained aspect features is used to load the training data set, build the aspect-level news encoding module, build the aspect-level user encoding module and build the candidate news prediction module. The news recommendation model construction unit based on fine-grained aspect features includes:
[0090] The training data set loading unit is responsible for loading the training data set;
[0091] The aspect-level news encoding module construction unit is responsible for training the news vector based on the Glove word vector model in the training data set and defining all the news vector representations; first, the convolutional neural network and the attention mechanism are used to encode the news title and summary respectively to obtain the news title and summary vectors; at the same time, the fully connected layer is used to encode the main category and subcategory of the news respectively to obtain the main category and subcategory vectors of the news; then the news title, summary, main category and subcategory vectors are connected and input into the attention mechanism to obtain the final news vector; at the same time, the news vector is processed by the embedding layer to obtain the news vector of the embedding layer; then the K-means algorithm is used to cluster the news vector of the embedding layer to obtain the fine-grained aspect feature matrix; at the same time, the attention mechanism is used to obtain the attention-based news vector, and finally the fine-grained aspect feature matrix and the attention-based news vector are processed by the matrix multiplication operation to obtain the final news vector based on the fine-grained aspect feature; the final news vector and the final news vector based on the fine-grained aspect feature are connected to obtain the aspect-level news vector;
[0092] The aspect-level user encoding module construction unit is responsible for constructing a user vector based on fine-grained aspect features according to the user's browsing history. The news vector of the user's browsing history is obtained by the aspect-level news encoding module construction unit, and then the aspect-level user vector is obtained through a layer of attention network.
[0093] The candidate news prediction module building unit is responsible for taking the aspect-level news vector and aspect-level user vector as input, generating the score of each candidate news, i.e., the click-through rate, through vector inner product operation, and then sorting all candidate news from high to low according to the click-through rate, and recommending the top-K news to the user;
[0094] The model training unit is used to construct the loss function required in the model training process and complete the optimization training of the model; the model training unit includes:
[0095] The loss function building unit is responsible for calculating the error between the predicted candidate news and the real target news;
[0096] The model optimization unit is responsible for training and adjusting the parameters in model training to reduce prediction errors.
[0097] A storage medium storing a plurality of instructions, characterized in that the instructions are loaded by a processor to execute the steps of the above-mentioned intelligent news recommendation method based on fine-grained aspect features.
[0098] The intelligent news recommendation method and system based on fine-grained aspect features of the present invention have the following advantages:
[0099] (i) The present invention proposes an intelligent news recommendation method based on fine-grained aspect features, which uses the potential aspect-level information of news content. Compared with the feature representation based on topic-level information of existing methods, it can enhance the feature representation of news and users at the fine-grained aspect level, thereby improving the accuracy of news recommendation and increasing the diversity of news recommendation content.
[0100] (ii) The present invention can extract features from the embedded representation of news through the aspect-level news encoder, and establish a news representation based on fine-grained aspect features, thereby obtaining a more accurate news representation.
[0101] (III) The present invention can extract features from news embedding representations in user browsing records through an aspect-level user encoder, and establish user representations based on fine-grained aspect features, thereby obtaining more accurate user representations.
[0102] (iv) The present invention can accurately output the prediction scores of candidate news sequences based on accurate news representation and user representation through a click rate predictor. BRIEF DESCRIPTION OF THE DRAWINGS
[0103] The present invention is further described below in conjunction with the accompanying drawings.
[0104] Figure 1 A flowchart of an intelligent news recommendation method based on fine-grained aspect features;
[0105] Figure 2 Flowchart of training dataset for building news recommendation model;
[0106] Figure 3 Flowchart for building a news recommendation model based on fine-grained aspect features;
[0107] Figure 4 Flowchart for training a news recommendation model based on fine-grained aspect features;
[0108] Figure 5 Schematic diagram of a news recommendation model based on fine-grained aspect features;
[0109] Figure 6 Schematic diagram of news feature extractor;
[0110] Figure 7 Schematic diagram of a fine-grained aspect feature extractor;
[0111] Figure 8 This is a structural diagram of the intelligent news recommendation system based on fine-grained aspect features. DETAILED DESCRIPTION
[0112] The intelligent news recommendation method and system based on fine-grained aspect features of the present invention are described in detail below with reference to the accompanying drawings and specific embodiments of the specification.
[0113] Embodiment 1:
[0114] The overall model framework of the present invention is as follows Figure 5 As shown. Figure 5 It can be seen that the main framework of the present invention includes aspect-level news encoder, aspect-level user encoder, and click rate predictor. Among them, aspect-level news encoder includes news feature extractor and aspect-level feature extractor; news feature extractor is responsible for generating news vectors, such as Figure 6 As shown in the figure, firstly, the embedding layer, convolution and attention mechanism are used to encode the news title and summary respectively, and the news title and summary vectors are obtained; at the same time, the embedding layer and the fully connected layer are used to encode the main category and subcategory of the news respectively, and the news main category and subcategory vectors are obtained; then the news title, summary, main category and subcategory vectors are simultaneously input into the attention mechanism to obtain the final news vector; the aspect-level feature extractor is responsible for extracting the fine-grained aspect features of the news, such as Figure 7 As shown in the figure, firstly, the embedding layer is used to process the news word vector to obtain the news vector of the embedding layer; then the K-means algorithm is used to cluster the news vector to obtain the fine-grained aspect feature matrix; at the same time, the attention-based news vector is obtained through the attention mechanism, and finally the fine-grained aspect feature matrix and the attention-based news vector are processed through matrix multiplication operation to obtain the final news vector based on fine-grained aspect features; the final news vector and the final news vector based on fine-grained aspect features are connected to obtain the aspect-level news vector representation. The aspect-level user encoder includes a news feature extractor, an aspect-level feature extractor and a user interest extractor; wherein the news feature extractor and the aspect-level feature extractor are the same as the aspect-level news encoder; the user interest extractor includes a layer of attention network, through which the aspect-level user vector representation can be obtained. The click rate predictor takes the aspect-level news vector representation and the aspect-level user vector representation as input, generates the score of each candidate news, i.e., the click rate, through the vector inner product operation, and then sorts all the candidate news from high to low according to the click rate, and recommends the top-K news to the user. The above is a brief introduction to the structure of this model invention.
[0115] Embodiment 2:
[0116] As attached Figure 1 As shown in FIG, an intelligent news recommendation method based on fine-grained aspect features is described as follows:
[0117] S1. Constructing a training data set for a news recommendation model: The news data set contains two parts of data files: user browsing records and news text content; wherein, the user browsing records contain user ID, time, historical news sequence, and interactive behavior sequence; the news text content contains news ID, main category, subcategory, title, summary, and entity; select each user's ID and interactive behavior sequence to construct the user behavior data of the training data set, and select the title, main category, subcategory, and summary of the news text content to construct the news text data of the training data set; wherein, the user behavior data will be used for user feature extraction, and the news text data will be used for news feature extraction; the method for constructing a training data set for a news recommendation model is as follows:
[0118] S101. Download the news recommendation system dataset.
[0119] Example: Download the MIND news dataset that Microsoft has made public on the Internet and use it as the original data for news recommendation. MIND is currently the largest English news recommendation system dataset, containing 1,000,000 users and 161,013 news items in 200,000 categories, divided into training sets, validation sets, and test sets. The MIND dataset also provides detailed information on the content of news text. Each news item has a news number, link, title, summary, category, and entity:
[0120]
[0121] In addition, the MIND dataset also provides user browsing records. Each record contains the user ID, time, historical news sequence, and interaction behavior sequence:
[0122]
[0123] Among them, the user number represents the unique number of each user on the news platform; the time represents the start time when the user clicks to browse a series of news; the historical news sequence represents the sequence of a series of news numbers browsed by the user; the interactive behavior sequence represents the user's actual interactive behavior on the series of news recommended by the system, 1 represents click, and 0 represents no click.
[0124] S102, preprocessing the news data set: preprocessing each news text in the news data set, removing stop words and special characters in the news data set; extracting the title, category, subcategory and summary information of each news text respectively.
[0125] S103, constructing positive training examples: using the historical news sequence in the user's browsing history and the news number labeled as 1 in the interactive behavior sequence, that is, the number of the news clicked by the user, to construct positive training examples.
[0126] For example, for the news instance displayed in step S101, the constructed positive example data is formalized as: (N29038, N15201, N8018, N32012, N30859, N26552, N25930), where the last number is the number of the news clicked by the user.
[0127] S104, constructing negative training examples: using the historical news sequence in the user's browsing history and the news numbers with a label of 0 in the interactive behavior sequence, that is, the numbers of the news that have not been clicked by the user, to construct negative training examples.
[0128] For example, for the news instance displayed in step S101, the constructed negative example data is formalized as: (N29038, N15201, N8018, N32012, N30859, N26552, N17825), where the last number is the number of the news that has not been clicked by the user.
[0129] S105, constructing a training data set: combining all the positive and negative data obtained after the operations of step S103 and step S104, and disrupting their order to construct a final training data set.
[0130] S2. Build a news recommendation model based on fine-grained features: Figure 3As shown in the figure, the news recommendation model based on fine-grained aspect features consists of three parts, namely, aspect-level news encoder, aspect-level user encoder, and click-through rate predictor; among them, aspect-level means fine-grained aspect features; firstly, the aspect-level news encoder is constructed to perform vector mapping on each word in the news to obtain the vector representation of the news, and then the news vector is obtained through the convolutional neural network and the attention mechanism; at the same time, the K-means algorithm and the attention mechanism are used to process the news word vector to obtain the news vector based on fine-grained aspect features; finally, the news vector and the news vector based on fine-grained aspect features are combined. The vectors are connected to obtain the aspect-level news vector; then the aspect-level user encoder is constructed to map each word in each news in the user's browsing history to a vector representation of the user, and then the aspect-level user vector is obtained through the aspect-level news encoder and the attention mechanism; finally, a click-through rate predictor is constructed to calculate the click-through rate of each candidate news by the vector inner product based on the aspect-level news vector and the aspect-level user vector; all candidate news are sorted from high to low according to the click-through rate, and the top-K news are recommended to the user. Figure 5 As shown, the details are as follows:
[0131] S201, constructing an aspect-level news encoder, specifically, including constructing a news feature extractor and constructing an aspect-level feature extractor;
[0132] S20101. Build a news feature extractor, as shown in the attached Figure 6 As shown in Figure 1, it includes four modules: title learning module, summary learning module, classification learning module and attention module, as follows:
[0133] S2010101. Construct a title learning module, as follows:
[0134] S201010101. Build a word mapping table for each word in the data set, and map each word in the table to a unique digital identifier. The mapping rule is: start with number 1, and then sort each word in the order in which it is entered into the word mapping table, thereby forming a word mapping conversion table; use the Glove pre-trained language model to obtain the word vector representation of each word; in the embedding layer, transform each news title T = [w 1 ,w 2 ,...,w N ] is converted into a vector representation, denoted as E = [e 1 ,e 2 ,...,eN ], where N represents the length of a news title, e N Represents the vector representation of each word.
[0135] For example, we can use the pre-trained word vector Glove to transform each news title T = [w 1 ,w 2 ,...,w N ] is converted into a word vector representation, expressed as E = [e 1 ,e 2 ,...,e N ].
[0136] S201010102, for E=[e 1 ,e 2 ,...,e N ]Use convolutional neural network CNN to extract features and obtain context feature vector [c 1 ,c 2 ,...,c N ], the formula is as follows:
[0137] c i =ReLU(Q w x (i-k):(i+k) +b w );
[0138] Among them, i represents the relative position of the corresponding word vector in the news title, k represents the difference from the relative position of i, and e (i-k):(i+k) represents the word vector that aggregates the word from (ik) to (i+k), Q w represents the convolution kernel of the CNN filter, b w represents bias, ReLU is an activation function, and operator × is matrix multiplication.
[0139] For example, in the pytorch machine learning framework, the code implementation described above is as follows:
[0140] self.title_CNN = nn.Conv2d(
[0141] 1,
[0142] config.num_filters,
[0143] (config.window_size,config.word_embedding_dim),
[0144] padding=(int((config.window_size-1) / 2),0))
[0145] title_vector=F.dropout(self.word_embedding(torch.stack(news['title'],dim=1).to(device)),
[0146] p=self.config.dropout_probability,
[0147] training = self.training)
[0148] convoluted_title_vector=
[0149] self.title_CNN(title_vector.unsqueeze(dim=1)).squeeze(dim=3)
[0150] activated_title_vector=F.dropout(F.relu(convoluted_title_vector),
[0151] p = self.dropout_rate,
[0152] training = self.training)
[0153] Among them, nn.Conv2d and F.dropout are built-in convolutional neural network methods in pytorch and methods to prevent overfitting in training, title_vector is the title vector processed by the pre-trained word vector, convoluted_title_vector is the context feature vector of the title vector processed by the convolutional neural network, and activated_title_vector is the context feature vector processed by the activation function ReLU function.
[0154] S201010103, the context feature vector [c 1 ,c 2 ,...,c N ], use the attention mechanism to further extract key features and obtain the final news title vector rt, the formula is as follows:
[0155] a i =q T tanh(V×c i +v);
[0156]
[0157]
[0158] Among them, q is the attention query vector obtained from the context feature vector, V and v are parameters learned during the training process, tanh is an activation function, the operator × is matrix multiplication, exp is the logarithmic function operation, and a i is the attention score of the i-th word, α i is the attention weight of the i-th word, N is the context feature vector [c 1 ,c 2 ,...,c N ]'s length.
[0159] For example, in the pytorch machine learning framework, the code implementation described above is as follows:
[0160] self.title_attention=AdditiveAttention(config.query_vector_dim,config.num_filters)
[0161] weighted_title_vector=self.title_attention(activated_title_vector.transpose(1,2))
[0162] Among them, self.title_attention, namely AdditiveAttention, is a customized method based on the principle of attention mechanism, weighted_title_vector is the attention weight of the title vector, and config.query_vector_dim and config.num_filters are customized vector dimension parameters.
[0163] S2010102. Construct summary learning module: The specific steps are the same as S20101. Construct title learning module to obtain summary vector r a .
[0164] S2010103. Construct classification learning module:
[0165] In the embedding layer, the main category label and subcategory label are mapped to low-dimensional space vectors through the word vector method to obtain the word vector representation of each category label. c and e sc , and then use the activation function ReLU to generate the final vector r of the category label c and r sc , the formula is as follows:
[0166] r c =ReLU(V c ×e c +v c );
[0167] r sc =ReLU(V sc ×e sc +v sc );
[0168] Among them, ReLU is an activation function, V c , V sc , v sc and v c are the parameters learned from the training process and the operator × is matrix multiplication.
[0169] For example, in the pytorch machine learning framework, the code implementation described above is as follows:
[0170]
[0171]
[0172] Among them, nn.Embedding, nn.Linear, and F.relu are the built-in word vector embedding method, connection layer method, and activation function in pytorch. config.category_embedding_dim and config.num_filters are custom vector dimension parameters, and activated_category_vector and activated_subcategory_vector are the main category label vectors r generated in the end. c and the subcategory label vector r sc .
[0173] S2010104. Construct an attention module: vector r for title, summary, main category label and subcategory label t 、r a 、r c and r sc , use the activation function tanh to calculate their respective attention scores, that is, a t 、a a 、a c 、a sc , and then further obtain their respective attention weights through the attention mechanism, the formula is as follows:
[0174]
[0175]
[0176]
[0177]
[0178]
[0179]
[0180]
[0181]
[0182] Among them, V t 、V a 、V c 、V sc 、v t 、v a 、v c 、v sc To calculate the title attention score a t , summary attention score a a , main category label attention score a c and subcategory label attention score a sc Parameters, is the title vector r t The generated attention query vector, is the summary vector r a The generated attention query vector, is the main category label vector r c The generated attention query vector, is the subcategory label vector r sc The generated attention query vector, tanh is an activation function, the operator × is matrix multiplication, exp is the logarithmic function operation, α t is the attention weight of the title, α a is the attention weight of the summary, α c is the attention weight of the main category label, α sc is the attention weight of the subcategory label.
[0183] The final news feature vector r is composed of the title vector r t , Abstract vector r a , main category label vector r c and the subcategory label vector r sc And their respective attention weights are determined by the following formula:
[0184] r=[α t r t; α a r a ; α c r c ; α sc r sc ];
[0185] Among them, the symbol; represents the connection operation.
[0186] For example, in the pytorch machine learning framework, the code implementation described above is as follows:
[0187]
[0188] Among them, self.final_attention is a method customized according to the principle of attention mechanism; weighted_title_vector, weighted_abstract_vector, activated_category_vector, activated_subcategory_vector are the vectors of title, abstract, main category label and subcategory label respectively. t 、r a 、r c and r sc ; news_vector is the final news feature vector r.
[0189] S20102. Build an Aspect-level feature extractor, as shown in the attached Figure 7 As shown, the details are as follows:
[0190] S2010201. In the embedding layer, for each piece of news, the word vector representation is calculated by weighted average to obtain its global word vector representation. Then, the word-level attention mechanism is used to reconstruct the news vector to obtain the attention-based news vector representation z. d The formula is as follows:
[0191]
[0192]
[0193]
[0194]
[0195] Among them, e i is the word vector representation corresponding to each word in each news item, y is the global word vector representation, N is the length of a news vector, and h i is the attention weight, H is the vector of y and news word e iThe mapping matrix between them, exp is the logarithmic function operation, α′ i is the attention weight, z d It is an attention-based news vector representation. The operator · is a vector inner product operation, that is, the operation of multiplying and adding the values at corresponding positions of two vectors.
[0196] For example, in the pytorch machine learning framework, the code implementation described above is as follows:
[0197] y_s=torch.mean(e_i,dim=-1)
[0198] h_i=torch.bmm(e_i.transpose(1,2),self.M(y_s).unsqueeze(2)).tanh()
[0199] a_i=torch.exp(h_i) / torch.sum(torch.exp(h_i))
[0200] z_d=normalize(torch.bmm(e_i,a_i).squeeze(2),dim=-1).to(device)
[0201] Among them, torch.mean is the average operation, torch.bmm is the vector inner product operation, torch.exp is the logarithmic function operation, and normalize is the regularization method.
[0202] S2010202. For all news word vectors, use the feature clustering algorithm - K-means to obtain the fine-grained aspect feature matrix A, and then reconstruct the attention-based news vector representation z in step S2010201 through matrix multiplication. d , and obtain the news vector r based on fine-grained aspect features d The formula is as follows:
[0203] p=softmax(W p ·z d + b);
[0204] r d =A T ·p;
[0205] Among them, W p is the weight matrix parameter, b is the bias vector, and p is the product of z d The fine-grained aspect feature weight vector calculated by the normalized softmax function, r dIt is a news vector based on fine-grained features. The operator · is a vector inner product operation, that is, the operation of multiplying and adding the values at corresponding positions of two vectors.
[0206] For example, in the pytorch machine learning framework, the code implementation described above is as follows:
[0207] p_t=softmax(self.Linear(z_d),dim=1).to(device)
[0208] r_d=normalize(torch.mm(self.A.weight.t(),p_t.t()).t(),dim=-1)
[0209] Among them, softmax is a normalization operation, torch.mm is a two-dimensional matrix operation, and normalize is a regularization method.
[0210] S2010203. Finally, by connecting the news feature vector r and the news vector r based on fine-grained aspect features d The aspect-level news vector representation n is obtained using the following formula:
[0211] n=[r;r d ];
[0212] S202, constructing an aspect-level user encoder, specifically, including a news feature extractor, an aspect-level feature extractor, and a user interest extractor.
[0213] The process of S20201, news feature extractor and aspect-level feature extractor is the same as step S20101 and step S20102, and will not be repeated here.
[0214] S20202. Build a user interest extractor, as follows:
[0215] S2020201. For the user's browsing history, a news feature vector k is obtained through a news feature extractor. The specific steps are the same as S20101. Then, an aspect-level feature extractor is used to construct a news vector k based on fine-grained aspect features. d , the specific steps are the same as S20102; finally, k and k d The connection is represented by n′, the final user browsing record. The formula is as follows:
[0216] n′=[k;k d ];
[0217] S20202. For the user browsing record representation n′, use the sentence-level attention mechanism to obtain the aspect-level user vector representation u. The formula is as follows:
[0218]
[0219]
[0220]
[0221] Among them, q n is the attention query vector generated by the user browsing record representation n′, V n and v n are parameters learned during training, tanh is an activation function, is the attention score of the i-th news, is the attention weight of the i-th news in each user's browsing record, and M is the length of the user's browsing record.
[0222] For example, in the pytorch machine learning framework, the code implementation described above is as follows:
[0223] self.additive_attention=AdditiveAttention(config.query_vector_dim,config.num_filters)
[0224] user_vector=self.additive_attention(clicked_news_vector)
[0225] Among them, self.additive_attention is a customized method based on the principle of attention mechanism, config.query_vector_dim and config.num_filters are customized vector dimension parameters, and clicked_news_vector is the user browsing record representation n′.
[0226] S203, construct a click rate predictor, and calculate the final click rate score by performing vector inner product calculation on the aspect-level news vector representation and the aspect-level user vector representation. The formula is as follows:
[0227] y=n T ·u.
[0228] For example, in the pytorch machine learning framework, the code implementation described above is as follows:
[0229] probability = torch.bmm(
[0230] user_vector.unsqueeze(dim=1),
[0231] candidate_news_vector.unsqueeze(dim=2)).flatten()
[0232] Among them, torch.bmm is the vector inner product operation, user_vector is the aspect-level user vector representation u, and candidate_news_vector is the aspect-level news vector representation n.
[0233] S3. Training model: as attached Figure 4 As shown, the details are as follows:
[0234] S301. Construct loss function: Use negative sampling technology to define a user's clicked news as positive samples and unclicked news as negative samples, and calculate the click prediction value p of the positive samples. i The formula is as follows:
[0235]
[0236] in, is the click rate of the jth negative example relative to the ith positive example in the same click sequence, is the i-th positive example, and G is the number of negative examples.
[0237] The loss function of news recommendation is the negative log-likelihood function of all positive examples, and the formula is as follows:
[0238]
[0239] in, is the set of positive examples.
[0240] For example, in the pytorch machine learning framework, the code implementation described above is as follows:
[0241] loss=torch.stack([x[0]for x in-F.log_softmax(y_pred,dim=1)]).mean()
[0242] Among them, F.log_softmax is the built-in log_softmax loss function of pytorch, and y_pred is the click prediction value p i .
[0243] At the same time, in order to ensure the quality of the aspect features obtained by the model, a loss function for the aspect-level feature extractor is designed. The formula is as follows:
[0244]
[0245] Among them, G is the number of negative samples, is the training data set, r d and z d is the feature vector generated by the Aspect feature extractor, n j is the vector representation of the jth negative sample, A n is a matrix where each row of the fine-grained feature matrix A is normalized to a length of 1, I is the identity matrix, and λ is a parameter that controls the weight of the regularization term.
[0246] The loss function U(θ) of the news recommendation method in step S301 and the loss function J(θ) of the aspect-level feature extractor are added together to obtain the loss function of the entire model, and the formula is as follows:
[0247] L = U (θ) + J (θ);
[0248] For example, in the pytorch machine learning framework, the code implementation described above is as follows:
[0249] pos=torch.bmm(z_s.unsqueeze(1),r_s.unsqueeze(2)).squeeze(2)
[0250] negs=torch.mm(z_n,r_s.t()).squeeze(1)
[0251] J=torch.ones(negs.shape).to(device)-pos.expand(negs.t().shape).t()+negs
[0252] loss+=Config.loss_weight*J
[0253] Among them, pos and negs are positive samples and negative samples respectively, J is the loss function of the aspect-level feature extractor, Config.loss_weight is the custom weight parameter, and loss is the loss function of the entire model.
[0254] S302, optimization model: select the Adam optimization function as the optimization function of this model, where the learning rate is set to 0.001, the smoothing constant is set to (0.9, 0.999), the eps is set to 1e-8, and the L2 penalty value is set to 0.
[0255] In the experiment, the present invention selects the area under the ROC curve AUC, the mean reciprocal rank MRR, and the cumulative gain nDCG as evaluation indicators.
[0256] For example, the optimization function described above is represented by the code in pytorch:
[0257] optimizer=torch.optim.Adam(model.parameters(),lr=learning_rate)
[0258] Among them, torch.optim.Adam is the Adam optimization function embedded in pytorch, model.parameters() is the parameter set for model training, and learning_rate is the learning rate.
[0259] The model of the present invention has achieved better results than the current model on the MIND public dataset. The comparison of experimental results is shown in the following table:
[0260]
[0261]
[0262] The model of the present invention is compared with the existing models, and it can be seen that the performance of the present invention method is the best compared with other methods. Among them, DKN comes from the document "DKN: Deep knowledge-aware network for news recommendation", Hi-Fi Ark comes from the document "Hi-Fi Ark: Deep User Representation via High-Fidelity ArchiveNetwork", and TANR comes from the document "Neural news recommendation with topic-aware news representation".
[0263] Embodiment 3:
[0264] Based on Example 2, an intelligent news recommendation system based on fine-grained aspect features is constructed, and the system includes:
[0265] The training data set generation unit first obtains the user's browsing record information on the online news website, and then performs a preprocessing operation on it, so as to obtain the user's browsing record and news text content that meet the training requirements; the training data set generation unit includes:
[0266] The original data acquisition unit is responsible for downloading the publicly available news website datasets on the Internet and using them as the original data for constructing the training dataset;
[0267] The raw data preprocessing unit is responsible for preprocessing each news text in the news data set, removing stop words and special characters in the news data set; extracting key information of each news text, such as title, category, and summary; and thus constructing a training data set;
[0268] The news recommendation model construction unit based on fine-grained aspect features is used to load the training data set, build the aspect-level news encoding module, build the aspect-level user encoding module and build the candidate news prediction module. The news recommendation model construction unit based on fine-grained aspect features includes:
[0269] The training data set loading unit is responsible for loading the training data set;
[0270] The aspect-level news encoding module construction unit is responsible for training the news vector based on the Glove word vector model in the training data set and defining all the news vector representations; first, the convolutional neural network and the attention mechanism are used to encode the news title and summary respectively to obtain the news title and summary vectors; at the same time, the fully connected layer is used to encode the main category and subcategory of the news respectively to obtain the main category and subcategory vectors of the news; then the news title, summary, main category and subcategory vectors are connected and input into the attention mechanism to obtain the final news vector; at the same time, the news vector is processed by the embedding layer to obtain the news vector of the embedding layer; then the K-means algorithm is used to cluster the news vector of the embedding layer to obtain the fine-grained aspect feature matrix; at the same time, the attention mechanism is used to obtain the attention-based news vector, and finally the fine-grained aspect feature matrix and the attention-based news vector are processed by the matrix multiplication operation to obtain the final news vector based on the fine-grained aspect feature; the final news vector and the final news vector based on the fine-grained aspect feature are connected to obtain the aspect-level news vector;
[0271] The aspect-level user encoding module construction unit is responsible for constructing a user vector based on fine-grained aspect features according to the user's browsing history. The news vector of the user's browsing history is obtained by the aspect-level news encoding module construction unit, and then the aspect-level user vector is obtained through a layer of attention network.
[0272] The candidate news prediction module building unit is responsible for taking the aspect-level news vector and aspect-level user vector as input, generating the score of each candidate news, i.e., the click-through rate, through vector inner product operation, and then sorting all candidate news from high to low according to the click-through rate, and recommending the top-K news to the user;
[0273] The model training unit is used to construct the loss function required in the model training process and complete the optimization training of the model; the model training unit includes:
[0274] The loss function building unit is responsible for calculating the error between the predicted candidate news and the real target news;
[0275] The model optimization unit is responsible for training and adjusting the parameters in model training to reduce prediction errors.
[0276] Embodiment 4:
[0277] A storage medium based on Example 2 stores a plurality of instructions, which are loaded by a processor to execute the steps of the intelligent news recommendation method based on fine-grained aspect features of Example 2.
[0278] Embodiment 5:
[0279] Based on the electronic device of embodiment 4, the electronic device includes: the storage medium of embodiment 4; and a processor, which is used to execute instructions in the storage medium of embodiment 4.
[0280] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. An intelligent news recommendation method based on fine-grained aspect features, It is characterized in that This method constructs and trains a news recommendation model consisting of an aspect-level news encoder, an aspect-level user encoder, and a click-through rate predictor, sorts all candidate news from high to low according to their click-through rates, and recommends the top-K news to users; the details are as follows: Construct an aspect-level news encoder, which takes the title, summary, main category and subcategory information of news as input, and uses convolutional neural network, attention mechanism and K-means clustering algorithm to learn news vectors based on fine-grained aspect features from the above four types of information respectively; Construct an aspect-level user encoder, take user browsing history as input, use aspect-level news encoder and attention mechanism to obtain user vector based on fine-grained aspect features; Build a click-through rate predictor to calculate the user's click-through rate for each candidate news item based on the candidate news vector and the user vector based on fine-grained features; sort all candidate news items from high to low based on their click-through rates, and recommend the top-K news items to users; The aspect-level news encoder is composed of a news feature extractor and an aspect-level feature extractor. The news feature vector r output by the news feature extractor and the news vector r based on fine-grained aspect features output by the aspect-level feature extractor are connected. d The aspect-level news vector representation n is obtained as follows: n = [r; r d ]; The news feature extractor includes four modules: title learning module, summary learning module, classification learning module and attention module, as follows: Construct a title learning module, build a word mapping table for each word in the data set, and map each word in the table to a unique digital identifier. The mapping rule is: start with number 1, and then sort each word in the order in which it is entered into the word mapping table, thereby forming a word mapping conversion table; use the Glove pre-trained language model to obtain the word vector representation of each word; in the embedding layer, transform each news title T = [w 1 ,w 2 ,...,w N ] is converted into a vector representation, denoted as E = [e 1 ,e 2 ,...,e N ], where N represents the length of a news title, e N Represents the Nth word w N The vector representation of ; For E = [e 1 ,e 2 ,...,e N ]Use convolutional neural network CNN to extract features and obtain context feature vector [c 1 ,c 2 ,…,c N ], the formula is as follows: c i =ReLU(Q w ×e (i-k):(i+k) +b w ): Among them, i represents the relative position of the corresponding word vector in the news title, k represents the difference from the relative position of i, and e (i-k):(i+k) represents the word vector that aggregates the word from (ik) to (i+k), Q w represents the convolution kernel of the CNN filter, b w represents bias, ReLU is an activation function, and the operator × is matrix multiplication; For the context feature vector [c 1 ,c 2 ,...,c N ], use the attention mechanism to further extract key features and obtain the final news title vector r t , the formula is as follows: Among them, q is the attention query vector obtained from the context feature vector, V and v are parameters learned during the training process, tanh is an activation function, the operator × is matrix multiplication, exp is the logarithmic function operation, and a i is the attention score of the i-th word, α i is the attention weight of the i-th word, N is the context feature vector [c 1 ,c 2 ,...,c N ]'s length; Construct the summary learning module. The specific steps are the same as constructing the title learning module to obtain the summary vector r a ; Construct a classification learning module, and map the main category label and subcategory label to low-dimensional space vectors through the word vector method in the embedding layer to obtain the word vector representation of each category label. c and e sc , and then use the activation function ReLU to generate the final vector r of the category label c and r sc , the formula is as follows: r c =ReLU(V c ×e c +v c ); r sc =ReLU(V sc ×e sc +v sc ); Among them, ReLU is an activation function, V c , V sc , v sc and v c are the parameters learned during training, and the operator × is matrix multiplication; Constructing the attention module: vector r for the title, summary, main category label, and subcategory label t 、r a 、r c and r sc , use the activation function tanh to calculate their respective attention scores, that is, a t 、a a 、a c 、a sc , and then further obtain their respective attention weights through the attention mechanism, the formula is as follows: Among them, V t 、V a 、V c 、V sc 、v t 、v a 、v c 、v sc To calculate the title attention score a t , summary attention score a a , main category label attention score a c and subcategory label attention score a sc Parameters, is the title vector r t The generated attention query vector, is the summary vector r a The generated attention query vector, is the main category label vector r c The generated attention query vector, is the subcategory label vector r sc The generated attention query vector, tanh is an activation function, the operator × is matrix multiplication, exp is the logarithmic function operation, α t is the attention weight of the title, α a is the attention weight of the summary, α c is the attention weight of the main category label, α sc is the attention weight of the subcategory label; The final news feature vector r is composed of the title vector r t , Abstract vector r a , main category label vector r c and the subcategory label vector r sc And their respective attention weights are determined by the following formula: r=[α t r t ;α a r a ;α c r c ;α sc r sc ]; Among them, the symbol; represents the connection operation.
2. According to claim 1, the intelligent news recommendation method based on fine-grained aspect features, Features Its aspect-level feature extractor is as follows: In the embedding layer, for each piece of news, the word vector representation is calculated by weighted average to obtain its global word vector representation, and then the news vector is reconstructed using the word-level attention mechanism to obtain the attention-based news vector representation z d , the formula is as follows: Among them, e i is the word vector representation corresponding to each word in each news item, y is the global word vector representation, N is the length of a news vector, and h i is the attention weight, H is the vector of y and news word e i The mapping matrix between them, exp is the logarithmic function operation, α′ i is the attention weight, z d It is a news vector representation based on attention. The operator · is a vector inner product operation, that is, the operation of multiplying and adding the values at corresponding positions of two vectors. For all the word vectors of news, we use the feature clustering algorithm K-means to obtain the fine-grained aspect feature matrix A, and then reconstruct the attention-based news vector representation z in the above step through matrix multiplication. d , and obtain the news vector r based on fine-grained aspect features d , the formula is as follows: p=softmax(W p ·z d +b) Among them, W p is the weight matrix parameter, b is the bias vector, and p is the product of z d The fine-grained aspect feature weight vector calculated by the normalized softmax function, r d It is a news vector based on fine-grained features. The operator · is a vector inner product operation, that is, the operation of multiplying and adding the values at corresponding positions of two vectors.
3. The intelligent news recommendation method based on fine-grained aspect features according to claim 1, It is characterized in that The construction process of the aspect-level user encoder is as follows: Construct an aspect-level user encoder, specifically, including a news feature extractor, an aspect-level feature extractor, and a user interest extractor; Among them, the user interest extractor is constructed, and the specific operations are as follows: Based on the user browsing history, the news feature vector k is obtained through the news feature extractor; then the aspect-level feature extractor is used to construct the news vector k based on fine-grained aspect features. d ; Finally, k and k d The connection is represented by the final user browsing record n′; the formula is as follows: n′=[k;k d ]; For the user browsing record representation n′, the sentence-level attention mechanism is used to obtain the aspect-level user vector representation u; the formula is as follows: Among them, q n is the attention query vector generated by the user browsing record representation n′, V n and v n are parameters learned during training, tanh is an activation function, is the attention score of the i-th news, is the attention weight of the i-th news in each user's browsing record, and M is the length of the user's browsing record.
4. The intelligent news recommendation method based on fine-grained aspect features according to claim 1, It is characterized in that The construction process of the click rate predictor is as follows: The final click rate score is obtained by calculating the vector inner product of the aspect-level news vector representation and the aspect-level user vector representation; the formula is as follows: When the model of this method has not been fully trained, it needs to be trained on the training data set to optimize the model parameters; when the model training is completed, the click rate predictor can predict the recommendation score of each candidate news, and recommend suitable news to users based on the score.
5. According to claim 4, the intelligent news recommendation method based on fine-grained aspect features, It is characterized in that The construction process of the training data set is as follows: Build a news dataset or select a publicly available news dataset; Preprocessing news data set: Preprocess each news text in the news data set to remove stop words and special characters in the news data set; Extract the title, main category, subcategory and summary information of each news text respectively; Constructing positive training examples: Use the historical news sequence in the user's browsing history and the news number with label 1 in the interactive behavior sequence, that is, the number of the news clicked by the user, to construct positive training examples; Constructing negative training examples: Use the news numbers with label 0 in the historical news sequence in the user's browsing history and the interactive behavior sequence, that is, the numbers of the news that have not been clicked by the user, to construct negative training examples; Construct a training data set: Combine all positive and negative data and shuffle their order to construct the final training data set.
6. According to claim 1, the intelligent news recommendation method based on fine-grained aspect features needs to be trained and optimized through a training data set, as follows: Construct loss function: Use negative sampling technology to define a user's clicked news as positive samples and unclicked news as negative samples, and calculate the click prediction value p of the positive samples. i ; The formula is as follows: in, is the click rate of the jth negative example relative to the ith positive example in the same click sequence, is the i-th positive example, G is the number of negative examples; The loss function of news recommendation is the negative log-likelihood function of all positive examples, and the formula is as follows: in, is the set of positive examples; At the same time, in order to ensure the quality of the aspect-level features obtained by the model, a loss function for the aspect-level feature extractor is designed. The formula is as follows: Among them, G is the number of negative samples, is the training data set, r d and z d is the feature vector generated by the aspect-level feature extractor, n j is the vector representation of the jth negative sample, A n It is a matrix where each row of the fine-grained feature matrix A is normalized to a length of 1, I is the identity matrix, and λ is a parameter that controls the weight of the regularization term; The loss function U(θ) of the news recommendation method and the loss function J(θ) of the aspect-level feature extractor are added together to get the loss function of the entire model. The formula is as follows: L = U (θ) + J (θ); Optimize the training model: Select the Adam optimization function as the optimization function of this model, where the learning rate is set to 0.001, the smoothing constant is set to (0.9, 0.999), the eps is set to 1e-8, and the L2 penalty value is set to 0.
7. An intelligent news recommendation system based on fine-grained aspect features, It is characterized in that The system includes a training data set generation unit, a news recommendation model construction unit based on fine-grained aspect features, and a model training unit, which respectively implement the steps of the intelligent news recommendation method based on fine-grained aspect features described in claims 1-6, which are described as follows: The training data set generation unit first obtains the user's browsing history information on the online news website, and then performs a preprocessing operation on it, so as to obtain the user's browsing history and news text content that meet the training requirements; The training data set generation unit includes: The original data acquisition unit is responsible for downloading the publicly available news website datasets on the Internet and using them as the original data for constructing the training dataset; The raw data preprocessing unit is responsible for preprocessing each news text in the news data set, removing stop words and special characters in the news data set; extracting key information of each news text, including title, category, and summary; thereby constructing a training data set; The news recommendation model construction unit based on fine-grained aspect features is used to load the training data set, build the aspect-level news encoding module, build the aspect-level user encoding module and build the candidate news prediction module. The news recommendation model construction unit based on fine-grained aspect features includes: The training data set loading unit is responsible for loading the training data set; The aspect-level news encoding module construction unit is responsible for training the news vector based on the Glove word vector model in the training data set and defining all the news vector representations; first, the convolutional neural network and the attention mechanism are used to encode the news title and summary respectively to obtain the news title and summary vectors; at the same time, the fully connected layer is used to encode the main category and subcategory of the news respectively to obtain the main category and subcategory vectors of the news; then the news title, summary, main category and subcategory vectors are connected and input into the attention mechanism to obtain the final news vector; at the same time, the news vector is processed by the embedding layer to obtain the news vector of the embedding layer; then the K-means algorithm is used to cluster the news vector of the embedding layer to obtain the fine-grained aspect feature matrix; at the same time, the attention mechanism is used to obtain the attention-based news vector, and finally the fine-grained aspect feature matrix and the attention-based news vector are processed by the matrix multiplication operation to obtain the final news vector based on the fine-grained aspect feature; the final news vector and the final news vector based on the fine-grained aspect feature are connected to obtain the aspect-level news vector; The aspect-level user encoding module construction unit is responsible for constructing a user vector based on fine-grained aspect features according to the user's browsing history. The news vector of the user's browsing history is obtained by the aspect-level news encoding module construction unit, and then the aspect-level user vector is obtained through a layer of attention network. The candidate news prediction module building unit is responsible for taking the aspect-level news vector and aspect-level user vector as input, generating the score of each candidate news, i.e., the click-through rate, through vector inner product operation, and then sorting all candidate news from high to low according to the click-through rate, and recommending the top-K news to the user; The model training unit is used to construct the loss function required in the model training process and complete the optimization training of the model; the model training unit includes: The loss function building unit is responsible for calculating the error between the predicted candidate news and the real target news; The model optimization unit is responsible for training and adjusting the parameters in model training to reduce prediction errors.
8. A storage medium having a plurality of instructions stored therein, It is characterized in that The instructions are loaded by the processor to execute the steps of the intelligent news recommendation method based on fine-grained aspect features described in claims 1-6.
