resistzzz / Prompt4NR

Source code for SIGIR 2023 paper: Prompt Learning for News Recommendation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Why reverse history clicked news?

nipirennipi opened this issue · comments

prepro_data.py:line42
his_clicks.reverse()

Because a user's history generally too long, but the BERT can be inputted only 512 tokens. After you concatenate the sentence, you need to make a trunction.
Of course, I want to reserve the latest clicked news, so making such "reverse()" operation is convenient for me to reserve the lastest clicked news in the sentence. I just need to set a threshold and cut off the these tokens that surpass the threshold length, and the previous tokens are the latest user's clicked news I want to obtain.