Skip to content

Commit 99b6ecf

Browse files
[textanalytics] merge feature/ta v3.2 preview.1 (Azure#20074)
* [textanalytics] regenerate v3.2-preview.1 (Azure#19805) * update swagger readme * regenerate code for v3.2-preview.1 * fixes for hooking up convenience layer to generated layer * remove unnecessary check * [textanalytics] adds extractive summarization action (Azure#19824) * update swagger readme * regenerate code for v3.2-preview.1 * fixes for hooking up convenience layer to generated layer * add support for extract summary action * align naming * missed one * readme and changelog * fixing docstrings * add some extract summary action tests * update sync/async sample to include summary action * fix disable_service_logs default * test rank score * add bug fix to changelog * add missing reprs to new models * add test for extract summary partial results * update changelog to specify API version now targeting * regen on latest swagger * target swagger in repo and fix sample docs whitespace * remove support for python 3.5 (Azure#19913) * [textanalytics] add extractive summarization samples (Azure#20010) * add extractive summarization samples * wording * [textanalytics] rerecord tests (Azure#20045) * rerecord everything but healthcare * linting * rerecord healthcare tests
1 parent 3d9c147 commit 99b6ecf

File tree

609 files changed

+16649
-10041
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

609 files changed

+16649
-10041
lines changed

sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,21 @@
11
# Release History
22

3-
## 5.1.1 (Unreleased)
3+
## 5.2.0b1 (Unreleased)
4+
5+
This version of the SDK defaults to the latest supported API version, which currently is `v3.2-preview.1`.
46

57
### Features Added
8+
- Added support for Extractive Summarization actions through the `ExtractSummaryAction` type.
69

710
### Breaking Changes
811

912
### Bugs Fixed
13+
- `RecognizePiiEntitiesAction` option `disable_service_logs` now correctly defaults to `True`.
1014

1115
### Other Changes
1216

17+
- Python 3.5 is no longer supported.
18+
1319
## 5.1.0 (2021-07-07)
1420

1521
This version of the SDK defaults to the latest supported API version, which currently is `v3.1`.

sdk/textanalytics/azure-ai-textanalytics/README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Text Analytics is a cloud-based service that provides advanced natural language
1717

1818
### Prerequisites
1919

20-
- Python 2.7, or 3.5 or later is required to use this package.
20+
- Python 2.7, or 3.6 or later is required to use this package.
2121
- You must have an [Azure subscription][azure_subscription] and a
2222
[Cognitive Services or Text Analytics resource][ta_or_cs_resource] to use this package.
2323

@@ -71,15 +71,16 @@ For example, `https://<my-custom-subdomain>.cognitiveservices.azure.com/`.
7171
Install the Azure Text Analytics client library for Python with [pip][pip]:
7272

7373
```bash
74-
pip install azure-ai-textanalytics
74+
pip install azure-ai-textanalytics --pre
7575
```
7676

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

8181
| SDK version | Supported API version of service |
8282
| ------------ | --------------------------------- |
83+
| 5.2.0b1 - Latest beta release | 3.0, 3.1, 3.2-preview.1 (default) |
8384
| 5.1.0 - Latest GA release | 3.0, 3.1 (default) |
8485
| 5.0.0 | 3.0 |
8586

@@ -376,7 +377,7 @@ The returned response is a heterogeneous list of result and error objects: list[
376377

377378
Please refer to the service documentation for [supported PII entity types][pii_entity_categories].
378379

379-
Note: The Recognize PII Entities service is available only in the v3.1 API version.
380+
Note: The Recognize PII Entities service is available in API version v3.1 and up.
380381

381382
### Extract key phrases
382383

@@ -492,7 +493,7 @@ for idx, doc in enumerate(docs):
492493
print("------------------------------------------")
493494
```
494495

495-
Note: The Healthcare Entities Analysis service is available only in the v3.1 API version.
496+
Note: The Healthcare Entities Analysis service is available in API version v3.1 and up.
496497

497498
### Multiple Analysis
498499

@@ -503,6 +504,7 @@ Note: The Healthcare Entities Analysis service is available only in the v3.1 API
503504
- Linked Entity Recognition
504505
- Key Phrase Extraction
505506
- Sentiment Analysis
507+
- Extractive Summarization
506508

507509
```python
508510
from azure.core.credentials import AzureKeyCredential
@@ -562,7 +564,7 @@ for doc, action_results in zip(documents, document_results):
562564

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

565-
Note: Multiple analysis is available only in the v3.1 API version.
567+
Note: Multiple analysis is available in API version v3.1 and up.
566568

567569
## Optional Configuration
568570

@@ -621,7 +623,7 @@ result = text_analytics_client.analyze_sentiment(documents, logging_enable=True)
621623

622624
These code samples show common scenario operations with the Azure Text Analytics client library.
623625
The async versions of the samples (the python sample files appended with `_async`) show asynchronous operations
624-
with Text Analytics and require Python 3.5 or later.
626+
with Text Analytics and require Python 3.6 or later.
625627

626628
Authenticate the client with a Cognitive Services/Text Analytics API key or a token credential from [azure-identity][azure_identity]:
627629

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
EntityCertainty,
5151
EntityAssociation,
5252
HealthcareEntityCategory,
53+
ExtractSummaryAction,
54+
ExtractSummaryResult,
55+
SummarySentence
5356
)
5457

5558
from ._lro import AnalyzeHealthcareEntitiesLROPoller, AnalyzeActionsLROPoller
@@ -101,6 +104,9 @@
101104
"AnalyzeHealthcareEntitiesLROPoller",
102105
"AnalyzeActionsLROPoller",
103106
"HealthcareEntityCategory",
107+
"ExtractSummaryAction",
108+
"ExtractSummaryResult",
109+
"SummarySentence"
104110
]
105111

106112
__version__ = VERSION

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_base_client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@
99
from ._generated import TextAnalyticsClient as _TextAnalyticsClient
1010
from ._policies import TextAnalyticsResponseHookPolicy
1111
from ._user_agent import USER_AGENT
12+
from ._version import DEFAULT_API_VERSION
1213

1314

1415
class TextAnalyticsApiVersion(str, Enum):
1516
"""Text Analytics API versions supported by this package"""
1617

1718
#: this is the default version
19+
V3_2_PREVIEW = "v3.2-preview.1"
1820
V3_1 = "v3.1"
1921
V3_0 = "v3.0"
2022

@@ -40,7 +42,7 @@ def __init__(self, endpoint, credential, **kwargs):
4042
self._client = _TextAnalyticsClient(
4143
endpoint=endpoint,
4244
credential=credential,
43-
api_version=kwargs.pop("api_version", TextAnalyticsApiVersion.V3_1),
45+
api_version=kwargs.pop("api_version", DEFAULT_API_VERSION),
4446
sdk_moniker=USER_AGENT,
4547
authentication_policy=_authentication_policy(credential),
4648
custom_hook_policy=TextAnalyticsResponseHookPolicy(**kwargs),

0 commit comments

Comments
 (0)