andreeaiana / newsreclib

PyTorch-Lightning Library for Neural News Recommendation
https://newsreclib.readthedocs.io/en/latest/
MIT License
43 stars 8 forks source link

Is sentiment required? #24

Open yangb0o opened 1 month ago

yangb0o commented 1 month ago

Hi,

I notice that in the model you added sentiment for training, may I ask how to remove it?

andreeaiana commented 1 month ago

Hi, you can specify which dataset attributes you want to use in the dataset config. If you don't want to use the sentiment information, you can comment it out.

yangb0o commented 1 month ago

Hi, I can remove some attributes in config, for example:

# configs/data/mind_rec.yaml
# Data preprocessing
dataset_attributes:
  - "title"
  - "abstract"
  - "category"
  - "subcategory"
  - "title_entities"
  - "abstract_entities"
  - "category_class"
  - "subcategory_class"
  # - "sentiment_class"
  # - "sentiment_score"

But it seems that it only affect data preprocessing, the model (such as NRMS) still relies on sentiment information for training. I can only manually remove the module about sentiment from the model's code, can this be done by way of configuration?

andreeaiana commented 1 month ago

Currently, all models use the sentiment for the evaluating the diversity of the recommendations w.r.t. sentiment, not for training the model itself. I'm planning to refactor the code to make it more modular and link more settings, like the one you mentioned, directly to the configuration of the model itself. However, I'll only have capacity for this at the end of the year. For now, you'd have to manually comment out those few lines that refer to sentiments from the model's evaluation code.

yangb0o commented 1 month ago

Currently, all models use the sentiment for the evaluating the diversity of the recommendations w.r.t. sentiment, not for training the model itself. I'm planning to refactor the code to make it more modular and link more settings, like the one you mentioned, directly to the configuration of the model itself. However, I'll only have capacity for this at the end of the year. For now, you'd have to manually comment out those few lines that refer to sentiments from the model's evaluation code.

Thanks for your reply. Looking forward to the better modular.