Repository navigation
Conversation
There was a problem hiding this comment.
Maybe better to move this out of models. It can go to utils for instance.
There was a problem hiding this comment.
Sounds good. That'd be a better fit than inside models
There was a problem hiding this comment.
What is the difference between this file "semantic_id_evaluation.py" and "sid_evaluation.py"?
- I would recommend improving the naming. For instance, can we say that semantic_id_evaluation.py implements a NextItemEvaluation for Semantic-ID based recommenders? If yes we can name it explicitly
- Add more documentation explain why and when to use this eval over the base NextItem evaluation
- Are there any references in the literature supporting this method? If yes, we can point to them
- Is this method dedicated to SIDs based models are can be used to evaluate list of models including both SID-based (e.g., Tiger) and non-SIDs-based (e.g., Sasrec) models?
- Also: semantic_id_evaluation can be confusing, what we are evaluating here is recommendation performance, not the quality of semantic IDs.
There was a problem hiding this comment.
- Add more docs with a concrete example to explain what code inside this scripts allows to do.
- /eval_methods may not be the right path for this script. Consider moving it to utils.
|
@saghiles Thanks for the suggestions. I’ve consolidated the implementation into:
The documentation now distinguishes two ways to convert SID predictions into item-level results:
|
Hi @hieuddo , thank you so much for the clarification. to follow up,
|
@saghiles, your design actually makes more sense. I tried to take on too big a scope for this PR. Let me reduce this PR to SID-level vs. item-level evaluation metrics for I'm thinking we can extend some flag for I'll skip the item resolvers for now and think it through first. |
|
I largely agree with @saghiles on trying to enable these SID models to work with
class SemanticIDMixin:
def semantic_id_catalog(self):
raise NotImplementedError
def predict_semantic_ids(self, history_items, **context):
raise NotImplementedError
class TIGER(NextItemRecommender, SemanticIDMixin):
...
There will be other details to get right, but I hope we can align on the above to more forward. |
Description
Many Semantic ID (SID) Recommendation models evaluate at SID level; if the model predicts the correct groundtruth SID, it's a perfect hit. However, one SID can map to multiple items, so predicting the correct SID does not necessarily identify the correct item; and it's also not fair for other item-based models (e.g., SASRec, BERT4Rec) in comparison.
This PR provides shared evaluation and resolution components for item-level evaluation for SID recommender models.
Implemented:
I added SID-item mapping/trace to cornac/models/semantic_id.py because it's not a Recommender abstract class, and to avoid making cornac/models/recommender.py bloated; not sure if it's appropriate.
Related Issues
Checklist:
examples/README.md(if you are adding a new example).