Skip to content

Commit

Permalink
Put org in ignore as it has many FPs (#1200)
Browse files Browse the repository at this point in the history
  • Loading branch information
omri374 authored Oct 31, 2023
1 parent 08c6c52 commit 22619f3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions .pipelines/templates/build-image-redactor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ steps:
set -eux # fail on error
pipenv install --deploy --dev
pipenv run python -m spacy download en_core_web_lg
pipenv run pip install -e ../presidio-analyzer/. # Use the existing analyzer and not the one in PyPI
- template: ./build-python.yml
parameters:
SERVICE: 'Image-Redactor'
Expand Down
4 changes: 2 additions & 2 deletions presidio-analyzer/conf/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ ner_model_configuration:

low_confidence_score_multiplier: 0.4
low_score_entity_names:
- ORG
- ORGANIZATION
-
labels_to_ignore:
- ORGANIZATION # Has many false positives
- CARDINAL
- EVENT
- LANGUAGE
Expand Down
5 changes: 3 additions & 2 deletions presidio-analyzer/conf/spacy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ ner_model_configuration:

low_confidence_score_multiplier: 0.4
low_score_entity_names:
- ORG
- ORGANIZATION

labels_to_ignore:
- ORG
- ORGANIZATION # has many false positives
- CARDINAL
- EVENT
- LANGUAGE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
HOSPITAL="ORGANIZATION",
)

LOW_SCORE_ENTITY_NAMES = {"ORG", "ORGANIZATION"}
LABELS_TO_IGNORE = {"O"}
LOW_SCORE_ENTITY_NAMES = {}
LABELS_TO_IGNORE = {"O", "ORG", "ORGANIZATION"}


@dataclass
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def test_given_image_then_text_entities_are_recognized_correctly(image_analyzer_engine):
# Image with PII entities
image = get_resource_image("ocr_test.png")
analyzer_results = image_analyzer_engine.analyze(image)
analyzer_results = image_analyzer_engine.analyze(image, score_threshold=0.4)
assert len(analyzer_results) == 7
results = __get_expected_ocr_test_image_analysis_results()
for i in range(7):
Expand Down

0 comments on commit 22619f3

Please sign in to comment.