-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[TA] Adding support for PII endpoint #13687
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
Conversation
...ai-textanalytics/src/main/java/com/azure/ai/textanalytics/RecognizePiiEntityAsyncClient.java
Outdated
Show resolved
Hide resolved
...zure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClient.java
Outdated
Show resolved
Hide resolved
...zure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClient.java
Outdated
Show resolved
Hide resolved
...xtanalytics/src/main/java/com/azure/ai/textanalytics/models/TextAnalyticsRequestOptions.java
Outdated
Show resolved
Hide resolved
...ai-textanalytics/src/main/java/com/azure/ai/textanalytics/RecognizePiiEntityAsyncClient.java
Outdated
Show resolved
Hide resolved
...zure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClient.java
Outdated
Show resolved
Hide resolved
...zure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClient.java
Outdated
Show resolved
Hide resolved
...lytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/PiiEntity.java
Show resolved
Hide resolved
...lytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/PiiEntity.java
Outdated
Show resolved
Hide resolved
...lytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/PiiEntity.java
Outdated
Show resolved
Hide resolved
...xtanalytics/src/main/java/com/azure/ai/textanalytics/models/TextAnalyticsRequestOptions.java
Outdated
Show resolved
Hide resolved
...lytics/azure-ai-textanalytics/src/samples/java/com/azure/ai/textanalytics/ReadmeSamples.java
Outdated
Show resolved
Hide resolved
...azure-ai-textanalytics/src/samples/java/com/azure/ai/textanalytics/RecognizePiiEntities.java
Outdated
Show resolved
Hide resolved
...-ai-textanalytics/src/samples/java/com/azure/ai/textanalytics/RecognizePiiEntitiesAsync.java
Outdated
Show resolved
Hide resolved
...-ai-textanalytics/src/test/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClientTest.java
Outdated
Show resolved
Hide resolved
For samples on using the production recommended option `RecognizePiiEntitiesBatch` see [here][recognize_pii_entities_sample]. | ||
Please refer to the service documentation for [supported PII entity types][pii_entity_recognition]. |
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.
Do we do this section for all the readme snippets if not consider moving this to Next Steps
?
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.
Not getting what you mean here. It should already for all the README snippets. It follows the pattern.
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.
I suggested if this could be moved to Next Steps section.
...ai-textanalytics/src/main/java/com/azure/ai/textanalytics/RecognizePiiEntityAsyncClient.java
Show resolved
Hide resolved
...lytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/PiiEntity.java
Outdated
Show resolved
Hide resolved
...lytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/PiiEntity.java
Outdated
Show resolved
Hide resolved
...lytics/azure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/PiiEntity.java
Outdated
Show resolved
Hide resolved
...extanalytics/src/main/java/com/azure/ai/textanalytics/models/RecognizePiiEntitiesResult.java
Show resolved
Hide resolved
...src/samples/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClientJavaDocCodeSnippets.java
Outdated
Show resolved
Hide resolved
...zure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClient.java
Outdated
Show resolved
Hide resolved
...ai-textanalytics/src/main/java/com/azure/ai/textanalytics/models/AnalyzeSentimentResult.java
Show resolved
Hide resolved
Looking at Azure/azure-rest-api-specs#10440 should we generate the PII code using 3.2-preview.1? |
if time is applicable, we should use 3.2-preview.1 instead of 3.1-preview.1. But I will do it in a new PR. |
@@ -82,6 +88,9 @@ This project welcomes contributions and suggestions. Find [more contributing][SD | |||
[async_sample_entities]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/textanalytics/azure-ai-textanalytics/src/samples/java/com/azure/ai/textanalytics/RecognizeEntitiesAsync.java | |||
[async_sample_entities_batch]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/textanalytics/azure-ai-textanalytics/src/samples/java/com/azure/ai/textanalytics/batch/RecognizeEntitiesBatchDocumentsAsync.java | |||
[async_sample_entities_batch_convenience]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/textanalytics/azure-ai-textanalytics/src/samples/java/com/azure/ai/textanalytics/batch/RecognizeEntitiesBatchStringDocumentsAsync.java | |||
[async_sample_pii_entities]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/textanalytics/azure-ai-textanalytics/src/samples/java/com/azure/ai/textanalytics/RecognizePiiEntitiesAsync.java |
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.
can't pass ci because of broken link, so will add them back after the sample merged.
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.
...zure-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/TextAnalyticsAsyncClient.java
Show resolved
Hide resolved
@ServiceMethod(returns = ReturnType.SINGLE) | ||
public RecognizePiiEntitiesResultCollection recognizePiiEntitiesBatch( | ||
Iterable<String> documents, String language, TextAnalyticsRequestOptions options) { | ||
return client.recognizePiiEntitiesBatch(documents, language, options).block(); |
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.
This can call the method on L403.
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.
it is better to link to call async version of it rather than depends on other sync overload.
@ServiceMethod(returns = ReturnType.SINGLE) | ||
public PiiEntityCollection recognizePiiEntities(String document, String language) { | ||
Objects.requireNonNull(document, "'document' cannot be null."); | ||
return client.recognizePiiEntities(document, language).block(); |
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.
Can this call the method on L373
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.
same reason as in #13687 (comment)
...e-ai-textanalytics/src/test/java/com/azure/ai/textanalytics/TextAnalyticsClientTestBase.java
Outdated
Show resolved
Hide resolved
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.
Apart from a few comments, changes lgtm
atomic API internally call the batch APIs, which is the single entities document result. If the result is an error (TextAnalyticsError), then we return it as TextAnalyticsException. |
fixes: [TA] Add PII endpoint feature #13417