Giter VIP home page Giter VIP logo

Comments (5)

hyp1231 avatar hyp1231 commented on June 3, 2024

您好,感谢关注我们的工作。

这里 field 指 feature 的名字,在这里就是 user_iditem_idtoken 指的就是外部 id,即数据集里存储的字符串形式的用户和商品 id。id 是 RecBole 框架的内部 id,即经过 remapping 之后的数字。

所以这里 dataset.field2token_id 是一个字典,key 是 field 的名字,value 是存储 "tokenid 的映射的字典"。所以取出来的 user_token2id 就是能把外部的 user id 映射成内部 user id 的字典,item_token2id 同理。

from llmrank.

KpiHang avatar KpiHang commented on June 3, 2024

明白了,感谢

from llmrank.

KpiHang avatar KpiHang commented on June 3, 2024

for batch_idx, batched_data in enumerate(iter_data):
interaction, history_index, positive_u, positive_i = batched_data
for i in range(len(interaction)):
if interaction['user_id'][i].item() in self.selected_uids:
pr = self.selected_uids.index(interaction['user_id'][i].item())
unsorted_selected_interactions.append((interaction[i], pr))
unsorted_selected_pos_i.append((positive_i[i], pr))
unsorted_selected_interactions.sort(key=lambda t: t[1])
unsorted_selected_pos_i.sort(key=lambda t: t[1])
selected_interactions = [_[0] for _ in unsorted_selected_interactions]
selected_pos_i = [_[0] for _ in unsorted_selected_pos_i]

image

再请教一下,这里的iteraction我不太理解,user_id 和 item_id 长度都是100, 是对应位置是一个用户的交互的一个item吗?
这六个字典有什么联系吗? 还是说“item_id”代表的是这个序列要预测的next_item?

另外,再请教一下这里的positive_u, 和 positive_i 是做什么的? 不求甚解,万分感谢!

from llmrank.

hyp1231 avatar hyp1231 commented on June 3, 2024

嗯嗯 item_id 是这个序列要预测的 next_item。positive_upositive_i 只是为了和 RecBole 的接口对齐,对 sequential recommendation 来说没有什么实际意义。

from llmrank.

KpiHang avatar KpiHang commented on June 3, 2024

非常有帮助!

from llmrank.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.