-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[text analytics] PII updates for v5.1.0b6 #17038
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9941478
Implemented change for PII categories
76b5dd6
Some renames
7cc73f3
Fixed merge conflicts
a136c4d
Added tests for pii categories
0b1a714
Removed pii categories from Analyze task; updated test recordings
6e33c35
Fixed merge conflict
fbc5bdc
PR comments
1aa4c76
Updated tests
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
24 changes: 12 additions & 12 deletions
24
...cs/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v3_1_preview_4/_metadata.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1410,13 +1410,21 @@ class RecognizePiiEntitiesAction(DictMixin): | |
:keyword str model_version: The model version to use for the analysis. | ||
:keyword str domain_filter: An optional string to set the PII domain to include only a | ||
subset of the PII entity categories. Possible values include 'phi' or None. | ||
:keyword categories_filter: A list of specific PII entity categories to return. If the value of `domain_filter` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. idk if it's worth to mention
|
||
is also set, the result will contain entities in the intersection of `domain_filter` and the items in | ||
`categories_filter`. | ||
:paramtype categories_filter: list[~azure.ai.textanalytics.PiiEntityCategoryType] | ||
:keyword str string_index_type: Specifies the method used to interpret string offsets. | ||
`UnicodeCodePoint`, the Python encoding, is the default. To override the Python default, | ||
you can also pass in `Utf16CodePoint` or TextElements_v8`. For additional information | ||
see https://aka.ms/text-analytics-offsets | ||
:ivar str model_version: The model version to use for the analysis. | ||
:ivar str domain_filter: An optional string to set the PII domain to include only a | ||
subset of the PII entity categories. Possible values include 'phi' or None. | ||
:ivar categories_filter: A list of specific PII entity categories to return. If the value of `domain_filter` | ||
is also set, the result will contain entities in the intersection of `domain_filter` and the list | ||
`categories_filter`. | ||
:vartype categories_filter: list[~azure.ai.textanalytics.PiiEntityCategoryType] | ||
:ivar str string_index_type: Specifies the method used to interpret string offsets. | ||
`UnicodeCodePoint`, the Python encoding, is the default. To override the Python default, | ||
you can also pass in `Utf16CodePoint` or TextElements_v8`. For additional information | ||
|
@@ -1427,17 +1435,24 @@ def __init__(self, **kwargs): | |
self.model_version = kwargs.get("model_version", "latest") | ||
self.domain_filter = kwargs.get("domain_filter", None) | ||
self.string_index_type = kwargs.get("string_index_type", "UnicodeCodePoint") | ||
self.categories_filter = kwargs.get("categories_filter", None) | ||
|
||
def __repr__(self, **kwargs): | ||
return "RecognizePiiEntitiesAction(model_version={}, domain_filter={}, string_index_type={})" \ | ||
.format(self.model_version, self.domain_filter, self.string_index_type)[:1024] | ||
return "RecognizePiiEntitiesAction(model_version={}, domain_filter={}, string_index_type={}, " \ | ||
"categories_filter={})".format( | ||
self.model_version, | ||
self.domain_filter, | ||
self.string_index_type, | ||
self.categories_filter | ||
)[:1024] | ||
|
||
def to_generated(self): | ||
return _latest_preview_models.PiiTask( | ||
parameters=_latest_preview_models.PiiTaskParameters( | ||
model_version=self.model_version, | ||
domain=self.domain_filter, | ||
string_index_type=self.string_index_type | ||
string_index_type=self.string_index_type, | ||
pii_entity_categories=self.categories_filter | ||
abhahn marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
) | ||
|
||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v tiny nit:
categories_filter