Skip to content

Commit

Permalink
Updating scores for entity classifier for context matching (daxa-ai#210)
Browse files Browse the repository at this point in the history
* Updating scores for entity classifier context matching
  • Loading branch information
dristysrivastava committed Feb 23, 2024
1 parent a5540d5 commit 2285ffe
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pebblo/entity_classifier/entity_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ def presidio_secret_classifier(self, input_text):
registry=custom_registry,
context_aware_enhancer=LemmaContextAwareEnhancer(
context_similarity_factor=float(
ConfidenceScore.ContextSimilarityScore.value
ConfidenceScore.EntityContextSimilarityFactor.value
),
min_score_with_context_similarity=float(
ConfidenceScore.Entity.value
ConfidenceScore.EntityMinScoreWithContext.value
),
),
)
Expand Down
9 changes: 6 additions & 3 deletions pebblo/entity_classifier/utils/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class SecretEntities(Enum):


class ConfidenceScore(Enum):
Entity = "0.35" # It denotes minimum confidence score when context matches
EntityMinScore = "0.4" # It denotes the pattern's strength
ContextSimilarityScore = "0.3" # It denotes how much to enhance confidence of match entity when context matches
Entity = "0.8" # based on this score entity output is finalized
EntityMinScore = "0.45" # It denotes the pattern's strength
EntityContextSimilarityFactor = (
"0.35" # It denotes how much to enhance confidence of match entity
)
EntityMinScoreWithContext = "0.4" # It denotes minimum confidence score

0 comments on commit 2285ffe

Please sign in to comment.