Closed kylefoley76 closed 4 years ago
Ok, I figured out that the json code has to go here
iwnlp = spaCyIWNLP(lemmatizer_path='data/IWNLP.Lemmatizer_20181001.json')
I can run this line of code
b = spacy.load('de_core_news_sm')
But I can't run
nlp = spacy.load('de')
Seems rather strange to me.
Alright, I got it working. I had to write out the full path of the code and changed 'de' to something different
nlp = spacy.load('de_core_news_sm')
iwnlp = spaCyIWNLP(lemmatizer_path='/users/kylefoley/codes/venv/lib/python3.8/site-packages/spacy/data/IWNLP.Lemmatizer_20181001.json')
nlp.add_pipe(iwnlp)
doc = nlp('Wir mögen Fußballspiele mit ausgedehnten Verlängerungen.')
for token in doc:
print('POS: {}\tIWNLP:{}'.format(token.pos_, token._.iwnlp_lemmas))
I cannot run this line of code
This is the error message:
Also, where am I supposed to put the json file here Download the latest processed IWNLP dump from http://lager.cs.uni-duesseldorf.de/NLP/IWNLP/IWNLP.Lemmatizer_20181001.zip and unzip it.
I tried putting it in the same directory that I run the code from. Is that correct?