Skip to content

Commit b939452

Browse files
[TA] beta updates (Azure#28291)
* rename AbstractSummaryAction.sentence_count -> max_sentence_count to match ext summ * add bespoke methods for abs and ext summ * fix docs, remove copy/paste error * add tests + recordings * add docstrings to patched resolutions * fix docstrings * autoLD design change * architect feedback * fix import * update recordings * do not expose BooleanResolution, not supported by TA * update changelog
1 parent 39d685f commit b939452

File tree

19 files changed

+1610
-261
lines changed

19 files changed

+1610
-261
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,22 @@
22

33
## 5.3.0b2 (Unreleased)
44

5+
This version of the client library defaults to the service API version `2022-10-01-preview`.
6+
57
### Features Added
68

9+
- Added `begin_extract_summary` client method to perform extractive summarization on documents.
10+
- Added `begin_abstract_summary` client method to perform abstractive summarization on documents.
11+
712
### Breaking Changes
813

14+
- Removed models `BaseResolution` and `BooleanResolution`.
15+
- Renamed property `date_time_sub_kind` to `datetime_subkind` on `DateTimeResolution`.
16+
- Renamed keyword argument `sentence_count` to `max_sentence_count` on `AbstractSummaryAction`.
17+
- Changed automatic language detection, it is now controlled by the boolean keyword argument `auto_detect_language`.
18+
Pass `True` to enable automatic language detection for text documents analyzed by long-running operation APIs.
19+
- Removed keyword argument `autodetect_default_language` - use `language` to provide a default/fallback language.
20+
921
### Bugs Fixed
1022

1123
### Other Changes

sdk/textanalytics/azure-ai-textanalytics/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "python",
44
"TagPrefix": "python/textanalytics/azure-ai-textanalytics",
5-
"Tag": "python/textanalytics/azure-ai-textanalytics_8fc6958f17"
5+
"Tag": "python/textanalytics/azure-ai-textanalytics_e6c8127cc8"
66
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,9 @@
6868
)
6969
from ._generated.models import (
7070
HealthcareDocumentType,
71-
BaseResolution,
7271
ResolutionKind,
7372
AgeResolution,
7473
AreaResolution,
75-
BooleanResolution,
7674
CurrencyResolution,
7775
DateTimeResolution,
7876
InformationResolution,
@@ -162,11 +160,9 @@
162160
"ExtractSummaryResult",
163161
"SummarySentence",
164162
"HealthcareDocumentType",
165-
"BaseResolution",
166163
"ResolutionKind",
167164
"AgeResolution",
168165
"AreaResolution",
169-
"BooleanResolution",
170166
"CurrencyResolution",
171167
"DateTimeResolution",
172168
"InformationResolution",

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the MIT License.
44
# ------------------------------------
55

6-
from typing import Any, List, Tuple, Optional, Iterable
6+
from typing import Any, Tuple, Optional, Iterable
77

88

99
class DictMixin:
@@ -17,7 +17,7 @@ def __repr__(self) -> str:
1717
return str(self)
1818

1919
def __len__(self) -> int:
20-
return len(self.keys())
20+
return len(self.keys()) # type: ignore
2121

2222
def __delitem__(self, key: str) -> None:
2323
self.__dict__[key] = None
@@ -42,10 +42,10 @@ def has_key(self, k: str) -> bool:
4242
def update(self, *args: Any, **kwargs: Any) -> None:
4343
self.__dict__.update(*args, **kwargs)
4444

45-
def keys(self) -> List[str]:
45+
def keys(self) -> Iterable[str]:
4646
return [k for k in self.__dict__ if not k.startswith("_")]
4747

48-
def values(self) -> List[Any]:
48+
def values(self) -> Iterable[Any]:
4949
return [v for k, v in self.__dict__.items() if not k.startswith("_")]
5050

5151
def items(self) -> Iterable[Tuple[str, Any]]:

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v2022_10_01_preview/models/__init__.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from ._models_py3 import AbstractiveSummary
1616
from ._models_py3 import AbstractiveSummaryDocumentResult
1717
from ._models_py3 import AbstractiveSummaryDocumentResultWithDetectedLanguage
18-
from ._models_py3 import AgeResolution
18+
from ._patch import AgeResolution
1919
from ._models_py3 import AnalyzeTextDynamicClassificationInput
2020
from ._models_py3 import AnalyzeTextEntityLinkingInput
2121
from ._models_py3 import AnalyzeTextEntityRecognitionInput
@@ -30,12 +30,12 @@
3030
from ._models_py3 import AnalyzeTextSentimentAnalysisInput
3131
from ._models_py3 import AnalyzeTextTask
3232
from ._models_py3 import AnalyzeTextTaskResult
33-
from ._models_py3 import AreaResolution
33+
from ._patch import AreaResolution
3434
from ._models_py3 import BaseResolution
3535
from ._models_py3 import BooleanResolution
3636
from ._models_py3 import ClassificationDocumentResult
3737
from ._models_py3 import ClassificationResult
38-
from ._models_py3 import CurrencyResolution
38+
from ._patch import CurrencyResolution
3939
from ._models_py3 import CustomEntitiesLROTask
4040
from ._models_py3 import CustomEntitiesResult
4141
from ._models_py3 import CustomEntitiesResultDocumentsItem
@@ -51,7 +51,7 @@
5151
from ._models_py3 import CustomSingleLabelClassificationLROTask
5252
from ._models_py3 import CustomSingleLabelClassificationTaskParameters
5353
from ._models_py3 import CustomTaskParameters
54-
from ._models_py3 import DateTimeResolution
54+
from ._patch import DateTimeResolution
5555
from ._models_py3 import DetectedLanguage
5656
from ._models_py3 import DocumentDetectedLanguage
5757
from ._models_py3 import DocumentDetectedLanguageString
@@ -100,7 +100,7 @@
100100
from ._models_py3 import HealthcareRelationEntity
101101
from ._models_py3 import HealthcareResult
102102
from ._models_py3 import HealthcareTaskParameters
103-
from ._models_py3 import InformationResolution
103+
from ._patch import InformationResolution
104104
from ._models_py3 import InnerErrorModel
105105
from ._models_py3 import InputError
106106
from ._models_py3 import JobState
@@ -117,15 +117,15 @@
117117
from ._models_py3 import LanguageDetectionTaskParameters
118118
from ._models_py3 import LanguageDetectionTaskResult
119119
from ._models_py3 import LanguageInput
120-
from ._models_py3 import LengthResolution
120+
from ._patch import LengthResolution
121121
from ._models_py3 import LinkedEntitiesDocumentResult
122122
from ._models_py3 import LinkedEntity
123123
from ._models_py3 import Match
124124
from ._models_py3 import MultiLanguageAnalysisInput
125125
from ._models_py3 import MultiLanguageInput
126-
from ._models_py3 import NumberResolution
127-
from ._models_py3 import NumericRangeResolution
128-
from ._models_py3 import OrdinalResolution
126+
from ._patch import NumberResolution
127+
from ._patch import NumericRangeResolution
128+
from ._patch import OrdinalResolution
129129
from ._models_py3 import PIIResultWithDetectedLanguage
130130
from ._models_py3 import Pagination
131131
from ._models_py3 import PiiEntitiesDocumentResult
@@ -149,7 +149,7 @@
149149
from ._models_py3 import SentimentResponse
150150
from ._models_py3 import SentimentResponseDocumentsItem
151151
from ._models_py3 import SentimentTaskResult
152-
from ._models_py3 import SpeedResolution
152+
from ._patch import SpeedResolution
153153
from ._models_py3 import SummaryContext
154154
from ._models_py3 import TargetConfidenceScoreLabel
155155
from ._models_py3 import TargetRelation
@@ -158,10 +158,10 @@
158158
from ._models_py3 import TaskState
159159
from ._models_py3 import TasksState
160160
from ._models_py3 import TasksStateTasks
161-
from ._models_py3 import TemperatureResolution
162-
from ._models_py3 import TemporalSpanResolution
163-
from ._models_py3 import VolumeResolution
164-
from ._models_py3 import WeightResolution
161+
from ._patch import TemperatureResolution
162+
from ._patch import TemporalSpanResolution
163+
from ._patch import VolumeResolution
164+
from ._patch import WeightResolution
165165

166166

167167
from ._text_analytics_client_enums import AgeUnit

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/v2022_10_01_preview/models/_models_py3.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2870,9 +2870,9 @@ class DateTimeResolution(BaseResolution):
28702870
(https://github.com/Microsoft/Recognizers-Text/blob/master/Patterns/English/English-DateTime.yaml).
28712871
Required.
28722872
:vartype timex: str
2873-
:ivar date_time_sub_kind: The DateTime SubKind. Required. Known values are: "Time", "Date",
2873+
:ivar datetime_subkind: The DateTime SubKind. Required. Known values are: "Time", "Date",
28742874
"DateTime", "Duration", and "Set".
2875-
:vartype date_time_sub_kind: str or
2875+
:vartype datetime_subkind: str or
28762876
~azure.ai.textanalytics.v2022_10_01_preview.models.DateTimeSubKind
28772877
:ivar value: The actual time that the extracted text denote. Required.
28782878
:vartype value: str
@@ -2886,14 +2886,14 @@ class DateTimeResolution(BaseResolution):
28862886
_validation = {
28872887
'resolution_kind': {'required': True},
28882888
'timex': {'required': True},
2889-
'date_time_sub_kind': {'required': True},
2889+
'datetime_subkind': {'required': True},
28902890
'value': {'required': True},
28912891
}
28922892

28932893
_attribute_map = {
28942894
"resolution_kind": {"key": "resolutionKind", "type": "str"},
28952895
"timex": {"key": "timex", "type": "str"},
2896-
"date_time_sub_kind": {"key": "dateTimeSubKind", "type": "str"},
2896+
"datetime_subkind": {"key": "dateTimeSubKind", "type": "str"},
28972897
"value": {"key": "value", "type": "str"},
28982898
"modifier": {"key": "modifier", "type": "str"},
28992899
}
@@ -2902,7 +2902,7 @@ def __init__(
29022902
self,
29032903
*,
29042904
timex: str,
2905-
date_time_sub_kind: Union[str, "_models.DateTimeSubKind"],
2905+
datetime_subkind: Union[str, "_models.DateTimeSubKind"],
29062906
value: str,
29072907
modifier: Optional[Union[str, "_models.TemporalModifier"]] = None,
29082908
**kwargs
@@ -2912,9 +2912,9 @@ def __init__(
29122912
(https://github.com/Microsoft/Recognizers-Text/blob/master/Patterns/English/English-DateTime.yaml).
29132913
Required.
29142914
:paramtype timex: str
2915-
:keyword date_time_sub_kind: The DateTime SubKind. Required. Known values are: "Time", "Date",
2915+
:keyword datetime_subkind: The DateTime SubKind. Required. Known values are: "Time", "Date",
29162916
"DateTime", "Duration", and "Set".
2917-
:paramtype date_time_sub_kind: str or
2917+
:paramtype datetime_subkind: str or
29182918
~azure.ai.textanalytics.v2022_10_01_preview.models.DateTimeSubKind
29192919
:keyword value: The actual time that the extracted text denote. Required.
29202920
:paramtype value: str
@@ -2927,7 +2927,7 @@ def __init__(
29272927
super().__init__(**kwargs)
29282928
self.resolution_kind = 'DateTimeResolution' # type: str
29292929
self.timex = timex
2930-
self.date_time_sub_kind = date_time_sub_kind
2930+
self.datetime_subkind = datetime_subkind
29312931
self.value = value
29322932
self.modifier = modifier
29332933

0 commit comments

Comments
 (0)