An interpretable news recommendation method, apparatus, and storage medium
By acquiring user identity attributes and behavioral sequences, long-term and short-term interest vectors are generated. Combined with a knowledge base for semantic enhancement, the interpretability and reliability issues of news recommendation methods are solved, clear recommendation reasons and deep semantic connections are achieved, and user trust is improved.
Patent Information
- Application Number
- CN202511667038.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-14
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2045-11-14
AI Technical Summary
Existing news recommendation methods lack interpretability and semantic understanding depth, making it difficult to capture the deep semantic connections between users and news. Furthermore, traditional methods cannot clearly explain the reasons for recommendations, leading to decreased user trust and insufficient recommendation reliability.
By acquiring user identity attribute data and behavior sequences, long-term and short-term interest vectors are generated. These are then combined with a pre-set knowledge base for semantic enhancement, generating user preference vectors and news representations. Recommendation decisions are determined using vector similarity and semantic relevance, and explanatory information is provided.
It improves the interpretability and reliability of news recommendations, providing reliable analysis from the perspective of user attributes and behavior, capturing deep semantic relationships, providing clear reasons for recommendations, and enhancing user trust.
Smart Images

Figure CN121117339B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of user interaction technology, and in particular to an interpretable news recommendation method, apparatus, and storage medium. Background Technology
[0002] With the rapid development of information technology, the amount of news on the internet has exploded, and users are facing a serious problem of information overload. News recommendation systems, as a core tool for solving this problem, can filter information based on users' interests and preferences, providing personalized services, and have become an indispensable part of information platforms.
[0003] Traditional news recommendation methods are mainly divided into two categories: one is based on statistical patterns (such as collaborative filtering), which generates recommendations by analyzing the user's interaction history with news and mining statistical patterns in group behavior; the other is based on shallow semantic matching (such as TF-IDF-based content recommendation), which achieves matching by calculating the literal similarity between the user's historical browsing text and candidate news articles. However, these methods have the following limitations in news recommendation scenarios:
[0004] (1) Poor interpretability: Traditional methods rely on black box models (such as deep neural networks) to output recommendation results, which cannot clearly explain "why a certain news is recommended". With the development of relevant laws and regulations, news recommendation has higher requirements for the transparency of recommendation logic. Lack of explanation will reduce user trust and may also be inconsistent with platform norms.
[0005] (2) Insufficient semantic understanding: News contains a large number of professional terms (such as "financial report" and "price-earnings ratio") and entity relationships (such as corporate mergers and acquisitions and industry associations). Traditional methods rely only on the surface features of the text (such as keyword matching) or statistical patterns, making it difficult to capture the deep semantic relationship between users and news (such as the implicit match between users' professions and the news industry), which ultimately leads to insufficient reliability of news recommendations.
[0006] Therefore, it is necessary to propose a new news recommendation method to achieve interpretability of the news recommendation process and improve the reliability of news recommendations. Summary of the Invention
[0007] This invention provides an interpretable news recommendation method, apparatus, and storage medium to achieve interpretability in the news recommendation process and improve the reliability of news recommendations.
[0008] The first aspect of this invention discloses an interpretable news recommendation method, the method comprising:
[0009] Obtain user identity attribute data, and determine the user's corresponding interest inference result based on the identity attribute data;
[0010] Obtain user behavior sequences, and divide the user behavior sequences into long-term behavior sequences and short-term behavior sequences based on the time information corresponding to the user behavior sequences; determine long-term interest vectors based on the long-term behavior sequences, and determine short-term interest vectors based on the short-term behavior sequences;
[0011] Based on the interest inference results, long-term interest vectors, and short-term interest vectors, a user preference vector and a first text description corresponding to the user preference vector are generated.
[0012] Candidate news is obtained, semantic features of the candidate news are extracted, semantic enhancement operation is performed on the semantic features according to a preset knowledge base, an enhanced news representation is obtained, and a second text description corresponding to the enhanced news representation is generated.
[0013] Based on the preference vector and the enhanced news representation, vector similarity and first matching information are generated; based on the first text description and the second text description, semantic relevance and second matching information are generated; based on the vector similarity and the semantic relevance, a decision label for the candidate news is determined, and the decision label is used to indicate whether to recommend the candidate news to the user.
[0014] Explanatory information is generated based on the first matching information and the second matching information, and the explanation information is used to show the user the reasons for the recommendation.
[0015] A second aspect of the present invention discloses an interpretable news recommendation device, the device comprising:
[0016] The attribute acquisition module is used to acquire user identity attribute data and determine the user's corresponding interest inference result based on the identity attribute data.
[0017] The behavior acquisition module is used to acquire user behavior sequences, divide the user behavior sequences into long-term behavior sequences and short-term behavior sequences based on the time information corresponding to the user behavior sequences, determine long-term interest vectors based on the long-term behavior sequences, and determine short-term interest vectors based on the short-term behavior sequences.
[0018] The preference analysis module is used to generate a user preference vector and a first text description corresponding to the user preference vector based on the interest inference results, long-term interest vector and short-term interest vector.
[0019] The semantic enhancement module is used to acquire candidate news, extract the semantic features of the candidate news, perform semantic enhancement operations on the semantic features according to a preset knowledge base, obtain an enhanced news representation, and generate a second text description corresponding to the enhanced news representation.
[0020] The news recommendation module is used to generate vector similarity and first matching information based on the preference vector and the enhanced news representation; generate semantic relevance and second matching information based on the first text description and the second text description; and determine the decision label of the candidate news based on the vector similarity and the semantic relevance, wherein the decision label is used to indicate whether to recommend the candidate news to the user.
[0021] The explanation module is used to generate explanation information based on the first matching information and the second matching information, and the explanation information is used to show the user the reasons for the recommendation.
[0022] As an optional implementation, in a second aspect of the present invention, the specific operation method by which the attribute acquisition module determines the user's corresponding interest inference result based on the identity attribute data includes:
[0023] Based on the identity attribute data, multiple identity attributes are determined and a corresponding attribute weight is determined for each identity attribute. The attribute weight is used to measure the degree of influence of the corresponding identity attribute on the user's interests.
[0024] Construct a set of natural language descriptions based on all the aforementioned identity attributes and the attribute weights corresponding to each identity attribute;
[0025] The natural language description set is input into a pre-trained LLM model to obtain an intermediate representation and multiple interest domains generated by the LLM model. The intermediate representation includes all identity attributes and semantic extensions corresponding to each identity attribute.
[0026] For each of the interest domains, the contribution of each identity attribute to the interest domain is determined based on the intermediate representation, and the confidence level corresponding to the interest domain is calculated based on the attribute weight and contribution of each identity attribute.
[0027] All interest domains with a confidence level greater than a preset confidence threshold are selected as the user's corresponding interest inference results.
[0028] As an optional implementation, in a second aspect of the present invention, the user behavior sequence includes user browsing records and a timestamp corresponding to each browsing record; the specific operation method by which the behavior acquisition module determines the long-term interest vector based on the long-term behavior sequence includes:
[0029] The long-term behavior sequence is traversed using a sliding window of a preset size. During the traversal, a compression step is performed every time the sliding window moves to obtain the interest features corresponding to the current sliding window.
[0030] Based on all the interest features obtained during the traversal process, a long-term interest vector is obtained;
[0031] The compression step includes:
[0032] Extract keywords from all browsing records in the sliding window. For each browsing record in the sliding window, determine the time weight of the browsing record based on the timestamp corresponding to the browsing record, determine the keyword weight of the browsing record based on the number of times the keyword corresponding to the browsing record appears in the sliding window, and determine the compression weight of the browsing record based on the time weight and the keyword weight.
[0033] The top K browsing records sorted by compression weight are selected from the sliding window as the interest features corresponding to the sliding window.
[0034] As an optional implementation, in a second aspect of the invention, the compression step further includes:
[0035] Based on the semantic relationship between any two keywords in the sliding window, determine multiple semantic domains corresponding to all keywords in the sliding window; based on the number of keywords corresponding to each semantic domain, determine the domain weight corresponding to each semantic domain.
[0036] Arrange all the semantic domains corresponding to the sliding window and the domain weights corresponding to each semantic domain according to a normal distribution, fit the normal distribution curve corresponding to the normal distribution arrangement of the semantic domains, and obtain the standard deviation of the normal distribution curve;
[0037] The K value corresponding to the sliding window is determined based on the standard deviation, wherein the larger the standard deviation, the smaller the corresponding K value.
[0038] As an optional implementation, in a second aspect of the present invention, the semantic enhancement module extracts the semantic features of the candidate news, performs semantic enhancement operations on the semantic features according to a preset knowledge base, obtains an enhanced news representation, and generates a second text description corresponding to the enhanced news representation. The specific operation includes:
[0039] The candidate news items are input into a pre-trained LLM model to obtain a set of news features;
[0040] Named entity recognition technology is used to extract entity sets from the candidate news, and all knowledge subgraphs corresponding to the entity sets are constructed according to a preset knowledge base. Natural language descriptions corresponding to the knowledge subgraphs are obtained from the knowledge subgraphs. The knowledge subgraphs include any two entities in the entity set and the relationship between the two entities.
[0041] Obtain the summary description corresponding to each entity in the entity set in the preset knowledge base;
[0042] All news features, natural language descriptions corresponding to all the knowledge subgraphs, and summary descriptions corresponding to all the entities are input into a pre-trained multi-source fusion gating network to obtain an enhanced news representation and generate a second text description corresponding to the enhanced news representation.
[0043] As an optional implementation, in a second aspect of the invention, the semantic enhancement module inputs all news features, natural language descriptions corresponding to all the knowledge subgraphs, and summary descriptions corresponding to all the entities into a pre-trained multi-source fusion gating network to obtain a specific operation method for enhancing news representation, including:
[0044] All news features, natural language descriptions corresponding to all the knowledge subgraphs, and summary descriptions corresponding to all the entities are embedded into their respective vector spaces to obtain the first embedding vector. Second embedding vector and the third embedding vector ;
[0045] The gate vector Dc is calculated using the following formula:
[0046]
[0047] in, This represents the Sigmoid activation function. Represents a learnable weight matrix based on linear transformation;
[0048] The enhanced news representation Z is calculated using the following formula:
[0049]
[0050] In the above formula, Represents the Hadamard product. Assign weights to the preset first information. Assign weights to the preset second information, where, .
[0051] As an optional implementation, in a second aspect of the invention, the explanation module generates explanation information based on the first matching information and the second matching information. The explanation information is used to demonstrate to the user the specific operation method of the recommendation reason, including:
[0052] A matching score is determined based on the vector similarity and the semantic relevance, and the matching score is used to measure the degree of matching between the first matching information and the second matching information.
[0053] Using a natural logic reasoning chain format, interpretable information is generated based on the first matching information, the second matching information, and the matching score.
[0054] A third aspect of the present invention discloses an interpretable news recommendation system, the system comprising:
[0055] Memory containing executable program code;
[0056] A processor coupled to the memory;
[0057] The processor invokes the executable program code stored in the memory to execute some or all of the steps in the interpretable news recommendation method according to any of the first aspects of the present invention.
[0058] The fourth aspect of the present invention discloses a computer storage medium storing computer instructions, which, when invoked by a processor, are used to execute some or all of the steps in the interpretable news recommendation method described in any of the first aspects of the present invention.
[0059] Compared with the prior art, the present invention has the following beneficial effects:
[0060] The interpretable news recommendation method in this invention generates a user preference vector based on interest inference results, long-term interest vectors, and short-term interest vectors. This user preference vector is derived from a comprehensive analysis of user attributes, long-term behavior, and short-term behavior, thus providing a more reliable analysis from the user's attribute and behavioral perspective. For the semantic features of candidate news articles, semantic enhancement is performed using a pre-defined knowledge base, achieving a higher depth of semantic understanding. Vector similarity provides a basis for news recommendation from a feature analysis perspective, while semantic relevance provides a basis from a semantic analysis perspective. Combining these two methods captures the deep semantic connections between users and news, ultimately improving the reliability of news recommendations. Finally, the first matching information consists of mutually matching features, and the second matching information consists of mutually matching text descriptions. Combining these two methods demonstrates the reasoning or rationale behind the news recommendations to the user, making the news recommendation method of this invention interpretable. Attached Figure Description
[0061] 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.
[0062] Figure 1 This is a flowchart illustrating an interpretable news recommendation method disclosed in an embodiment of the present invention;
[0063] Figure 2 This is a flowchart illustrating a three-stage news recommendation method based on thought chain prompts and a large language model disclosed in an embodiment of the present invention.
[0064] Figure 3 This is a flowchart illustrating the user modeling CoT inference stage disclosed in an embodiment of the present invention;
[0065] Figure 4 This is a schematic diagram of the working process of the two-layer news enhancement representation model disclosed in the embodiments of the present invention;
[0066] Figure 5 This is a flowchart illustrating the news recommendation generation stage as disclosed in an embodiment of the present invention;
[0067] Figure 6 This is a graph showing the performance difference between the three-stage news recommendation method based on mind chain prompts and a large language model proposed in this embodiment of the invention and the baseline method under limited learning conditions.
[0068] Figure 7 This is a schematic diagram of the structure of an interpretable news recommendation device disclosed in an embodiment of the present invention;
[0069] Figure 8 This is a schematic diagram of the structure of an interpretable news recommendation system disclosed in an embodiment of the present invention. Detailed Implementation
[0070] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. 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.
[0071] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this invention are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, apparatus, product, or end that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or ends.
[0072] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of the invention. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.
[0073] This invention discloses an interpretable news recommendation method, apparatus, and storage medium, used to achieve interpretability in the news recommendation process and improve the reliability of news recommendations. These are described in detail below.
[0074] Example 1
[0075] like Figure 1 As shown, Embodiment 1 of the present invention discloses an interpretable news recommendation method, which can be integrated into a news recommendation device, which can in turn be integrated into a local server or a cloud server. Specifically, the interpretable news recommendation method disclosed in Embodiment 1 of the present invention may include:
[0076] Step 101: Obtain user identity attribute data and determine the user's corresponding interest inference result based on the identity attribute data.
[0077] In this embodiment of the invention, the interest inference result is used to represent the degree of user interest in different interest areas, and the user identity attribute data can be a sequence of "attribute-value" pairs:
[0078] , This represents the i-th attribute (e.g., gender, age, education level, income, etc.). Let represent the value of the i-th attribute, and M represent the number of attributes. Different identity attributes often lead to corresponding areas of interest. Comprehensive analysis of multiple identity attributes can infer the degree of user interest in different areas of interest, thus obtaining interest inference results.
[0079] Step 102: Obtain user behavior sequences. Based on the time information corresponding to the user behavior sequences, divide the user behavior sequences into long-term behavior sequences and short-term behavior sequences. Determine the long-term interest vector based on the long-term behavior sequences and the short-term interest vector based on the short-term behavior sequences.
[0080] In this embodiment of the invention, user behavior consists of long-term behavior and short-term behavior. Long-term behavior reflects a user's relatively stable long-term interests, while short-term behavior reflects a user's sudden interest in the short term. Both can reflect a user's interests based on their behavior. Specifically, the user's browsing history can be obtained first, denoted as user behavior sequence C, where... ,in, For users' news browsing history, Let n be the timestamp and n be the total number of browsing records. Then, based on the timestamps, the user behavior sequence is divided into short-term and long-term windows to distinguish between short-term interests and long-term preferences; for example, browsing records within 7 days are defined as short-term behavior sequences, and browsing records within 90 days are defined as long-term behavior sequences, thus constructing two sub-sequences:
[0081]
[0082] In the above formula, Represents a short-term user behavior sequence. Represents a long-term sequence of user behavior. For the current moment and The difference.
[0083] Step 103: Based on the interest inference results, long-term interest vector, and short-term interest vector, generate user preference vector and the first text description corresponding to the user preference vector.
[0084] In this embodiment of the invention, the user preference vector is obtained based on a comprehensive analysis of user attributes, long-term behavior, and short-term behavior, thus providing a more reliable analysis from the perspective of user attributes and behavior. Furthermore, generating corresponding text descriptions for this user preference vector not only increases interpretability but also facilitates subsequent news recommendation operations from a natural language perspective.
[0085] Step 104: Obtain candidate news, extract semantic features of candidate news, perform semantic enhancement operation on semantic features according to preset knowledge base, obtain enhanced news representation and generate second text description corresponding to enhanced news representation.
[0086] In this embodiment of the invention, the semantic features of candidate news are semantically enhanced by combining them with a preset knowledge base. For example, the semantic features are enhanced by combining them with the online knowledge base of Wikipedia, thereby achieving a higher depth of semantic understanding.
[0087] Step 105: Generate vector similarity and first matching information based on preference vector and enhanced news representation; generate semantic relevance and second matching information based on first and second text descriptions; determine the decision label of candidate news based on vector similarity and semantic relevance.
[0088] In this embodiment of the invention, the decision label is used to indicate whether to recommend candidate news to the user. In this embodiment, vector similarity provides a basis for news recommendation from the perspective of feature analysis, while semantic relevance provides a basis for news recommendation from the perspective of semantic analysis. The combination of the two can capture the deep semantic relationship between users and news (such as the implicit match between a user's profession and the news industry), ultimately improving the reliability of news recommendations.
[0089] Step 106: Generate explanatory information based on the first matching information and the second matching information. The explanatory information is used to show the user the reasons for the recommendation.
[0090] In this embodiment of the invention, the first matching information is mutually matching features, and the second matching information is mutually matching text descriptions. The combination of the two can show users the ideas or reasons for news recommendations, making the news recommendation method of the present invention interpretable.
[0091] As can be seen, the interpretable news recommendation method in this embodiment generates a user preference vector based on interest inference results, long-term interest vectors, and short-term interest vectors. The user preference vector is obtained through a comprehensive analysis of user attributes, long-term behavior, and short-term behavior, thus providing a more reliable analysis from the user's attribute and behavioral perspective. For the semantic features of candidate news, semantic enhancement is performed using a pre-set knowledge base, achieving a higher depth of semantic understanding. Vector similarity provides a basis for news recommendation from the perspective of feature analysis, while semantic relevance provides a basis for news recommendation from the perspective of semantic analysis. The combination of these two methods can capture the deep semantic relationship between users and news, ultimately improving the reliability of news recommendations. Finally, the first matching information consists of mutually matching features, and the second matching information consists of mutually matching text descriptions. The combination of these two methods can demonstrate the thought process or reasoning behind the news recommendations to the user, making the news recommendation method of this invention interpretable.
[0092] In an optional embodiment, determining the user's interest inference result based on identity attribute data includes:
[0093] Based on the identity attribute data, multiple identity attributes are identified and a corresponding attribute weight is assigned to each identity attribute. The attribute weight is used to measure the degree of influence of the corresponding identity attribute on user interests.
[0094] A set of natural language descriptions is constructed based on all identity attributes and the attribute weights corresponding to each identity attribute; for example, an artificial intelligence model can be used to analyze identity attributes and attribute weights to construct a set of natural language descriptions.
[0095] Input the set of natural language descriptions into the pre-trained LLM model to obtain the intermediate representation and multiple interest domains generated by the LLM model. The intermediate representation includes all identity attributes and the semantic extension corresponding to each identity attribute.
[0096] For each interest domain, the contribution of each identity attribute to that interest domain is determined based on the intermediate representation. Based on the attribute weight and contribution of each identity attribute, the confidence level corresponding to that interest domain is calculated. The confidence level is used as the selection criterion for interest domains.
[0097] All interest domains with a confidence level greater than a preset confidence threshold are selected as the user's corresponding interest inference results.
[0098] For this optional embodiment, an example is given below:
[0099] Chain of Reasoning (CoT) is a technique that simulates the human logical reasoning process. Its core is to break down complex problems into progressively solvable sub-problems through a series of intermediate reasoning steps, ultimately leading to a conclusion. In natural language processing and user modeling tasks, CoT allows models to move beyond the "black box" mode of directly outputting results. By integrating information and correcting biases through explicit reasoning chains, it can more accurately capture user needs or preferences. In the CoT reasoning stage of user modeling, this optional embodiment integrates user information through two-tiered reasoning, progressively generating user preferences through CoT, specifically including:
[0100] Step 1.1, First Cascade Reasoning: Interest Inference Based on Attributes;
[0101] Step 1.1.1: Obtain the user's "attribute-value" pair sequence data. , This represents the i-th attribute (e.g., gender, age, education level, income, etc.). This represents the value of the i-th attribute, and M represents the number of attributes;
[0102] Step 1.1.2: Assign learnable weights to each attribute. This reflects the degree of its impact on user interests; design semantically reserved prompt templates. The user attribute data is transformed into a coherent set of natural language descriptions using equation (1). :
[0103] (1)
[0104] In equation (1), LLM represents a large language model. express The i-th attribute description output by the large language model This represents the weight of the i-th attribute;
[0105] The specific format is: "based on user attribute name" Attribute values and their weights To generate a coherent natural language description, the attribute should reflect its impact on user interests.
[0106] Step 1.1.3: Large LLM (Limited Learning Model) demonstrates unique advantages in news analysis and user interest mining. It can accurately analyze semantic information, relationships, and even underlying intentions in news texts, providing strong support for inferring user interests. Based on this, [the following steps are taken]. Inputting LLM allows the system to guide users in inferring their interests through prompts, specifically including:
[0107] Step 1.1.3.1: Constructing an LLM to generate an intermediate representation It includes semantic expansion and association mapping of attribute values: , Indicates the first The semantic extension corresponding to each attribute value, " indicates a mapping relationship.
[0108] Step 1.1.3.2: Based on intermediate representation Each interest area is calculated by weighted summation. confidence level :
[0109] (2)
[0110] In equation (2), The contribution of the i-th attribute to the j-th interest domain can be generated by LLM based on semantic relevance.
[0111] Step 1.1.3.3: Filter the set of highly credible interest areas. As an attribute-based interest inference result, This is the preset confidence threshold.
[0112] In another optional embodiment, the user behavior sequence includes user browsing history and a timestamp corresponding to each browsing history; a long-term interest vector is determined based on the long-term behavior sequence, including:
[0113] The long-term behavior sequence is traversed using a sliding window of a preset size. During the traversal, a compression step is performed every time the sliding window moves to obtain the interest features corresponding to the current sliding window.
[0114] Based on all the interest features obtained during the traversal process, a long-term interest vector is obtained;
[0115] The compression steps include:
[0116] Extract keywords from all browsing records in the sliding window. For each browsing record in the sliding window, determine the time weight of the browsing record based on the timestamp corresponding to the browsing record, determine the keyword weight of the browsing record based on the number of times the keywords corresponding to the browsing record appear in the sliding window, and determine the compression weight of the browsing record based on the time weight and keyword weight.
[0117] The top K browsing records, sorted by compression weight, are selected from the sliding window to represent the interest features corresponding to the sliding window.
[0118] For short-term behavior sequences, the same method described above is used to determine the short-term interest vector based on the short-term behavior sequence.
[0119] In this optional embodiment, the amount of user browsing history data may be very large, and it may contain various noises or useless data. Therefore, it is necessary to optimize the user browsing history data to reduce the amount of data and extract more useful data. To this end, this optional embodiment employs a sliding window traversal data compression method. For example, the sliding window can be an n×m window that moves 'a' data units at a time, thereby traversing the entire long-term or short-term behavior sequence.
[0120] Regarding the compression step in the traversal process, this optional embodiment first considers the browsing time of each browsing record. Generally, the longer the browsing time, the greater the influence of the browsing record. Secondly, the invention also considers the frequency of different keywords. Generally, in a sliding window, different browsing records correspond to different keywords, and the frequency of each keyword in the entire sliding window can reflect the importance of the keyword. Then, the keyword weight corresponding to the browsing record is determined according to the number of times the keyword corresponding to the browsing record appears in the sliding window. For example, if a certain browsing record corresponds to multiple high-frequency keywords, then the browsing record is more likely to reflect the user's interests.
[0121] Finally, this optional embodiment determines the compression weight corresponding to the browsing record based on time weight and keyword weight; and selects the top K browsing records in the compression weight sorting from the sliding window as the interest features corresponding to the sliding window, which can reduce the amount of data and extract more useful interest feature data.
[0122] In this optional embodiment, K can be a preset positive integer; however, the data quality of different sliding windows is actually different. For example, if the distribution of keywords in some data windows is relatively messy, it often indicates that the user's browsing is rather casual, and the browsing history in that sliding window reflects the user's interests to a low degree. Conversely, if the distribution of keywords in a certain sliding window is very concentrated, for example, most keywords are related to "enterprise management," it indicates that the data quality of that sliding window is high, and its reflection of user interests is high. Therefore, in this optional embodiment, the compression step may further optionally include:
[0123] Based on the semantic relationship between any two keywords in the sliding window, determine multiple semantic domains corresponding to all keywords in the sliding window. Then, determine the domain weight for each semantic domain based on the number of keywords corresponding to each semantic domain. For example, based on the semantic relationship between all keywords in the sliding window, semantic domains include business management, stocks, corporate team building, career planning, savings, and the real estate market. Then, determine the domain weight for each semantic domain based on the total number of keywords corresponding to each semantic domain. Correspondingly, if the weight parameters for each semantic domain are roughly the same, it often means that the browsing history in the sliding window represents a general browsing rather than detailed reading based on interest. Therefore, the data quality in the sliding window is low in this state, and its corresponding K value can be lowered. Conversely, if the weight parameter for the semantic domain "real estate market" is significantly higher than the weight parameters of other semantic domains, it indicates that the real estate market is an object the user wants to browse in detail. In this case, the browsing history in the sliding window better reflects the user's interests, and its corresponding K value can be increased.
[0124] Based on the above description, it can be seen that this optional embodiment actually measures the importance of the data browsed within the sliding window by the degree of concentration of weight parameters corresponding to the semantic domain. To better utilize this degree of concentration, this optional embodiment further proposes:
[0125] Arrange all semantic domains corresponding to the sliding window and the domain weights corresponding to each semantic domain according to a normal distribution, fit the normal distribution curve corresponding to the normal distribution of semantic domains, and obtain the standard deviation of the normal distribution curve;
[0126] The K value corresponding to the sliding window is determined based on the standard deviation, where the larger the standard deviation, the smaller the corresponding K value.
[0127] For a normal distribution, a smaller standard deviation results in a taller, narrower distribution curve, indicating more concentrated data. Conversely, a larger standard deviation results in a shorter, wider distribution curve, indicating more dispersed data. This application utilizes this characteristic of the normal distribution, as well as the fact that semantic distributions generally conform to a normal distribution, to determine the K value using the fitted standard deviation. This approach provides a more reliable and efficient determination of the K value, thereby further improving the reliability of user interest analysis.
[0128] In another optional embodiment, semantic features of candidate news are extracted, and semantic enhancement operations are performed on the semantic features according to a preset knowledge base to obtain an enhanced news representation and generate a second text description corresponding to the enhanced news representation, including:
[0129] Input candidate news into a pre-trained LLM model to obtain a set of news features;
[0130] Named entity recognition technology is used to extract entity sets from candidate news articles. Based on a pre-defined knowledge base, all knowledge subgraphs corresponding to the entity sets are constructed, and the natural language descriptions corresponding to the knowledge subgraphs are obtained. The knowledge subgraphs include any two entities in the entity set and the relationship between the two entities.
[0131] Retrieve the summary description of each entity in the entity set of the preset knowledge base;
[0132] All news features, natural language descriptions corresponding to all knowledge subgraphs, and summary descriptions corresponding to all entities are input into a pre-trained multi-source fusion gating network to obtain an enhanced news representation and generate a second text description corresponding to the enhanced news representation.
[0133] The optional embodiment is illustrated below:
[0134] like Figure 3 As shown, since the recommendation dataset may lack relevant knowledge about news features, it is necessary to extract relevant knowledge from LLM or external knowledge to align the generated users and news. In the news semantic enhancement CoT inference stage, a two-layer news enhancement representation model is constructed using a two-layer modeling method of "feature extraction (semantic layer) + knowledge enhancement (knowledge layer)," specifically including:
[0135] Step 2.1: Extract news features from the semantic layer, specifically including:
[0136] Step 2.1.1: Design a prompt template Guide LLM to extract candidate news Feature dimension set ,in Here, k is the name of the feature dimension, and k is the number of features.
[0137] News Feature Extraction Tip Template The text description is: "From news text" Extract the core feature dimensions and list the specific feature dimension names.
[0138] Step 2.1.2: Extract entities using Named Entity Recognition (NER) ,in Represents the i-th entity, "" indicates the correspondence between news items and entities, where s is the total number of entities;
[0139] Step 2.2: To overcome the limitations of the news text itself, in this optional embodiment, external knowledge is used to enhance the knowledge layer of the news. This process provides the LLM with the background knowledge needed to understand the news, specifically including:
[0140] Step 2.2.1: Based on the entity E extracted in Step 2.1.2, find the knowledge subgraph G related to this entity, and use triples... Composition, in which, and Representing entities, Represents the relationship between entities;
[0141] Step 2.2.2: Design a relational mapping prompt template for converting knowledge graphs into natural language. The retrieved knowledge subgraphs are transformed into natural language descriptions. ;
[0142] Prompt Template The text structure is: "to use knowledge graphs" The output should be smoothly converted into spoken text. Requirements: 1) Maintain the integrity of the logical relationship chain; 2) The path between entities should not exceed 3 hops; 3) The output should be a coherent paragraph.
[0143] Step 2.2.3: Obtain information from Wikipedia related to... Relevant summaries and their text descriptions are generated. .
[0144] In this optional embodiment, further optionally, inputting all news features, natural language descriptions corresponding to all knowledge subgraphs, and summary descriptions corresponding to all entities into a pre-trained multi-source fusion gating network to obtain enhanced news representations may include:
[0145] All news features, natural language descriptions corresponding to all knowledge subgraphs, and summary descriptions corresponding to all entities are embedded into their respective vector spaces to obtain the first embedding vector. Second embedding vector and the third embedding vector ;
[0146] The gate vector Dc is calculated using the following formula:
[0147]
[0148] in, This represents the Sigmoid activation function. Represents a learnable weight matrix based on linear transformation;
[0149] The enhanced news representation Z is calculated using the following formula:
[0150]
[0151] In the above formula, Represents the Hadamard product. Assign weights to the preset first information. Assign weights to the preset second information, where, .
[0152] The optional embodiment is illustrated below:
[0153] Step 2.3: Design a multi-source fusion gating network and embed news features. Knowledge graph description embedding Embedding with Wikipedia summaries Input into the entry control network to generate enhanced representations Specifically, it includes:
[0154] Step 2.3.1, , and The input is fed into the embedding layer of the BERT pre-trained language model to obtain fixed-dimensional embedding vectors. , and ;
[0155] Step 2.3.2: Calculate the gating vector The fusion weights for the three embeddings mentioned above are used to dynamically allocate the weights, and the calculation formula is as follows:
[0156] (6)
[0157] In equation (6), Represents the Sigmoid activation function. It is a learnable weight matrix used for linear transformations, where the semicolons indicate vector concatenation operations. This means embedding its internal vectors into a corresponding vector space.
[0158] By assigning dynamic weights to embeddings from different sources using the gated vector Dc, the core features of the news itself are preserved, while the semantics are enhanced by supplementing information from knowledge graphs and Wikipedia.
[0159] Step 2.3.3: Calculate the enhanced representation Z, whose textual description is Fz;
[0160] (7)
[0161] In equation (7), This represents the Hadamard product. and Assign weights to the pre-defined supplementary information. It leans towards precise associations based on knowledge graphs. Background expansion leaning towards Wikipedia, satisfying It can be learned through training, and the initial value can be set to... and .
[0162] In yet another optional embodiment, explanatory information is generated based on the first matching information and the second matching information. This explanatory information is used to present the recommendation reasons to the user, including:
[0163] The matching score is determined based on vector similarity and semantic relevance. The matching score is used to measure the degree of matching between the first matching information and the second matching information.
[0164] Using a natural logic reasoning chain format, interpretable information is generated based on the first matching information, the second matching information, and the matching score.
[0165] Example 2
[0166] Based on the same inventive concept, Embodiment 2 of the present invention discloses another interpretable news recommendation method, which can also be called a three-stage news recommendation method and system based on thought chain prompts and a large language model.
[0167] Embodiment 2 of this invention reveals the following drawbacks of existing news recommendation methods:
[0168] Poor interpretability: Traditional methods often rely on black-box models (such as deep neural networks) to output recommendation results, which cannot clearly explain "why a certain news item is recommended". In some fields, users have high requirements for the transparency of the recommendation logic, and the lack of explanation will reduce user trust.
[0169] Insufficient semantic understanding depth: News contains a large number of professional terms (such as "financial report" and "price-earnings ratio") and entity relationships (such as corporate mergers and acquisitions and industry associations). Traditional methods rely only on surface features of the text (such as keyword matching) or statistical patterns, making it difficult to capture the deep semantic relationship between users and news (such as the implicit match between users' professions and the news industry).
[0170] User preference modeling is crude: users' preferences for news are dynamic (short-term focus on market hotspots, long-term stability in specific industries). Traditional methods often treat user behavior sequences as static data, failing to distinguish between short-term and long-term interests, resulting in recommendation results lagging behind changes in user interests.
[0171] Weak ability to integrate external knowledge: Understanding news relies on background knowledge (such as corporate background and industry rules), and traditional recommendation systems have difficulty effectively integrating external knowledge (such as knowledge graphs and encyclopedic knowledge), which limits the exploration of the deeper meaning of news.
[0172] In recent years, large language models (LLMs) have shown potential in the recommendation field due to their powerful natural language understanding and logical reasoning capabilities. However, existing LLM-based recommendation methods still have shortcomings: directly using LLMs to generate recommendation results does not fully guide them to simulate the step-by-step reasoning process of human experts; news modeling is limited to the text itself and does not combine external knowledge to enhance semantics; user preference modeling lacks an explicit long-term and short-term distinction mechanism, resulting in room for improvement in recommendation accuracy and interpretability.
[0173] Therefore, there is an urgent need for a news recommendation solution that can guide LLM to perform logical reasoning and integrate multi-dimensional information in stages, in order to solve at least one of the above-mentioned technical problems.
[0174] like Figure 2 As shown, the three-stage news recommendation method based on thought chain prompts and a large language model disclosed in Embodiment 2 of the present invention includes three stages:
[0175] In the CoT inference stage of user modeling, user information is integrated to generate user preferences through two-level inference (attribute-based interest inference and behavior sequence-based preference mining);
[0176] In the news semantic enhancement CoT reasoning stage, a two-layer model of "feature extraction + knowledge enhancement" is used to generate enhanced news representations by combining knowledge graphs and Wikipedia knowledge.
[0177] In the news recommendation generation stage, user preferences and enhanced news representations are integrated through CoT prompts. Recommendation results are generated based on two-dimensional matching scores and supervised fine-tuning. The final recommendation results output by the model include decision labels for whether to recommend and interpretable basis.
[0178] Embodiment 2 of the present invention solves the problems of poor interpretability, shallow semantic matching, and coarse user preference modeling in traditional recommendation systems, and improves the accuracy, transparency and credibility of recommendations, making it suitable for various personalized news recommendation scenarios.
[0179] Specifically, this three-stage news recommendation method based on thought chain prompts and a large language model can include:
[0180] Step 1: Chain of Reasoning (CoT) is a technique that simulates the human logical reasoning process. Its core is to break down complex problems into solvable sub-problems through a series of intermediate reasoning steps, ultimately leading to a conclusion. In natural language processing and user modeling tasks, CoT allows models to move beyond the "black box" mode of directly outputting results. By integrating information and correcting biases through explicit reasoning chains, it can more accurately capture user needs or preferences. For example... Figure 3 As shown, in the CoT inference stage of user modeling, this invention integrates user information through two-level cascaded inference and gradually generates user preferences through CoT, specifically including:
[0181] Step 1.1, First Cascade Reasoning: Interest Inference Based on Attributes;
[0182] Step 1.1.1: Obtain the user's "attribute-value" pair sequence data. , This represents the i-th attribute (e.g., gender, age, education level, income, etc.). This represents the value of the i-th attribute, and M represents the number of attributes;
[0183] Step 1.1.2: Assign learnable weights to each attribute. This reflects the degree of its impact on user interests; design semantically reserved prompt templates. Equation (1) is used to transform user attribute data into a coherent set of natural language descriptions. :
[0184] (1)
[0185] In equation (1), LLM represents a large language model. express The i-th attribute description output by the large language model This represents the weight of the i-th attribute;
[0186] The specific format is: "based on user attribute name" Attribute values and their weights To generate a coherent natural language description, the attribute should reflect its impact on user interests.
[0187] Step 1.1.3: Large LLM (Limited Learning Model) demonstrates unique advantages in news analysis and user interest mining. It can accurately analyze semantic information, relationships, and even underlying intentions in news texts, providing strong support for inferring user interests. Based on this, [the following steps are taken]. Inputting LLM allows the system to guide users in inferring their interests through prompts, specifically including:
[0188] Step 1.1.3.1: Constructing an LLM to generate an intermediate representation It includes semantic expansion and association mapping of attribute values: , This represents the semantic extension corresponding to the i-th attribute value. This indicates a mapping relationship.
[0189] Step 1.1.3.2: Based on the intermediate representation Z, calculate the summation for each interest domain using weighted summation. confidence level :
[0190] (2)
[0191] In equation (2), The contribution of the i-th attribute to the j-th interest domain can be generated by LLM based on semantic relevance.
[0192] Step 1.1.3.3: Filter the set of highly credible interest areas. As an attribute-based interest inference result This is the preset confidence threshold.
[0193] Step 1.2, Second-level cascaded reasoning: User preference mining based on behavioral sequences;
[0194] Step 1.2.1: Obtain the user's click history as the user behavior sequence C, denoted as: ,in, For users' news browsing history, Let n be the timestamp and n be the total number of browsing records. Then, the user's behavior sequences over the past 7 days and 90 days are divided into short-term and long-term windows to distinguish between short-term interests and long-term preferences; two sub-sequences are constructed:
[0195] (3)
[0196] In equation (3), Represents a short-term user behavior sequence. Represents a long-term sequence of user behavior. For the current moment and The difference;
[0197] right and Each news item and its time are encoded and then concatenated to obtain a sequence containing both news and time features. Since the original sequence is too long during concatenation, a sliding window approach can be used, similar to Example 1, to compress the features into shorter sequences. and long-term characteristics .
[0198] Step 1.2.2: Design a prompt template and ,Will , And in step 1.1.3.3 as well as and Input a large model and have it output short-term interest vectors step by step. and long-term interest vector :
[0199] (4)
[0200] In equation (4), This represents a concatenation operation, which combines the prompt string with the subsequent tensor content in sequence to form a complete input. The feature flattening function is to flatten the features and Flattening it into a one-dimensional sequence makes it easier for LLM to read as a mixed "text + number" input;
[0201] Short-term interest prompt template The format is: "Based on the user's click sequence over the past 7 days" High-confidence areas of interest and short-term characteristics Please generate short-term interest vectors step by step, including time-sensitive feature analysis.
[0202] Long-term interest prompt template The format is: "Based on the user's click sequence over the last 90 days" High-confidence areas of interest and long-term characteristics Please deduce and generate long-term interest vectors step by step, including stability preference analysis.
[0203] Step 1.2.3: Introduce learnable weights based on time decay. The initial value is set to 0.5, and the user preference vector is generated by fusion. As shown in equation (5), its corresponding textual description is ;
[0204] (5)
[0205] Step 2, as follows Figure 4 As shown, since the recommendation dataset may lack relevant knowledge about news features, it is necessary to extract relevant knowledge from LLM or external knowledge to align the generated users and news. In the news semantic enhancement CoT inference stage, a two-layer news enhancement representation model is constructed using a two-layer modeling method of "feature extraction (semantic layer) + knowledge enhancement (knowledge layer)," specifically including:
[0206] Step 2.1: Extract news features from the semantic layer, specifically including:
[0207] Step 2.1.1: Design a prompt template Guide LLM to extract candidate news Feature dimension set ,in Here, k is the name of the feature dimension, and k is the number of features.
[0208] News Feature Extraction Tip Template The text description is: "From news text" Extract the core feature dimensions and list the specific feature dimension names.
[0209] Step 2.1.2: Extract entities using Named Entity Recognition (NRT) ,in Represents the i-th entity, "" indicates the correspondence between news items and entities, where s is the number of entities.
[0210] Step 2.2: To overcome the limitations of the news text itself, this embodiment of the invention utilizes external knowledge to enhance the knowledge layer of the news. This process provides the LLM with the background knowledge needed to understand the news, specifically including:
[0211] Step 2.2.1: Based on the entity E extracted in Step 2.1.2, find the knowledge subgraph G related to this entity, and use triples... Composition, in which, and Representing entities, Represents the relationship between entities;
[0212] Step 2.2.2: Design a relational mapping prompt template for converting knowledge graphs into natural language. The retrieved knowledge subgraphs are transformed into natural language descriptions. ;
[0213] Prompt Template The text structure is: "to use knowledge graphs" The output should be smoothly converted into spoken text. Requirements: 1) Maintain the integrity of the logical relationship chain; 2) The path between entities should not exceed 3 hops; 3) The output should be a coherent paragraph.
[0214] Step 2.2.3: Obtain summaries related to E from Wikipedia and generate their text descriptions. .
[0215] Step 2.3: Design a multi-source fusion gating network and embed news features. Knowledge graph description embedding Embedding with Wikipedia summaries Input into the entry control network to generate enhanced representations Specifically, it includes:
[0216] Step 2.3.1, , and The input is fed into the embedding layer of the BERT pre-trained language model to obtain fixed-dimensional embedding vectors. , and ;
[0217] Step 2.3.2: Calculate the gating vector Dc, which is used to dynamically allocate the fusion weights of the three embeddings mentioned above. The calculation formula is as follows:
[0218] (6)
[0219] In equation (6), Represents the Sigmoid activation function. It is a learnable weight matrix used for linear transformations. The semicolon in the text indicates a vector concatenation operation. This indicates that its content is embedded into a predefined vector space.
[0220] Through gating vectors Dynamic weights are assigned to embeddings from different sources, which preserves the core features of the news itself and enhances semantics by supplementing information through knowledge graphs and Wikipedia.
[0221] Step 2.3.3: Calculate the enhanced representation Its corresponding textual description is Fz;
[0222] (7)
[0223] In equation (7), This represents the Hadamard product. and Weights are assigned to supplement information. It leans towards precise associations based on knowledge graphs. Background expansion leaning towards Wikipedia, satisfying It can be learned through training, and the initial value can be set to... and .
[0224] Step 3, News Recommendation Generation Stage: Using CoT prompts, user preferences from the first stage are integrated with the enhanced news semantics from the second stage to generate recommendation results, such as... Figure 5 As shown.
[0225] In this embodiment of the invention, the enhancement vectors generated in the first and second stages are... Z is used as an additional feature field in the recommendation model, enabling them to be compared with candidate news. To engage in explicit interaction. Specifically, this includes:
[0226] Step 3.1: Design a two-dimensional matching score S based on vector similarity and semantic relevance. m This is used to quantify the degree of match between user preferences and news, and the calculation formula is:
[0227] (8)
[0228] In equation (8), As the weighting coefficient, it can be set to... The quantification results of priority vector similarity Semantic relevance is described by the large model based on textual user preferences. With news enhancement description Fz generation, is the cosine similarity function; the closer the value is to 1, the more similar the vectors are semantically. It is used to calculate the semantic alignment at the vector level, where:
[0229] (9)
[0230] in, Let Z represent the magnitude of vector Z.
[0231] Step 3.2: Design structured CoT prompts and recommendation decisions, specifically including:
[0232] Step 3.2.1: Construct a three-level CoT prompt template ={Input information; Reasoning requirements; Output format}, which guides the reasoning process of large models;
[0233] Recommended to generate CoT prompt template The text description is: "You act as a news recommendation expert. Please complete the task of news recommendation and reasoning based on the following input information, reasoning requirements, and output format. [Input Information]: 1) User preferences" ;2) Enhanced description of candidate news Fz;3) Matching score S m
Reasoning Requirements
Output Format
[0234] Step 3.2.2, to Inputting LLM (Local Modeling) guides the step-by-step matching and reasoning process. The news recommendation stage integrates the previous analysis and outputs structured recommendation results. ,in, The decision labels are "recommend" and "not recommend," respectively. "u" represents the interpretable basis supporting the above decision, generated by LLM matching analysis, and associated with the core features of the user preference vector and the news augmentation representation.
[0235] The generation of interpretable evidence must meet the following requirements: 1) It must include at least one semantic association analysis between a user's point of interest and the news topic; 2) The citation matching score S m As a quantitative support; 3) The language description conforms to the format of natural logical reasoning chain.
[0236] Step 3.3: Train the LLM-based recommendation system using the Supervised Fine-Tuning (SFT) method. The loss function used during training satisfies:
[0237] (10)
[0238] In equation (10), Let be the i-th word in the prompt text, and u be the length of the prompt text. Probability Calculated from LLM; when training LLM using the SFT method, the hyperparameters are set to: learning rate 5 × 10⁻⁶. -5 10 training rounds, batch size 16.
[0239] Step 3.4: During the testing phase, remove "Yes" or "No" from the end of the prompt text. Then, display the modified prompt. The input is fed into a large language model, and the probability that the model predicts the next word to be "Yes" or "No" is obtained:
[0240] (11)
[0241] Step 3.5: Use the softmax function to convert the model output into a probability distribution.
[0242] (12)
[0243] Furthermore, to verify the effectiveness of the method in this embodiment of the invention, 17,799 entities and 26,798 relations were collected from a knowledge graph. User click records on news articles were collected, covering the period from January 3, 2024 to July 2, 2024. The dataset contains 642,385 clicks from 15,368 users on 66,436 news articles. The training set includes 48,365 news articles and 513,908 clicks, while the test set includes 18,071 articles and 128,477 clicks.
[0244] All experiments in this invention were conducted on four NVIDIA A10 GPUs. AUC (Area Under the Curve), MRR (Mean Reciprocal Rank), NDCG@5 (Normalized Discounted Cumulative Gain at rank 5), and NDCG@10 (Normalized Discounted Cumulative Gain at rank 10) metrics were selected to evaluate the performance of the proposed method and some advanced baseline methods. These metrics are widely used in the news recommendation field. The backbone model used in this invention is Llama 2-13B. Six baseline methods were selected for comparison with this invention: the traditional deep learning and knowledge graph model DKN, the fine-tuning model RoBERTa, the prompt-tuning method, and three LLM-based methods: Llama2-13B, ONCE, and LKPNR. DKN is a recommendation model that combines deep learning and knowledge graphs, and can improve the performance of recommendation systems through contextual embedding. Fine-tuning the model is the process of training a RoBERTa model on new data for a specific task or domain. RoBERTa is a pre-trained model, and this invention will fine-tune the RoBERTa model on our news dataset. Prompt-tuning transforms the text input into a "cloze"-like task, processes it using RoBERTa, and maps predicted words to labels using manually prompted templates. Llama 2-13B is used to complete the news recommendation task through instruction-based tuning. The ONCE framework enhances content-based recommendation functionality by leveraging open and closed-source LLMs to enrich the representation of recommended content. The LKPNR framework improves news semantic representation by integrating large language models and knowledge graphs.
[0245] Comparing the above six methods with the methods of the embodiments of the present invention, the experimental results are shown in Table 1:
[0246] Table 1. Comparison of results between the method of this invention (Ours) and six other baseline methods.
[0247]
[0248] Table 1 shows that the three-stage news recommendation method based on thought chain prompts and a large language model proposed in this invention outperforms all baseline methods. Compared with other LLM-based news recommendation models (Llama 2-13B, ONCE, LKPNR), the method in this invention still performs excellently. Taking LKPNR as an example, the AUC value of the method in this invention is 0.46 higher, and the NDCG@10 value is 0.38 higher. This verifies the advantages of the method in integrating user modeling, news semantic enhancement, and news recommendation. Although models such as LKPNR also utilize LLM and knowledge graphs to improve news semantic representation, the method in this invention, through a carefully designed CoT prompt framework, gradually guides LLM to explore and optimize user preference mining, news feature extraction, and knowledge enhancement more deeply, making the recommendation results more consistent with user characteristics.
[0249] In addition, to verify the effectiveness of the embodiments of the present invention in the case of a small number of samples, the training set was randomly selected and data subsets containing different proportions (100%, 50%, 30%, 20%, 10%) of training samples were created. Figure 6 Figures (a) and (b) illustrate the performance differences between the proposed three-stage news recommendation method based on thought chain prompts and a large language model and baseline methods under limited-shot learning conditions. In the few-shot learning scenario, experimental results show that the performance of all models is affected to varying degrees as the amount of data decreases. However, the proposed method demonstrates superior performance and strong robustness in the few-shot learning scenario, outperforming all baseline methods, indicating its significant advantage in data-scarce situations and its high practical application value.
[0250] Compared with the prior art, the beneficial effects of the embodiments of the present invention are as follows:
[0251] 1. This invention proposes a three-stage news recommendation method based on CoT (Co-T) prompts and a large language model (LLM). Co-T prompts guide the LLM to output the step-by-step reasoning process at each stage, clearly explaining the logic of user preference formation, the basis for news semantic enhancement, and the reasons for recommendation matching. This solves the problem of low user trust caused by the "black box output" of traditional recommendation systems, enabling users to understand the underlying logic of the recommendation.
[0252] 2. This invention proposes a three-stage hierarchical modeling strategy. In the user modeling stage, long-term and short-term preferences are distinguished and multi-dimensional information is integrated. In the news semantic enhancement stage, external knowledge (knowledge graph, Wikipedia) is combined to break through the limitations of the text itself and realize the multi-dimensional alignment between users and news at the deep semantic level. Compared with traditional recommendation methods that rely on shallow features or statistical patterns, this approach is better able to capture potential associations.
[0253] 3. The embodiments of this invention design a flexible preference factor and a general news feature extraction framework that can be adapted to different types of news recommendation scenarios (such as finance, politics, science and technology, entertainment, etc.) without significantly adjusting the model structure for specific fields. Compared with field-specific recommendation methods, it has stronger versatility and scalability.
[0254] Example 3
[0255] This invention discloses an interpretable news recommendation device, such as... Figure 7 As shown, the device may include:
[0256] The attribute acquisition module 201 is used to acquire user identity attribute data and determine the user's corresponding interest inference result based on the identity attribute data.
[0257] The behavior acquisition module 202 is used to acquire user behavior sequences, divide user behavior sequences into long-term behavior sequences and short-term behavior sequences based on the time information corresponding to the user behavior sequences, determine long-term interest vectors based on long-term behavior sequences, and determine short-term interest vectors based on short-term behavior sequences.
[0258] The preference analysis module 203 is used to generate a user preference vector and a first text description corresponding to the user preference vector based on the interest inference results, long-term interest vector and short-term interest vector.
[0259] The semantic enhancement module 204 is used to acquire candidate news, extract the semantic features of the candidate news, perform semantic enhancement operations on the semantic features according to the preset knowledge base, obtain the enhanced news representation, and generate the second text description corresponding to the enhanced news representation.
[0260] The news recommendation module 205 is used to generate vector similarity and first matching information based on preference vector and enhanced news representation, and to generate semantic relevance and second matching information based on first text description and second text description; and to determine decision labels for candidate news based on vector similarity and semantic relevance, the decision labels being used to indicate whether to recommend candidate news to the user;
[0261] The explanation module 206 is used to generate explanation information based on the first matching information and the second matching information. The explanation information is used to show the user the reasons for the recommendation.
[0262] In an optional embodiment, the specific operation method by which the attribute acquisition module 201 determines the user's corresponding interest inference result based on the identity attribute data may include:
[0263] Based on the identity attribute data, multiple identity attributes are identified and a corresponding attribute weight is assigned to each identity attribute. The attribute weight is used to measure the degree of influence of the corresponding identity attribute on user interests.
[0264] Construct a set of natural language descriptions based on all identity attributes and the attribute weights corresponding to each identity attribute;
[0265] Input a set of natural language descriptions into a pre-trained LLM model to obtain intermediate representations and multiple interest domains generated by the LLM model. The intermediate representations can include all identity attributes and the semantic extensions corresponding to each identity attribute.
[0266] For each interest domain, the contribution of each identity attribute to the interest domain is determined based on the intermediate representation, and the confidence level corresponding to the interest domain is calculated based on the attribute weight and contribution of each identity attribute.
[0267] All interest domains with a confidence level greater than a preset confidence threshold are selected as the user's corresponding interest inference results.
[0268] In another optional embodiment, the user behavior sequence may include the user's browsing history and the timestamp corresponding to each browsing history; the behavior acquisition module 202 may determine the specific operation method of the long-term interest vector based on the long-term behavior sequence, which may include:
[0269] The long-term behavior sequence is traversed using a sliding window of a preset size. During the traversal, a compression step is performed every time the sliding window moves to obtain the interest features corresponding to the current sliding window.
[0270] Based on all the interest features obtained during the traversal process, a long-term interest vector is obtained;
[0271] The compression step may include:
[0272] Extract keywords from all browsing records in the sliding window. For each browsing record in the sliding window, determine the time weight of the browsing record based on the timestamp corresponding to the browsing record, determine the keyword weight of the browsing record based on the number of times the keywords corresponding to the browsing record appear in the sliding window, and determine the compression weight of the browsing record based on the time weight and keyword weight.
[0273] The top K browsing records, sorted by compression weight, are selected from the sliding window to represent the interest features corresponding to the sliding window.
[0274] In yet another optional embodiment, the compression step may further include:
[0275] Based on the semantic relationship between any two keywords in the sliding window, determine multiple semantic domains corresponding to all keywords in the sliding window; based on the number of keywords corresponding to each semantic domain, determine the domain weight corresponding to each semantic domain.
[0276] Arrange all semantic domains corresponding to the sliding window and the domain weights corresponding to each semantic domain according to a normal distribution, fit the normal distribution curve corresponding to the normal distribution of semantic domains, and obtain the standard deviation of the normal distribution curve;
[0277] The K value corresponding to the sliding window is determined based on the standard deviation, where the larger the standard deviation, the smaller the corresponding K value.
[0278] In another optional embodiment, the semantic enhancement module 204 extracts the semantic features of the candidate news, performs semantic enhancement operations on the semantic features according to a preset knowledge base, obtains an enhanced news representation, and generates a second text description corresponding to the enhanced news representation. The specific operation may include:
[0279] Input candidate news into a pre-trained LLM model to obtain a set of news features;
[0280] Named entity recognition technology is used to extract entity sets from candidate news articles. Based on a pre-defined knowledge base, all knowledge subgraphs corresponding to the entity sets are constructed, and natural language descriptions corresponding to the knowledge subgraphs are obtained. The knowledge subgraphs can include any two entities in the entity set and the relationship between the two entities.
[0281] Retrieve the summary description of each entity in the entity set of the preset knowledge base;
[0282] All news features, natural language descriptions corresponding to all knowledge subgraphs, and summary descriptions corresponding to all entities are input into a pre-trained multi-source fusion gating network to obtain an enhanced news representation and generate a second text description corresponding to the enhanced news representation.
[0283] In another optional embodiment, the semantic enhancement module 204 inputs all news features, natural language descriptions corresponding to all knowledge subgraphs, and summary descriptions corresponding to all entities into a pre-trained multi-source fusion gating network to obtain the specific operation method for enhancing news representation, which may include:
[0284] All news features, natural language descriptions corresponding to all knowledge subgraphs, and summary descriptions corresponding to all entities are embedded into their respective vector spaces to obtain the first embedding vector. Second embedding vector and the third embedding vector ;
[0285] The gate vector Dc is calculated using the following formula:
[0286]
[0287] in, This represents the Sigmoid activation function. Represents a learnable weight matrix based on linear transformation;
[0288] The enhanced news representation Z is calculated using the following formula:
[0289]
[0290] In the above formula, Represents the Hadamard product. Assign weights to the preset first information. Assign weights to the preset second information, where, .
[0291] In another optional embodiment, the explanation module 206 generates explanation information based on the first matching information and the second matching information. The explanation information is used to show the user the specific operation method of the recommendation reason, and may include:
[0292] The matching score is determined based on vector similarity and semantic relevance. The matching score is used to measure the degree of matching between the first matching information and the second matching information.
[0293] Using a natural logic reasoning chain format, interpretable information is generated based on the first matching information, the second matching information, and the matching score.
[0294] Example 4
[0295] Please see Figure 8 , Figure 8 This is a schematic diagram of the structure of an interpretable news recommendation system disclosed in an embodiment of the present invention. The interpretable news recommendation system may include:
[0296] Memory 301 storing executable program code;
[0297] Processor 302 coupled to memory 301;
[0298] The processor 302 calls the executable program code stored in the memory 301 to execute some or all of the steps in any of the news recommendation methods in Embodiment 1 or Embodiment 2 of the present invention.
[0299] Example 5
[0300] This invention discloses a computer storage medium storing computer instructions. When these computer instructions are executed by a processor, they implement some or all of the steps in any of the news recommendation methods in Embodiment 1 or Embodiment 2 of this invention.
[0301] Through the detailed description of the above embodiments, those skilled in the art can clearly understand that each implementation method can be implemented using software plus necessary general-purpose hardware platforms, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or in terms of their contribution to the prior art, can be embodied in the form of a software product, which can be stored in a computer-readable storage medium.
Claims
1. An interpretable news recommendation method, characterized by, The method comprises: obtaining user identity attribute data, determining the user's interest inference result corresponding to the identity attribute data; obtaining a user behavior sequence, dividing the user behavior sequence into a long-term behavior sequence and a short-term behavior sequence according to the time information corresponding to the user behavior sequence; determining a long-term interest vector according to the long-term behavior sequence, and determining a short-term interest vector according to the short-term behavior sequence; According to the interest inference result, the long-term interest vector and the short-term interest vector, a user preference vector and a first text description corresponding to the user preference vector are generated; obtaining a candidate news, extracting the semantic features of the candidate news, performing a semantic enhancement operation on the semantic features according to a preset knowledge base, obtaining an enhanced news representation and generating a second text description corresponding to the enhanced news representation; According to the preference vector and the enhanced news representation, a vector similarity and first matching information are generated, and a semantic correlation degree and second matching information are generated according to the first text description and the second text description; The decision label of the candidate news is determined according to the vector similarity and the semantic correlation degree, and the decision label is used to indicate whether the candidate news is recommended to the user; According to the first matching information and the second matching information, the explanation information is generated, and the explanation information is used to show the user the recommendation reason. 2.The interpretable news recommendation method of claim 1, wherein, According to the identity attribute data, the interest inference result corresponding to the user is determined, comprising: According to the identity attribute data, a plurality of identity attributes are determined, and the attribute weight corresponding to each identity attribute is determined, and the attribute weight is used to measure the influence degree of the corresponding identity attribute on the user interest; According to all the identity attributes and the attribute weight corresponding to each identity attribute, a natural language description set is constructed; input the natural language description set into the pre-trained LLM model to obtain the intermediate representation generated by the LLM model and a plurality of interest fields, the intermediate representation includes all identity attributes and the semantic extension corresponding to each identity attribute; For each of the interest fields, the contribution degree of each identity attribute to the interest field is determined according to the intermediate representation, and the confidence degree corresponding to the interest field is calculated according to the attribute weight and the contribution degree of each identity attribute; All interest fields with a confidence degree greater than a preset confidence threshold are selected as the interest inference result corresponding to the user. 3.The interpretable news recommendation method of claim 1, wherein, The user behavior sequence includes user browsing records and a timestamp corresponding to each browsing record; the long-term interest vector is determined according to the long-term behavior sequence, comprising: using a sliding window of a preset size to traverse the long-term behavior sequence, in the traversal process, the sliding window moves once, and then a compression step is performed to obtain the interest features corresponding to the current sliding window; According to all the interest features obtained in the traversal process, a long-term interest vector is obtained; The compression step comprises: extracting keywords of all the browsing records in the sliding window, for each of the browsing records in the sliding window, determining a time weight of the browsing record according to a time stamp corresponding to the browsing record, determining a keyword weight of the browsing record according to a number of occurrences of the keyword corresponding to the browsing record in the sliding window, and determining a compression weight of the browsing record according to the time weight and the keyword weight; selecting, from the sliding window, K browsing records with the highest compression weights as interest features corresponding to the sliding window. 4.The interpretable news recommendation method of claim 3, wherein, The compression step further includes: determining a plurality of semantic fields corresponding to all the keywords in the sliding window according to semantic relationships between any two keywords in the sliding window, and determining a field weight of each semantic field according to a number of keywords corresponding to the semantic field; arranging all the semantic fields corresponding to the sliding window and the field weight of each semantic field according to a normal distribution, fitting a normal distribution curve corresponding to the normal distribution arrangement of the semantic fields, and obtaining a standard deviation value of the normal distribution curve; determining a K value corresponding to the sliding window according to the standard deviation value, wherein the larger the standard deviation value is, the smaller the corresponding K value is. 5.The interpretable news recommendation method of claim 1, wherein, The extracting of the semantic features of the candidate news, the semantic enhancement operation of the semantic features according to a preset knowledge base, the obtaining of enhanced news representations, and the generation of a second text description corresponding to the enhanced news representations include: inputting the candidate news into a pre-trained LLM model to obtain a news feature set; extracting an entity set from the candidate news using a named entity recognition technology, constructing all knowledge subgraphs corresponding to the entity set according to a preset knowledge base, and obtaining a natural language description corresponding to the knowledge subgraph according to the knowledge subgraph; the knowledge subgraph includes any two entities in the entity set and the relationship between the two entities; obtaining a summary description corresponding to each entity in the entity set in the preset knowledge base; inputting all the news features, the natural language descriptions corresponding to all the knowledge subgraphs, and the summary descriptions corresponding to all the entities into a pre-trained multi-source fusion gating network to obtain enhanced news representations and generate a second text description corresponding to the enhanced news representations. 6.The interpretable news recommendation method of claim 5, wherein, The inputting of all the news features, the natural language descriptions corresponding to all the knowledge subgraphs, and the summary descriptions corresponding to all the entities into a pre-trained multi-source fusion gating network to obtain enhanced news representations includes: Embedding all news features, all natural language descriptions corresponding to the knowledge sub-graphs and all summary descriptions corresponding to the entities into corresponding vector spaces respectively to obtain first embedding vectors , second embedding vectors and third embedding vectors ; calculating a gating vector Dc according to the following formula: wherein, denotes a Sigmoid activation function, denotes a learnable weight matrix based on a linear transformation; calculating an enhanced news representation Z according to the following formula: In the above formulae, denotes the Hadamard product, assigning weights to the preset first information, assigning weights to the preset second information, wherein, . 7.The interpretable news recommendation method of claim 1, wherein, The generating of explanation information according to the first matching information and the second matching information, the explanation information being used to show a recommendation reason to the user, includes: determining a matching score according to the vector similarity and the semantic correlation, the matching score being used to measure a matching degree corresponding to the first matching information and the second matching information; generating interpretable information according to the first matching information, the second matching information, and the matching score using a natural logic reasoning chain format. 8.An interpretable news recommendation apparatus characterized by comprising: The device comprises: an attribute acquisition module configured to acquire user identity attribute data, and determine a user interest inference result corresponding to the user according to the identity attribute data; a behavior acquisition module configured to acquire a user behavior sequence, divide the user behavior sequence into a long-term behavior sequence and a short-term behavior sequence according to time information corresponding to the user behavior sequence, determine a long-term interest vector according to the long-term behavior sequence, and determine a short-term interest vector according to the short-term behavior sequence; a preference analysis module configured to generate a user preference vector and a first text description corresponding to the user preference vector according to the interest inference result, the long-term interest vector, and the short-term interest vector; a semantic enhancement module configured to acquire a candidate news, extract semantic features of the candidate news, perform a semantic enhancement operation on the semantic features according to a preset knowledge base, obtain an enhanced news representation, and generate a second text description corresponding to the enhanced news representation; a news recommendation module configured to generate a vector similarity and first matching information according to the preference vector and the enhanced news representation, generate a semantic correlation degree and second matching information according to the first text description and the second text description, determine a decision label of the candidate news according to the vector similarity and the semantic correlation degree, and use the decision label to indicate whether to recommend the candidate news to the user; an explanation module configured to generate explanation information according to the first matching information and the second matching information, and use the explanation information to show the user a recommendation reason.
9. An interpretable news recommendation system, characterized in that, The system comprises a memory storing executable program codes, a processor coupled with the memory, and the processor invokes the executable program codes stored in the memory to execute the interpretable news recommendation method according to any one of claims 1-7.
10. A computer storage medium, characterized in that, The computer storage medium stores computer instructions, and the computer instructions are executed by a processor to implement the interpretable news recommendation method according to any one of claims 1-7.
Citation Information
Patent Citations
News recommendation method based on interest perception and user similarity
CN115098767A
Energy technology news recommendation method based on deentanglement representation learning
CN120611091A