Skip to content

Commit

Permalink
[textanalytics] feature/ta-v3.2-preview.2 (Azure#21409)
Browse files Browse the repository at this point in the history
* [textanalytics] regen on v3.2 preview.2 (Azure#20674)

* regenerate with version 3.2-preview.2

* hook up convenience layer to new api version

* fix import and skip tests for now

* [textanalytics] add support for custom text actions (Azure#20721)

* impl for custom actions sync/async + models

* remove project_name and deployment_name from result models

* update naming to classify documents

* add samples for arch board

* fix sample

* update naming to align with all langs

* update sample names

* arch board feedback

* rename samples and fix types

* regenerate on latest swagger

* add new tests and recordings

* make corrections to code based on renames

* remove samples from PR

* fix

* update changelog

* update missing docstrings

* bump azure-core for azure.core.rest

* re-enable tests and record for v3.2-preview.2 (Azure#21106)

* add 2.7 disclaimer in readme and 3.10 to setup classifiers (Azure#21096)

* [textanalytics] support multiple actions of the same type (Azure#21152)

* allow support for multiple actions of the same type

* rerecord all analyze tests now that we set task_name

* lint

* review feedback

* izzy's feedback

* [textanalytics] add samples for custom text actions (Azure#21182)

* add samples for custom text actions

* add samples + links to samples readme

* wording

* switch to asyncio.run in async samples

* [textanalytics] update readme + docs (Azure#21272)

* readme updates

* more docs updates

* update with aka links to service docs

* updating env vars with temp persistent resource (Azure#21342)

* rerecord test

* [textanalytics] enabling support for rehydration of LROs in TA (Azure#21338)

* enabling support for rehydration of LROs in TA

* lint

* updating docs

* review feedback

* update envars so live tests pass
  • Loading branch information
kristapratico authored Oct 26, 2021
1 parent 652f6e8 commit 03bebad
Show file tree
Hide file tree
Showing 651 changed files with 28,933 additions and 15,770 deletions.
8 changes: 8 additions & 0 deletions sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@

## 5.2.0b2 (Unreleased)

This version of the SDK defaults to the latest supported API version, which currently is `v3.2-preview.2`.

### Features Added
- Added support for Custom Entities Recognition through the `begin_analyze_actions` API with the `RecognizeCustomEntitiesAction` and `RecognizeCustomEntitiesResult` types.
- Added support for Custom Single Classification through the `begin_analyze_actions` API with the `SingleCategoryClassifyAction` and `SingleCategoryClassifyActionResult` types.
- Added support for Custom Multi Classification through the `begin_analyze_actions` API with the `MultiCategoryClassifyAction` and `MultiCategoryClassifyActionResult` types.
- Multiple of the same action type is now supported with `begin_analyze_actions`.

### Breaking Changes

### Bugs Fixed
- Restarting a long-running operation from a saved state is now supported for the `begin_analyze_actions` and `begin_recognize_healthcare_entities` methods.

### Other Changes
- Package requires [azure-core](https://pypi.org/project/azure-core/) version 1.16.0 or greater

## 5.2.0b1 (2021-08-09)

Expand Down
30 changes: 25 additions & 5 deletions sdk/textanalytics/azure-ai-textanalytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@
Text Analytics is a cloud-based service that provides advanced natural language processing over raw text, and includes the following main features:

- Sentiment Analysis
- Named Entity Recognition
- Linked Entity Recognition
- Personally Identifiable Information (PII) Entity Recognition
- Entity Recognition (Named, Linked, and Personally Identifiable Information (PII) entities)
- Language Detection
- Key Phrase Extraction
- Multiple Analysis
- Healthcare Entities Analysis
- Extractive Text Summarization
- Custom Entity Recognition
- Custom Single and Multi Category Classification

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

## _Disclaimer_

_Azure SDK Python packages support for Python 2.7 is ending 01 January 2022. For more information and questions, please refer to https://github.com/Azure/azure-sdk-for-python/issues/20691_

## Getting started

### Prerequisites
Expand Down Expand Up @@ -75,13 +79,13 @@ Install the Azure Text Analytics client library for Python with [pip][pip]:
pip install azure-ai-textanalytics --pre
```

> Note: This version of the client library defaults to the v3.2-preview.1 version of the service
> Note: This version of the client library defaults to the v3.2-preview.2 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.2.0b1 - Latest beta release | 3.0, 3.1, 3.2-preview.1 (default) |
| 5.2.0b2 - Latest beta release | 3.0, 3.1, 3.2-preview.2 (default) |
| 5.1.0 - Latest GA release | 3.0, 3.1 (default) |
| 5.0.0 | 3.0 |

Expand Down Expand Up @@ -229,6 +233,10 @@ The following section provides several code snippets covering some of the most c
- [Detect Language](#detect-language "Detect language")
- [Healthcare Entities Analysis](#healthcare-entities-analysis "Healthcare Entities Analysis")
- [Multiple Analysis](#multiple-analysis "Multiple analysis")
- [Extractive Summarization][extract_summary_sample]
- [Custom Entity Recognition][recognize_custom_entities_sample]
- [Custom Single Category Classification][single_category_classify_sample]
- [Custom Multi Category Classification][multi_category_classify_sample]

### Analyze sentiment

Expand Down Expand Up @@ -506,6 +514,9 @@ Note: The Healthcare Entities Analysis service is available in API version v3.1
- Key Phrase Extraction
- Sentiment Analysis
- Extractive Summarization (see sample [here][extract_summary_sample])
- Custom Entity Recognition (see sample [here][recognize_custom_entities_sample])
- Custom Single Category Classification (see sample [here][single_category_classify_sample])
- Custom Multi Category Classification (see sample [here][multi_category_classify_sample])

```python
from azure.core.credentials import AzureKeyCredential
Expand Down Expand Up @@ -641,6 +652,9 @@ Common scenarios
- Healthcare Entities Analysis: [sample_analyze_healthcare_entities.py][analyze_healthcare_entities_sample] ([async version][analyze_healthcare_entities_sample_async])
- Multiple Analysis: [sample_analyze_actions.py][analyze_sample] ([async version][analyze_sample_async])
- Extractive text summarization: [sample_extract_summary.py][extract_summary_sample] ([async version][extract_summary_sample_async])
- Custom Entity Recognition: [sample_recognize_custom_entities.py][recognize_custom_entities_sample] ([async_version][recognize_custom_entities_sample_async])
- Custom Single Classification: [sample_single_category_classify.py][single_category_classify_sample] ([async_version][single_category_classify_sample_async])
- Custom Multi Classification: [sample_multi_category_classify.py][multi_category_classify_sample] ([async_version][multi_category_classify_sample_async])

Advanced scenarios

Expand Down Expand Up @@ -738,6 +752,12 @@ This project has adopted the [Microsoft Open Source Code of Conduct][code_of_con
[opinion_mining_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_analyze_sentiment_with_opinion_mining_async.py
[extract_summary_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/sample_extract_summary.py
[extract_summary_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_extract_summary_async.py
[recognize_custom_entities_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/sample_recognize_custom_entities.py
[recognize_custom_entities_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_recognize_custom_entities_async.py
[single_category_classify_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/sample_single_category_classify.py
[single_category_classify_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_single_category_classify_async.py
[multi_category_classify_sample]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/sample_multi_category_classify.py
[multi_category_classify_sample_async]: https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/textanalytics/azure-ai-textanalytics/samples/async_samples/sample_multi_category_classify_async.py
[cla]: https://cla.microsoft.com
[code_of_conduct]: https://opensource.microsoft.com/codeofconduct/
[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@
ExtractSummaryAction,
ExtractSummaryResult,
SummarySentence,
RecognizeCustomEntitiesAction,
RecognizeCustomEntitiesResult,
SingleCategoryClassifyAction,
SingleCategoryClassifyResult,
MultiCategoryClassifyAction,
MultiCategoryClassifyResult,
ClassificationCategory,
)

from ._lro import AnalyzeHealthcareEntitiesLROPoller, AnalyzeActionsLROPoller
Expand Down Expand Up @@ -107,6 +114,13 @@
"ExtractSummaryAction",
"ExtractSummaryResult",
"SummarySentence",
"RecognizeCustomEntitiesAction",
"RecognizeCustomEntitiesResult",
"SingleCategoryClassifyAction",
"SingleCategoryClassifyResult",
"MultiCategoryClassifyAction",
"MultiCategoryClassifyResult",
"ClassificationCategory",
]

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

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

Expand Down Expand Up @@ -44,8 +44,8 @@ def __init__(self, endpoint, credential, **kwargs):
credential=credential,
api_version=kwargs.pop("api_version", DEFAULT_API_VERSION),
sdk_moniker=USER_AGENT,
authentication_policy=_authentication_policy(credential),
custom_hook_policy=TextAnalyticsResponseHookPolicy(**kwargs),
authentication_policy=kwargs.pop("authentication_policy", _authentication_policy(credential)),
custom_hook_policy=kwargs.pop("custom_hook_policy", TextAnalyticsResponseHookPolicy(**kwargs)),
**kwargs
)

Expand Down
Loading

0 comments on commit 03bebad

Please sign in to comment.