Skip to content

Commit 68959f1

Browse files
authored
[text analytics] v3.1-preview.4 autogenerated code + opinion mining changes (#16884)
1 parent e7b901a commit 68959f1

File tree

124 files changed

+9822
-785
lines changed

Some content is hidden

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

124 files changed

+9822
-785
lines changed

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

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

33
## 5.1.0b6 (Unreleased)
44

5+
**Breaking Changes**
6+
7+
- Renamed properties `aspect` and `opinions` to `target` and `assessments` respectively in class `MinedOpinion`.
8+
- Renamed classes `AspectSentiment` and `OpinionSentiment` to `TargetSentiment` and `AssessmentSentiment` respectively.
59

610
## 5.1.0b5 (2021-02-10)
711

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
SentenceSentiment,
2828
SentimentConfidenceScores,
2929
MinedOpinion,
30-
AspectSentiment,
31-
OpinionSentiment,
30+
TargetSentiment,
31+
AssessmentSentiment,
3232
RecognizePiiEntitiesResult,
3333
PiiEntity,
3434
PiiEntityDomainType,
@@ -67,8 +67,8 @@
6767
'SentenceSentiment',
6868
'SentimentConfidenceScores',
6969
'MinedOpinion',
70-
'AspectSentiment',
71-
'OpinionSentiment',
70+
'TargetSentiment',
71+
'AssessmentSentiment',
7272
'RecognizePiiEntitiesResult',
7373
'PiiEntity',
7474
'PiiEntityDomainType',

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,8 @@ class AsyncAnalyzeBatchActionsLROPollingMethod(TextAnalyticsAsyncLROPollingMetho
170170

171171
@property
172172
def _current_body(self):
173-
from ._generated.v3_1_preview_3.models import JobMetadata
174-
return JobMetadata.deserialize(self._pipeline_response)
173+
from ._generated.v3_1_preview_3.models import AnalyzeJobMetadata
174+
return AnalyzeJobMetadata.deserialize(self._pipeline_response)
175175

176176
@property
177177
def created_on(self):

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
class TextAnalyticsApiVersion(str, Enum):
1414
"""Text Analytics API versions supported by this package"""
1515

16+
V3_1_PREVIEW_4 = "v3.1-preview.4"
1617
#: this is the default version
1718
V3_1_PREVIEW = "v3.1-preview.3"
1819
V3_0 = "v3.0"

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_operations_mixin.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
import warnings
1414

1515
# FIXME: have to manually reconfigure import path for multiapi operation mixin
16-
from .._lro import AnalyzeHealthcareEntitiesLROPoller, AnalyzeHealthcareEntitiesLROPollingMethod
17-
from .._lro import AnalyzeBatchActionsLROPoller, AnalyzeBatchActionsLROPollingMethod
16+
from .._lro import AnalyzeBatchActionsLROPoller, AnalyzeBatchActionsLROPollingMethod, AnalyzeHealthcareEntitiesLROPoller, AnalyzeHealthcareEntitiesLROPollingMethod
1817
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
1918
from azure.core.pipeline import PipelineResponse
2019
from azure.core.pipeline.transport import HttpRequest, HttpResponse
@@ -61,6 +60,8 @@ def analyze_status(
6160
api_version = self._get_api_version('analyze_status')
6261
if api_version == 'v3.1-preview.3':
6362
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
63+
elif api_version == 'v3.1-preview.4':
64+
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
6465
else:
6566
raise ValueError("API version {} does not have operation 'analyze_status'".format(api_version))
6667
mixin_instance = OperationClass()
@@ -96,6 +97,8 @@ def begin_analyze(
9697
api_version = self._get_api_version('begin_analyze')
9798
if api_version == 'v3.1-preview.3':
9899
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
100+
elif api_version == 'v3.1-preview.4':
101+
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
99102
else:
100103
raise ValueError("API version {} does not have operation 'begin_analyze'".format(api_version))
101104
mixin_instance = OperationClass()
@@ -130,6 +133,8 @@ def begin_cancel_health_job(
130133
api_version = self._get_api_version('begin_cancel_health_job')
131134
if api_version == 'v3.1-preview.3':
132135
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
136+
elif api_version == 'v3.1-preview.4':
137+
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
133138
else:
134139
raise ValueError("API version {} does not have operation 'begin_cancel_health_job'".format(api_version))
135140
mixin_instance = OperationClass()
@@ -174,6 +179,8 @@ def begin_health(
174179
api_version = self._get_api_version('begin_health')
175180
if api_version == 'v3.1-preview.3':
176181
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
182+
elif api_version == 'v3.1-preview.4':
183+
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
177184
else:
178185
raise ValueError("API version {} does not have operation 'begin_health'".format(api_version))
179186
mixin_instance = OperationClass()
@@ -215,6 +222,8 @@ def entities_linking(
215222
from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
216223
elif api_version == 'v3.1-preview.3':
217224
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
225+
elif api_version == 'v3.1-preview.4':
226+
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
218227
else:
219228
raise ValueError("API version {} does not have operation 'entities_linking'".format(api_version))
220229
mixin_instance = OperationClass()
@@ -257,6 +266,8 @@ def entities_recognition_general(
257266
from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
258267
elif api_version == 'v3.1-preview.3':
259268
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
269+
elif api_version == 'v3.1-preview.4':
270+
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
260271
else:
261272
raise ValueError("API version {} does not have operation 'entities_recognition_general'".format(api_version))
262273
mixin_instance = OperationClass()
@@ -307,6 +318,8 @@ def entities_recognition_pii(
307318
api_version = self._get_api_version('entities_recognition_pii')
308319
if api_version == 'v3.1-preview.3':
309320
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
321+
elif api_version == 'v3.1-preview.4':
322+
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
310323
else:
311324
raise ValueError("API version {} does not have operation 'entities_recognition_pii'".format(api_version))
312325
mixin_instance = OperationClass()
@@ -348,6 +361,8 @@ def health_status(
348361
api_version = self._get_api_version('health_status')
349362
if api_version == 'v3.1-preview.3':
350363
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
364+
elif api_version == 'v3.1-preview.4':
365+
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
351366
else:
352367
raise ValueError("API version {} does not have operation 'health_status'".format(api_version))
353368
mixin_instance = OperationClass()
@@ -389,6 +404,8 @@ def key_phrases(
389404
from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
390405
elif api_version == 'v3.1-preview.3':
391406
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
407+
elif api_version == 'v3.1-preview.4':
408+
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
392409
else:
393410
raise ValueError("API version {} does not have operation 'key_phrases'".format(api_version))
394411
mixin_instance = OperationClass()
@@ -431,6 +448,8 @@ def languages(
431448
from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
432449
elif api_version == 'v3.1-preview.3':
433450
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
451+
elif api_version == 'v3.1-preview.4':
452+
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
434453
else:
435454
raise ValueError("API version {} does not have operation 'languages'".format(api_version))
436455
mixin_instance = OperationClass()
@@ -473,6 +492,8 @@ def sentiment(
473492
from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
474493
elif api_version == 'v3.1-preview.3':
475494
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
495+
elif api_version == 'v3.1-preview.4':
496+
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
476497
else:
477498
raise ValueError("API version {} does not have operation 'sentiment'".format(api_version))
478499
mixin_instance = OperationClass()

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/_text_analytics_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ def __init__(
7575
base_url = '{Endpoint}/text/analytics/v3.0'
7676
elif api_version == 'v3.1-preview.3':
7777
base_url = '{Endpoint}/text/analytics/v3.1-preview.3'
78+
elif api_version == 'v3.1-preview.4':
79+
base_url = '{Endpoint}/text/analytics/v3.1-preview.4'
7880
else:
7981
raise ValueError("API version {} is not available".format(api_version))
8082
self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs)
@@ -94,13 +96,17 @@ def models(cls, api_version=DEFAULT_API_VERSION):
9496
9597
* v3.0: :mod:`v3_0.models<azure.ai.textanalytics.v3_0.models>`
9698
* v3.1-preview.3: :mod:`v3_1_preview_3.models<azure.ai.textanalytics.v3_1_preview_3.models>`
99+
* v3.1-preview.4: :mod:`v3_1_preview_4.models<azure.ai.textanalytics.v3_1_preview_4.models>`
97100
"""
98101
if api_version == 'v3.0':
99102
from .v3_0 import models
100103
return models
101104
elif api_version == 'v3.1-preview.3':
102105
from .v3_1_preview_3 import models
103106
return models
107+
elif api_version == 'v3.1-preview.4':
108+
from .v3_1_preview_4 import models
109+
return models
104110
raise ValueError("API version {} is not available".format(api_version))
105111

106112
def close(self):

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_operations_mixin.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
import warnings
1414

1515
# FIXME: have to manually reconfigure import path for multiapi operation mixin
16-
from ..._async_lro import AnalyzeHealthcareEntitiesAsyncLROPoller, AnalyzeHealthcareEntitiesAsyncLROPollingMethod
17-
from ..._async_lro import AsyncAnalyzeBatchActionsLROPoller, AsyncAnalyzeBatchActionsLROPollingMethod
16+
from ..._async_lro import AnalyzeHealthcareEntitiesAsyncLROPoller, AnalyzeHealthcareEntitiesAsyncLROPollingMethod, AsyncAnalyzeBatchActionsLROPoller, AsyncAnalyzeBatchActionsLROPollingMethod
1817
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
1918
from azure.core.pipeline import PipelineResponse
2019
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
@@ -57,6 +56,8 @@ async def analyze_status(
5756
api_version = self._get_api_version('analyze_status')
5857
if api_version == 'v3.1-preview.3':
5958
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
59+
elif api_version == 'v3.1-preview.4':
60+
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
6061
else:
6162
raise ValueError("API version {} does not have operation 'analyze_status'".format(api_version))
6263
mixin_instance = OperationClass()
@@ -86,12 +87,14 @@ async def begin_analyze(
8687
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
8788
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
8889
:return: An instance of AsyncAnalyzeBatchActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)
89-
:rtype: ~...._async_lro.AsyncAnalyzeBatchActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState]
90+
:rtype: ~....._async_lro.AsyncAnalyzeBatchActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState]
9091
:raises ~azure.core.exceptions.HttpResponseError:
9192
"""
9293
api_version = self._get_api_version('begin_analyze')
9394
if api_version == 'v3.1-preview.3':
9495
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
96+
elif api_version == 'v3.1-preview.4':
97+
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
9598
else:
9699
raise ValueError("API version {} does not have operation 'begin_analyze'".format(api_version))
97100
mixin_instance = OperationClass()
@@ -126,6 +129,8 @@ async def begin_cancel_health_job(
126129
api_version = self._get_api_version('begin_cancel_health_job')
127130
if api_version == 'v3.1-preview.3':
128131
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
132+
elif api_version == 'v3.1-preview.4':
133+
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
129134
else:
130135
raise ValueError("API version {} does not have operation 'begin_cancel_health_job'".format(api_version))
131136
mixin_instance = OperationClass()
@@ -170,6 +175,8 @@ async def begin_health(
170175
api_version = self._get_api_version('begin_health')
171176
if api_version == 'v3.1-preview.3':
172177
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
178+
elif api_version == 'v3.1-preview.4':
179+
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
173180
else:
174181
raise ValueError("API version {} does not have operation 'begin_health'".format(api_version))
175182
mixin_instance = OperationClass()
@@ -211,6 +218,8 @@ async def entities_linking(
211218
from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
212219
elif api_version == 'v3.1-preview.3':
213220
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
221+
elif api_version == 'v3.1-preview.4':
222+
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
214223
else:
215224
raise ValueError("API version {} does not have operation 'entities_linking'".format(api_version))
216225
mixin_instance = OperationClass()
@@ -253,6 +262,8 @@ async def entities_recognition_general(
253262
from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
254263
elif api_version == 'v3.1-preview.3':
255264
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
265+
elif api_version == 'v3.1-preview.4':
266+
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
256267
else:
257268
raise ValueError("API version {} does not have operation 'entities_recognition_general'".format(api_version))
258269
mixin_instance = OperationClass()
@@ -303,6 +314,8 @@ async def entities_recognition_pii(
303314
api_version = self._get_api_version('entities_recognition_pii')
304315
if api_version == 'v3.1-preview.3':
305316
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
317+
elif api_version == 'v3.1-preview.4':
318+
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
306319
else:
307320
raise ValueError("API version {} does not have operation 'entities_recognition_pii'".format(api_version))
308321
mixin_instance = OperationClass()
@@ -344,6 +357,8 @@ async def health_status(
344357
api_version = self._get_api_version('health_status')
345358
if api_version == 'v3.1-preview.3':
346359
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
360+
elif api_version == 'v3.1-preview.4':
361+
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
347362
else:
348363
raise ValueError("API version {} does not have operation 'health_status'".format(api_version))
349364
mixin_instance = OperationClass()
@@ -385,6 +400,8 @@ async def key_phrases(
385400
from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
386401
elif api_version == 'v3.1-preview.3':
387402
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
403+
elif api_version == 'v3.1-preview.4':
404+
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
388405
else:
389406
raise ValueError("API version {} does not have operation 'key_phrases'".format(api_version))
390407
mixin_instance = OperationClass()
@@ -427,6 +444,8 @@ async def languages(
427444
from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
428445
elif api_version == 'v3.1-preview.3':
429446
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
447+
elif api_version == 'v3.1-preview.4':
448+
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
430449
else:
431450
raise ValueError("API version {} does not have operation 'languages'".format(api_version))
432451
mixin_instance = OperationClass()
@@ -469,6 +488,8 @@ async def sentiment(
469488
from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
470489
elif api_version == 'v3.1-preview.3':
471490
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
491+
elif api_version == 'v3.1-preview.4':
492+
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
472493
else:
473494
raise ValueError("API version {} does not have operation 'sentiment'".format(api_version))
474495
mixin_instance = OperationClass()

sdk/textanalytics/azure-ai-textanalytics/azure/ai/textanalytics/_generated/aio/_text_analytics_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ def __init__(
7373
base_url = '{Endpoint}/text/analytics/v3.0'
7474
elif api_version == 'v3.1-preview.3':
7575
base_url = '{Endpoint}/text/analytics/v3.1-preview.3'
76+
elif api_version == 'v3.1-preview.4':
77+
base_url = '{Endpoint}/text/analytics/v3.1-preview.4'
7678
else:
7779
raise ValueError("API version {} is not available".format(api_version))
7880
self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs)
@@ -92,13 +94,17 @@ def models(cls, api_version=DEFAULT_API_VERSION):
9294
9395
* v3.0: :mod:`v3_0.models<azure.ai.textanalytics.v3_0.models>`
9496
* v3.1-preview.3: :mod:`v3_1_preview_3.models<azure.ai.textanalytics.v3_1_preview_3.models>`
97+
* v3.1-preview.4: :mod:`v3_1_preview_4.models<azure.ai.textanalytics.v3_1_preview_4.models>`
9598
"""
9699
if api_version == 'v3.0':
97100
from ..v3_0 import models
98101
return models
99102
elif api_version == 'v3.1-preview.3':
100103
from ..v3_1_preview_3 import models
101104
return models
105+
elif api_version == 'v3.1-preview.4':
106+
from ..v3_1_preview_4 import models
107+
return models
102108
raise ValueError("API version {} is not available".format(api_version))
103109

104110
async def close(self):

0 commit comments

Comments
 (0)