Search code examples
pythonnlpstanford-stanza

How can I download a stanza's model via command line?


One can download a stanza's model via Python as follows (mirror):

import stanza
stanza.download('en')       # This downloads the English models for the neural pipeline

How can I download a stanza's model via command line?

E.g. with spaCy one can use:

python -m spacy download en

I unsuccessfully tried:

python -m stanza download en

I use stanza==1.0.1.


Solution

  • Instead of using to -m argument for the Python interpreter, you can use -c (command). To replicate your download call would look like this:

    python -c 'import stanza; stanza.download("en")'