Reputation: 33
I am trying to use spaCy and I am having trouble with this error that I am receiving.
from spacy.lang.en import English
parser = English()
import en_core_web_sm
nlp = en_core_web_sm.load()
comment = data['comment']
This is the line of code causing the error:
comment = nlp(comment)
Upvotes: 2
Views: 4178
Reputation: 1882
data['comment']
returns a pandas series. Spacy is expecting a list. You should convert the pandas series to list using tolist() command and then pass to Spacy - refer to SO question here
comment = data['comment'].tolist()
Upvotes: 3