rogueZ
rogueZ

Reputation: 71

Can I run stanza NER without downloading the language modules?

I need to run stanza ner in a platform without any access to external network. The code stanza.download('en') fails. Running without the download function, gives me an exception

Exception: Resources file not found at: \home\stanza_resources\resources.json. Try to download the model again

Is there a way to download and cache all the required modules in a resource directory and point this directory to stanza pipeline?

Thanks

Upvotes: 3

Views: 1867

Answers (1)

rogueZ
rogueZ

Reputation: 71

It looks like both download and the Pipeline class take an argument for directory dir

So the below code works

stanza.download('en', dir='resources/', processors={ner_processor: package})

nlp_pipeline = stanza.Pipeline('en', dir='resources/', processors={ner_processor: package})

Upvotes: 4

Related Questions