Closed lifepillar closed 4 months ago
Hi, please see the following code snippet:
from presidio_analyzer import AnalyzerEngine
from presidio_analyzer.nlp_engine import SpacyNlpEngine, NerModelConfiguration
# Define which model to use
model_config = [{"lang_code": "en", "model_name": "en_core_web_lg"}]
ner_model_configuration = NerModelConfiguration(default_score = 0.6)
# Create the NLP Engine based on this configuration
spacy_nlp_engine = SpacyNlpEngine(models= model_config, ner_model_configuration=ner_model_configuration)
analyzer = AnalyzerEngine(nlp_engine=spacy_nlp_engine)
analyzer.analyze(...)
Using the NerModelConfiguration
class you can further configure which entities the model returns, how they map to Presidio's entities and more.
I have tried this with Presidio 2.2.354:
The assigned score is always 0.85. How can I change that?
My goal is to define multiple
SpacyRecognizer
s and control which takes precedence over which. At the moment, if two entities overlap, the larger one wins, or ties are resolved arbitrarily if the spans are the same. Am I missing something?