alexandrainst / danlp

DaNLP is a repository for Natural Language Processing resources for the Danish Language.
BSD 3-Clause "New" or "Revised" License
199 stars 34 forks source link

'str' object has no attribute 'exists' #169

Open mirfan899 opened 1 year ago

mirfan899 commented 1 year ago

Describe the bug

I'm trying to use the sentiment model.

To Reproduce

from danlp.models import load_spacy_model
import operator 

# load the model
nlp = load_spacy_model(textcat='sentiment') 

# use the model for prediction
doc = nlp("Vi er glade for spacy!")
max(doc.cats.items(), key=operator.itemgetter(1))[0]

Screenshots

danlp

Your Environment