【发布时间】:2017-03-10 13:18:06
【问题描述】:
我有一个数据框 IRC_DF,我想在输入对象到词汇表上创建一个迭代器,为此我尝试这样做:
it_train <- itoken(IRC_DF$Raison.Reco, preprocessor = prep_fun,
tokenizer = tok_fun, ids = IRC_DF$ID, progressbar = FALSE)
但我收到此错误:
Error in UseMethod("itoken") :
no applicable method for 'itoken' applied to an object of class "factor"
有什么想法吗?
【问题讨论】:
-
哪些类是使用的对象,
itoken实际期望的是什么? -
@RomanLuštrik,我尝试在本教程中这样做analyzecore.com/2017/02/08/twitter-sentiment-analysis-doc2vec/…
-
查看
itoken的文档并写下它期望作为输入的类。然后遍历每个输入,检查类并确认它与要求的类匹配。