language=x["language"]))    Warning : `load_model` does not return WordVectorModel or SupervisedModel any more, but a `FastText` object which is very similar.chain.invoke("Yo soy Sof√≠a")    es    'Yo soy Angela Werner'chain.invoke("My name is John Doe")    en    'My name is Carlos Newton'This way you only need to initialize the model with the engines corresponding to the relevant languages, but using the tool is fully automated.Advanced usage‚ÄãCustom labels in NER model‚ÄãIt may be that the spaCy model has different class names than those supported by the Microsoft Presidio by default. Take Polish, for example:# ! python -m spacy download pl_core_news_mdimport spacynlp = spacy.load("pl_core_news_md")doc = nlp("Nazywam siƒô Wiktoria")  # "My name is Wiktoria" in Polishfor ent in doc.ents:    print(        f"Text: {ent.text}, Start: {ent.start_char}, End: {ent.end_char}, Label: {ent.label_}"    )    Text: Wiktoria, Start: 12, End: 20, Label: persNameThe name Victoria was classified as persName, which does not correspond to the default class names PERSON/PER implemented in Microsoft Presidio (look for CHECK_LABEL_GROUPS in SpacyRecognizer implementation). You can find out more about custom labels in spaCy models (including your own, trained ones) in this thread.That's why our sentence will not be anonymized:nlp_config = {    "nlp_engine_name": "spacy",    "models": [        {"lang_code": "en", "model_name": "en_core_web_md"},        {"lang_code": "es", "model_name": "es_core_news_md"},        {"lang_code": "pl", "model_name": "pl_core_news_md"},    ],}anonymizer = PresidioReversibleAnonymizer(    analyzed_fields=["PERSON", "LOCATION", "DATE_TIME"],    languages_config=nlp_config,)print(    anonymizer.anonymize("Nazywam siƒô Wiktoria", language="pl"))  # "My name is Wiktoria" in Polish    Nazywam siƒô WiktoriaTo address this, create your own SpacyRecognizer with your own class mapping and add it to the anonymizer:from presidio_analyzer.predefined_recognizers import
Open In Colab
Open In Colab ->: language=x["language"]))    Warning : `load_model` does not return WordVectorModel or SupervisedModel any more, but a `FastText` object which is very similar.chain.invoke("Yo soy Sof√≠a")    es    'Yo soy Angela Werner'chain.invoke("My name is John Doe")    en    'My name is Carlos Newton'This way you only need to initialize the model with the engines corresponding to the relevant languages, but using the tool is fully automated.Advanced usage‚ÄãCustom labels in NER model‚ÄãIt may be that the spaCy model has different class names than those supported by the Microsoft Presidio by default. Take Polish, for example:# ! python -m spacy download pl_core_news_mdimport spacynlp = spacy.load("pl_core_news_md")doc = nlp("Nazywam siƒô Wiktoria")  # "My name is Wiktoria" in Polishfor ent in doc.ents:    print(        f"Text: {ent.text}, Start: {ent.start_char}, End: {ent.end_char}, Label: {ent.label_}"    )    Text: Wiktoria, Start: 12, End: 20, Label: persNameThe name Victoria was classified as persName, which does not correspond to the default class names PERSON/PER implemented in Microsoft Presidio (look for CHECK_LABEL_GROUPS in SpacyRecognizer implementation). You can find out more about custom labels in spaCy models (including your own, trained ones) in this thread.That's why our sentence will not be anonymized:nlp_config = {    "nlp_engine_name": "spacy",    "models": [        {"lang_code": "en", "model_name": "en_core_web_md"},        {"lang_code": "es", "model_name": "es_core_news_md"},        {"lang_code": "pl", "model_name": "pl_core_news_md"},    ],}anonymizer = PresidioReversibleAnonymizer(    analyzed_fields=["PERSON", "LOCATION", "DATE_TIME"],    languages_config=nlp_config,)print(    anonymizer.anonymize("Nazywam siƒô Wiktoria", language="pl"))  # "My name is Wiktoria" in Polish    Nazywam siƒô WiktoriaTo address this, create your own SpacyRecognizer with your own class mapping and add it to the anonymizer:from presidio_analyzer.predefined_recognizers import