Skip to content

Error attempting to use Stanza engine #726

Answered by kmatt
kmatt asked this question in Q&A
Discussion options

You must be logged in to vote

With a clean virtualenv, and installing only:

  1. presidio_analyzer
  2. presidio_anonymizer
  3. stanza
  4. spacy_stanza
import stanza
stanza.download("en")

from presidio_analyzer import AnalyzerEngine
from presidio_anonymizer import AnonymizerEngine
from presidio_analyzer.nlp_engine import NlpEngineProvider

configuration = {
    "nlp_engine_name": "stanza",
    "models": [{"lang_code": "en", "model_name": "en"}]
}

provider = NlpEngineProvider(nlp_configuration=configuration)
nlp_engine = provider.create_engine()

print(nlp_engine)
Downloading https://raw.githubusercontent.com/stanfordnlp/stanza-resources/main/resources_1.2.1.json: 138kB [00:00, 29.4MB/s]
2021-06-09 13:57:30 INFO: Downloading defaul…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
5 replies
@kmatt
Comment options

@kmatt
Comment options

@SharonHart
Comment options

@kmatt
Comment options

@SharonHart
Comment options

Comment options

You must be logged in to vote
2 replies
@omri374
Comment options

@Momilijaz96
Comment options

Answer selected by SharonHart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants