Skip to content

Commit

Permalink
v2.3.0 all checks passed
Browse files Browse the repository at this point in the history
  • Loading branch information
Sid Mohan authored and Sid Mohan committed Mar 12, 2024
1 parent d599f4d commit 6257657
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Binary file modified .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions src/datafog/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# datafog-python/src/datafog/__init__.py
import json
import logging

import pandas as pd
import requests
Expand All @@ -8,6 +9,8 @@
from .__about__ import __version__
from .pii_tools import PresidioEngine

logger = logging.getLogger(__name__).setLevel(logging.ERROR)

__all__ = [
"__version__",
"PresidioEngine",
Expand Down
16 changes: 12 additions & 4 deletions src/datafog/pii_tools/PresidioEngine/__init__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
from presidio_analyzer import AnalyzerEngine, RecognizerRegistry, RecognizerResult, PatternRecognizer, Pattern
from presidio_analyzer.nlp_engine import NlpEngineProvider
from typing import List, Optional, Tuple
import logging
from typing import List, Optional

from presidio_analyzer import (
AnalyzerEngine,
Pattern,
PatternRecognizer,
RecognizerRegistry,
)
from presidio_analyzer.nlp_engine import NlpEngineProvider

from .analyzer import CustomSpacyRecognizer

logger = logging.getLogger("presidio-engine-init").setLevel(logging.ERROR)


# Helper methods
def create_ad_hoc_deny_list_recognizer(
deny_list=Optional[List[str]],
Expand All @@ -30,6 +38,7 @@ def create_ad_hoc_regex_recognizer(
)
return regex_recognizer


def analyzer_engine():
"""Return AnalyzerEngine."""

Expand All @@ -55,7 +64,6 @@ def analyzer_engine():
"low_score_entity_names": ["ORG", "ORGANIZATION"],
"labels_to_ignore": ["DATE_TIME"],
},

}

# Create NLP engine based on configuration
Expand Down
1 change: 0 additions & 1 deletion src/datafog/pii_tools/PresidioEngine/analyzer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
logger = logging.getLogger("custom-spacy-recognizer").setLevel(logging.ERROR)



class CustomSpacyRecognizer(LocalRecognizer):
ENTITIES = [
"LOCATION",
Expand Down

0 comments on commit 6257657

Please sign in to comment.