【发布时间】:2021-05-27 06:48:37
【问题描述】:
有一个这样的数据框:
index terms
1345 ['jays', 'place', 'great', 'subway']
1543 ['described', 'communicative', 'friendly']
9874 ['great', 'sarahs', 'apartament', 'back']
2456 ['great', 'sarahs', 'apartament', 'back']
我尝试从 cmets[ 'terms' ] 语料库创建字典,但遇到错误消息!
from gensim import corpora, models
dictionary = corpora.Dictionary( comments['terms'] )
TypeError: doc2bow expects an array of unicode tokens on input, not a single string
【问题讨论】:
标签: python dictionary gensim