then the blank:es part refers to a "blank" Spanish model that doesn't have any pretrained components. It would only have a tokenizer. Instead, what you can do is use one of the pretrained Spanish models:
To do so, make sure you have es_core_news_lg installed in your environment. If not, you can download it first like so:
spacy download es_core_news_lg
The new Spanish v3 models indeed don't have a tagger, but instead they have a morphologizer component which sets the POS attribute you need for your custom pattern.
Hope that works for you - let us know if it doesn't!
I made it work with model es_core_news_sm, many thanks for the reply (more coming on a weekend)
With es_core_news_sm model I can check in a Jupyter Notebook what are the LEMMAS, POS
import spacy
!python3 -m spacy download es_core_news_sm
import es_core_news_sm
nlp = es_core_news_sm.load()
doc = nlp("12 MESES DE CDP. un mes. UN MES. CUATRO DÍAS cuatro días dos meses")
for token in doc:
print(token.text, token.lemma_, token.pos_, token.tag_, token.dep_,
token.shape_, token.is_alpha, token.is_digit)
When I try the same with the larger model, es_core_news_lg I cannot make it work. No matter what method to download it I try, I cannot make it work:
import es_core_news_lg
nlp = spacy.load('es_core_news_lg ')
If you're running this in a Jupyter notebook, have you tried restarting the kernel after downloading es_core_news_lg? Or better yet - ensure the environment is properly set up, with the model installed, before you start the notebook. We've seen some trouble in the past with notebooks & virtual environments, but this is unfortunately not something we can control...