shenweichen / DeepMatch

A deep matching model library for recommendations & advertising. It's easy to train models and to export representation vectors which can be used for ANN search.
https://deepmatch.readthedocs.io/en/latest/
Apache License 2.0
2.22k stars 530 forks source link

在MIND里怎样处理多个 item features #22

Open zhangLongli opened 4 years ago

zhangLongli commented 4 years ago

我想在MIND里添加多个item features。比如movielens里面的movie_id和genres。我是新手,所以尽量基于你的代码改。我现在遇到的问题是,需要给SampledSoftmaxLayer传递所有的item features的embedding。不同的tem feature的embedding的vocabulary_size是不一样的。怎样才能把多个item features的embedding给链接起来呢。

具体是mind.py里面的这段代码。如果item_features是多个的话,怎么办。

item_inputs_list = list(item_features.values())
item_embedding_matrix = embedding_matrix_dict[item_feature_name]
item_index = EmbeddingIndex(list(range(item_vocabulary_size)))(item_features[item_feature_name])
item_embedding_weight = NoMask()(item_embedding_matrix(item_index))
pooling_item_embedding_weight = PoolingLayer()([item_embedding_weight])

output = SampledSoftmaxLayer(num_sampled=num_sampled)(
    inputs=(pooling_item_embedding_weight,user_embedding_final, item_features[item_feature_name]))

万分感谢

Brentbin commented 4 years ago

同问 Now MIND only support 1 item feature like item_id

shenweichen commented 4 years ago

这个我们正在开发中~ 请保持关注!

cl5220418 commented 3 years ago

这个我们正在开发中~ 请保持关注!

请问这个部分开发完了吗