News recommendation method, electronic equipment and storage medium

By obtaining and updating news and user characteristics, the news that users are potentially interested in is obtained from the news database based on multiple perspectives, solving the problems of homogeneity of recommendation results and data sparsity in the existing technology, and achieving more personalization and diversification. News recommendation effect.

CN119357469AActive Publication Date: 2025-01-24北京中科闻歌科技股份有限公司 +1
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411434652.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-24
Estimated Expiration
2044-10-15

AI Technical Summary

Technical Problem

Existing news recommendation technology relies too much on user attribute characteristics and behavioral data, ignores deep information on news content, resulting in homogeneity of recommendation results and data sparsity, which makes it difficult to meet users' personalized needs.

Method used

By obtaining the initial characteristics of news and initial characteristics of users in the news database, based on the similarity between users, the similarity between user news, the similarity between news, the word frequency of co-occurring entities and the user's field of interest, the user's potential interests are obtained from the news database. Candidate news set, and update news and user characteristics to calculate recommendation value.

Benefits of technology

The diversity of news recommendations has been increased, which can more comprehensively understand user interest, reduce the homogeneity of recommendation results, and improve the personalized effect of recommendation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119357469A_ABST
    Figure CN119357469A_ABST
Patent Text Reader

Abstract

The invention relates to the field of natural language processing, and provides a news recommendation method, electronic equipment and a storage medium, and the method comprises the steps: obtaining an initial news feature corresponding to a news database; obtaining a user corresponding to the news database, and obtaining a corresponding initial user feature based on the initial news feature of the interested news corresponding to the user; on the basis of the similarity between the users, the similarity between the user news, the similarity between the news, the common reality word frequency and the interested field of the user, obtaining a candidate news set in which the user is potentially interested from the news database; updating the initial news features to obtain updated news features, and updating the initial user features to obtain updated user features; obtaining recommendation values corresponding to the candidate news based on the updated user features and updated news features of the corresponding candidate news; and taking the candidate news of which the recommendation value is greater than a preset recommendation value in the candidate news set as recommended news and recommending the recommended news to the corresponding user. According to the invention, more accurate news can be provided for users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of natural language processing, and in particular to a news recommendation method, electronic equipment and storage medium. Background Art

[0002] With the continuous advancement and popularization of artificial intelligence technology, recommendation systems are gradually moving from traditional single-dimensional methods such as collaborative filtering and content filtering to a new stage of knowledge-driven and empowered. The core of this transformation is to deeply integrate the information in the knowledge graph into the recommendation system through knowledge representation learning technology, improve the system's ability to understand user intentions, and thus generate a more accurate recommendation list that meets user expectations. However, the current news recommendation technology system generally relies too much on user attribute characteristics and behavioral data, while ignoring the effective mining of deep and potential information contained in the news content itself. This model limits the recommendation algorithm's ability to fully understand user interests, easily leads to data sparsity challenges and homogeneity problems in recommendation results, and is difficult to meet users' growing personalized needs. At the same time, although the event knowledge graph, as a cutting-edge technology for information organization and representation, has powerful knowledge integration and reasoning capabilities, its rich potential value has not been fully released and utilized due to its relatively new concept and limited actual application scenarios. Summary of the invention

[0003] In view of the above technical problems, the technical solution adopted by the present invention is: According to a first aspect of the present invention, a news recommendation method is provided, the method comprising the following steps: S100, obtaining initial news features of each piece of news in a news database, wherein the initial news features include corresponding news entity features and news text features.

[0004] S200, obtaining a user corresponding to a news database, and obtaining a corresponding initial user feature based on an initial news feature of the news of interest corresponding to the user.

[0005] S300, based on the similarity between users, the similarity between user news, the similarity between news, the frequency of common entity words and the user's interest areas, the news that the user is potentially interested in is obtained from the news database as candidate news to form a candidate news set.

[0006] S400, updating the initial news feature 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.

[0007] S500: Obtain a recommendation value corresponding to the candidate news based on the updated user feature and the updated news feature of the corresponding candidate news.

[0008] S600: Recommend candidate news in the candidate news set whose recommendation value is greater than a preset recommendation value as recommended news and recommend it to the corresponding user.

[0009] According to a second aspect of the present invention, there is provided an electronic device comprising a processor and a memory; the processor is used to execute the steps of the method described in the first aspect of the present invention by calling a program or instruction stored in the memory.

[0010] According to a second aspect of the present invention, there is provided a non-transitory computer-readable storage medium storing a program or instructions, wherein the program or instructions enable a computer to execute the steps of the method described in the first aspect of the present invention.

[0011] The present invention has at least the following beneficial effects: The news recommendation method provided by the embodiment of the present invention obtains a set of candidate news that the user is potentially interested in from the news database based on multiple angles such as similarity between users, similarity between user news, similarity between news, frequency of co-existing entity words, and areas of interest to users, thereby increasing the diversity of news recommendations.

[0012] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0014] Figure 1 A flowchart of a news recommendation method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0015] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0016] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.

[0017] It should be noted that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the steps as sequential processes, many of the steps can be implemented in parallel, concurrently or simultaneously. In addition, the order of the steps can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0018] The embodiment of the present invention provides a news recommendation method, such as Figure 1 As shown, the method comprises the following steps: S100, obtaining initial news features of each piece of news in a news database, wherein the initial news features include corresponding news entity features and news text features.

[0019] S200, obtaining a user corresponding to a news database, and obtaining a corresponding initial user feature based on an initial news feature of the news of interest corresponding to the user.

[0020] S300, based on similarity between users, similarity between user news, similarity between news, frequency of common entity words and user's areas of interest, news that the user is potentially interested in is obtained from the news database as candidate news, forming a candidate news set, i.e., the candidate news set includes a plurality of candidate news.

[0021] S400, updating the initial news feature based on the initial news feature and the news entity feature to obtain the updated news feature as the updated news feature, and updating the corresponding initial user feature based on the updated news feature to obtain the updated user feature as the updated user feature.

[0022] S500, obtaining a recommendation value corresponding to the candidate news based on the updated user feature and the updated news feature of the corresponding candidate news; S600: Recommend candidate news in the candidate news set whose recommendation value is greater than a preset recommendation value as recommended news and recommend it to the corresponding user.

[0023] The news recommendation method provided by the embodiment of the present invention obtains a set of candidate news that the user is potentially interested in from the news database based on multiple angles such as similarity between users, similarity between user news, similarity between news, frequency of co-existing entity words, and areas of interest to users, thereby increasing the diversity of news recommendations.

[0024] In the embodiment of the present invention, the news in the news database can be obtained by using a web crawler.

[0025] Furthermore, in the embodiment of the present invention, S100 may specifically include: S101, obtaining text features corresponding to each piece of news in a news database as news text features.

[0026] In an embodiment of the present invention, news text features can be obtained based on a trained Roformer-sim model. Specifically, the news text is input into the trained Roformer-sim model to obtain corresponding news text features.

[0027] S102, obtaining an entity corresponding to each piece of news in the news database, and obtaining an initial entity feature of each entity corresponding to each piece of news.

[0028] S103, based on the position, word frequency and corresponding entity category of each entity corresponding to each news in the news database, generate a corresponding position code, word frequency code and category code for the entity.

[0029] In the embodiment of the present invention, the position refers to whether the entity is in the title or summary of the news. If the entity appears in both the title and the summary, the title shall prevail. In an exemplary embodiment, if the entity appears in the title of the news, the corresponding position code may be 1, and if the entity appears in the summary of the news, the corresponding position code may be 2.

[0030] In an embodiment of the present invention, the word frequency code may be the corresponding word frequency. For example, if the word frequency of an entity is 10, the corresponding word frequency code is 10. In one embodiment, the upper limit of the word frequency code may be set to 20, that is, if the word frequency of an entity is greater than 20, the corresponding word frequency code is 20.

[0031] In the embodiment of the present invention, different entity categories may have different codes, which may be user-defined values, such as society, education, current affairs, economy, military, science and technology, sports, culture, entertainment, tourism and others.

[0032] S104, the initial entity features, position codes, word frequency codes and category codes of each entity of each news in the news database are fused to obtain the features of each entity relative to the corresponding news as the entity fusion features of the entity.

[0033] S105, fusing all entity fusion features corresponding to each piece of news in the news database to obtain corresponding news entity features, and fusing the corresponding news entity features with the corresponding news text features to obtain corresponding initial news features.

[0034] In the embodiment of the present invention, fusion refers to a splicing operation.

[0035] Further, in the embodiment of the present invention, in S102, entities in the news can be identified based on an entity recognition model.

[0036] In an illustrative embodiment, the entity in the news may be an entity in an open source event graph or an open source knowledge graph. In another illustrative embodiment, the entity in the news may be an entity in an event knowledge graph constructed based on the event graph and the knowledge graph. Preferably, the entity in the news is an entity in the event knowledge graph.

[0037] In an embodiment of the present invention, the initial entity feature of an entity in the news may be a feature vector of the entity in a target graph. The target graph may be an event graph, a knowledge graph, or an event knowledge graph.

[0038] In the embodiment of the present invention, the event knowledge graph can be constructed by the following method: S1, builds an event graph based on the source text dataset.

[0039] In an embodiment of the present invention, the source text data may be text data obtained by a web crawler. In an exemplary embodiment, the source text data may be news text data.

[0040] Furthermore, S1 may specifically include: S11, preprocessing the source text data set to obtain data containing events as a candidate data set.

[0041] The purpose of S11 is to remove redundant information that does not contain events in the source text data to reduce noise interference and thereby improve the accuracy of event extraction.

[0042] In the embodiment of the present invention, the event format is <event type, trigger word, event element>.

[0043] In an embodiment of the present 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 "A meeting is held at location B", the corresponding event type is meeting development, held is the trigger word, and the event elements are A meeting and B location.

[0044] Furthermore, S11 may specifically include: S111, segmenting the source text data set to obtain a plurality of corresponding paragraphs.

[0045] It is known to those skilled in the art that any method for segmenting a text falls within the protection scope of the present invention. For example, the text may be segmented according to punctuation marks or length in the text.

[0046] S112, input each paragraph into a preset event type recognition model, and if a corresponding event type is obtained, add the paragraph as a candidate paragraph to the current candidate paragraph set.

[0047] The initial value of the current candidate paragraph set is empty. It is known to those skilled in the art that if a paragraph is not identified as an event type, it will not be added to the current candidate paragraph set.

[0048] S113, input any candidate paragraph in the current candidate paragraph set into a preset event recognition model, and if the recognition result indicates that the candidate paragraph contains an event, use the candidate paragraph as data containing the event, and obtain a candidate data set.

[0049] In an embodiment of the present invention, the preset event type recognition model and the preset event recognition model are both trained mT5 models. In an embodiment of the present invention, a complete version of ACE (Automatic Content Extraction) data set can be used to train the mT5 model.

[0050] Those skilled in the art are aware that any method of using a data set to train mT5 to obtain a preset event type recognition model and a preset event recognition model falls within the protection scope of the present invention.

[0051] S12, extracting the event description of any candidate data in the candidate data set to obtain an event description set corresponding to the candidate data set.

[0052] In an embodiment of the present invention, the event description is a summary description of the event, which can be obtained based on a preset event description model. In an exemplary embodiment of the present invention, the preset event description model can be a trained T7 model.

[0053] S13, extracting the trigger words and event elements of any event description in the event description set to obtain corresponding event triples, and constructing corresponding event graphs based on the event triples corresponding to all event descriptions in the event description set, wherein the event triples include a head entity, a relationship, and a tail entity, wherein the head entity is the event description, the relationship is the trigger words in the event description, and the tail entity is the event elements in the event description.

[0054] In the embodiment of the present invention, the method for extracting trigger words and event elements from any event description in the event description set may be the prior art.

[0055] Those skilled in the art know that a node in an event graph is a head entity or a tail entity, and a directed edge represents the relationship between a head entity and a tail entity.

[0056] In an embodiment of the present invention, in the process of constructing an 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, which can significantly improve the efficiency and accuracy of locating the core content in the text and ensure rapid and effective focus on the effective parts of the article.

[0057] 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 merged to obtain an event knowledge graph that merges the event graph and the open source knowledge graph; the nodes in the event knowledge graph represent the head entity and the tail entity, and the directed edges represent the relationship between the head entity and the tail entity.

[0058] In an embodiment of the present invention, the open source knowledge graph may be an existing open source knowledge graph.

[0059] Furthermore, S2 may specifically include: S21, obtain the intersection between the entity set of the event graph and the entity set of the open source knowledge graph, that is, the completely identical entities, and use the corresponding entities of the obtained intersection as the common entities of the event graph and the open source knowledge graph.

[0060] Those skilled in the art know that the entity set in the event graph is the entity corresponding to all nodes, including the head entity and the tail entity.

[0061] 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 taken as a retained entity, and the other is taken as a non-retained entity, and the node corresponding to the non-retained entity is deleted from the corresponding graph, and the directed edge connecting the node corresponding to the non-retained entity is connected to the node corresponding to the retained entity; an event knowledge graph that integrates the event graph and the open source knowledge graph is obtained.

[0062] In an embodiment of the present invention, retained entities and non-retained entities can be determined based on actual needs, and the present invention does not make 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 used as a retained entity, and entity 1 in the knowledge graph can be used as a non-retained entity. The non-retained entity can then be deleted, and the relationship corresponding to the retained entity can be connected to the retained entity.

[0063] S3, obtaining feature vectors of nodes and directed edges in the event knowledge graph to obtain an event knowledge graph with knowledge representation.

[0064] In an exemplary embodiment of the present invention, the feature vectors of nodes and directed edges in the event knowledge graph can be obtained by a supervised learning method, and specifically can be obtained by the following steps: S40, based on the sentence encoding model, obtains the initial feature vectors corresponding to the head entity, relationship, and tail entity in the target graph. Compared with Onehot encoding, the sentence encoding model can better retain the semantic information of the text. The model represents the semantics of the input by converting texts of different lengths into embedded vectors of fixed length. The sentence encoding model consists of two layers: The first layer: is a transformer model, which inputs text or sentences and outputs the encoding vector of the corresponding position of each input word. The second layer: inputs the encoding vector into the pooling layer to obtain a fixed-length encoding result.

[0065] Those skilled in the art are aware that any method for obtaining the initial feature vectors corresponding to the head entity, relationship and tail entity in the graph based on the sentence encoding model falls within the scope of protection of the present invention.

[0066] S41, input the initial feature vectors corresponding to the head entity, relationship and tail entity into the preset knowledge graph representation model, and obtain the knowledge representation feature vectors corresponding to the head entity, relationship and tail entity, as the target feature vectors corresponding to the head entity, relationship and tail entity, that is, the target feature vector is a vector that integrates the triple information, and obtains the feature vectors corresponding to the nodes and directed edges in the graph.

[0067] In an embodiment of the present invention, the preset knowledge graph representation model is a TransE model that can be used to describe triples in the knowledge base by using distributed representation. The representation method of the TransE model avoids the construction of a huge tree structure and can obtain semantic information through simple mathematical calculations.

[0068] In another embodiment of the present invention, the feature vectors of nodes and directed edges in the event knowledge graph can be obtained by an unsupervised learning method, and can be obtained by the following steps: S50, respectively obtain the initial feature vector of the head entity, the relationship feature vector, the tail entity feature vector in the event knowledge graph, and obtain the feature vector corresponding to the relationship-tail entity in the event knowledge graph.

[0069] In an embodiment of the present invention, the head entity initial feature vector, the relationship feature vector, the tail entity feature vector and the relationship-tail entity feature vector are obtained through a sentence encoding model. When obtaining the head entity initial feature vector, all head entities in the event knowledge graph can be input into the sentence encoding model to obtain the corresponding feature vector, and the head entity initial feature vector of each head entity is obtained. When obtaining the relationship feature vector, all relations in the event knowledge graph can be input into the sentence encoding model to obtain the corresponding feature vector, and the relationship feature vector of each relationship is obtained. When obtaining the tail entity feature vector, all tail entities in the event knowledge graph can be input into the sentence encoding model to obtain the corresponding feature vector, and the tail entity feature vector of each tail entity is obtained. When obtaining the feature vector corresponding to the relationship-tail entity, first, the character string corresponding to each head entity and the character string corresponding to the tail entity are concatenated to obtain a concatenated character string; then, the concatenated character string is input into the sentence encoding model to obtain the corresponding feature vector.

[0070] S51, based on the feature vectors corresponding to all the relationship-tail entities corresponding to any head entity, obtain the relationship-tail entity feature vector corresponding to the head entity, and update the initial feature vector of the head entity based on the relationship-tail entity feature vector corresponding to the head entity to obtain the updated feature vector as the head entity feature vector of the head entity.

[0071] In an embodiment of the present invention, the relationship-tail entity feature vector corresponding to the head entity may be the average of the feature vectors corresponding to all relationship-tail entities corresponding to the head entity, that is, the average of the feature vectors corresponding to all relationship-tail entities connected to the head entity.

[0072] Further, the updating of the initial feature vector of the head entity based on the relationship-tail entity feature vector corresponding to the head entity to obtain an updated feature vector as the head entity feature vector of the head entity specifically includes: The relationship-tail entity feature vector corresponding to the head entity is average pooled to obtain the corresponding average pooling result, and the average pooling result is concatenated with the initial feature vector corresponding to the head entity to obtain a head entity vector that integrates the triplet information of the entity relationship as the head entity feature vector corresponding to the head entity.

[0073] S52, perform dimensionality reduction processing on the head entity feature vector, relationship feature vector, and tail entity feature vector corresponding to the event knowledge graph to obtain the reduced-dimensional feature vectors as the feature vectors of the nodes and directed edges in the event knowledge graph, thereby obtaining the event knowledge graph with knowledge representation.

[0074] Furthermore, S50 specifically includes: S3301, based on the head entity feature vector, relationship feature vector and tail entity feature vector, construct an initial matrix of size n×m, where the value of n is the vector dimension corresponding to the head entity feature vector, relationship feature vector and tail entity feature vector, and the value of m is the number of vectors corresponding to the head entity feature vector, relationship feature vector and tail entity feature vector.

[0075] In an exemplary embodiment of the present invention, the vector dimension may be 768.

[0076] S3302, performing zero mean processing on each row of the initial matrix to obtain a processed initial matrix as an intermediate matrix.

[0077] S3303, obtaining the covariance matrix of the intermediate matrix, and obtaining the eigenvalues ​​of the covariance matrix and the eigenvectors corresponding to the eigenvalues.

[0078] Those skilled in the art know that any method for obtaining the covariance matrix of the intermediate matrix, and obtaining the eigenvalues ​​of the covariance matrix and the eigenvectors corresponding to the eigenvalues, falls within the protection scope of the present invention.

[0079] S3304, sorting the acquired eigenvalues ​​in descending order, and obtaining eigenvectors corresponding to the first k eigenvalues ​​in the sorted eigenvalues ​​as target eigenvectors, and using the target eigenvectors as row vectors to form an eigenvector matrix.

[0080] In the embodiment of the present invention, the value of k can be set based on actual needs. In an exemplary embodiment, k=100.

[0081] S3305, taking a matrix obtained by multiplying the initial matrix and the eigenvector matrix as a target matrix; S3306, based on the target matrix, obtain the characteristic vectors of the nodes and directed edges in the event knowledge graph, and then obtain the event knowledge graph with knowledge representation.

[0082] Through S50 to S51, the head entity feature vector obtained integrates the entity relationship triplet information and performs dimensionality reduction processing, converting a large number of feature vectors containing potentially associated head entities, relationships, and tail entities into a set of low-dimensional vectors that are unrelated to each other and have non-overlapping information, which can reduce the computational overhead of subsequent algorithms.

[0083] In the embodiment of the present invention, the feature vector of the entity in the event knowledge graph is used as the feature of the entity in the news, which can increase the information in the news feature.

[0084] Further, in S200, the user corresponding to the news database can be obtained based on the acquisition of the marked news. For a piece of news, if the user is interested, the corresponding interest mark will be marked, and the interest mark will be associated with the user ID, and the user corresponding to the news database can be obtained through these interest marks.

[0085] Further, in S200, the obtaining of the corresponding initial user features based on the initial news features of the news of interest to the user specifically includes: The initial news features of the news of interest corresponding to any user are spliced ​​into a P×Q matrix as a matrix to be processed; wherein P is the number of news of interest to the user, and Q is the preset news vector dimension. In the embodiment of the present invention, Q can be set based on actual needs, for example, Q can be set to 100.

[0086] The matrix to be processed is average pooled using an average pooling window of size P×1 to obtain a feature vector of size 1×Q as the corresponding initial user feature.

[0087] Furthermore, S300 may specifically include: S301, obtaining the similarity between the initial user feature corresponding to the target user and the initial user feature corresponding to any other user, obtaining a first similarity set corresponding to the target user, and sorting the similarities in the first similarity set in descending order to obtain a sorted first similarity set, and obtaining the interested news corresponding to other users corresponding to the top N similarities from the sorted first similarity set to form a first candidate news set for the target user; wherein the target user is any user among the users corresponding to the news database, and the other user is any user among the users corresponding to the news database except the target user.

[0088] In the embodiment of the present invention, N can be set based on actual needs. For example, the value of N can be 200 to 400. In the embodiment of the present invention, the similarity is cosine similarity.

[0089] S302, obtaining the similarity between the initial user feature corresponding to the target user and any other initial news feature, obtaining a second similarity set corresponding to the target user, and sorting the similarities in the second similarity set in descending order to obtain a sorted second similarity set, and obtaining news corresponding to the top N similarities from the sorted second similarity set to form a second candidate news set for the target user. The other initial news features are initial news features corresponding to the news database except for the initial news features corresponding to the target user.

[0090] S303, obtaining the similarity between the initial news feature of each news of interest and any other initial news feature in the news of interest corresponding to the target user, obtaining a third similarity set corresponding to the target user, and sorting the similarities in the third similarity set in descending order to obtain a sorted third similarity set, and obtaining news corresponding to the top N similarities from the sorted third similarity set to form a third candidate news set for the target user.

[0091] S304, obtaining the intersection between the entity set corresponding to the news of interest corresponding to the target user and the entity set corresponding to any other news as the co-reality entity between the target user and the other news, and obtaining the co-occurrence word frequency corresponding to the co-reality entity based on the word frequency of the co-reality entity in the news of interest corresponding to the target user and the word frequency in the other news, obtaining the co-occurrence word frequency set corresponding to the target user, and sorting the word frequency in the co-occurrence word frequency set in descending order to obtain the sorted co-occurrence word frequency set, and obtaining other news corresponding to the top N co-occurrence word frequencies from the sorted co-occurrence word frequency set to form a fourth candidate news set for the target user; other news refers to news in the news database other than the news of interest to the target user.

[0092] In the embodiment of the present invention, the co-occurrence word frequency CF corresponding to the target user and any other news satisfies the following conditions: CF=∑ z i=1 (F i1 +F i2 ) Among them, F i1 is the word frequency of the i-th co-reality entity in the target user's news of interest, among the co-reality entities corresponding to any other news, i2 is the word frequency of the i-th co-reality entity in any other news, i ranges from 1 to z, and z is the number of co-reality entities corresponding to the target user and any other news.

[0093] S305, sorting the news in the field of interest corresponding to the target user's field of interest in descending order of popularity value to obtain sorted news in the field of interest, and obtaining N candidate news from the sorted news in the field of interest to form a fifth candidate news set for the target user.

[0094] In the embodiment of the present invention, news in the field of interest of the target user is used as candidate news, which can avoid the problem of too few candidate news due to too little user history data.

[0095] S306: Merge the first to fifth candidate news sets of the target user to obtain a candidate news set that the target user is potentially interested in, that is, obtain a candidate news set that the user may be interested in without duplicate samples.

[0096] Further, the updating of the initial news feature based on the initial news feature and the news entity feature to obtain the updated news feature as the updated news feature specifically includes: S401, obtaining the attention weight of each entity corresponding to each piece of news.

[0097] In the embodiment of the present 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 jth entity of the rth news item is j The following conditions must be met: 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)); Among them, exp() represents a function with natural number e as base, w1 and w2 are learnable network weights, b1 and b2 are learnable network parameters, RELU() is the activation function, h j is the entity fusion feature corresponding to the jth entity, v n r is the initial news feature corresponding to the rth news, h s is the entity fusion feature corresponding to the sth entity in the rth news. r ranges from 1 to G, G is the news in the news database, and ∏ represents splicing.

[0098] S402, multiplying the attention weight of each entity corresponding to each piece of news by the corresponding entity fusion feature to obtain the weighted entity feature of the entity.

[0099] S403: taking the average value of the weighted entity features of all entities corresponding to each piece of news as the updated news entity feature corresponding to the news.

[0100] S404: Fusing the updated news entity feature and the news text feature corresponding to each piece of news to obtain the updated news feature corresponding to the news.

[0101] Specifically, the rth news updates news feature v new r The following conditions must be met: v new r =Tanh(w3(h new r ∏v w r )+b3); Tanh() is the Tanh function, w3 is the learnable network weight, b3 is the learnable network parameter, h new r is the updated news entity feature corresponding to the rth news, v w r is the text feature corresponding to the rth news.

[0102] Further, the updating of the corresponding initial user features based on the updated news features to obtain the updated user features as updated user features specifically includes: S405, obtaining the attention weight of the updated news feature corresponding to the news database.

[0103] In the embodiment of the present invention, the specific method for obtaining the updated news features may refer to the method for obtaining the attention weight of the entity in S401.

[0104] S406: multiply the attention weight of each updated news feature by the corresponding updated news feature to obtain a weighted news feature of the updated news feature.

[0105] S407: taking the average value of the weighted news features of the news of interest corresponding to each user as the updated user feature of the user.

[0106] Furthermore, in the embodiment of the present invention, the recommendation value of the candidate news satisfies the following conditions: 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 the learnable network weight, and b is the learnable network parameter.

[0107] In practical applications, the recommendation value of the candidate news can be obtained based on the trained news recommendation value acquisition model. The trained news recommendation value acquisition model adopts the attention mechanism to obtain the recommendation value.

[0108] In the embodiment of the present invention, the updated news features and updated user features that integrate the event knowledge graph representation and the attention mechanism are used to calculate the recommendation value, which can take into account both the text information and the event knowledge information contained in the news and achieve precise ranking of the recommendation model.

[0109] In the embodiment of the present invention, the preset recommendation value is the median of the recommendation values ​​corresponding to the candidate news sets.

[0110] The inventors of the present invention have discovered that the median can adaptively filter according to the distribution of ranking scores, taking into account the differences between different users, ensuring that each user can obtain a certain amount of recommended news, while reducing the occurrence of overcrowding or oversparseness.

[0111] In summary, the news recommendation method provided by the embodiment of the present invention combines the event knowledge graph with the news recommendation system, aiming to introduce the event knowledge graph, a resource rich in information beyond interaction records, through a representation learning method, and significantly improve the accuracy and effectiveness of the recommendation algorithm. Using representation learning technology to extract and parse key information from the event knowledge graph and integrate it into user portraits and news portraits can effectively overcome the problem of monotony or deviation in recommended content caused by the excessive reliance of traditional recommendation algorithms on user historical behavior data. This process not only enhances the system's ability to capture users' immediate needs and potential interest preferences, but also enables the recommendation system to transcend traditional boundaries, understand and grasp users' real needs and expectations at a deeper level, and ultimately bring users news recommendation services that are more in line with their interests and needs.

[0112] An embodiment of the present invention also provides an electronic device, comprising: 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, and the instructions are configured to execute the method described in the embodiment of the present invention.

[0113] The embodiment of the present invention further provides a non-transitory computer-readable storage medium storing computer-executable instructions, wherein the computer instructions are used to execute the method described in the embodiment of the present invention.

[0114] 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 the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in the present invention can be achieved, and this document does not limit this.

[0115] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A news recommendation method, characterized in that: The method comprises the following steps: S100, obtaining initial news features of each piece of news in a news database, wherein the initial news features include corresponding news entity features and news text features; S200, obtaining a user corresponding to a news database, and obtaining a corresponding initial user feature based on an initial news feature of the news of interest corresponding to the user; S300, based on the similarity between users, the similarity between user news, the similarity between news, the frequency of common entity words and the user's interest field, the news that the user is potentially interested in is obtained from the news database as candidate news to form a candidate news set; S400, the initial news feature of each news in the news database is updated to obtain the updated news feature as the updated news feature, and the corresponding initial user feature is updated based on the updated news feature to obtain the updated user feature as the updated user feature; S500, obtaining a recommendation value corresponding to the candidate news based on the updated user feature and the updated news feature of the corresponding candidate news; S600: Recommend candidate news in the candidate news set whose recommendation value is greater than a preset recommendation value as recommended news and recommend it to the corresponding user.

2. The method according to claim 1, characterized in that S300 specifically includes: S301, obtaining the similarity between the initial user feature corresponding to the target user and the initial user feature corresponding to any other user, obtaining a first similarity set corresponding to the target user, and sorting the similarities in the first similarity set in descending order to obtain a sorted first similarity set, and obtaining the interested news corresponding to other users corresponding to the top N similarities from the sorted first similarity set to form a first candidate news set for the target user; wherein the target user is any user among the users corresponding to the news database, and the other user is any user among the users corresponding to the news database except the target user; S302, obtaining the similarity between the initial user feature corresponding to the target user and any other initial news feature, obtaining a second similarity set corresponding to the target user, and sorting the similarities in the second similarity set in descending order to obtain a sorted second similarity set, and obtaining news corresponding to the top N similarities from the sorted second similarity set to form a second candidate news set for the target user. The other initial news features are initial news features corresponding to the news database except for the initial news features corresponding to the target user; S303, obtaining the similarity between the initial news feature of each news of interest and any other initial news feature in the news of interest corresponding to the target user, obtaining a third similarity set corresponding to the target user, and sorting the similarities in the third similarity set in descending order to obtain a sorted third similarity set, and obtaining news corresponding to the top N similarities from the sorted third similarity set to form a third candidate news set for the target user; S304, obtaining the intersection between the entity set corresponding to the news of interest to the target user and the entity set corresponding to any other news as the co-reality entity between the target user and the other news, and obtaining the co-occurrence word frequency corresponding to the co-reality entity based on the word frequency of the co-reality entity in the news of interest to the target user and the word frequency in the other news, obtaining the co-occurrence word frequency set corresponding to the target user, and sorting the word frequency in the co-occurrence word frequency set in descending order to obtain a sorted co-occurrence word frequency set, and obtaining other news corresponding to the top N co-occurrence word frequencies from the sorted co-occurrence word frequency set to form a fourth candidate news set for the target user; the other news is news in the news database other than the news of interest to the target user; S305, sorting the news in the field of interest corresponding to the target user's field of interest in descending order of popularity value to obtain sorted news in the field of interest, and obtaining N candidate news from the sorted news in the field of interest to form a fifth candidate news set for the target user; S306, merging the first candidate news set to the fifth candidate news set for the target user to obtain a candidate news set that the target user is potentially interested in.

3. The method according to claim 1, characterized in that S100 specifically includes: S101, obtaining text features corresponding to each piece of news in a news database as news text features; S102, obtaining an entity corresponding to each piece of news in the news database, and obtaining an initial entity feature of each entity corresponding to each piece of news in the news database; S103, based on the position, word frequency and corresponding entity category of each entity corresponding to each news in the news database, generating a corresponding position encoding vector, word frequency encoding and category encoding for the entity; S104, fusing the initial entity features, position coding vectors, word frequency coding, and category coding of each entity in each news in the news database to obtain entity fusion features of each entity; S105, fusing all entity fusion features corresponding to each piece of news in the news database to obtain corresponding news entity features, and fusing the corresponding news entity features with the corresponding news text features to obtain corresponding initial news features.

4. The method according to claim 3, characterized in that The updating of the initial news feature based on the initial news feature and the news entity feature to obtain the updated news feature as the updated news feature specifically includes: S401, obtaining the attention weight of each entity corresponding to each piece of 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 piece of 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 piece of news in the news database to obtain the updated news feature corresponding to the news; The updating of the corresponding initial user features based on the updated news features to obtain the updated user features as the updated user features specifically includes: 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 by the corresponding updated news feature to obtain a weighted news feature of the updated news feature; S407: taking the average value of the weighted news features of the news of interest corresponding to each user as the updated user feature of the user.

5. The method according to claim 1, characterized in that The recommendation value of candidate news meets the following conditions: 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 the learnable network weight, and b is the learnable network parameter.

6. The method according to claim 1, characterized in that The preset recommendation value is the median of the recommendation values ​​corresponding to the candidate news sets.

7. The method according to claim 1, characterized in that The obtaining of the corresponding initial user features based on the initial news features of the news of interest to the user specifically includes: The initial news features of any user's news of interest are concatenated into a P×Q matrix as the matrix to be processed; where P is the number of news of interest to the user, and Q is the preset news vector dimension; The matrix to be processed is average pooled using an average pooling window of size P×1 to obtain a feature vector of size 1×Q as the corresponding initial user feature.

8. The method according to claim 1, characterized in that News text features are obtained based on the trained Roformer-sim model.

9. An electronic device, characterized in that: including a processor and a memory; The processor is used to execute the steps of the method according to any one of claims 1 to 8 by calling the program or instruction stored in the memory.

10. A non-transitory computer-readable storage medium, characterized in that: The non-transitory computer-readable storage medium is used to store a program or instruction, and the program or instruction enables a computer to execute the steps of the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Content recommend method and device

    CN108268619A

  • Information recommendation method, apparatus and device and medium

    CN108920649A

  • News recommendation method and system based on knowledge enhancement and attention mechanism

    CN114741599A

  • 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