Skip to content

Commit

Permalink
FIX: change the method of getting keys of map_dict
Browse files Browse the repository at this point in the history
  • Loading branch information
Wicknight committed May 13, 2023
1 parent c9a8304 commit 06ff040
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion recbole_cdr/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

from recbole.data.dataset import Dataset
from recbole.utils import FeatureSource, FeatureType, set_color
from recbole_cdr.utils import get_keys_from_chainmap_by_order


class CrossDomainSingleDataset(Dataset):
Expand Down Expand Up @@ -112,7 +113,7 @@ def _remap_fields(self, field_names, map_dict):
map_dict (dict): The dict whose keys are the original ids and values are the new ids.
"""
for field_name in field_names:
self.field2id_token[field_name] = list(map_dict.keys())
self.field2id_token[field_name] = get_keys_from_chainmap_by_order(map_dict)
self.field2token_id[field_name] = map_dict
if field_name in self.inter_feat.columns:
self.inter_feat[field_name] = self.inter_feat[field_name].map(lambda x: map_dict.get(x, x))
Expand Down

0 comments on commit 06ff040

Please sign in to comment.