MCPcopy Create free account
hub / github.com/alibaba/bigcomputing / gen_item_block

Method gen_item_block

DIEN/data_iterator.py:105–113  ·  view source on GitHub ↗
(self, item_idx)

Source from the content-addressed store, hash-verified

103 return int(self.brand_dict.get(x, -1))
104
105 def gen_item_block(self, item_idx):
106 neg_item = self.all_items[item_idx]
107 neg_cate = self.map_cate(self.item_info[neg_item][0])
108 neg_shop = self.map_shop(self.item_info[neg_item][1])
109 neg_node = self.map_node(self.item_info[neg_item][2])
110 neg_product = self.map_product(self.item_info[neg_item][3])
111 neg_brand = self.map_brand(self.item_info[neg_item][4])
112 neg_item = self.map_item(self.all_items[item_idx])#map origin item to item_id
113 return neg_item, neg_cate, neg_shop, neg_node, neg_product, neg_brand
114
115 def gen_neg_hist(self, length):
116 if len(self.neg_hist_catch.get(length, [1])) == self.max_catch_num:

Callers

nothing calls this directly

Calls 6

map_cateMethod · 0.95
map_shopMethod · 0.95
map_nodeMethod · 0.95
map_productMethod · 0.95
map_brandMethod · 0.95
map_itemMethod · 0.95

Tested by

no test coverage detected