dengyang17 / unicorn

The implementation of Unified Conversational Recommendation Policy Learning via Graph-based Reinforcement Learning (SIGIR 2021).
45 stars 8 forks source link

_feature_score() function in class BinaryRecommendEnv #10

Open zhanglitiger opened 1 year ago

zhanglitiger commented 1 year ago
def _feature_score(self):
    reach_fea_score = []
    for feature_id in self.reachable_feature:
        '''
        score = self.attr_ent[feature_id]
        reach_fea_score.append(score)
        '''
        feature_embed = self.feature_emb[feature_id]
        score = 0
        score += np.inner(np.array(self.user_embed), feature_embed)
        prefer_embed = self.feature_emb[self.user_acc_feature, :]  # np.array (x*64)
        for i in range(len(self.user_acc_feature)):
            score += np.inner(prefer_embed[i], feature_embed)
        if feature_id in self.user_rej_feature:
            score -= self.sigmoid([feature_embed, feature_embed])[0]
        reach_fea_score.append(score)

    return reach_fea_score

Why comment on the proposed weighted entropy calculation method, and use a calculation method similar to Preference-based Item Selection?Looking forward to your reply.