哪个功能列可以将单词映射到单词ID,但不能一键映射?

时间:2018-09-30 05:17:06

标签: tensorflow

给出vocabulary_list=["kitchenware", "electronics", "sports"]。我们可以使用tf.feature_column.categorical_column_with_vocabulary_list来实现映射:

["kitchenware"] -> [1,0,0]
["electronics"] -> [0,1,0]
["sports"]      -> [0,0,1]

但是我想将单词映射到单词ID,例如:

["kitchenware"] -> [0]
["electronics"] -> [1]
["sports"]      -> [2]

是否有任何功能列可以实现这一目标?

0 个答案:

没有答案