News recommendation method and device, electronic equipment and computer readable storage medium
By constructing a news recommendation model that combines text and boundary features, the problem of low recommendation accuracy caused by ignoring boundary information in existing technologies is solved, achieving more accurate news recommendations and higher click-through rates.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PING AN TECH (SHENZHEN) CO LTD
- Filing Date
- 2023-04-19
- Publication Date
- 2026-05-15
AI Technical Summary
Existing news recommendation methods mainly rely on textual information, ignoring the boundary information of the news, resulting in low accuracy of recommendation results and room for improvement in click-through rate.
A news recommendation model is constructed by encoding text features and boundary features through a multi-feature encoding network, fusing features using a multi-feature fusion network, and determining user interest through a fully connected neural network, taking into account both textual and boundary information of the news.
It improved the accuracy and click-through rate of news recommendations, provided more precise news recommendations, and enhanced the user experience.
Smart Images

Figure CN116578778B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the fields of deep learning and digital healthcare technologies, and more specifically, to a news recommendation method, apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] With the development of technology, people have gradually moved from an era of information scarcity to an era of information overload. To address the problem of information overload, personalized news recommendation technology has emerged in the news field, playing a crucial role in helping users find news of interest and improving their reading experience.
[0003] In real-world scenarios, a news article often includes not only textual data but also boundary information reflecting its popularity, such as readership, clicks, saves, and likes. Current news recommendation methods primarily extract textual information from the news, matching and ranking textual features with user characteristics to obtain the final recommendation result. Existing technologies only consider the textual information of the news, ignoring the aforementioned boundary information, resulting in low accuracy in news recommendations and room for improvement in click-through rates. Therefore, a method to improve the accuracy of news recommendations is urgently needed. Summary of the Invention
[0004] In view of the above situation, this application provides a news recommendation method, apparatus, electronic device and computer-readable storage medium, which aims to solve the problem of low accuracy of news recommendation results in the prior art.
[0005] In a first aspect, embodiments of this application provide a news recommendation method, which is implemented through a news recommendation model, the news recommendation model comprising a multi-feature encoding network, a multi-feature fusion network and a fully connected neural network connected in sequence;
[0006] The method includes:
[0007] Candidate news texts are preprocessed to obtain text features and boundary features, wherein the boundary features include at least one of the following: discrete boundary features and continuous boundary features;
[0008] Based on the multi-feature encoding network, the text features are encoded to obtain a text feature vector; and the boundary features are encoded to obtain a boundary feature vector.
[0009] Based on the multi-feature fusion network, the text feature vector and the boundary feature vector are fused to obtain a fused feature vector;
[0010] Based on the fully connected neural network, the user's interest in the candidate news text is determined according to the fused feature vector and the user feature vector, and whether to recommend the candidate news text to the user is determined according to the interest. The user feature vector is generated based on the user's browsing history.
[0011] Secondly, this application also provides a news recommendation device, which is equipped with a news recommendation model, the news recommendation model including a multi-feature encoding network, a multi-feature fusion network and a fully connected neural network connected in sequence;
[0012] The device includes:
[0013] A preprocessing unit is used to preprocess candidate news texts to obtain text features and boundary features, wherein the boundary features include at least one of the following: discrete boundary features and continuous boundary features;
[0014] A multi-feature encoding unit is used to encode the text features based on the multi-feature encoding network to obtain a text feature vector; and to encode the boundary features to obtain a boundary feature vector;
[0015] A multi-feature fusion unit is used to fuse the text feature vector and the boundary feature vector based on the multi-feature fusion network to obtain a fused feature vector;
[0016] The prediction unit is used to determine the user's interest in the candidate news text based on the fully connected neural network, according to the fused feature vector and the user feature vector, and to determine whether to recommend the candidate news text to the user based on the interest, wherein the user feature vector is generated based on the user's historical browsing records.
[0017] Thirdly, embodiments of this application also provide an electronic device, including: a processor; and a memory arranged to store computer-executable instructions, which, when executed, cause the processor to perform the steps of the above-described news recommendation method.
[0018] Fourthly, embodiments of this application also provide a computer-readable storage medium that stores one or more programs, which, when executed by an electronic device including multiple applications, cause the electronic device to perform the steps of the above-described news recommendation method.
[0019] The above-described technical solutions adopted in the embodiments of this application can achieve the following beneficial effects:
[0020] The news recommendation method provided in this application embodiment constructs a news recommendation model, preprocesses candidate news texts to obtain text features and boundary features, uses the model's multi-feature encoding network to encode the text features and boundary features to obtain text feature vectors and boundary feature vectors, then uses the model's multi-feature fusion network to fuse the text feature vectors and boundary feature vectors to obtain fused feature vectors, and finally uses the model's fully connected neural network to determine the user's interest in the candidate news texts based on the fused feature vectors and user feature vectors, and determines whether to recommend the candidate news texts to the user based on the interest. As can be seen, this application preprocesses the news text to obtain text features and boundary features, and encodes these features to obtain text feature vectors and boundary feature vectors. This approach considers both the textual information and the boundary information of the news. Since the boundary information reflects the popularity of the news and user preference, the text feature vectors and boundary feature vectors are fused. This not only considers the textual information of the news but also its timeliness and the interaction between the news and the user, making the news information represented by the fused feature vector more accurate and richer. This can greatly improve the accuracy of news recommendation results based on the fused feature vector, providing users with more precise news recommendations, thereby significantly increasing the click-through rate of recommended news and improving the user experience. Attached Figure Description
[0021] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0022] Figure 1 A flowchart illustrating a news recommendation method according to an embodiment of this application is shown;
[0023] Figure 2 A schematic diagram of the structure of a news recommendation model according to an embodiment provided in this application is shown;
[0024] Figure 3 A flowchart illustrating a news recommendation method according to another embodiment of this application is shown;
[0025] Figure 4 A schematic diagram of the structure of a news recommendation device according to an embodiment of the present application is shown;
[0026] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.
[0029] With the development of technology, people have gradually moved from an era of information scarcity to an era of information overload. To address this problem, personalized news recommendation technology has emerged in the news field, playing a crucial role in helping users find news of interest and improving their reading experience. In real-world scenarios, a news article often includes not only textual data but also boundary information reflecting its popularity, such as readership, clicks, saves, and likes. Current news recommendation methods primarily extract textual information from the news, matching and ranking textual features with user characteristics to obtain the final recommendation result. Existing technologies only consider the textual information of the news, ignoring the aforementioned boundary information, resulting in low accuracy of news recommendations and room for improvement in click-through rates.
[0030] Based on this, the present invention proposes a news recommendation method. The news recommendation method provided in this application preprocesses the news text to obtain text features and boundary features, and encodes the text features and boundary features to obtain text feature vectors and boundary feature vectors. This method considers both the textual information and the boundary information of the news. Since the boundary information reflects the popularity of the news and the user's preference, the text feature vector and the boundary feature vector are fused. The resulting fused feature vector represents the news information more accurately and richly, thereby greatly improving the accuracy of the news recommendation results obtained based on the fused feature vector, providing users with more precise news recommendations, and thus significantly increasing the click-through rate of recommended news and improving the user experience.
[0031] The present application will now be described in detail through specific embodiments.
[0032] Figure 1 This illustration shows a flowchart of a news recommendation method according to an embodiment provided in this application. Figure 1 It can be seen that this application includes at least steps S101 to S104:
[0033] Step S101: Preprocess the candidate news text to obtain text features and boundary features, wherein the boundary features include at least one of the following: discrete boundary features and continuous boundary features.
[0034] The news recommendation method in this application is based on a news recommendation model. Figure 2 This diagram illustrates the structure of a news recommendation model according to an embodiment of this application. Figure 2 As can be seen, the news recommendation model 200 includes a multi-feature encoding network 201, a multi-feature fusion network 202, and a fully connected neural network 203 connected in sequence.
[0035] The candidate news texts can fall into fields including, but are not limited to, finance, technology, entertainment, sports, international affairs, military, fashion, and gaming. Boundary features can be quantities that reflect news popularity and user engagement, including but not limited to continuous boundary features such as clicks, likes, comments, favorites, and click-through rate, as well as discrete boundary features such as timeliness information and author tags. Timeliness information refers to the difference between the current time and the news publication time.
[0036] In some embodiments, text cleaning, word segmentation, and word cleaning operations can be performed on the text information of candidate news texts to obtain text features; boundary information of candidate news texts can be extracted to obtain boundary features. For example, for candidate news text A "Text1; 100 clicks, 50 likes, 10 comments, 40 favorites", text1 of candidate news text A can first be cleaned, for example, by removing non-text content and filtering punctuation marks, to obtain cleaned text1. Then, text1 is segmented, for example, using a jieba word segmentation tool, to obtain multiple words. These multiple words are then cleaned, for example, by removing stop words and low-frequency words, to obtain text features. Boundary information of candidate news text A is extracted to obtain continuous boundary features: 100, 50, 10, 40. For example, for candidate news text B "Text 2; 100 clicks, 50 likes, 10 comments, 40 favorites, 2 minutes of timeliness information", the boundary information of candidate news text A is extracted to obtain continuous boundary features and discrete features: 100, 50, 10, 40, 2 minutes.
[0037] Step S102: Based on the multi-feature coding network, the text features are encoded to obtain a text feature vector; and the boundary features are encoded to obtain a boundary feature vector.
[0038] After obtaining the text features and boundary features, the text features can be encoded using a multi-feature encoding network to obtain a text feature vector. For example, in some embodiments, if the text features of a news article include six words such as: Qin Shi Huang, imperial mausoleum, reclining terracotta warrior, craftsman, for, and teenagers, then a word vector matrix E can be constructed. t The vector representations of the words are obtained, resulting in text feature vectors e1, e2, e3, e4, e5, and e6. Among them, E... t ∈R Vt×d V t d represents the word list dimension, and d represents the word vector dimension. This application does not limit the word list vector dimension and the word vector dimension.
[0039] Boundary features can be encoded using a multi-feature coding network to obtain a boundary feature vector. For example, in some embodiments of this application, the boundary features in the above method include discrete boundary features and continuous boundary features; encoding the boundary features to obtain the boundary feature vector includes: classifying the discrete boundary features to obtain a discrete boundary vector; normalizing and vectorizing the continuous boundary features to obtain a continuous boundary vector; and using the discrete boundary vector and the continuous boundary vector as the boundary feature vector.
[0040] In this embodiment, discrete boundary features can be classified to obtain discrete boundary vectors. Specifically, in some embodiments, such as in a news scenario, each news item typically has discrete boundary features: timeliness information. A label matrix E can be constructed by first statistically analyzing all categories of discrete boundary features, such as 1 minute, 5 minutes, 1 hour, 1 day, etc. s E s ∈R Vs×d Among them, V s d represents the number of categories of the discrete boundary feature, and d represents the dimension of the discrete boundary vector. For example, if the timeliness information of a news item is 1 minute, then the discrete boundary vector [1, 0, 0, 0] can be obtained from the tag matrix.
[0041] For continuous boundary features, they can be normalized and vectorized to obtain continuous boundary vectors. Specifically, in some embodiments, for continuous boundary features, such as the number of likes on a news article, the continuous boundary feature can be normalized to the range [0, 1] by counting the total number of likes on all training texts used in training the news recommendation model. For example, if the number of likes on candidate news text A in step S101 is 50 and the total number of likes on all training texts is 500, then the normalized value of the continuous boundary feature is 0.1. Then, this value can be vectorized. For example, 0.1 can be multiplied by a randomly initialized vector of dimension d and modulus 1. For example, if d is 2, then the continuous boundary vector corresponding to the continuous boundary feature is [0.1, 0].
[0042] Finally, discrete boundary vectors and continuous boundary vectors are used as boundary feature vectors.
[0043] Step S103: Based on the multi-feature fusion network, the text feature vector and the boundary feature vector are fused to obtain a fused feature vector.
[0044] Based on a multi-feature fusion network, text feature vectors and boundary feature vectors can be fused to obtain a fused feature vector. For example, in some embodiments, text feature vectors and boundary feature vectors can be concatenated to obtain a fused feature vector.
[0045] Traditional news recommendation methods do not consider the correlation between the text features and boundary features of news. Therefore, the resulting fused feature vector has slightly lower accuracy in describing news features. In order to further improve the accuracy of prediction results, in some embodiments of this application, an attention mechanism can be introduced into the multi-feature fusion network. The attention mechanism can focus on the information that is more critical to the current task from a large amount of input information, reduce the attention to other information, and even filter out irrelevant information, which can solve the problem of information overload and improve the efficiency and accuracy of task processing.
[0046] Specifically, in some embodiments of this application, in the above method, fusing the text feature vector and the boundary feature vector based on the multi-feature fusion network to obtain a fused feature vector includes: determining the square of each element in the text feature vector and the boundary feature vector to obtain the intermediate value corresponding to each element; normalizing each intermediate value to obtain the weight corresponding to each element; determining the product of the element value of each element and the corresponding weight to obtain multiple intermediate vectors; and determining the cumulative value of each intermediate vector to obtain the fused feature vector.
[0047] In this embodiment, the square of each element in the text feature vector and the boundary feature vector can be determined to obtain the intermediate value corresponding to each element; the intermediate value is normalized to obtain the weight corresponding to each element; the product of the element value of each element and the corresponding weight is determined to obtain multiple intermediate vectors; the cumulative value of each intermediate vector is determined to obtain the fused feature vector.
[0048] Let the text feature vector and the boundary feature vector be {e1, e2, ..., e...} p ,e p+1 ,e p+2 …,e p+q}, where e1, e2, ..., e p e is the text feature vector. p+1 ,e p+2 …,e p+q This is the boundary feature vector. The following uses e1 as an example to illustrate the process of generating the intermediate vector corresponding to e1.
[0049] First, the squares of each element in the text feature vector and the boundary feature vector can be determined to obtain the intermediate value of each element. For example, the intermediate value can be determined according to the following formula (1):
[0050] α' kz =e k *e z Equation (1);
[0051] Among them, e k e z For {e1,e2,…,e p ,e p+1 ,e p+2 …,e p+q The elements in}. Let k = z, then we can get the intermediate value of each element. For example, for e1, let k = z = e1, then according to formula (1), we can get the intermediate value of e1 as e1. 2 .
[0052] Then, the intermediate values are normalized to obtain the weights corresponding to each element. For example, the weights can be determined according to the following formula (2):
[0053]
[0054] For example, for element e1, for the intermediate value e1 2 After normalization, according to the above formula (1), exp(α' kk ) is exp(e1 2 ), For exp(e1) 2)+exp(e1*e2)+exp(e1*e3)+…+exp(e1*e p+q According to formula (2), the weight α1 is calculated.
[0055] Finally, the product of the element value and the corresponding weight of each element is determined to obtain multiple intermediate vectors; the cumulative value of each intermediate vector is determined to obtain the fused feature vector. For example, the fused feature vector can be determined according to the following formula (3):
[0056]
[0057] For example, element e1 can be multiplied by its corresponding weight α1 to obtain the intermediate vector 1 corresponding to e1. Similarly, according to the above formulas (1), (2), and (3), we can obtain e2, ..., e p ,e p+1 ,e p+2 …,e p+q The corresponding intermediate vectors are 2, 3, ..., p+q. The fused feature vector F is obtained by summing these intermediate vectors. ij .
[0058] As can be seen from the above embodiments, by introducing an attention mechanism, the text feature vector and boundary feature vector of the news are fused, and the correlation between the two types of features is fully considered, so as to more accurately capture the key points of the news and obtain a more accurate fused feature vector for the news. This makes the news recommendation results obtained by using the fused feature vector more in line with the user's preferences, thereby greatly improving the click-through rate of the recommended news.
[0059] Step S104: Based on the fully connected neural network, determine the user's interest in the candidate news text according to the fused feature vector and the user feature vector, and determine whether to recommend the candidate news text to the user based on the interest. The user feature vector is generated based on the user's historical browsing records.
[0060] In this embodiment, the user feature vector is generated based on the user's browsing history. For example, in some embodiments, the user's browsing history can be input into the user encoding neural network to obtain the user feature vector. In other embodiments, the user's own characteristics, such as age group, gender, occupation, etc., can be input into the user encoding neural network along with the user's browsing history to obtain the user feature vector.
[0061] After obtaining the fused feature vector and the user feature vector, they can be input into a fully connected neural network, such as a multilayer perceptron, to obtain the user's interest level in candidate news texts. Based on this interest level, it can be determined whether to recommend candidate news texts to the user. In other embodiments, the fused feature vector can be multiplied by the user feature vector to obtain the interest level in candidate news texts, and then the decision to recommend candidate news texts to the user can be made based on this interest level.
[0062] In some embodiments of this application, in the above method, determining the user's interest in the candidate news text based on the fully connected neural network, according to the fused feature vector and the user feature vector, and determining whether to recommend the candidate news text to the user based on the interest, includes: inputting the fused feature vector and the user feature vector into the fully connected neural network to obtain the user's interest in the candidate news text; if the interest is greater than or equal to a preset threshold, then determining to recommend the candidate news text to the user; if the interest is less than the preset threshold, then determining not to recommend the candidate news text to the user.
[0063] In this embodiment, the fused feature vector and the user feature vector can be input into a fully connected neural network to obtain the user's interest level in candidate news texts. Then, based on this interest level and a preset threshold, it is determined whether to recommend the candidate news text to the user. For example, the fused feature vector and the user feature vector can be input into a fully connected neural network to obtain the user's interest level in candidate news texts. For instance, if the preset threshold is 80, and the interest level is 95, which is greater than the preset threshold, it indicates that the user has a relatively high level of interest in the candidate news text, and the candidate news text can be recommended to the user; if the interest level is 80, which is equal to the preset threshold, it indicates that the user has a relatively high level of interest in the candidate news text, and the candidate news text can be recommended to the user; if the interest level is 75, which is less than the preset threshold, it indicates that the user has a relatively low level of interest in the candidate news text, and the candidate news text can not be recommended to the user. The preset threshold can be set according to actual needs; this is only an example.
[0064] from Figure 1As can be seen from the method shown, the news recommendation method provided in this application embodiment constructs a news recommendation model, preprocesses candidate news texts to obtain text features and boundary features, uses the model's multi-feature encoding network to encode the text features and boundary features to obtain text feature vectors and boundary feature vectors, then uses the model's multi-feature fusion network to fuse the text feature vectors and boundary feature vectors to obtain fused feature vectors, and finally uses the model's fully connected neural network to determine the user's interest in the candidate news texts based on the fused feature vectors and user feature vectors, and determines whether to recommend the candidate news texts to the user based on the interest. As can be seen, this application preprocesses the news text to obtain text features and boundary features, and encodes these features to obtain text feature vectors and boundary feature vectors. This approach considers both the textual information and the boundary information of the news. Since the boundary information reflects the popularity of the news and user preference, the text feature vectors and boundary feature vectors are fused. This not only considers the textual information of the news but also its timeliness and the interaction between the news and the user, making the news information represented by the fused feature vector more accurate and richer. This can greatly improve the accuracy of news recommendation results based on the fused feature vector, providing users with more precise news recommendations, thereby significantly increasing the click-through rate of recommended news and improving the user experience.
[0065] In some embodiments of this application, the candidate news texts in the above method include multiple texts; the method further includes: inputting the multiple candidate news texts and the user feature vector into the news recommendation model respectively to obtain multiple degrees of interest; sorting the multiple candidate news texts in descending order according to the magnitude of the multiple degrees of interest to obtain a sorting result; and determining the user's news recommendation list based on the sorting result.
[0066] Multiple candidate news texts and user feature vectors can be input into a news recommendation model to obtain multiple levels of interest. The candidate news texts are then sorted in descending order according to the magnitude of the multiple levels of interest to obtain the ranking result. Based on the ranking result, the user's news recommendation list is determined.
[0067] For example, in some embodiments, assuming there are candidate news text 1, candidate news text 2, candidate news text 3, and candidate news text 4, then candidate news text 1 and the user feature vector can be input into the news recommendation model to obtain the user's interest level 1 for candidate news text 1; candidate news text 2 and the user feature vector can be input into the news recommendation model to obtain the user's interest level 2 for candidate news text 2; candidate news text 3 and the user feature vector can be input into the news recommendation model to obtain the user's interest level 3 for candidate news text 3; and candidate news text 4 and the user feature vector can be input into the news recommendation model to obtain the user's interest level 4 for candidate news text 4. If the value of interest level 1 is 80, the value of interest level 2 is 95, the value of interest level 3 is 98, and the value of interest level 4 is 89, then sorting the candidate news texts in descending order according to the magnitude of the interest level will yield the following sorting result: candidate news text 3, candidate news text 2, candidate news text 4, and candidate news text 1. If a user's news recommendation list is set to include 3 recommended news texts, then candidate news text 3, candidate news text 2, and candidate news text 4 constitute the user's news recommendation list.
[0068] In other embodiments, within a digital healthcare scenario, news in the medical field can be recommended to users. This news can be categorized into several types, such as medical devices, pharmaceuticals, biological products, health supplements and nutritional foods, physical examinations, diagnosis and treatment, medical insurance, medical companionship, and overseas medical care. Multiple candidate news texts related to healthcare, along with at least one historical news text from the user, can be input into a news recommendation model to obtain multiple levels of interest. These candidate news texts are then sorted in descending order according to the magnitude of their interest levels to obtain a ranking result. Based on this ranking result, a news recommendation list for the user is determined.
[0069] In some embodiments of this application, in the above method, the news recommendation model is trained according to the following method: constructing a training sample set; wherein the training sample set includes multiple sets of user data and corresponding sample labels, wherein the user data is a historical recommended news list containing multiple historical recommended news texts, and the sample labels are whether the user clicked on the corresponding historical recommended news text; obtaining an initial news recommendation model; inputting the training sample set into the initial news recommendation model to obtain multiple interest prediction values; based on the multiple interest prediction values and sample labels, according to a preset logistic regression loss function, training the initial news recommendation model multiple times to obtain a news recommendation model.
[0070] First, a training sample set is constructed. The training sample set contains multiple sets of user data and corresponding sample labels. The user data is a list of historical recommended news articles containing multiple historical recommended news texts, and the sample labels are whether the user clicked on the corresponding historical recommended news text.
[0071] Specifically, in some embodiments, the above training sample set can be expressed as D = {(u1, r1), ..., (u i ,r i ),…,(u n ,r n ),},r i =[(x i1 ,y i1 ),…,((x ij ,y ij )...,(x im ,y im ]], where n represents the number of users in the training sample set D, u i Let r represent the i-th user in the training sample set D. i Indicates user u i The historical recommended news list, i.e., using u i The user data corresponding to the household, m represents the number of news items in the historical recommended news list, x ij Indicates user u i The j-th historical recommended news text. ij For the sample label, y ij A value of 1 indicates that user u i Clicked on the j-th historical recommended news text x ij ;y ij A value of 0 indicates that user u i No clicks were made on the j-th historical recommended news text. ij .
[0072] In implementation, the 10 most recent news recommendation records from 20,333 users can be selected as the initial training corpus for the training sample set. Since the obtained historical news recommendation texts contain a large number of useless characters, such as book titles, repeated punctuation marks used as decoration, spaces, and link symbols, these useless characters need to be filtered out first.
[0073] After removing invalid characters from each historical recommended news text in the initial training sample set, the removed historical recommended news texts can be segmented to obtain the final training sample set. Specifically, in some embodiments, segmentation tools such as Pangu Segmentation, Yaha Segmentation, Jieba Segmentation, and Tsinghua THULAC can be used to segment each historical recommended news text, obtaining the processed historical recommended news texts, and thus the aforementioned training sample set.
[0074] Obtain the initial model for news recommendation. See also Figure 2 As shown, specifically, in some embodiments, it is possible to... Figure 2 The parameters of the news recommendation model are initialized to obtain the initial news recommendation model. The training sample set is input into the initial news recommendation model to obtain multiple interest prediction values. Based on the multiple interest prediction values and sample labels, the initial news recommendation model is trained multiple times according to the logistic regression loss function to obtain the news recommendation model.
[0075] Specifically, in some embodiments, the training sample set may include: user data 1 and sample label 1, user data 2 and sample label 2, user data 2 and sample label 2, ..., user data N and sample label N, where N is the number of samples in the training sample set. User data 1 can be input into the initial news recommendation model to obtain an interest prediction value 1. Based on a logistic regression loss function, such as a cross-entropy loss function, and the interest prediction value 1 and sample label 1, the parameters in the initial news recommendation model are updated to obtain news recommendation model 1.
[0076] Then, user data 2 is input into news recommendation model 1 to obtain interest prediction value 2. Based on the cross-entropy loss function, the parameters in news recommendation model 1 are updated according to interest prediction value 2 and sample label 2 to obtain news recommendation model 2. Similarly, user data x is input into news recommendation model x-1 to obtain the final news recommendation model, where x is 3, 4, 5, ..., N.
[0077] In other embodiments, a loss threshold can be set, and the predicted value of interest and the corresponding sample label can be substituted into the logistic regression loss function to obtain the loss value. If the loss value is less than the loss threshold, the training of the model is completed, and the final news recommendation model is obtained.
[0078] Figure 3 This illustration shows a flowchart of a news recommendation method according to another embodiment provided in this application. Figure 3 As can be seen, the news recommendation method in this embodiment includes the following steps S301 to S317:
[0079] Step S301: Construct a training sample set. The training sample set contains multiple sets of user data and corresponding sample labels. The user data is a list of historical recommended news articles containing multiple historical recommended news texts, and the sample labels are whether the user clicked on the corresponding historical recommended news text.
[0080] Step S302: Obtain the initial news recommendation model. The initial news recommendation model consists of a multi-feature encoding network, a multi-feature fusion network, and a fully connected neural network connected in sequence, wherein the multi-feature fusion network is formed based on an attention mechanism.
[0081] Step S303: Input the training sample set into the news recommendation initial model to obtain multiple interest prediction values.
[0082] Step S304: Based on multiple predicted interest values and sample labels, the initial news recommendation model is trained multiple times according to the preset logistic regression loss function to obtain the news recommendation model.
[0083] Step S305: Preprocess the candidate news texts to obtain text features, discrete boundary features, and continuous boundary features.
[0084] Step S306: Encode the text features based on the multi-feature coding network to obtain the text feature vector.
[0085] Step S307: Classify the discrete boundary features to obtain discrete boundary vectors.
[0086] Step S308: Normalize and vectorize the continuous boundary features to obtain the continuous boundary vector.
[0087] Step S309: Use the discrete boundary vector and the continuous boundary vector as boundary feature vectors.
[0088] Step S310: Determine the square of each element in the text feature vector and the boundary feature vector to obtain the intermediate value corresponding to each element.
[0089] Step S311: Normalize each intermediate value to obtain the weight corresponding to each element.
[0090] Step S312: Determine the product of the element value and the corresponding weight of each element to obtain multiple intermediate vectors.
[0091] Step S313: Determine the cumulative value of each intermediate vector to obtain the fused feature vector.
[0092] Step S314: Input the fused feature vector and the user feature vector into a fully connected neural network to obtain the user's interest level in the candidate news texts. In practice, steps S305 to S314 can be repeated to obtain multiple interest levels; the candidate news texts are then sorted in descending order according to the magnitude of the interest levels to obtain the ranking result; based on the ranking result, the user's news recommendation list is determined.
[0093] Step S315: Determine whether the interest level is greater than or equal to the preset threshold. If yes, proceed to step S316; otherwise, proceed to step S317.
[0094] Step S316: Determine which candidate news texts to recommend to the user.
[0095] Step S317: Determine not to recommend candidate news texts to the user.
[0096] Figure 4 This diagram illustrates the structure of a news recommendation device according to an embodiment of the present application. The news recommendation device is equipped with a news recommendation model, the structure of which can be referenced. Figure 2 The device includes:
[0097] The preprocessing unit 401 is used to preprocess the candidate news text to obtain text features and boundary features, wherein the boundary features include at least one of the following: discrete boundary features and continuous boundary features.
[0098] The multi-feature encoding unit 402 is used to encode the text features based on the multi-feature encoding network to obtain a text feature vector; and to encode the boundary features to obtain a boundary feature vector.
[0099] The multi-feature fusion unit 403 is used to fuse the text feature vector and the boundary feature vector based on the multi-feature fusion network to obtain a fused feature vector.
[0100] The prediction unit 404 is used to determine the user's interest in the candidate news text based on the fully connected neural network, according to the fused feature vector and the user feature vector, and to determine whether to recommend the candidate news text to the user based on the interest, wherein the user feature vector is generated based on the user's historical browsing records.
[0101] In some embodiments of this application, in the above-described apparatus, the boundary features include discrete boundary features and continuous boundary features; the multi-feature encoding unit 402 is used to classify the discrete boundary features to obtain discrete boundary vectors; to normalize and vectorize the continuous boundary features to obtain continuous boundary vectors; and to use the discrete boundary vectors and the continuous boundary vectors as the boundary feature vectors.
[0102] In some embodiments of this application, in the above-described apparatus, the multi-feature fusion unit 403 is used to determine the square of each element in the text feature vector and the boundary feature vector to obtain the intermediate value corresponding to each element; to normalize each intermediate value to obtain the weight corresponding to each element; to determine the product of the element value of each element and the corresponding weight to obtain multiple intermediate vectors; and to determine the cumulative value of each intermediate vector to obtain the fused feature vector.
[0103] In some embodiments of this application, in the above-described apparatus, the prediction unit 404 is used to input the fused feature vector and the user feature vector into the fully connected neural network to obtain the user's interest in the candidate news text; if the interest is greater than or equal to a preset threshold, then the candidate news text is recommended to the user; if the interest is less than the preset threshold, then the candidate news text is not recommended to the user.
[0104] In some embodiments of this application, the multi-feature fusion network in the above-described apparatus is formed based on an attention mechanism.
[0105] In some embodiments of this application, the above-mentioned apparatus further includes a list generation unit; the candidate news texts include multiple ones; the list generation unit is used to input the multiple candidate news texts and the user feature vector into the news recommendation model respectively to obtain multiple degrees of interest; sort the multiple candidate news texts in descending order according to the magnitude of the multiple degrees of interest to obtain a sorting result; and determine the news recommendation list of the user based on the sorting result.
[0106] In some embodiments of this application, the above-mentioned apparatus further includes a training unit, which is used to construct a training sample set; wherein the training sample set includes multiple sets of user data and corresponding sample labels, wherein the user data is a historical recommended news list containing multiple historical recommended news texts, and the sample labels are whether the user clicked on the corresponding historical recommended news text; obtain an initial news recommendation model; input the training sample set into the initial news recommendation model to obtain multiple interest prediction values; based on the multiple interest prediction values and sample labels, and according to a preset logistic regression loss function, train the initial news recommendation model multiple times to obtain a news recommendation model.
[0107] It should be noted that any of the above-mentioned news recommendation devices can implement the aforementioned news recommendation method one by one, which will not be elaborated here.
[0108] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of this application is shown. Figure 5As shown, at the hardware level, this electronic device includes a processor, and optionally also includes an internal bus, a network interface, and memory. The memory may include main memory, such as high-speed random-access memory (RAM), or it may include non-volatile memory, such as at least one disk drive. Of course, this electronic device may also include other hardware required for other business operations.
[0109] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 5 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0110] Memory is used to store programs. Specifically, programs may include program code, which includes computer operation instructions. Memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0111] The processor reads the corresponding computer program from non-volatile memory into main memory and then runs it, forming a news recommendation device at the logical level. The processor executes the program stored in memory and specifically performs the aforementioned methods.
[0112] The processor may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above method.
[0113] The electronic device can execute the news recommendation method provided in several embodiments of this application, and is implemented as a news recommendation device. Figure 4 The functions of the embodiments shown are not described in detail here.
[0114] This application also proposes a computer-readable storage medium that stores one or more programs, the programs including instructions that, when executed by an electronic device including multiple applications, enable the electronic device to perform the news recommendation method provided in several embodiments of this application.
[0115] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0116] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0117] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0118] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0119] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0120] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0121] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0122] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0123] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0124] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A news recommendation method, characterized in that, The method is implemented through a news recommendation model, which includes a multi-feature encoding network, a multi-feature fusion network, and a fully connected neural network connected in sequence. The method includes: Candidate news texts are preprocessed to obtain text features and boundary features, wherein the boundary features include at least one of the following: discrete boundary features and continuous boundary features; wherein, the boundary features are quantities that can reflect the popularity of the news and the user's liking; continuous boundary features include: number of clicks, number of likes, number of comments, number of favorites, and click rate; discrete boundary features include: timeliness information and author tags; Based on the multi-feature encoding network, the text features are encoded to obtain a text feature vector; and the boundary features are encoded to obtain a boundary feature vector. Based on the multi-feature fusion network, the text feature vector and the boundary feature vector are fused to obtain a fused feature vector; Based on the fully connected neural network, the user's interest in the candidate news text is determined according to the fused feature vector and the user feature vector, and whether to recommend the candidate news text to the user is determined according to the interest. The user feature vector is generated based on the user's browsing history. The boundary features include discrete boundary features and continuous boundary features; encoding the boundary features to obtain a boundary feature vector includes: The discrete boundary features are classified to obtain discrete boundary vectors; The continuous boundary features are normalized and vectorized to obtain continuous boundary vectors; The discrete boundary vector and the continuous boundary vector are used as the boundary feature vector; The process of fusing the text feature vector and the boundary feature vector based on the multi-feature fusion network to obtain a fused feature vector includes: The square of each element in the text feature vector and the boundary feature vector is determined to obtain the median value of each element; The intermediate values are normalized to obtain the weights corresponding to each element; Determine the product of the element value and the corresponding weight of each element to obtain multiple intermediate vectors; The cumulative value of each intermediate vector is determined to obtain the fused feature vector.
2. The method according to claim 1, characterized in that, The step of determining the user's interest in the candidate news text based on the fully connected neural network, according to the fused feature vector and the user feature vector, and determining whether to recommend the candidate news text to the user based on the interest, includes: The fused feature vector and the user feature vector are input into the fully connected neural network to obtain the user's interest in the candidate news text; If the interest level is greater than or equal to a preset threshold, then the candidate news text is recommended to the user. If the interest level is less than the preset threshold, then it is determined that the candidate news text will not be recommended to the user.
3. The method according to claim 1, characterized in that, The multi-feature fusion network is formed based on the attention mechanism.
4. The method according to claim 1, characterized in that, The candidate news texts include multiple texts; The method further includes: Multiple candidate news texts are input into the news recommendation model along with the user feature vector to obtain multiple degrees of interest. The candidate news texts are sorted in descending order according to the magnitude of interest to obtain the sorting result. Based on the sorting results, the user's news recommendation list is determined.
5. The method according to any one of claims 1 to 4, characterized in that, The news recommendation model was trained using the following method: Construct a training sample set; wherein the training sample set contains multiple sets of user data and corresponding sample labels, wherein the user data is a list of historical recommended news containing multiple historical recommended news texts, and the sample labels are whether the user clicked on the corresponding historical recommended news text; Obtain the initial model for news recommendation; The training sample set is input into the initial news recommendation model to obtain multiple interest prediction values; Based on the multiple predicted interest values and sample labels, the initial news recommendation model is trained multiple times according to a preset logistic regression loss function to obtain the news recommendation model.
6. A news recommendation device, characterized in that, The device is equipped with a news recommendation model, which includes a multi-feature encoding network, a multi-feature fusion network, and a fully connected neural network connected in sequence. The device includes: The preprocessing unit is used to preprocess the candidate news text to obtain text features and boundary features, wherein the boundary features include at least one of the following: discrete boundary features and continuous boundary features; wherein, the boundary features are quantities that can reflect the popularity of the news and the user's liking; continuous boundary features include: number of clicks, number of likes, number of comments, number of favorites, and click rate; discrete boundary features include: timeliness information and author tags; A multi-feature encoding unit is used to encode the text features based on the multi-feature encoding network to obtain a text feature vector; and to encode the boundary features to obtain a boundary feature vector; A multi-feature fusion unit is used to fuse the text feature vector and the boundary feature vector based on the multi-feature fusion network to obtain a fused feature vector; The prediction unit is used to determine the user's interest in the candidate news text based on the fully connected neural network, according to the fused feature vector and the user feature vector, and to determine whether to recommend the candidate news text to the user based on the interest, wherein the user feature vector is generated based on the user's historical browsing records; The boundary features include discrete boundary features and continuous boundary features; the multi-feature encoding unit is used to classify the discrete boundary features to obtain discrete boundary vectors; to normalize and vectorize the continuous boundary features to obtain continuous boundary vectors; and to use the discrete boundary vectors and the continuous boundary vectors as the boundary feature vectors. The multi-feature fusion unit is used to determine the square of each element in the text feature vector and the boundary feature vector to obtain the intermediate value corresponding to each element; normalize each intermediate value to obtain the weight corresponding to each element; determine the product of the element value of each element and the corresponding weight to obtain multiple intermediate vectors; and determine the cumulative value of each intermediate vector to obtain the fused feature vector.
7. An electronic device, comprising: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the steps of the news recommendation method as described in any one of claims 1 to 5.
8. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the steps of the news recommendation method as described in any one of claims 1 to 5.