I was getting the following error while i was trying to read a txt file in spacy.
TypeError: Argument 'string' has incorrect type (expected unicode, got str)
Here is the code below
from __future__ import unicode_literals
import spacy
nlp= spacy.load('en')
doc_file = nlp(open("example.txt").read())
you should use nlp= spacy.blank('en') instead of spacy.load('en').
nlp= spacy.blank('en')
doc_file = nlp(open("example.txt").read())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With