Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sdk/textanalytics/azure-ai-textanalytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## 5.1.0b6 (Unreleased)

**Breaking Changes**

- Renamed properties `aspect` and `opinions` to `target` and `assessments` respectively in class `MinedOpinion`.
- Renamed classes `AspectSentiment` and `OpinionSentiment` to `TargetSentiment` and `AssessmentSentiment` respectively.

## 5.1.0b5 (2021-02-10)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
SentenceSentiment,
SentimentConfidenceScores,
MinedOpinion,
AspectSentiment,
OpinionSentiment,
TargetSentiment,
AssessmentSentiment,
RecognizePiiEntitiesResult,
PiiEntity,
PiiEntityDomainType,
Expand Down Expand Up @@ -67,8 +67,8 @@
'SentenceSentiment',
'SentimentConfidenceScores',
'MinedOpinion',
'AspectSentiment',
'OpinionSentiment',
'TargetSentiment',
'AssessmentSentiment',
'RecognizePiiEntitiesResult',
'PiiEntity',
'PiiEntityDomainType',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@ class AsyncAnalyzeBatchActionsLROPollingMethod(TextAnalyticsAsyncLROPollingMetho

@property
def _current_body(self):
from ._generated.v3_1_preview_3.models import JobMetadata
return JobMetadata.deserialize(self._pipeline_response)
from ._generated.v3_1_preview_3.models import AnalyzeJobMetadata
return AnalyzeJobMetadata.deserialize(self._pipeline_response)

@property
def created_on(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
class TextAnalyticsApiVersion(str, Enum):
"""Text Analytics API versions supported by this package"""

V3_1_PREVIEW_4 = "v3.1-preview.4"
#: this is the default version
V3_1_PREVIEW = "v3.1-preview.3"
V3_0 = "v3.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import warnings

# FIXME: have to manually reconfigure import path for multiapi operation mixin
from .._lro import AnalyzeHealthcareEntitiesLROPoller, AnalyzeHealthcareEntitiesLROPollingMethod
from .._lro import AnalyzeBatchActionsLROPoller, AnalyzeBatchActionsLROPollingMethod
from .._lro import AnalyzeBatchActionsLROPoller, AnalyzeBatchActionsLROPollingMethod, AnalyzeHealthcareEntitiesLROPoller, AnalyzeHealthcareEntitiesLROPollingMethod
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpRequest, HttpResponse
Expand Down Expand Up @@ -61,6 +60,8 @@ def analyze_status(
api_version = self._get_api_version('analyze_status')
if api_version == 'v3.1-preview.3':
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'analyze_status'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -96,6 +97,8 @@ def begin_analyze(
api_version = self._get_api_version('begin_analyze')
if api_version == 'v3.1-preview.3':
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'begin_analyze'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -130,6 +133,8 @@ def begin_cancel_health_job(
api_version = self._get_api_version('begin_cancel_health_job')
if api_version == 'v3.1-preview.3':
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'begin_cancel_health_job'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -174,6 +179,8 @@ def begin_health(
api_version = self._get_api_version('begin_health')
if api_version == 'v3.1-preview.3':
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'begin_health'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -215,6 +222,8 @@ def entities_linking(
from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.3':
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'entities_linking'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -257,6 +266,8 @@ def entities_recognition_general(
from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.3':
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'entities_recognition_general'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -307,6 +318,8 @@ def entities_recognition_pii(
api_version = self._get_api_version('entities_recognition_pii')
if api_version == 'v3.1-preview.3':
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'entities_recognition_pii'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -348,6 +361,8 @@ def health_status(
api_version = self._get_api_version('health_status')
if api_version == 'v3.1-preview.3':
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'health_status'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -389,6 +404,8 @@ def key_phrases(
from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.3':
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'key_phrases'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -431,6 +448,8 @@ def languages(
from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.3':
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'languages'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -473,6 +492,8 @@ def sentiment(
from .v3_0.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.3':
from .v3_1_preview_3.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from .v3_1_preview_4.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'sentiment'".format(api_version))
mixin_instance = OperationClass()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def __init__(
base_url = '{Endpoint}/text/analytics/v3.0'
elif api_version == 'v3.1-preview.3':
base_url = '{Endpoint}/text/analytics/v3.1-preview.3'
elif api_version == 'v3.1-preview.4':
base_url = '{Endpoint}/text/analytics/v3.1-preview.4'
else:
raise ValueError("API version {} is not available".format(api_version))
self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs)
Expand All @@ -94,13 +96,17 @@ def models(cls, api_version=DEFAULT_API_VERSION):

* v3.0: :mod:`v3_0.models<azure.ai.textanalytics.v3_0.models>`
* v3.1-preview.3: :mod:`v3_1_preview_3.models<azure.ai.textanalytics.v3_1_preview_3.models>`
* v3.1-preview.4: :mod:`v3_1_preview_4.models<azure.ai.textanalytics.v3_1_preview_4.models>`
"""
if api_version == 'v3.0':
from .v3_0 import models
return models
elif api_version == 'v3.1-preview.3':
from .v3_1_preview_3 import models
return models
elif api_version == 'v3.1-preview.4':
from .v3_1_preview_4 import models
return models
raise ValueError("API version {} is not available".format(api_version))

def close(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
import warnings

# FIXME: have to manually reconfigure import path for multiapi operation mixin
from ..._async_lro import AnalyzeHealthcareEntitiesAsyncLROPoller, AnalyzeHealthcareEntitiesAsyncLROPollingMethod
from ..._async_lro import AsyncAnalyzeBatchActionsLROPoller, AsyncAnalyzeBatchActionsLROPollingMethod
from ..._async_lro import AnalyzeHealthcareEntitiesAsyncLROPoller, AnalyzeHealthcareEntitiesAsyncLROPollingMethod, AsyncAnalyzeBatchActionsLROPoller, AsyncAnalyzeBatchActionsLROPollingMethod
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
Expand Down Expand Up @@ -57,6 +56,8 @@ async def analyze_status(
api_version = self._get_api_version('analyze_status')
if api_version == 'v3.1-preview.3':
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'analyze_status'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -86,12 +87,14 @@ async def begin_analyze(
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
:return: An instance of AsyncAnalyzeBatchActionsLROPoller that returns either AnalyzeJobState or the result of cls(response)
:rtype: ~...._async_lro.AsyncAnalyzeBatchActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState]
:rtype: ~....._async_lro.AsyncAnalyzeBatchActionsLROPoller[~azure.ai.textanalytics.v3_1_preview_3.models.AnalyzeJobState]
:raises ~azure.core.exceptions.HttpResponseError:
"""
api_version = self._get_api_version('begin_analyze')
if api_version == 'v3.1-preview.3':
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'begin_analyze'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -126,6 +129,8 @@ async def begin_cancel_health_job(
api_version = self._get_api_version('begin_cancel_health_job')
if api_version == 'v3.1-preview.3':
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'begin_cancel_health_job'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -170,6 +175,8 @@ async def begin_health(
api_version = self._get_api_version('begin_health')
if api_version == 'v3.1-preview.3':
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'begin_health'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -211,6 +218,8 @@ async def entities_linking(
from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.3':
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'entities_linking'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -253,6 +262,8 @@ async def entities_recognition_general(
from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.3':
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'entities_recognition_general'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -303,6 +314,8 @@ async def entities_recognition_pii(
api_version = self._get_api_version('entities_recognition_pii')
if api_version == 'v3.1-preview.3':
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'entities_recognition_pii'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -344,6 +357,8 @@ async def health_status(
api_version = self._get_api_version('health_status')
if api_version == 'v3.1-preview.3':
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'health_status'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -385,6 +400,8 @@ async def key_phrases(
from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.3':
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'key_phrases'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -427,6 +444,8 @@ async def languages(
from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.3':
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'languages'".format(api_version))
mixin_instance = OperationClass()
Expand Down Expand Up @@ -469,6 +488,8 @@ async def sentiment(
from ..v3_0.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.3':
from ..v3_1_preview_3.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
elif api_version == 'v3.1-preview.4':
from ..v3_1_preview_4.aio.operations import TextAnalyticsClientOperationsMixin as OperationClass
else:
raise ValueError("API version {} does not have operation 'sentiment'".format(api_version))
mixin_instance = OperationClass()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def __init__(
base_url = '{Endpoint}/text/analytics/v3.0'
elif api_version == 'v3.1-preview.3':
base_url = '{Endpoint}/text/analytics/v3.1-preview.3'
elif api_version == 'v3.1-preview.4':
base_url = '{Endpoint}/text/analytics/v3.1-preview.4'
else:
raise ValueError("API version {} is not available".format(api_version))
self._config = TextAnalyticsClientConfiguration(credential, endpoint, **kwargs)
Expand All @@ -92,13 +94,17 @@ def models(cls, api_version=DEFAULT_API_VERSION):

* v3.0: :mod:`v3_0.models<azure.ai.textanalytics.v3_0.models>`
* v3.1-preview.3: :mod:`v3_1_preview_3.models<azure.ai.textanalytics.v3_1_preview_3.models>`
* v3.1-preview.4: :mod:`v3_1_preview_4.models<azure.ai.textanalytics.v3_1_preview_4.models>`
"""
if api_version == 'v3.0':
from ..v3_0 import models
return models
elif api_version == 'v3.1-preview.3':
from ..v3_1_preview_3 import models
return models
elif api_version == 'v3.1-preview.4':
from ..v3_1_preview_4 import models
return models
raise ValueError("API version {} is not available".format(api_version))

async def close(self):
Expand Down
Loading