我有下面的示例数据框架。它已经被标记化了。
No category problem_definition_stopwords
175 2521 ['coffee', 'maker', 'brewing', 'properly', '2', '420', '420', '420']
211 1438 ['galley', 'work', 'table', 'stuck']
912 2698 ['cloth', 'stuck']
572 2521 ['stuck', 'coffee']
我想在这个数据框架上做部分语音标记。下面是我的代码的开头。它正在出错:
from nltk.corpus import state_union
from nltk.tokenize import PunktSentenceTokenizer
train_text = state_union.raw(df['problem_definition_stopwords'])
误差
TypeError: join() argument must be str or bytes, not 'list'
我期望的结果如下:“xxx”是一个标记化的单词,在它是语音的一部分(即nnp)之后:
[('xxx'、'nnp')、('xxx'、'vbd')、('xxx'、'pos')]