-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added changes for new api for entity and topic classification #518
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
shreyas-damle
requested changes
Sep 2, 2024
srics
force-pushed
the
classifier_api
branch
from
September 5, 2024 05:57
309a228
to
5aa1241
Compare
srics
force-pushed
the
classifier_api
branch
from
September 7, 2024 05:10
5aa1241
to
35e9dbe
Compare
srics
previously approved these changes
Sep 8, 2024
srics
force-pushed
the
classifier_api
branch
from
September 9, 2024 03:46
8bec477
to
87e77d6
Compare
shreyas-damle
approved these changes
Sep 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Created an api which can take text as input and return the entity and topic classification.
payload = {
"data": text,
"mode": "entity"/"topic"/"all"
"anonymize": True/False/Optional
}
"mode" is optional. It defaults to both entity and topic.
"anonymize" is an optional field if not sent, it will be considered False. If sent True then it will return the anonymized text.
If annonymize False:
{'entityCount': 1, 'entities': {'us-ssn': 1}, 'entityDetails': {'us-ssn': [{'location': '17_28', 'confidence_score': 'HIGH', 'entity_group': 'pii-identification'}]}, 'topicCount': 0, 'topics': {}, 'topicDetails': {}}
If annonymize True
{'data': "\nSachin's SSN is <US_SSN>\n", 'entityCount': 1, 'entities': {'us-ssn': 1}, 'entityDetails': {'us-ssn': [{'location': '17_25', 'confidence_score': 'HIGH', 'entity_group': 'pii-identification'}]}, 'topicCount': 0, 'topics': {}, 'topicDetails': {}}