Skip to content

Commit

Permalink
[textanalytics] regen on v3.1 (#19193)
Browse files Browse the repository at this point in the history
* regen on v3.1

* fix v3.1-preview.5 -> v3.1 references

* regenerating with swagger transform to override ApiVersion parameterizing

* update test references to v3.1

* some more test fixes

* [textanalytics] add categories filter to RecognizePiiEntitiesAction (#19223)

* add categories_filter to RecognizePiiEntitiesAction

* add tests for categories_filter

* fix tests and docstring

* update changelog

* updating categories filter tests to new analyze design

* update docs

* update changelog to new format

* rerecord with v3.1

* bump msrest version for failsafe_deserialize

* [textanalytics] add HealthcareEntityCategory + move aliased enums to models (#19266)

* add HealthcareEntityCategory

* update changelog

* moving enums to models so they show up in docs
  • Loading branch information
kristapratico authored Jun 23, 2021
1 parent 185b636 commit 991c638
Show file tree
Hide file tree
Showing 619 changed files with 10,949 additions and 11,052 deletions.
22 changes: 16 additions & 6 deletions sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# Release History

## 5.1.0b8 (Unreleased)
## 5.1.0 (Unreleased)

**Breaking Changes**
This version of the SDK defaults to the latest supported API version, which currently is `v3.1`.
Includes all changes from `5.1.0b1` to `5.1.0b7`.

Note: this version will be the last to officially support Python 3.5, future versions will require Python 2.7 or Python 3.6+.

### Features Added

- Added `catagories_filter` to `RecognizePiiEntitiesAction`
- Added `HealthcareEntityCategory`

### Breaking Changes

- Changed the response structure of `being_analyze_actions`. Now, we return a list of results, where each result is a list of the action results for the document, in the order the documents and actions were passed
- Removed `AnalyzeActionsType`
- Removed `AnalyzeActionsResult`
- Removed `AnalyzeActionsError`
- Changed: the response structure of `being_analyze_actions`. Now, we return a list of results, where each result is a list of the action results for the document, in the order the documents and actions were passed.
- Removed: `AnalyzeActionsType`
- Removed: `AnalyzeActionsResult`
- Removed: `AnalyzeActionsError`

## 5.1.0b7 (2021-05-18)

Expand Down
24 changes: 10 additions & 14 deletions sdk/textanalytics/azure-ai-textanalytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Text Analytics is a cloud-based service that provides advanced natural language
- Language Detection
- Key Phrase Extraction
- Multiple Analysis
- Healthcare Entities Analysis (Gated Preview)
- Healthcare Entities Analysis

[Source code][source_code] | [Package (PyPI)][ta_pypi] | [API reference documentation][ta_ref_docs]| [Product documentation][ta_product_documentation] | [Samples][ta_samples]

Expand Down Expand Up @@ -71,17 +71,18 @@ For example, `https://<my-custom-subdomain>.cognitiveservices.azure.com/`.
Install the Azure Text Analytics client library for Python with [pip][pip]:

```bash
pip install azure-ai-textanalytics --pre
pip install azure-ai-textanalytics
```

> Note: This version of the client library defaults to the v3.1-preview version of the service
> Note: This version of the client library defaults to the v3.1 version of the service
This table shows the relationship between SDK versions and supported API versions of the service

| SDK version | Supported API version of service |
| ------------------------------------------------------------------------- | --------------------------------- |
| 5.0.0 - Latest GA release (can be installed by removing the `--pre` flag) | 3.0 |
| 5.1.0b7 - Latest release (beta) | 3.0, 3.1-preview.5 |
| SDK version | Supported API version of service |
| ------------ | --------------------------------- |
| 5.1.0 - Latest GA release | 3.0, 3.1 (default) |
| 5.0.0 | 3.0 |


### Authenticate the client

Expand Down Expand Up @@ -489,7 +490,7 @@ for idx, doc in enumerate(docs):
print("------------------------------------------")
```

Note: The Healthcare Entities Analysis service is currently available only in the API v3.1 preview versions and is in gated preview. Since this is a gated preview, AAD is not supported. More information [here](https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-for-health?tabs=ner#request-access-to-the-public-preview).
Note: The Healthcare Entities Analysis service is available only in the v3.1 API version.

### Multiple Analysis

Expand Down Expand Up @@ -559,19 +560,14 @@ for doc, action_results in zip(documents, document_results):

The returned response is an object encapsulating multiple iterables, each representing results of individual analyses.

Note: Multiple analysis is currently available only in the v3.1-preview API version.
Note: Multiple analysis is available only in the v3.1 API version.

## Optional Configuration

Optional keyword arguments can be passed in at the client and per-operation level.
The azure-core [reference documentation][azure_core_ref_docs]
describes available configurations for retries, logging, transport protocols, and more.

## Known Issues

- `begin_analyze_healthcare_entities` is currently in gated preview and can not be used with AAD credentials. For more information, see [the Text Analytics for Health documentation](https://docs.microsoft.com/azure/cognitive-services/text-analytics/how-tos/text-analytics-for-health?tabs=ner#request-access-to-the-public-preview).
- At time of this SDK release, the service is not respecting the value passed through `model_version` to `begin_analyze_healthcare_entities`, it only uses the latest model.

## Troubleshooting

### General
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@
HealthcareRelation,
HealthcareRelationRole,
HealthcareEntityAssertion,
AnalyzeSentimentAction
)
from ._generated.v3_1_preview_5.models import (
PiiCategory as PiiEntityCategoryType,
RelationType as HealthcareEntityRelationType,
Conditionality as EntityConditionality,
Certainty as EntityCertainty,
Association as EntityAssociation
AnalyzeSentimentAction,
PiiEntityCategoryType,
HealthcareEntityRelationType,
EntityConditionality,
EntityCertainty,
EntityAssociation,
HealthcareEntityCategory
)

from ._lro import AnalyzeHealthcareEntitiesLROPoller, AnalyzeActionsLROPoller

__all__ = [
Expand Down Expand Up @@ -102,6 +102,7 @@
"AnalyzeSentimentAction",
"AnalyzeHealthcareEntitiesLROPoller",
"AnalyzeActionsLROPoller",
"HealthcareEntityCategory"
]

__version__ = VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class TextAnalyticsApiVersion(str, Enum):
"""Text Analytics API versions supported by this package"""

#: this is the default version
V3_1_PREVIEW = "v3.1-preview.5"
V3_1 = "v3.1"
V3_0 = "v3.0"

def _authentication_policy(credential):
Expand All @@ -36,7 +36,7 @@ def __init__(self, endpoint, credential, **kwargs):
self._client = _TextAnalyticsClient(
endpoint=endpoint,
credential=credential,
api_version=kwargs.pop("api_version", TextAnalyticsApiVersion.V3_1_PREVIEW),
api_version=kwargs.pop("api_version", TextAnalyticsApiVersion.V3_1),
sdk_moniker=USER_AGENT,
authentication_policy=_authentication_policy(credential),
custom_hook_policy=TextAnalyticsResponseHookPolicy(**kwargs),
Expand Down
Loading

0 comments on commit 991c638

Please sign in to comment.