【发布时间】:2022-01-05 00:35:48
【问题描述】:
final_vocab = {'Amazon',
'Big Bazaar',
'Brand Factory',
'Central',
'Cleartrip',
'Dominos',
'Flipkart',
'IRCTC',
'Lenskart',
'Lifestyle',
'MAX',
'MMT',
'More',
'Myntra'}
vect = CountVectorizer(vocabulary=final_vocab)
token_df = pd.DataFrame(vect.fit_transform(['Big Bazaar','Brand Factory']).todense(), columns=vect.get_feature_names())
为什么所有的输出都是零???对于 Big Bazaar 和品牌工厂的价值应该是 1 ???
【问题讨论】:
标签: python nlp countvectorizer