Popularity debiasing recommendation method and device based on sentiment analysis and causal inference

This popularity-based recommendation method, which combines sentiment analysis and causal inference, addresses the issue of popularity bias in recommendation systems. It improves the fairness and diversity of recommendations, maintains recommendation accuracy, and enhances the authenticity and interpretability of the recommendation results.

CN122390837APending Publication Date: 2026-07-14ANHUI UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ANHUI UNIV
Filing Date
2026-04-27
Publication Date
2026-07-14

Smart Images

  • Figure CN122390837A_ABST
    Figure CN122390837A_ABST
Patent Text Reader

Abstract

The application relates to a popularity debiasing recommendation method based on sentiment analysis and causal inference, which comprises the following steps: obtaining user item interaction data, user comment text data and timestamp data; performing sentiment feature extraction; calculating dynamic popularity features of the items; constructing a causal debiasing recommendation model; performing a causal intervention operation to cut off the backdoor confusion path of popularity to item exposure; calculating a debiased recommendation base score; and outputting a final debiased recommendation list. The application significantly alleviates popularity bias, improves recommendation fairness and diversity, weakens the confusion effect of popularity on user real preferences, makes the recommendation result more balanced, improves recommendation fairness and diversity, accurately distinguishes benign popularity from harmful popularity, realizes debiasing without reducing accuracy, appropriately retains reasonable positive popularity signals in the reasoning stage, thereby reducing bias while maintaining recommendation accuracy, and realizes debiasing and effect consideration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of recommendation systems, natural language processing, and causal inference, and in particular to a popularity-based debiased recommendation method and device based on sentiment analysis and causal inference. Background Technology

[0002] Recommendation systems are a technology that analyzes user behavior data to push items or content that users may be potentially interested in. They are widely used in e-commerce, video, and news industries, and are a core support for personalized services. However, existing recommendation systems generally suffer from popularity bias in personalized services, mainly manifested in the following aspects:

[0003] First, the recommendation model overly favors popular items, resulting in a severe lack of exposure for high-quality long-tail items: the model tends to recommend popular items that are already trending to users, making it difficult for users to discover a large number of high-quality but low-exposure long-tail items, resulting in insufficient diversity.

[0004] Second, the herd mentality of users and the platform's exposure mechanism together create false relevance, exacerbating the Matthew effect, echo chamber effect and filter bubble: popular items are more likely to get user interaction because of their high exposure, forming a cycle of "the more popular, the more recommended", which leads to the convergence of recommendation results and users getting trapped in information cocoons.

[0005] Third, traditional de-biasing methods often use a "one-size-fits-all" approach to suppress popularity, which can easily inadvertently harm items that are popular due to their high quality: simply reducing the weight of popular items will also suppress high-quality popular items that have high interaction due to their high quality, thus reducing the accuracy of recommendations.

[0006] Fourth, the emotional signals in user comments are not incorporated, making it impossible to distinguish between genuine preferences and conformist behavior: relying solely on user clicks, purchases, and other behavioral data makes it impossible to determine whether user interactions are based on genuine liking or blind following, and it is difficult to accurately characterize user preferences.

[0007] Fifth, single-dimensional causal debiasing can easily lead to over-biasing, resulting in a decrease in recommendation accuracy: Existing causal debiasing methods usually only model from the single dimension of popularity, which can easily lose the predictive ability of recommendations while eliminating bias, resulting in a decrease in recommendation accuracy. Summary of the Invention

[0008] To address the problems in existing recommendation systems, such as severe popularity bias, insufficient exposure of long-tail items, easy misrepresentation of high-quality popular items, inability to distinguish between genuine user preferences and herd behavior, and the tendency for single-dimensional causal debiasing to lead to decreased recommendation accuracy, the primary objective of this invention is to provide a popularity debiasing recommendation method based on sentiment analysis and causal inference that significantly alleviates popularity bias, improves recommendation fairness and diversity, accurately distinguishes between benign and harmful popularity, achieves debiasing without reducing accuracy, introduces sentiment signals to enhance the authenticity and interpretability of recommendation results, introduces a time dimension to improve dynamic adaptability, significantly improves recommendation performance, and has strong versatility.

[0009] To achieve the above objectives, the present invention adopts the following technical solution: a popularity-based recommendation method based on sentiment analysis and causal inference, which includes the following sequential steps:

[0010] (1) Obtain user item interaction data, user comment text data, and timestamp data;

[0011] (2) Input the user review text data into the RoBERTa model to extract sentiment features and obtain the average sentiment features of the items. ,

[0012] (3) Based on user item interaction data, timestamp data and average sentiment characteristics of items Calculate the dynamic popularity characteristics of items ;

[0013] (4) Based on user item interaction data, timestamp data, and average sentiment characteristics of items With dynamic popularity characteristics We construct a causal bias-free recommendation model that includes variables such as user, item, popularity, sentiment, and time.

[0014] (5) Combine user item interaction data, timestamp data, and average sentiment characteristics. and dynamic popularity characteristics Input the causal debiased recommendation model and perform causal intervention to cut off the backdoor obfuscation path of popularity on item exposure, and obtain the deobfuscated user-item matching relationship;

[0015] (6) Based on the de-obfuscated user-item matching relationship, decouple the actual user-item matching score from the popularity bias, and calculate the bias-free recommendation base score. ;

[0016] (7) Average emotional characteristics of integrated items Dynamic popularity characteristics and the recommended baseline score after bias removal Output the final bias-free recommendation list.

[0017] In step (1), the user-item interaction data includes records of user-item interactions such as clicks, purchases, favorites, and ratings, user IDs, item IDs, and the number of interactions with the item; the user-item interaction data is collected from user behavior logs of e-commerce platforms or content platforms; the user comment text data refers to the text comments posted by users on items, including user IDs, item IDs, comment text, and comment time, and is collected from the comment database of e-commerce platforms or content platforms; the timestamp data refers to the time information of user interaction or comment behavior, and is synchronously obtained from user behavior logs or comment databases, and is used to represent the temporal information of interaction and comment.

[0018] Step (2) specifically includes the following steps:

[0019] (2a) The user comment text data is preprocessed using the RoBERTa model. The preprocessing includes word segmentation, stop word removal and sub-word decomposition to obtain standardized comment text data. The standardized comment text data includes the comment text content, the user ID corresponding to the comment, the item ID corresponding to the comment, and the timestamp information of the comment.

[0020] (2b) For each standardized comment text data, the RoBERTa model outputs a positive sentiment score. and negative sentiment score And through the RoberTa model The function yields the probability distribution of emotions. and :

[0021] ;

[0022] ;

[0023] Calculate the sentiment feature value of a single comment in standardized comment text data. :

[0024] ;

[0025] (2c) Summarize the sentiment feature values ​​of all comments corresponding to item i, and calculate the average sentiment feature of item i. :

[0026] ;

[0027] in, This represents the total number of user comments corresponding to item i.

[0028] In step (3), the dynamic popularity feature The calculation formula is:

[0029] ;

[0030] in, Let i be the number of interactions with item i in stage t; I represents the set of items. The total number of interactions between all items in the item set during stage t; ; For items The number of interactions in phase t.

[0031] Step (4) specifically includes the following steps:

[0032] (4a) Based on the average emotional characteristics of objects E serves as an emotional variable in causal modeling;

[0033] (4b) Dynamic popularity characteristics Set as an independent variable to characterize the impact of item popularity on the matching relationship between users and items and the probability of item exposure, and establish the influence relationship between popularity z on items and popularity z on interaction results, so as to characterize the confounding effect of popularity z.

[0034] (4c) Set users and items as independent variables, and describe users' true preferences through the association between users and items;

[0035] (4d) Introduce a time variable to characterize the dynamic characteristics of item popularity over time and to adjust local popularity so that time factors can work together with sentiment factors to optimize recommendation scores.

[0036] (4e) Establish the direct impact path of popularity z on interaction results, as well as the path of popularity z indirectly affecting interaction results through items, and block the backdoor path through causal intervention operations to weaken the negative impact of item popularity on user-item matching; at the same time, introduce the influence relationship between emotional factors on user interaction behavior and item popularity.

[0037] (4f) The user variable, item variable, popularity variable z, sentiment variable E and time variable are integrated into a causal debiased recommendation model. The causal debiased recommendation model is used to perform popularity debiasing during the training phase and to adjust the recommendation score during the inference phase.

[0038] Step (5) specifically refers to: by adjusting the distribution of popularity z, cutting off the backdoor obfuscation path of popularity z on item exposure, eliminating the direct influence of popularity z on item exposure, and obtaining the deobfuscated user-item matching relationship. The mathematical form of the deobfuscated user-item matching relationship is the interaction probability after intervention. The calculation method is as follows:

[0039] ;

[0040] Where C represents the interaction result between users and items; U represents the user set; I represents the item set; E represents the sentiment variable; and P(z) is the prior distribution of popularity z.

[0041] Step (6) specifically includes the following steps:

[0042] (6a) Design a conditional probability model for matching users and items. This decouples user item matching relationships from the influence of popularity. For users, ∈U, where U represents the set of users; c is the matching result variable between users and items, where c=1 indicates that the user has a valid interaction with the item, and c=0 indicates that the user has not a valid interaction with the item;

[0043] (6b) Set θ as the learnable parameter of the user-item matching conditional probability model, and optimize the learnable parameter θ based on Bayesian personalized loss. Maximize the objective function by iteratively updating the learnable parameter θ to complete the training process of the user-item matching conditional probability model. The objective function formula of the user-item matching conditional probability model is as follows:

[0044] ;

[0045] Where D is the training dataset, consisting of interaction triples (u, ..., D) composed of user, item, and sentiment features. , ) where u is the user, 'b' represents positive sample items, i.e., items that the user has actually interacted with; 'b' represents negative sample items, i.e., items that the user has not interacted with. b∈I, b∈I, where I represents the set of items; For items The average emotional characteristics; For items Dynamic popularity characteristics at stage t; The average emotional characteristic of item b; The dynamic popularity characteristics of item b in stage t; It is the sigmoid activation function;

[0046] (6c) After the user-item matching conditional probability model is trained, the biased recommendation base score is obtained by eliminating the confusion effect of popularity z on exposure and retaining only the user-item matching part. :

[0047] ;

[0048] in, The output of the conditional probability model for matching users and items; For a variant of the exponential linear unit activation function, the formula is:

[0049] ;

[0050] In the formula, for ; It is the natural constant e. Power;

[0051] Ensure the output is non-negative and monotonically increasing to avoid probability calculation failure due to negative values.

[0052] Step (7) specifically includes the following steps:

[0053] (7a) The value of the item Expressed as follows:

[0054] ;

[0055] in, The basic intrinsic quality parameter of item i is a fixed variable that is independent of time and emotion; Weber's ratio;

[0056] (7b) Calculate the predicted ranking score :

[0057] ;

[0058] in, (⋅) is the hyperbolic tangent function. (⋅) is the activation function;

[0059] (7c) Causal bias-reduced recommendation model training: based on predicted ranking scores The causal unbiased recommendation model is trained using the Bayesian personalized ranking loss function L, resulting in the trained causal unbiased recommendation model. The loss function L is:

[0060] ;

[0061] Where D is the training dataset, consisting of interaction triples (u, ..., D) composed of user, item, and sentiment features. , ) where u is the user, 'b' represents positive sample items, i.e., items that the user has actually interacted with; 'b' represents negative sample items, i.e., items that the user has not interacted with. b∈I, b∈I, where I represents the set of items; This is a negative sample sampling distribution used to draw negative samples for each positive sample. For user u, positive sample items The predicted ranking score; The predicted ranking score for user u for negative sample item b; It is the sigmoid activation function;

[0062] (7d) Generation of final recommendation results: Use the causal debiased recommendation model trained in step (7c) to generate predicted ranking scores for all items to be recommended to the user, and sort them in descending order according to the predicted ranking scores, and output the final debiased recommendation list.

[0063] Another object of the present invention is to provide an electronic device comprising:

[0064] Processor; and

[0065] The memory stores computer program instructions that, when executed by the processor, cause the processor to perform the popularity-based debiasing recommendation method based on sentiment analysis and causal inference as described above.

[0066] The present invention also provides a computer-readable storage medium having stored thereon computer program instructions, which, when executed by a processor, cause the processor to perform the popularity-based debiasing recommendation method based on sentiment analysis and causal inference as described above.

[0067] As can be seen from the above technical solution, the beneficial effects of this invention are as follows: First, it significantly alleviates popularity bias and improves the fairness and diversity of recommendations: This invention addresses the problem of excessive bias towards popular items and insufficient exposure of long-tail items in recommendation systems. It analyzes the causes of popularity bias from the perspective of causal modeling and weakens the confusing effect of popularity on users' true preferences by constructing relevant causal paths and implementing interventions. This reduces the system's over-reliance on top items, increases the display opportunities for high-quality long-tail items, makes the recommendation results more balanced, and improves the fairness and diversity of recommendations. Second, it accurately distinguishes between benign and harmful popularity, achieving bias removal without reducing accuracy: Traditional methods often uniformly regard popularity as a negative factor, which can easily lead to the misjudgment of items that are popular due to their high actual quality. This invention weakens the impact of negative popularity during the training phase and appropriately retains reasonable positive popularity signals during the inference phase through causal inference and backdoor adjustment, thereby reducing bias while maintaining recommendation accuracy, achieving a balance between bias removal and effectiveness. Third, it introduces sentiment information. First, it enhances the authenticity and interpretability of recommendation results: This invention incorporates sentiment information from user reviews into recommendation modeling, using the RoBERTa model to extract users' sentiment towards items. This allows the RoBERTa model to judge user preferences not only based on behavioral data such as clicks and purchases, but also by combining real feedback from reviews. This enables a more accurate distinction between genuine interests and conformity interactions, improving the credibility and interpretability of recommendation results. Second, it introduces a time dimension to enhance dynamic adaptability: This invention further introduces a time factor, dynamically reflecting changes in item popularity and user interests by characterizing changes in local popularity and sentiment intensity decay. This allows the system to maintain good timeliness and stability even in scenarios such as hot topic updates and interest migration. Third, it significantly improves recommendation performance and has strong versatility: Experimental results show that this invention achieves significant performance improvements on six public Amazon datasets, with the highest improvement in click prediction recall reaching 33.78%. Furthermore, this invention can be combined with existing recommendation models such as MF and LightGCN, and is easily integrated into e-commerce, short video, and news recommendation systems, demonstrating strong engineering application value and scalability. Attached Figure Description

[0068] Figure 1 This is a flowchart of the method of the present invention;

[0069] Figure 2 This is a schematic diagram of causal intervention that cuts off the backdoor confusion path of popularity;

[0070] Figure 3 This is a schematic diagram of a causal debiased recommendation model that incorporates sentiment variables. Detailed Implementation

[0071] like Figure 1As shown, a popularity-based recommendation method based on sentiment analysis and causal inference includes the following sequential steps:

[0072] (1) Obtain user item interaction data, user comment text data, and timestamp data;

[0073] (2) Input the user review text data into the RoBERTa model to extract sentiment features and obtain the average sentiment features of the items. ,

[0074] (3) Based on user item interaction data, timestamp data and average sentiment characteristics of items Calculate the dynamic popularity characteristics of items ;

[0075] (4) Based on user item interaction data, timestamp data, and average sentiment characteristics of items With dynamic popularity characteristics We construct a causal bias-free recommendation model that includes variables such as user, item, popularity, sentiment, and time.

[0076] (5) Combine user item interaction data, timestamp data, and average sentiment characteristics. and dynamic popularity characteristics Input the causal debiased recommendation model and perform causal intervention to cut off the backdoor obfuscation path of popularity on item exposure, and obtain the deobfuscated user-item matching relationship;

[0077] (6) Based on the de-obfuscated user-item matching relationship, decouple the actual user-item matching score from the popularity bias, and calculate the bias-free recommendation base score. ;

[0078] (7) Average emotional characteristics of integrated items Dynamic popularity characteristics and the recommended baseline score after bias removal Output the final bias-free recommendation list.

[0079] In step (1), the user-item interaction data includes records of user-item interactions such as clicks, purchases, favorites, and ratings, user IDs, item IDs, and the number of interactions with the item; the user-item interaction data is collected from user behavior logs of e-commerce platforms or content platforms; the user comment text data refers to the text comments posted by users on items, including user IDs, item IDs, comment text, and comment time, and is collected from the comment database of e-commerce platforms or content platforms; the timestamp data refers to the time information of user interaction or comment behavior, and is synchronously obtained from user behavior logs or comment databases, and is used to represent the temporal information of interaction and comment.

[0080] Step (2) specifically includes the following steps:

[0081] (2a) The user comment text data is preprocessed using the RoBERTa model. The preprocessing includes word segmentation, stop word removal and sub-word decomposition to obtain standardized comment text data. The standardized comment text data includes the comment text content, the user ID corresponding to the comment, the item ID corresponding to the comment, and the timestamp information of the comment.

[0082] (2b) For each standardized comment text data, the RoBERTa model outputs a positive sentiment score. and negative sentiment score And through the RoberTa model The function yields the probability distribution of emotions. and :

[0083] ;

[0084] ;

[0085] Calculate the sentiment feature value of a single comment in standardized comment text data. :

[0086] ;

[0087] (2c) Summarize the sentiment feature values ​​of all comments corresponding to item i, and calculate the average sentiment feature of item i. :

[0088] ;

[0089] in, This represents the total number of user comments corresponding to item i.

[0090] In step (3), the dynamic popularity feature The calculation formula is:

[0091] ;

[0092] in, Let i be the number of interactions with item i in stage t; I represents the set of items. The total number of interactions between all items in the item set during stage t; ; For items The number of interactions in phase t.

[0093] Step (4) specifically includes the following steps:

[0094] (4a) Based on the average emotional characteristics of objects E serves as an emotional variable in causal modeling;

[0095] (4b) Dynamic popularity characteristics Set as an independent variable to characterize the impact of item popularity on the matching relationship between users and items and the probability of item exposure, and establish the influence relationship between popularity z on items and popularity z on interaction results, so as to characterize the confounding effect of popularity z.

[0096] (4c) Set users and items as independent variables, and describe users' true preferences through the association between users and items;

[0097] (4d) Introduce a time variable to characterize the dynamic characteristics of item popularity over time and to adjust local popularity so that time factors can work together with sentiment factors to optimize recommendation scores.

[0098] (4e) Establish the direct impact path of popularity z on interaction results, as well as the path of popularity z indirectly affecting interaction results through items, and block the backdoor path through causal intervention operations to weaken the negative impact of item popularity on user-item matching; at the same time, introduce the influence relationship between emotional factors on user interaction behavior and item popularity.

[0099] (4f) Integrate user variables, item variables, popularity variable z, sentiment variable E, and time variable into a causal bias-free recommendation model, such as Figure 3 As shown, the causal debiased recommendation model is used to perform popularity debiasing during the training phase and to adjust the recommendation score during the inference phase.

[0100] Step (5) specifically refers to: by adjusting the distribution of popularity z, cutting off the backdoor obfuscation path of popularity z on item exposure, such as... Figure 2As shown, by eliminating the direct impact of popularity z on item exposure, the de-obfuscated user-item matching relationship is obtained. The mathematical form of the de-obfuscated user-item matching relationship is the interaction probability after intervention. The calculation method is as follows:

[0101] ;

[0102] Where C represents the interaction result between users and items; U represents the user set; I represents the item set; E represents the sentiment variable; and P(z) is the prior distribution of popularity z.

[0103] Step (6) specifically includes the following steps:

[0104] (6a) Design a conditional probability model for matching users and items. This decouples user item matching relationships from the influence of popularity. For users, ∈U, where U represents the set of users; c is the matching result variable between users and items, where c=1 indicates that the user has a valid interaction with the item, and c=0 indicates that the user has not a valid interaction with the item;

[0105] (6b) Set θ as the learnable parameter of the user-item matching conditional probability model, and optimize the learnable parameter θ based on Bayesian personalized loss. Maximize the objective function by iteratively updating the learnable parameter θ to complete the training process of the user-item matching conditional probability model. The objective function formula of the user-item matching conditional probability model is as follows:

[0106] ;

[0107] Where D is the training dataset, consisting of interaction triples (u, ..., D) composed of user, item, and sentiment features. , ) where u is the user, 'b' represents positive sample items, i.e., items that the user has actually interacted with; 'b' represents negative sample items, i.e., items that the user has not interacted with. b∈I, b∈I, where I represents the set of items; For items The average emotional characteristics; For items Dynamic popularity characteristics at stage t; The average emotional characteristic of item b; The dynamic popularity characteristics of item b in stage t; It is the sigmoid activation function;

[0108] (6c) After the user-item matching conditional probability model is trained, the biased recommendation base score is obtained by eliminating the confusion effect of popularity z on exposure and retaining only the user-item matching part. :

[0109] ;

[0110] in, The output of the conditional probability model for matching users and items; For a variant of the exponential linear unit activation function, the formula is:

[0111] ;

[0112] In the formula, for ; It is the natural constant e. Power;

[0113] Ensure the output is non-negative and monotonically increasing to avoid probability calculation failure due to negative values.

[0114] Step (7) specifically includes the following steps:

[0115] (7a) The value of the item Expressed as follows:

[0116] ;

[0117] in, The basic intrinsic quality parameter of item i is a fixed variable that is independent of time and emotion; Weber's ratio;

[0118] (7b) Calculate the predicted ranking score :

[0119] ;

[0120] in, (⋅) is the hyperbolic tangent function, used to express value Projecting the model onto the interval [0,1] makes the model more stable; (⋅) is the activation function, which ensures that the output is always greater than 0 while making the output smoother.

[0121] (7c) Causal bias-reduced recommendation model training: based on predicted ranking scores The causal unbiased recommendation model is trained using the Bayesian personalized ranking loss function L, resulting in the trained causal unbiased recommendation model. The loss function L is:

[0122] ;

[0123] Where D is the training dataset, consisting of interaction triples (u, ..., D) composed of user, item, and sentiment features. , ) where u is the user, 'b' represents positive sample items, i.e., items that the user has actually interacted with; 'b' represents negative sample items, i.e., items that the user has not interacted with. b∈I, b∈I, where I represents the set of items; This is a negative sample sampling distribution used to draw negative samples for each positive sample. For user u, positive sample items The predicted ranking score; The predicted ranking score for user u for negative sample item b; It is the sigmoid activation function;

[0124] (7d) Generation of final recommendation results: Use the causal debiased recommendation model trained in step (7c) to generate predicted ranking scores for all items to be recommended to the user, and sort them in descending order according to the predicted ranking scores, and output the final debiased recommendation list.

[0125] In summary, this invention significantly alleviates popularity bias and improves recommendation fairness and diversity. Addressing the problem of excessive bias towards popular items and insufficient exposure of long-tail items in recommendation systems, this invention analyzes the causes of popularity bias from a causal modeling perspective and weakens the confusing effect of popularity on users' true preferences by constructing relevant causal paths and implementing interventions. This reduces the system's over-reliance on top-performing items, increases the display opportunities for high-quality long-tail items, and makes the recommendation results more balanced, improving recommendation fairness and diversity. It also accurately distinguishes between benign and harmful popularity, achieving bias reduction without sacrificing accuracy: Traditional methods often uniformly treat popularity as a negative factor, easily unfairly penalizing items popular due to their inherent high quality. This invention, through causal inference and backdoor adjustments, weakens the impact of negative popularity during the training phase and appropriately retains reasonable positive popularity signals during the inference phase, thereby reducing bias while maintaining recommendation accuracy, achieving a balance between bias reduction and effectiveness.

[0126] This invention introduces sentiment signals to enhance the authenticity and interpretability of recommendation results: It incorporates sentiment information from user reviews into recommendation modeling, using the RoBERTa model to extract users' sentiment towards items. This allows the RoBERTa model to judge user preferences not only based on behavioral data such as clicks and purchases, but also by combining genuine feedback from reviews. This enables a more accurate distinction between genuine interests and conformity interactions, improving the credibility and interpretability of recommendation results. It also introduces a time dimension to enhance dynamic adaptability: By characterizing changes in local popularity and sentiment intensity decay, it dynamically reflects changes in item popularity and user interests, ensuring the system maintains good timeliness and stability even during hot topic updates and interest migrations. The invention significantly improves recommendation performance and has strong versatility: Experimental results show that this invention achieves significant performance improvements on six public Amazon datasets, with the highest improvement in click prediction recall reaching 33.78%. Furthermore, this invention can be combined with existing recommendation models such as MF and LightGCN, making it easy to integrate into e-commerce, short video, and news recommendation systems, demonstrating strong engineering application value and scalability.

[0127] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.

Claims

1. A popularity-based recommendation method based on sentiment analysis and causal inference, characterized in that: The method includes the following steps in sequence: (1) Obtain user item interaction data, user comment text data, and timestamp data; (2) Input the user review text data into the RoBERTa model to extract sentiment features and obtain the average sentiment features of the items. , (3) Based on user item interaction data, timestamp data and average sentiment characteristics of items Calculate the dynamic popularity characteristics of items ; (4) Based on user item interaction data, timestamp data, and average sentiment characteristics of items With dynamic popularity characteristics We construct a causal bias-free recommendation model that includes variables such as user, item, popularity, sentiment, and time. (5) Combine user item interaction data, timestamp data, and average sentiment characteristics. and dynamic popularity characteristics Input the causal debiased recommendation model and perform causal intervention to cut off the backdoor obfuscation path of popularity on item exposure, and obtain the deobfuscated user-item matching relationship; (6) Based on the de-obfuscated user-item matching relationship, decouple the actual user-item matching score from the popularity bias, and calculate the bias-free recommendation base score. ; (7) Average emotional characteristics of integrated items Dynamic popularity characteristics and the recommended baseline score after bias removal Output the final bias-free recommendation list.

2. The popularity-based recommendation method based on sentiment analysis and causal inference according to claim 1, characterized in that: In step (1), the user-item interaction data includes records of user-item interactions such as clicks, purchases, favorites, and ratings, user IDs, item IDs, and the number of interactions with the item; the user-item interaction data is collected from user behavior logs of e-commerce platforms or content platforms; the user comment text data refers to the text comments posted by users on items, including user IDs, item IDs, comment text, and comment time, and is collected from the comment database of e-commerce platforms or content platforms; the timestamp data refers to the time information of user interaction or comment behavior, and is synchronously obtained from user behavior logs or comment databases, and is used to represent the temporal information of interaction and comment.

3. The popularity-based recommendation method based on sentiment analysis and causal inference according to claim 1, characterized in that: Step (2) specifically includes the following steps: (2a) The user comment text data is preprocessed using the RoBERTa model. The preprocessing includes word segmentation, stop word removal and sub-word decomposition to obtain standardized comment text data. The standardized comment text data includes the comment text content, the user ID corresponding to the comment, the item ID corresponding to the comment, and the timestamp information of the comment. (2b) For each standardized comment text data, the RoBERTa model outputs a positive sentiment score. and negative sentiment score And through the RoberTa model The function yields the probability distribution of emotions. and : ; ; Calculate the sentiment feature value of a single comment in standardized comment text data. : ; (2c) Summarize the sentiment feature values ​​of all comments corresponding to item i, and calculate the average sentiment feature of item i. : ; in, This represents the total number of user comments corresponding to item i.

4. The popularity-based recommendation method based on sentiment analysis and causal inference according to claim 1, characterized in that: In step (3), the dynamic popularity feature The calculation formula is: ; in, Let i be the number of interactions with item i in stage t; I represents the set of items. The total number of interactions between all items in the item set during stage t; ; For items The number of interactions in phase t.

5. The popularity-based recommendation method based on sentiment analysis and causal inference according to claim 1, characterized in that: Step (4) specifically includes the following steps: (4a) Based on the average emotional characteristics of objects E serves as an emotional variable in causal modeling; (4b) Dynamic popularity characteristics Set as an independent variable to characterize the impact of item popularity on the matching relationship between users and items and the probability of item exposure, and establish the influence relationship between popularity z on items and popularity z on interaction results, so as to characterize the confounding effect of popularity z. (4c) Set users and items as independent variables, and describe users' true preferences through the association between users and items; (4d) Introduce a time variable to characterize the dynamic characteristics of item popularity over time and to adjust local popularity so that time factors can work together with sentiment factors to optimize recommendation scores. (4e) Establish the direct impact path of popularity z on interaction results, as well as the path of popularity z indirectly affecting interaction results through items, and block the backdoor path through causal intervention operations to weaken the negative impact of item popularity on user-item matching; at the same time, introduce the influence relationship between emotional factors on user interaction behavior and item popularity. (4f) The user variable, item variable, popularity variable z, sentiment variable E and time variable are integrated into a causal debiased recommendation model. The causal debiased recommendation model is used to perform popularity debiasing during the training phase and to adjust the recommendation score during the inference phase.

6. The popularity-based recommendation method and system based on sentiment analysis and causal inference according to claim 1, characterized in that: Step (5) specifically refers to: by adjusting the distribution of popularity z, cutting off the backdoor obfuscation path of popularity z on item exposure, eliminating the direct influence of popularity z on item exposure, and obtaining the deobfuscated user-item matching relationship. The mathematical form of the deobfuscated user-item matching relationship is the interaction probability after intervention. The calculation method is as follows: ; Where C represents the interaction result between users and items; U represents the user set; I represents the item set; E represents the sentiment variable; and P(z) is the prior distribution of popularity z.

7. The popularity-based recommendation method based on sentiment analysis and causal inference according to claim 1, characterized in that: Step (6) specifically includes the following steps: (6a) Design a conditional probability model for matching users and items. This decouples user item matching relationships from the influence of popularity. For users, ∈U, where U represents the set of users; c is the matching result variable between users and items, where c=1 indicates that the user has a valid interaction with the item, and c=0 indicates that the user has not a valid interaction with the item; (6b) Set θ as the learnable parameter of the user-item matching conditional probability model, and optimize the learnable parameter θ based on Bayesian personalized loss. Maximize the objective function by iteratively updating the learnable parameter θ to complete the training process of the user-item matching conditional probability model. The objective function formula of the user-item matching conditional probability model is as follows: ; Where D is the training dataset, consisting of interaction triples (u, ..., D) composed of user, item, and sentiment features. , ) where u is the user, 'b' represents positive sample items, i.e., items that the user has actually interacted with; 'b' represents negative sample items, i.e., items that the user has not interacted with. b∈I, b∈I, where I represents the set of items; For items The average emotional characteristics; For items Dynamic popularity characteristics at stage t; The average emotional characteristic of item b; The dynamic popularity characteristics of item b in stage t; It is the sigmoid activation function; (6c) After the user-item matching conditional probability model is trained, the biased recommendation base score is obtained by eliminating the confusion effect of popularity z on exposure and retaining only the user-item matching part. : ; in, The output of the conditional probability model for matching users and items; For a variant of the exponential linear unit activation function, the formula is: ; In the formula, for ; It is the natural constant e. Power; Ensure the output is non-negative and monotonically increasing to avoid probability calculation failure due to negative values.

8. The popularity-based recommendation method based on sentiment analysis and causal inference according to claim 1, characterized in that: Step (7) specifically includes the following steps: (7a) The value of the item Expressed as follows: ; in, The basic intrinsic quality parameter of item i is a fixed variable that is independent of time and emotion; Weber's ratio; (7b) Calculate the predicted ranking score : ; in, (⋅) is the hyperbolic tangent function. (⋅) is the activation function; (7c) Causal bias-reduced recommendation model training: based on predicted ranking scores The causal unbiased recommendation model is trained using the Bayesian personalized ranking loss function L, resulting in the trained causal unbiased recommendation model. The loss function L is: ; Where D is the training dataset, consisting of interaction triples (u, ..., D) composed of user, item, and sentiment features. , ) where u is the user, 'b' represents positive sample items, i.e., items that the user has actually interacted with; 'b' represents negative sample items, i.e., items that the user has not interacted with. b∈I, b∈I, where I represents the set of items; This is a negative sample sampling distribution used to draw negative samples for each positive sample. For user u, positive sample items The predicted ranking score; The predicted ranking score for user u for negative sample item b; It is the sigmoid activation function; (7d) Generation of final recommendation results: Use the causal debiased recommendation model trained in step (7c) to generate predicted ranking scores for all items to be recommended to the user, and sort them in descending order according to the predicted ranking scores, and output the final debiased recommendation list.

9. An electronic device, comprising: processor; as well as A memory storing computer program instructions that, when executed by the processor, cause the processor to perform the popularity-based debiasing recommendation method based on sentiment analysis and causal inference as described in any one of claims 1-8.

10. A computer-readable storage medium having stored thereon computer program instructions, which, when executed by a processor, cause the processor to perform the popularity-based debiased recommendation method based on sentiment analysis and causal inference as described in any one of claims 1-8.