0
我想加载数据帧csv到spacy管道。我得到的参数字符串错误这里是我的代码。如何在sparse pipeline nlp中加载数据框或csv文件?
from __future__ import unicode_literals
nlp = spacy.load('en')
data = pd.read_csv("sometextdata.csv")
text = []
for line in data.Line:
text.append(clean_text(line))
text_spacy = nlp(data['Line'])
data['Line'].apply(nlp)
document = nlp(text)
TypeError: Argument 'string' has incorrect type (expected unicode, got str)
我试图以不同的方式加载我得到同样的错误。
平台:操作系统 - Mac和蟒蛇2.7