Skip to content

Commit

Permalink
fixed mentions to v3.1-preview.1 in code and docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
iscai-msft committed Jul 29, 2020
1 parent e5451ea commit f85ae53
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
**New features**
- We are now targeting the service's v3.1-preview.1 API as the default. If you would like to still use version v3.0 of the service,
pass in `v3.0` to the kwarg `api_version` when creating your TextAnalyticsClient
- We have added an API `recognize_pii_entities` which returns entities containing personal information for a batch of documents. Only available for version v3.1-preview.1 and up.
- We have added an API `recognize_pii_entities` which returns entities containing personal information for a batch of documents. Only available for API version v3.1-preview.1 and up.

## 5.0.0 (2020-07-27)

Expand Down
4 changes: 2 additions & 2 deletions sdk/textanalytics/azure-ai-textanalytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ and [supported types][linked_entities_categories].

### Recognize PII entities
[recognize_pii_entities][recognize_pii_entities] recognizes and categorizes Personally Identifiable Information (PII) entities in its input text, such as
Social Security Numbers, bank account information, credit card numbers, and more.
Social Security Numbers, bank account information, credit card numbers, and more. This endpoint is only available for v3.1-preview.1 and up.

```python
from azure.core.credentials import AzureKeyCredential
Expand All @@ -303,7 +303,7 @@ from azure.ai.textanalytics import TextAnalyticsClient, ApiVersion
credential = AzureKeyCredential("<api_key>")
endpoint="https://<region>.api.cognitive.microsoft.com/"

text_analytics_client = TextAnalyticsClient(endpoint, credential, api_version=ApiVersion.V3_1_preview_1)
text_analytics_client = TextAnalyticsClient(endpoint, credential)

documents = [
"The employee's SSN is 859-98-0987.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ def recognize_pii_entities( # type: ignore
except AttributeError as error:
if "'TextAnalyticsClient' object has no attribute 'entities_recognition_pii'" in str(error):
raise NotImplementedError(
"'recognize_pii_entities' endpoint is only available for API version v3.1-preview.1"
"'recognize_pii_entities' endpoint is only available for API version v3.1-preview.1 and up"
)
raise error
except HttpResponseError as error:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ async def recognize_pii_entities( # type: ignore
except AttributeError as error:
if "'TextAnalyticsClient' object has no attribute 'entities_recognition_pii'" in str(error):
raise NotImplementedError(
"'recognize_pii_entities' endpoint is only available for API version v3.1-preview.1"
"'recognize_pii_entities' endpoint is only available for API version v3.1-preview.1 and up"
)
raise error
except HttpResponseError as error:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
DESCRIPTION:
This sample demonstrates how to recognize personally identifiable information in a batch of documents.
The endpoint recognize_pii_entities is only available for API version v3.1-preview.1 and up.
USAGE:
python sample_recognize_pii_entities_async.py
Expand All @@ -36,7 +37,7 @@ async def recognize_pii_entities_async(self):
key = os.environ["AZURE_TEXT_ANALYTICS_KEY"]

text_analytics_client = TextAnalyticsClient(
endpoint=endpoint, credential=AzureKeyCredential(key), api_version=ApiVersion.V3_1_preview_1
endpoint=endpoint, credential=AzureKeyCredential(key)
)
documents = [
"The employee's SSN is 859-98-0987.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
DESCRIPTION:
This sample demonstrates how to recognize personally identifiable information in a batch of documents.
The endpoint recognize_pii_entities is only available for API version v3.1-preview.1 and up.
USAGE:
python sample_recognize_pii_entities.py
Expand All @@ -34,7 +35,7 @@ def recognize_pii_entities(self):
key = os.environ["AZURE_TEXT_ANALYTICS_KEY"]

text_analytics_client = TextAnalyticsClient(
endpoint=endpoint, credential=AzureKeyCredential(key), api_version=ApiVersion.V3_1_preview_1
endpoint=endpoint, credential=AzureKeyCredential(key)
)
documents = [
"The employee's SSN is 859-98-0987.",
Expand Down

0 comments on commit f85ae53

Please sign in to comment.