A news recommendation method, electronic device, and storage medium
By constructing a candidate news set and combining it with an event knowledge graph and an attention mechanism, the problem of relying on users' historical behavior data in news recommendation is solved, thereby improving the diversity and accuracy of news recommendations and meeting users' personalized needs.
Patent Information
- Application Number
- CN202411434652.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2026-01-06
- Estimated Expiration
- 2044-10-15
AI Technical Summary
Existing news recommendation technologies rely excessively on user attribute features and behavioral data, neglecting the deeper information in news content. This leads to homogenized recommendation results and data sparsity, making it difficult to meet users' personalized needs, and the potential value of event knowledge graphs has not been fully utilized.
By acquiring news and user features from news databases, and utilizing user similarity, news similarity, co-occurring entity word frequency, and user interest areas, a candidate news set is constructed. Then, by updating news and user features, and combining event knowledge graphs and attention mechanisms, a recommendation value is calculated to recommend candidate news.
It improves the diversity and accuracy of news recommendations, enhances the ability to capture users' immediate needs and potential interests, overcomes the problem of the singularity of traditional recommendation algorithms, and achieves news recommendations that are more in line with users' interests.
Smart Images

Figure CN119357469B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of natural language processing, and in particular to a news recommendation method, electronic device, and storage medium. Background Technology
[0002] With the continuous advancement and popularization of artificial intelligence technology, recommender systems are gradually moving from traditional single-dimensional methods such as collaborative filtering and content filtering to a new stage driven and empowered by knowledge. The core of this transformation lies in deeply integrating information from knowledge graphs into the recommender system through knowledge representation learning techniques, enhancing the system's ability to understand user intent and thus generating more accurate and tailored recommendation lists. However, current news recommendation technologies generally rely excessively on user attribute characteristics and behavioral data, neglecting the effective mining of the deeper, potential information inherent in the news content itself. This model limits the comprehensive insight of recommendation algorithms into user interests, easily leading to data sparsity challenges and homogenized recommendation results, making it difficult to meet users' growing personalized needs. Meanwhile, although event knowledge graphs, as a cutting-edge technology for information organization and representation, possess powerful knowledge integration and reasoning capabilities, their relatively new concept and limited practical application scenarios have prevented the full release and utilization of their rich potential value. Summary of the Invention
[0003] To address the aforementioned technical problems, the technical solution adopted by this invention is as follows:
[0004] According to a first aspect of the present invention, a news recommendation method is provided, the method comprising the following steps:
[0005] S100, Obtain the initial news features of each news item in the news database, wherein the initial news features include the corresponding news entity features and news text features.
[0006] S200: Obtain the user corresponding to the news database, and obtain the corresponding initial user features based on the initial news features of the news that the user is interested in.
[0007] S300: Based on user-to-user similarity, user-to-news similarity, news-to-news similarity, co-occurrence word frequency, and user-interest areas, obtain news that users may be potentially interested in from the news database as candidate news, and form a candidate news set.
[0008] S400, update the initial news features to obtain updated news features as updated news features, and update the corresponding initial user features based on the updated news features to obtain updated user features as updated user features.
[0009] S500 obtains the recommendation value corresponding to the candidate news based on the updated user features and the updated news features of the corresponding candidate news.
[0010] S600 selects candidate news items with a recommendation value greater than the preset recommendation value from the candidate news set as recommended news items and recommends them to the corresponding users.
[0011] According to a second aspect of the present invention, an electronic device is provided, including a processor and a memory; the processor executes the steps of the method described in the first aspect of the present invention by invoking a program or instructions stored in the memory.
[0012] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, the non-transitory computer-readable storage medium storing a program or instructions that cause a computer to perform the steps of the method described in the first aspect of the present invention.
[0013] The present invention has at least the following beneficial effects:
[0014] The news recommendation method provided in this invention obtains a set of candidate news that users may be interested in from the news database based on multiple perspectives, such as user-to-user similarity, user-to-news similarity, news-to-news similarity, co-occurrence word frequency, and user-interest areas, thereby increasing the diversity of news recommendations.
[0015] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart of a news recommendation method provided in an embodiment of the present invention. Detailed Implementation
[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of this invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0020] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of these steps can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the steps can be rearranged. A process can be terminated when its operation is complete, but it may also have additional steps not included in the figures. A process can correspond to a method, function, procedure, subroutine, subroutine, etc.
[0021] This invention provides a news recommendation method, such as... Figure 1 As shown, the method includes the following steps:
[0022] S100, Obtain the initial news features of each news item in the news database, wherein the initial news features include the corresponding news entity features and news text features.
[0023] S200: Obtain the user corresponding to the news database, and obtain the corresponding initial user features based on the initial news features of the news that the user is interested in.
[0024] S300: Based on user-to-user similarity, user-to-news similarity, news-to-news similarity, co-occurrence word frequency, and user-interest areas, obtain news that users may be potentially interested in from the news database as candidate news, forming a candidate news set, i.e., the candidate news set includes several candidate news items.
[0025] S400, the initial news features are updated based on the initial news features and news entity features to obtain the updated news features as the updated news features, and the corresponding initial user features are updated based on the updated news features to obtain the updated user features as the updated user features.
[0026] S500: Based on the updated user features and the updated news features of the corresponding candidate news, the recommendation value corresponding to the candidate news is obtained.
[0027] S600 selects candidate news items with a recommendation value greater than the preset recommendation value from the candidate news set as recommended news items and recommends them to the corresponding users.
[0028] The news recommendation method provided in this invention obtains a set of candidate news that users may be interested in from the news database based on multiple perspectives, such as user-to-user similarity, user-to-news similarity, news-to-news similarity, co-occurrence word frequency, and user-interest areas, thereby increasing the diversity of news recommendations.
[0029] In this embodiment of the invention, news from the news database can be obtained through web crawlers.
[0030] Furthermore, in this embodiment of the invention, S100 may specifically include:
[0031] S101, Obtain the text features corresponding to each news item in the news database as news text features.
[0032] In this embodiment of the invention, news text features can be obtained based on a trained Roformer-sim model. Specifically, by inputting the news text into the trained Roformer-sim model, the corresponding news text features can be obtained.
[0033] S102, obtain the entity corresponding to each news item in the news database, and obtain the initial entity features of each entity corresponding to each news item.
[0034] S103, based on the position, word frequency and corresponding entity category of each entity in each news article in the news database, generate the corresponding position code, word frequency code and category code for the entity.
[0035] In this embodiment of the invention, position refers to whether an entity appears in the title or summary of a news article. If an entity appears in both the title and summary, the title takes precedence. In an illustrative embodiment, if an entity appears in the title of a news article, the corresponding position code can be 1; if the entity appears in the summary of a news article, the corresponding position code can be 2.
[0036] In this embodiment of the invention, the word frequency encoding can be the corresponding word frequency. For example, if the word frequency of a certain entity is 10, then the corresponding word frequency encoding is 10. In one embodiment, the upper limit of the word frequency encoding can be set to 20, that is, if the word frequency of a certain entity is greater than 20, then the corresponding word frequency encoding is 20.
[0037] In this embodiment of the invention, different entity categories may have different codes, which can be user-defined values. For example, they may include social, educational, political, economic, military, scientific and technological, sports, cultural, entertainment, tourism, and others.
[0038] S104, the initial entity features, position codes, word frequency codes and category codes of each entity in each news item in the news database are fused to obtain the features of each entity relative to the corresponding news item, which are used as the entity fusion features of that entity.
[0039] S105, fuse all entity fusion features corresponding to each news item in the news database to obtain the corresponding news entity features, and fuse the corresponding news entity features and the corresponding news text features to obtain the corresponding initial news features.
[0040] In this embodiment of the invention, fusion refers to a splicing operation.
[0041] Furthermore, in this embodiment of the invention, in S102, the entities in the news can be identified based on an entity recognition model.
[0042] In one illustrative embodiment, the entities in the news can be entities in an open-source event graph or an open-source knowledge graph. In another illustrative embodiment, the entities in the news can be entities in an event knowledge graph constructed based on the event graph and the knowledge graph. Preferably, the entities in the news are entities in an event knowledge graph.
[0043] In this embodiment of the invention, the initial entity features of an entity in the news can be the feature vector of that entity in the target graph. The target graph can be an event graph, a knowledge graph, or an event knowledge graph.
[0044] In this embodiment of the invention, an event knowledge graph can be constructed using the following method:
[0045] S1, construct an event graph based on the source text dataset.
[0046] In this embodiment of the invention, the source text data may be text data obtained through web crawling. In one illustrative embodiment, the source text data may be news text data.
[0047] Furthermore, S1 may specifically include:
[0048] S11, preprocess the source text dataset to obtain data containing events, which serves as a candidate dataset.
[0049] The purpose of S11 is to remove redundant information in the source text data that does not contain events, so as to reduce noise interference and improve the accuracy of event extraction.
[0050] In this embodiment of the invention, the event format is <event type, trigger word, event element>.
[0051] In this embodiment of the invention, the event type is determined based on the content contained in the event, the trigger word is the verb in the event, and the event element is the noun in the event. For example, for the event "Meeting A is held in location B", the corresponding event type is "Meeting unfolds", "held" is the trigger word, and the event elements are "Meeting A" and "location B".
[0052] Furthermore, S11 may specifically include:
[0053] S111, the source text dataset is segmented to obtain multiple corresponding paragraphs.
[0054] As those skilled in the art will know, any method of segmenting text falls within the scope of protection of this invention, such as segmenting according to punctuation marks or length in the text.
[0055] S112, input each paragraph into the preset event type recognition model. If the corresponding event type is obtained, add the paragraph as a candidate paragraph to the current candidate paragraph set.
[0056] The initial value of the current candidate paragraph set is empty. As those skilled in the art will know, if a paragraph does not have an event type identified, it will not be added to the current candidate paragraph set.
[0057] S113, input any candidate paragraph from the current candidate paragraph set into the preset event recognition model. If the recognition result indicates that the candidate paragraph contains an event, use the candidate paragraph as data containing the event; and obtain the candidate dataset.
[0058] In this embodiment of the invention, both the preset event type recognition model and the preset event recognition model are trained mT5 models. In one embodiment of the invention, the mT5 model can be trained using the full version of the ACE (Automatic Content Extraction) dataset.
[0059] As will be known to those skilled in the art, any method that uses a dataset to train mT5 to obtain a preset event type recognition model and a preset event recognition model falls within the protection scope of this invention.
[0060] S12, extract the event description of any candidate data in the candidate dataset to obtain the event description set corresponding to the candidate dataset.
[0061] In this embodiment of the invention, the event description is a generalized description of the event, which can be obtained based on a preset event description model. In an illustrative embodiment of the invention, the preset event description model can be a trained T7 model.
[0062] S13, extract the trigger words and event elements of any event description in the event description set to obtain the corresponding event triples, and construct the corresponding event graph based on the event triples corresponding to all event descriptions in the event description set. The event triples include a head entity, a relation, and a tail entity. The head entity is the event description, the relation is the trigger word in the event description, and the tail entity is the event element in the event description.
[0063] In this embodiment of the invention, the method for extracting trigger words and event elements from any event description in the event description set can be a prior art.
[0064] As those skilled in the art will know, nodes in an event graph are head entities or tail entities, and directed edges represent the relationship between head entities and tail entities.
[0065] In this embodiment of the invention, during the construction of the event knowledge graph, a collaborative strategy of event detection and event extraction is used to preprocess the source text data to obtain data containing events. This can significantly improve the efficiency and accuracy of locating the core content in the text, ensuring that the effective parts of the article are focused on quickly and effectively.
[0066] S2, based on the common entities between the event graph and the open-source knowledge graph, the event graph and the open-source knowledge graph are fused to obtain an event knowledge graph that integrates the event graph and the open-source knowledge graph; the nodes in the event knowledge graph represent head entities and tail entities, and the directed edges represent the relationship between head entities and tail entities.
[0067] In this embodiment of the invention, the open-source knowledge graph can be an existing open-source knowledge graph.
[0068] Furthermore, S2 may specifically include:
[0069] S21. Obtain the intersection of the entity set of the event graph and the entity set of the open source knowledge graph, i.e., the entities that are completely identical, and use the entities corresponding to the obtained intersection as the common entities of the event graph and the open source knowledge graph.
[0070] As those skilled in the art will know, the entity set in the event graph is the entity corresponding to all nodes, including the head entity and the tail entity.
[0071] S22, For any common entity, one of the two entities corresponding to the common entity in the event graph and the open source knowledge graph is retained, and the other is not retained. The node corresponding to the non-retained entity is deleted from the corresponding graph, and the directed edge connected to the node corresponding to the non-retained entity is connected to the node corresponding to the retained entity; thus, an event knowledge graph that integrates the event graph and the open source knowledge graph is obtained.
[0072] In this embodiment of the invention, the retained entities and non-retained entities can be determined based on actual needs. This invention does not impose any special limitations. For example, if the common entity existing in the event graph and the knowledge graph is entity 1, entity 1 in the event graph can be retained, and entity 1 in the knowledge graph can be non-retained. Then, the non-retained entities are deleted, and the relationships corresponding to the retained entities are connected with the retained entities.
[0073] S3, obtain the feature vectors of nodes and directed edges in the event knowledge graph to obtain the event knowledge graph with knowledge representation.
[0074] In an illustrative embodiment of the present invention, the feature vectors of nodes and directed edges in the event knowledge graph can be obtained through a supervised learning method, specifically through the following steps:
[0075] S40 uses a sentence encoding model to obtain initial feature vectors corresponding to head entities, relations, and tail entities in the target graph. Compared to one-hot encoding, sentence encoding better preserves the semantic information of text. This model represents the semantics of the input by converting text of different lengths into fixed-length embedding vectors. The sentence encoding model consists of two layers: The first layer is a transformer model that takes text or sentences as input and outputs an encoding vector for each input word. The second layer feeds the encoding vectors into a pooling layer to obtain a fixed-length encoding result.
[0076] As those skilled in the art will know, any method for obtaining the initial feature vectors corresponding to the head entities, relations, and tail entities in the graph based on a sentence encoding model falls within the protection scope of this invention.
[0077] S41, input the initial feature vectors corresponding to the head entity, relation and tail entity into the preset knowledge graph representation model to obtain the knowledge representation feature vectors corresponding to the head entity, relation and tail entity, which are used as the target feature vectors corresponding to the head entity, relation and tail entity. That is, the target feature vector is a vector that integrates the triple information, and the feature vectors corresponding to the nodes and directed edges in the graph are obtained.
[0078] In this embodiment of the invention, the preset knowledge graph representation model can be the TransE model, which uses distributed representation to describe triples in the knowledge base. The TransE model avoids the construction of a large tree structure and can obtain semantic information through simple mathematical calculations.
[0079] In another embodiment of the present invention, the feature vectors of nodes and directed edges in the event knowledge graph can be obtained through an unsupervised learning method, specifically through the following steps:
[0080] S50: Obtain the initial feature vector of the head entity, the feature vector of the relation, the feature vector of the tail entity in the event knowledge graph, and the feature vector corresponding to the relation-tail entity in the event knowledge graph.
[0081] In this embodiment of the invention, the initial feature vector of the head entity, the feature vector of the relation, the feature vector of the tail entity, and the feature vector of the relation-tail entity are obtained through a sentence encoding model. When obtaining the initial feature vector of the head entity, all head entities in the event knowledge graph can be input into the sentence encoding model to obtain the corresponding feature vectors, thus obtaining the initial feature vector of each head entity. When obtaining the feature vector of the relation, all relations in the event knowledge graph can be input into the sentence encoding model to obtain the corresponding feature vectors, thus obtaining the relation feature vector of each relation. When obtaining the feature vector of the tail entity, all tail entities in the event knowledge graph can be input into the sentence encoding model to obtain the corresponding feature vectors, thus obtaining the tail entity feature vector of each tail entity. When obtaining the feature vector corresponding to the relation-tail entity, firstly, the string corresponding to the relation of each head entity and the string corresponding to the tail entity are concatenated to obtain a concatenated string; then, the concatenated string is input into the sentence encoding model to obtain the corresponding feature vector.
[0082] S51. Based on the feature vectors of all relation-tail entities corresponding to any head entity, obtain the relation-tail entity feature vector corresponding to the head entity, and update the initial feature vector of the head entity based on the relation-tail entity feature vector corresponding to the head entity to obtain the updated feature vector, which is used as the head entity feature vector of the head entity.
[0083] In this embodiment of the invention, the feature vector of the relation-tail entity corresponding to the head entity can be the average value of the feature vectors of all relation-tail entities corresponding to the head entity, that is, the average value of the feature vectors of all relation-tail entities connected to the head entity.
[0084] Further, updating the initial feature vector of the head entity based on the relation-tail entity feature vector corresponding to the head entity to obtain the updated feature vector, which serves as the head entity feature vector of the head entity, specifically includes:
[0085] The relation-tail entity feature vector corresponding to the head entity is subjected to average pooling to obtain the corresponding average pooling result. The obtained average pooling result is then concatenated with the initial feature vector corresponding to the head entity to obtain the head entity vector that incorporates the triple information of the entity relation, which is used as the head entity feature vector corresponding to the head entity.
[0086] S52, the head entity feature vector, relation feature vector, and tail entity feature vector corresponding to the event knowledge graph are subjected to dimensionality reduction processing to obtain the dimensionality-reduced feature vectors, which are used as the feature vectors of nodes and directed edges in the event knowledge graph, thereby obtaining the event knowledge graph with knowledge representation.
[0087] Furthermore, the S50 specifically includes:
[0088] S3301, based on the head entity feature vector, relation feature vector and tail entity feature vector, construct an initial matrix of size n×m, where n is the vector dimension corresponding to the head entity feature vector, relation feature vector and tail entity feature vector, and m is the number of vectors corresponding to the head entity feature vector, relation feature vector and tail entity feature vector.
[0089] In one illustrative embodiment of the present invention, the vector dimension may be 768.
[0090] S3302, perform zero-mean processing on each row of the initial matrix to obtain the processed initial matrix, which is used as the intermediate matrix.
[0091] S3303, obtain the covariance matrix of the intermediate matrix, and obtain the eigenvalues of the covariance matrix and the eigenvectors corresponding to the eigenvalues.
[0092] As will be known to those skilled in the art, any method for obtaining the covariance matrix of the intermediate matrix, as well as the eigenvalues of the covariance matrix and the eigenvectors corresponding to the eigenvalues, falls within the protection scope of this invention.
[0093] S3304: Sort the acquired feature values in descending order, and obtain the feature vectors corresponding to the first k feature values in the sorted feature values as target feature vectors, and use the target feature vectors as row vectors to form a feature vector matrix.
[0094] In this embodiment of the invention, the value of k can be set based on actual needs. In one illustrative embodiment, k=100.
[0095] S3305, the matrix obtained by multiplying the initial matrix and the eigenvector matrix is used as the target matrix;
[0096] S3306, Based on the target matrix, the feature vectors of the nodes and directed edges in the event knowledge graph are obtained, thereby obtaining the event knowledge graph with knowledge representation.
[0097] Through steps S50 to S51, the obtained head entity feature vectors are fused with entity relationship triplet information and dimensionality reduction is performed. This transforms a large number of feature vectors containing potentially related head entities, relationships, and tail entities into a set of unrelated, non-overlapping low-dimensional vectors, which can reduce the computational cost of subsequent algorithms.
[0098] In this embodiment of the invention, using the feature vectors of entities in the event knowledge graph as features of entities in the news can increase the information in the news features.
[0099] Furthermore, in S200, the users corresponding to the news database can be obtained based on the news items marked. For a particular news item, if a user is interested, a corresponding interest identifier will be marked, and this interest identifier will be associated with the user ID. Through these interest identifiers, the user corresponding to the news database can be obtained.
[0100] Furthermore, in S200, the step of obtaining the corresponding initial user features based on the initial news features of the user's news of interest specifically includes:
[0101] The initial news features of news items of interest to any user are concatenated into a P×Q matrix, which serves as the matrix to be processed; where P is the number of news items of interest to the user, and Q is a preset news vector dimension. In this embodiment of the invention, Q can be set according to actual needs, for example, Q can be set to 100.
[0102] The matrix to be processed is subjected to average pooling using a P×1 average pooling window to obtain a 1×Q feature vector, which serves as the corresponding initial user feature.
[0103] Furthermore, the S300 may specifically include:
[0104] S301, obtain the similarity between the initial user features corresponding to the target user and the initial user features corresponding to any other user, to obtain the first similarity set corresponding to the target user, and sort the similarity in the first similarity set in descending order to obtain the sorted first similarity set, and obtain the news of interest corresponding to other users corresponding to the top N similarity in the sorted first similarity set to form the first candidate news set of the target user; wherein, the target user is any user in the news database, and the other users are any user in the news database other than the target user.
[0105] In this embodiment of the invention, N can be set based on actual needs. For example, the value of N can be between 200 and 400. In this embodiment of the invention, the similarity is cosine similarity.
[0106] S302, obtain the similarity between the initial user features corresponding to the target user and any other initial news features to obtain the second similarity set corresponding to the target user, and sort the similarities in the second similarity set in descending order to obtain the sorted second similarity set. Then, obtain the news corresponding to the top N similarities from the sorted second similarity set to form the second candidate news set for the target user. Other initial news features are the initial news features in the news database other than the initial news features corresponding to the target user.
[0107] S303, obtain the similarity between the initial news features of each news item of interest to the target user and any other initial news features, to obtain the third similarity set corresponding to the target user, and sort the similarity in the third similarity set in descending order to obtain the sorted third similarity set, and obtain the news items corresponding to the top N similarity in the sorted third similarity set to form the third candidate news set of the target user.
[0108] S304, obtain the intersection between the entity set corresponding to the news of interest of the target user and the entity set corresponding to any other news, as the co-occurrence entity between the target user and the other news, and obtain the co-occurrence word frequency corresponding to the co-occurrence entity based on the word frequency of the co-occurrence entity in the news of interest of the target user and the word frequency in the other news, to obtain the co-occurrence word frequency set corresponding to the target user, and sort the word frequencies in the co-occurrence word frequency set in descending order to obtain the sorted co-occurrence word frequency set, and obtain the other news corresponding to the top N co-occurrence word frequencies from the sorted co-occurrence word frequency set to form the fourth candidate news set of the target user; the other news is the news in the news database other than the news of interest of the target user.
[0109] In this embodiment of the invention, the co-occurrence frequency (CF) of the target user and any other news item satisfies the following condition:
[0110] CF=∑ z i=1 (F) i1 +F i2 )
[0111] Among them, F i1 Let F be the word frequency of the i-th co-reality entity in the target user and any other news item in the news item of interest to the target user. i2 Let i be the word frequency of the i-th co-occurring entity in any other news article, where i ranges from 1 to z, and z is the number of co-occurring entities corresponding to the target user and any other news article.
[0112] S305, sort the news in the target user's area of interest according to the popularity value from high to low, obtain the sorted news in the area of interest, and obtain N candidate news from the sorted news in the area of interest to form the target user's fifth candidate news set.
[0113] In this embodiment of the invention, news from the target user's area of interest is used as candidate news, which can avoid the problem of too few candidate news due to too little historical data of the user.
[0114] S306, merge the first to fifth candidate news sets of the target user to obtain the candidate news set that the target user may be interested in, that is, obtain the candidate news set that users without duplicate samples may be interested in.
[0115] Furthermore, the step of updating the initial news features based on the initial news features and news entity features to obtain the updated news features specifically includes:
[0116] S401, obtain the attention weight of each entity corresponding to each news item.
[0117] In this embodiment of the invention, the attention weight of each entity corresponding to each news item can be obtained through the self-attention mechanism module. Specifically, the attention weight AW of the j-th entity in the r-th news item is... j The following conditions must be met:
[0118] AW j =exp(w2×RELU(w1(h j ∏v n r )+b1)+b2) / (∑ x s=1 (exp(w2×RELU(w1(h))) s +v r )+b1)+b2));
[0119] Where exp() represents a function with base e, w1 and w2 are learnable network weights, b1 and b2 are learnable network parameters, ReLU() is the activation function, and h j v is the entity fusion feature corresponding to the j-th entity. n r Let h be the initial news feature corresponding to the r-th news item. s Let be the entity fusion feature corresponding to the s-th entity in the r-th news item. The value of r ranges from 1 to G, where G is the news item in the news database, and ∏ represents concatenation.
[0120] S402, multiply the attention weight of each entity corresponding to each news item by the corresponding entity fusion feature to obtain the weighted entity feature of that entity.
[0121] S403, take the average of the weighted entity features of all entities corresponding to each news item as the updated news entity feature corresponding to that news item.
[0122] S404: The updated news entity features and news text features corresponding to each news item are fused to obtain the updated news features corresponding to that news item.
[0123] Specifically, the rth news item updates the news features v new r The following conditions must be met:
[0124] v new r =Tanh(w3(h) new r ∏v w r )+b3);
[0125] Tanh() is the Tanh function, w3 are the learnable network weights, b3 are the learnable network parameters, and h new r Let v be the updated news entity feature corresponding to the r-th news item. w r Let be the text features corresponding to the r-th news item.
[0126] Furthermore, the step of updating the corresponding initial user features based on the updated news features to obtain the updated user features specifically includes:
[0127] S405, obtain the attention weights of the updated news features corresponding to the news database.
[0128] In this embodiment of the invention, the specific method for obtaining the updated news features can refer to the method for obtaining the attention weight of the entity in S401.
[0129] S406, multiply the attention weight of each updated news feature with the corresponding updated news feature to obtain the weighted news feature of that updated news feature.
[0130] S407, the weighted average of the news features of the news that each user is interested in is used as the updated user feature for that user.
[0131] Furthermore, in this embodiment of the invention, the recommendation value of the candidate news meets the following condition:
[0132] y = w × (u + v) + b, where y is the recommendation value corresponding to the candidate news, u is the updated user feature of the user corresponding to the candidate news, v is the updated news feature corresponding to the candidate news, w is the learnable network weight, and b is the learnable network parameter.
[0133] In practical applications, the recommendation value of candidate news can be obtained based on a trained news recommendation value acquisition model. This model employs an attention mechanism to acquire recommendation values.
[0134] In this embodiment of the invention, the updated news features and updated user features, which are fused with event knowledge graph representation and attention mechanism, are used to calculate the recommendation value. This approach can take into account both the textual information and event knowledge information contained in the news, thereby achieving fine ranking of the recommendation model.
[0135] In this embodiment of the invention, the preset recommendation value is the median of the recommendation values corresponding to the candidate news set.
[0136] The inventors of this invention discovered that the median can adaptively filter based on the distribution of sorting scores, taking into account the differences between different users, ensuring that each user can receive a certain number of recommended news items, while reducing the occurrence of overcrowding or oversparseness.
[0137] In summary, the news recommendation method provided in this invention combines an event knowledge graph with a news recommendation system. It aims to significantly improve the accuracy and effectiveness of the recommendation algorithm by introducing the rich information beyond interaction records into the event knowledge graph through representation learning methods. By extracting and parsing key information from the event knowledge graph using representation learning techniques and integrating it into user and news profiles, it effectively overcomes the problem of over-reliance on historical user behavior data in traditional recommendation algorithms, which leads to simplistic or biased recommended content. This process not only enhances the system's ability to capture users' immediate needs and potential interests but also enables the recommendation system to transcend traditional boundaries, gain a deeper understanding of users' true needs and expectations, and ultimately provide users with news recommendation services that better match their interests and needs.
[0138] This invention also provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to perform the method described in this invention.
[0139] This invention also provides a non-transitory computer-readable storage medium storing computer-executable instructions for performing the methods described in this invention.
[0140] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this invention can be achieved, and this is not limited herein.
[0141] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A news recommendation method characterized by comprising: The method comprises the following steps: S100, obtaining initial news features of each news in a news database, the initial news features comprising corresponding news entity features and news text features; S200, obtaining users corresponding to the news database, and obtaining corresponding initial user features based on initial news features of news of interest of the users; S300, obtaining news of potential interest of a user from the news database as candidate news based on user similarity, user-news similarity, news similarity, co-occurring entity word frequency, and fields of interest of the user, to form a candidate news set; S400, updating the initial news features based on the initial news features and the news entity features to obtain updated news features as updated news features, and updating the corresponding initial user features based on the updated news features to obtain updated user features as updated user features; S500, obtaining a recommendation value corresponding to the candidate news based on the updated user features and the updated news features of the corresponding candidate news; S600, recommending candidate news with a recommendation value greater than a preset recommendation value in the candidate news set to the corresponding user as recommended news; S300 specifically comprises: S301, obtaining similarity between initial user features corresponding to a target user and initial user features corresponding to any other user, obtaining a first similarity set corresponding to the target user, sorting the similarity in the first similarity set in descending order to obtain a sorted first similarity set, and obtaining news of interest of the other users corresponding to the top N similarities in the sorted first similarity set to form a first candidate news set of the target user; wherein the target user is any user in the news database, and the other user is any user in the news database except the target user; S302, obtaining similarity between initial user features corresponding to a target user and any other initial news features, obtaining a second similarity set corresponding to the target user, sorting the similarity in the second similarity set in descending order to obtain a sorted second similarity set, and obtaining news corresponding to the top N similarities in the sorted second similarity set to form a second candidate news set of the target user, the other initial news features being initial news features in the news database except the initial news features corresponding to the target user; S303, obtaining similarity between initial news features of each news of interest of a target user and any other initial news features, obtaining a third similarity set corresponding to the target user, sorting the similarity in the third similarity set in descending order to obtain a sorted third similarity set, and obtaining news corresponding to the top N similarities in the sorted third similarity set to form a third candidate news set of the target user; S304, obtaining an intersection between the entity set corresponding to the news of interest of the target user and the entity set corresponding to any other news as a co-occurring entity between the target user and the other news, and obtaining a co-occurring word frequency corresponding to the co-occurring entity based on a word frequency of the co-occurring entity in the news of interest of the target user and a word frequency of the co-occurring entity in the other news, obtaining a co-occurring word frequency set corresponding to the target user, and sorting the word frequencies in the co-occurring word frequency set in descending order to obtain a sorted co-occurring word frequency set, and obtaining the other news corresponding to the top N co-occurring word frequencies in the sorted co-occurring word frequency set to form a fourth candidate news set of the target user; the other news is news in the news database other than the news of interest of the target user; S305, sorting the news of interest in the field corresponding to the field of interest of the target user in descending order of heat value to obtain sorted news of interest in the field, and obtaining N candidate news from the sorted news of interest in the field to form a fifth candidate news set of the target user; S306, merging the first candidate news set to the fifth candidate news set of the target user to obtain a candidate news set of potential interest of the target user.
2. The method of claim 1, wherein, S100 specifically includes: S101, obtaining a text feature corresponding to each news in the news database as a news text feature; S102, obtaining an entity corresponding to each news in the news database, and obtaining an initial entity feature of each entity corresponding to each news in the news database; S103, generating a corresponding position encoding vector, word frequency encoding and category encoding for each entity corresponding to each news in the news database based on the position, word frequency and corresponding entity category of each entity in the news; S104, fusing the initial entity feature, position encoding vector, word frequency encoding and category encoding of each entity in each news in the news database to obtain an entity fusion feature of each entity; S105, fusing all entity fusion features corresponding to each news in the news database to obtain a corresponding news entity feature, and fusing the corresponding news entity feature and the corresponding news text feature to obtain an initial news feature.
3. The method of claim 2, wherein, The initial news feature is updated based on the initial news feature and the news entity feature to obtain an updated news feature as an updated news feature, specifically including: S401, obtaining an attention weight of each entity corresponding to each news in the news database; S402, multiplying the attention weight of each entity corresponding to each news in the news database and the corresponding entity fusion feature to obtain a weighted entity feature of the entity; S403, taking the average value of the weighted entity features of all entities corresponding to each news in the news database as the updated news entity feature corresponding to the news; S404, fusing the updated news entity feature and the news text feature corresponding to each news in the news database to obtain the updated news feature corresponding to the news; The initial user feature corresponding to the updated news feature is updated to obtain an updated user feature as an updated user feature, and the method specifically comprises: S405, obtaining the attention weight of the updated news feature corresponding to the news database; S406, multiplying the attention weight of each updated news feature and the corresponding updated news feature to obtain the weighted news feature of the updated news feature; S407, taking the average value of the weighted news feature of the news interested by each user as the updated user feature of the user.
4. The method of claim 1, wherein, The recommendation value of the candidate news satisfies the following condition: y=w×(u+v)+b, y is the recommendation value corresponding to the candidate news, u is the updated user feature of the user corresponding to the candidate news, v is the updated news feature corresponding to the candidate news, w is a learnable network weight, and b is a learnable network parameter.
5. The method of claim 1, wherein, The preset recommendation value is the median of the recommendation values corresponding to the candidate news set.
6. The method of claim 1, wherein, The initial news feature of the news interested by the user is used to obtain the initial user feature corresponding to the user, and the method specifically comprises: The initial news feature of the news interested by any user is spliced into a P×Q matrix as a to-be-processed matrix; wherein P is the number of news interested by the user, and Q is a preset news vector dimension; The to-be-processed matrix is processed by using a P×1 size average pooling window to obtain a 1×Q size feature vector as the initial user feature corresponding to the user.
7. The method of claim 1, wherein, The news text feature is obtained based on a trained Roformer-sim model.
8. An electronic device, comprising: The processor and the memory are included. The processor is used to execute the steps of the method according to any one of claims 1 to 7 by calling the program or instructions stored in the memory.
9. A non-transitory computer-readable storage medium, comprising: The non-transitory computer readable storage medium is used to store the program or instructions, and the program or instructions make the computer execute the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Knowledge perception and time sensitive financial news recommendation system and method based on company derived relationship
CN115238082A
News association recommendation method and device based on association prediction model and medium
CN116226533A