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