[🐛BUG] The values of dataset.field2id_token and dataset.field2token_id are not the same in Knowledge based models.
See original GitHub issueDescribe the bug:
The values of dataset.field2id_token and dataset.field2token_id are not the same in Knowledge-based models.
To Reproduce:
I inserted the following debug message code in the run_recbole to check the reason of the bug. https://github.com/RUCAIBox/RecBole/blob/152358e570c05826c63e3308bd627c08f2d5f80f/recbole/quick_start/quick_start.py#L39
# dataset filtering
dataset = create_dataset(config)
logger.info(dataset)
#! insert debug message
print('tr dataset.field2id_token=', len(dataset.field2id_token['item_id']))
print('tr dataset.field2token_id=', len(dataset.field2token_id['item_id']))
I trained KGCN model ( other KG-based model also has the same errors )
python run_recbole.py --model=KGCN
Expected behavior:
I expected dataset.field2id_token and dataset.field2id_token are the same. However, it shows two dictionary length is not the same. It makes errors when we call dataset.id2token().
tr dataset.field2id_token= 1683
tr dataset.field2token_id= 34713
When I train/test sequential models, the values of dataset.field2id_token and dataset.field2token_id are the same.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
@russellkim Thanks for your code. We fixed a type error in
Now you can run your code in KGCN algorithm. We also uploaded the fixed code.
fixed_test_predict.zip
KnowledgeBasedDataset
(#831), which will fix problem 1. For problem 2, you need to change the shape ofscores
in line 169 like this@russellkim It seems that the id(2591) is an entity id but not an item id. Could you please provide your code so that we can check if there is any bug?