Use a simple spanish tokenizer

I've always used the spacy library with English or German.

To load the library I used this code:

import spacy
nlp = spacy.load('en')

      

I would like to use a Spanish tokeniser, but I don't know how to do it because spacy does not have a Spanish model. I tried this

python -m spacy download es

      

and then:

nlp = spacy.load('es')

      

But obviously without any success.

Does anyone know how to properly sign a Spanish sentence with Spanish?

+3


source to share


1 answer


For versions prior to 1.6, this code works correctly:

from spacy.es import Spanish
nlp = Spanish()

      

but in version 1.7.2 a little change is required:



from spacy.es import Spanish
nlp = Spanish(path=None)

      

Source: @honnibal on gitter chat

+4


source







All Articles